Skip to content

Commit e596dd2

Browse files
committed
Update copilot instructions: refine testing details, clarify paths, enhance task extraction features, and improve documentation clarity
1 parent a706fe5 commit e596dd2

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

.github/copilot-instructions.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AI-powered journaling system with markdown entries, semantic backlinks, and LLM-
77
**Tech Stack:**
88
- Python 3.13+ with full type hints
99
- Package manager: `uv` (ALWAYS use `uv`, never `pip`)
10-
- Testing: pytest with 64 tests, 50% coverage
10+
- Testing: pytest with 57 tests, 47% coverage
1111
- CLI: typer (add_completion=False) + rich
1212
- LLM: Azure OpenAI (required)
1313
- Search: Azure AI Search for book notes
@@ -34,14 +34,14 @@ User-facing commands with typer:
3434

3535
- `main.py` - Root CLI entry point (92% coverage)
3636
- `diary_commands.py` - Diary management (23% coverage)
37-
- `plan_commands.py` - Daily planning (73% coverage)
37+
- `plan_commands.py` - Daily planning with LLM task extraction (49% coverage)
3838
- `notes_commands.py` - Book notes search (44% coverage)
3939

4040
## Common Commands
4141

4242
```bash
4343
# Planning commands
44-
uv run brain plan create # Create daily plan (auto-carries todos)
44+
uv run brain plan create # Create daily plan with LLM task extraction
4545
uv run brain plan create tomorrow # Plan for tomorrow
4646

4747
# Diary commands
@@ -69,32 +69,37 @@ uv run pytest tests/ --cov # With coverage
6969

7070
## Configuration (.env)
7171

72-
**Required:**
73-
- `DIARY_PATH` - Path to Obsidian vault or markdown directory
74-
- `PLANNER_PATH` - Path for extracted todo files
72+
**Required Paths:**
73+
- `DIARY_PATH` - Path to Obsidian vault or markdown directory (for reflection entries)
74+
- `PLANNER_PATH` - Path to directory for daily plan files (separate from diary)
7575

76-
**Azure OpenAI (required):**
76+
**Azure OpenAI (required for all LLM features):**
7777
- `AZURE_OPENAI_API_KEY` - API key
7878
- `AZURE_OPENAI_ENDPOINT` - Service endpoint
7979
- `AZURE_OPENAI_DEPLOYMENT` - Model deployment name (e.g., gpt-4o)
8080
- `AZURE_OPENAI_API_VERSION` - Default: 2024-02-15-preview
81-
-**Full functionality:** Supports both `brain diary` and `brain notes` commands.
81+
-**Full functionality:** Diary prompts, task extraction, semantic analysis, backlinks, tags, reports
8282

83-
**Azure AI Search (required for `brain notes` search):**
83+
**Azure AI Search (required for `brain notes` search only):**
8484
- `AZURE_SEARCH_ENDPOINT` - Search service endpoint
8585
- `AZURE_SEARCH_API_KEY` - API key
86-
- `AZURE_SEARCH_INDEX_NAME` - Index name (default: notes-index)
86+
- `AZURE_SEARCH_INDEX_NAME` - Index name (default: second-brain-notes)
8787
- ⚠️ **No local alternative:** This is a separate Azure service.
8888

8989
## Entry Structure
9090

9191
Two entry types with specific formats:
9292

9393
**Morning Plan** (YYYY-MM-DD-plan.md):
94+
- Saved to `PLANNER_PATH` (separate from diary)
9495
- Action Items section ONLY
95-
- LLM intelligently extracts actionable tasks from yesterday's diary entry
96+
- LLM intelligently extracts actionable tasks from yesterday's diary entry:
97+
- Identifies incomplete/pending tasks
98+
- Extracts follow-ups from meetings
99+
- Filters out completed activities and vague intentions
96100
- Auto-carries forward unchecked todos from yesterday's plan
97-
- All tasks include backlinks to source entries
101+
- All tasks include backlinks to source entries (e.g., "from [[2025-10-14]]")
102+
- Combines both sources (diary + plan) with deduplication
98103
- Simple, distraction-free format for task management
99104

100105
**Evening Reflection** (YYYY-MM-DD.md):
@@ -142,16 +147,21 @@ Two entry types with specific formats:
142147
## Key Implementation Details
143148

144149
- **Calendar-based context**: Uses past 3 calendar days, not last 3 entries
145-
- **Linking threshold**: Requires >50 chars in Brain Dump section
150+
- **Linking threshold**: Requires >1 char in Brain Dump section (MIN_SUBSTANTIAL_CONTENT_CHARS = 1)
146151
- **Semantic backlinks**: LLM-powered with confidence scores (high/medium/low)
147152
- **Topic tags**: Emotional/psychological themes, not surface topics
148153
- **Entity extraction**: People, places, projects, themes
154+
- **Task extraction**: LLM analyzes diary entries for actionable tasks (temperature=0.4)
155+
- **File separation**: Plans save to PLANNER_PATH, reflections save to DIARY_PATH
149156
- **88% API call reduction**: Single-pass analysis vs legacy bidirectional
150157

151158
## Module Relationships
152159

153160
```
154161
CLI Layer (brain_cli/)
162+
├── diary_commands.py → report_generator.py, llm_analysis.py
163+
├── plan_commands.py → extract_tasks_from_diary() → LLM
164+
└── notes_commands.py → notes_search_client.py
155165
156166
report_generator.py (orchestration)
157167
↓ uses
@@ -161,9 +171,10 @@ llm_client.py → azure_openai_client.py
161171
```
162172

163173
**Separation of Concerns:**
164-
- `llm_analysis.py` = Stateless atomic operations
165-
- `report_generator.py` = Stateful orchestration
166-
- `entry_manager.py` = I/O and parsing only
174+
- `llm_analysis.py` = Stateless atomic operations (backlinks, tags, entities)
175+
- `report_generator.py` = Stateful orchestration (reports, patterns)
176+
- `plan_commands.py` = Task extraction from diary using LLM
177+
- `entry_manager.py` = I/O and parsing only (supports both diary_path and planner_path)
167178

168179
## Important Notes
169180

@@ -185,19 +196,26 @@ llm_client.py → azure_openai_client.py
185196
- Removed Ollama client (195 lines) - Azure OpenAI only
186197
- Removed scheduler/daemon system (312 lines, 0% coverage)
187198
- Removed todos command (redundant with plan command)
188-
- Total code reduction: ~500 lines
199+
- Removed `generate_planning_prompts()` - plans no longer have prompts
200+
- Total code reduction: ~600 lines
189201

190202
**Module Improvements:**
191203
- Renamed `analysis.py``report_generator.py` (clearer purpose)
192204
- Renamed `azure_client.py``azure_openai_client.py` (clarity)
193205
- Renamed `azure_search_client.py``notes_search_client.py` (clarity)
194-
- Moved `extract_todos()` to `entry_manager.py` (better organization)
206+
- Moved plan command from diary to separate `plan_commands.py` module
207+
- Updated `EntryManager` to accept separate diary_path and planner_path
208+
209+
**New Features:**
210+
- LLM-powered task extraction from diary entries (`extract_tasks_from_diary()`)
211+
- Plan entries now save to PLANNER_PATH (separate from diary)
212+
- Combines tasks from both diary analysis and unchecked plan items
213+
- Added TASK_EXTRACTION_TEMPERATURE and TASK_EXTRACTION_MAX_TOKENS constants
195214

196215
**Code Quality:**
197216
- Converted `SemanticLink` to dataclass (type safety)
198217
- Extracted all magic numbers to constants
199-
- Added 4 helper functions for DRY principle (2 in diary, 2 in notes)
200-
- Added timing metrics to all LLM operations
218+
- Added timing metrics to all LLM operations including task extraction
201219
- Comprehensive docstrings on all helpers
202-
- Fixed 4 critical bugs in diary_commands
203-
- Improved from 47% → 50% test coverage
220+
- Maintained 47% test coverage with 57 passing tests
221+
- Added progress spinner for task extraction

0 commit comments

Comments
 (0)