@id: tasks.description-section @labels: parser, linter, schema, indexing, search, cross-cutting @created: 2025-12-03
Add support for a ## Description section in task files that allows free-form text (including @agent-note annotations) to provide context for both humans and agents. This section appears after the file-level metadata block and before the ## Tasks section.
Key Requirements:
- Free-form text with optional annotations
- Placement: after metadata, before
## Tasks - Length limit: 500-1000 characters (enforced by linter)
- Indexed in SQLite and searchable via FTS5
- Supports inline
@agent-noteannotations for LLM-specific hints
Example Format:
# Module Name
@id: module.name
@labels: backend
## Description
Free-form text explaining scope and intent. Can include @agent-note: for LLM-specific hints.
This provides context for both humans and agents.
## Tasks
- [ ] First task@id: task-1-design-doc @priority: HIGH @effort: 0.5 days @depends-on: None
Update the design document to formalize the ## Description section specification.
- Update section 4.1 (High-Level Structure) in design-doc.md
- Replace "optional overview" with formal
## Descriptionsection - Specify placement: after metadata block, before
## Tasks - Document that it's optional but recommended
- Replace "optional overview" with formal
- Update section 4.1 example to include
## Description- Add example description text
- Show inline
@agent-note:usage
- Add Description Section specification details
- Define allowed content: free-form Markdown text
- Specify length limit: 500-1000 characters (configurable)
- Document
@agent-note:inline annotation support
- Update section 9.2 (SQLite Schema) to mention description storage
- Add
descriptioncolumn tofilestable specification - Note that description is indexed in FTS5
- Add
Success Criteria:
- Design document clearly specifies
## Descriptionsection format - Examples demonstrate proper usage
- Schema changes documented
@id: task-2-parser @priority: CRITICAL @effort: 1-1.5 days @depends-on: tasks.description-section.md#task-1-design-doc
Extend the Markdown parser to recognize and extract ## Description sections from task files.
- Update
Sectionenum in parser module- Add
Section::Descriptionvariant - Update section detection logic in event stream processor
- Handle transition from Header -> Description -> Tasks
- Add
- Implement description extraction in parser
- Detect
## Descriptionheading - Collect all text until next
##heading or EOF - Preserve formatting (paragraphs, inline code, etc.)
- Extract inline
@agent-note:annotations
- Detect
- Update
TaskFilestruct in core data model- Add
description: Option<String>field - Add
description_agent_notes: Vec<String>field - Update constructors and builders
- Add
- Handle edge cases
- Empty description section (just heading, no content)
- Multiple
## Descriptionheadings (error: duplicate section) - Description after
## Tasks(error: wrong order)
- Update parser tests
- Parse file with description section
- Parse file without description (verify None)
- Parse description with inline annotations
- Parse description with multiple paragraphs
- Error on duplicate description sections
Success Criteria:
- Parser correctly extracts description text
TaskFilestruct contains description data- Inline
@agent-noteannotations extracted - All edge cases handled with appropriate errors
- Existing parser tests still pass
@id: task-3-linter @priority: HIGH @effort: 1 day @depends-on: tasks.description-section.md#task-2-parser
Implement linter rules to validate description sections, primarily enforcing the length limit.
- Implement Rule: Description Length Limit
- Code:
W_SEM_DESC_TOO_LONG(warning) /E_SEM_DESC_TOO_LONG(error) - Check: Description <= 1000 characters (warning)
- Check: Description > 2000 characters (error, hard limit)
- Suggestion: "Consider moving detailed content to linked documentation"
- Code:
- Implement Rule: Description Section Order
- Code:
E_PARSE_DESCRIPTION_AFTER_TASKS(handled by parser) - Check: Description appears after header, before Tasks
- Error on: Description after
## Tasksor## References
- Code:
- Implement Rule: Duplicate Description Section
- Code:
E_SYNTAX_DUPLICATE_DESCRIPTION - Check: Only one
## Descriptionsection per file
- Code:
- Add configuration option for length limit
- Add
description_max_lengthtoLintConfig - Default: 1000 characters (warning threshold)
- Allow projects to configure via
.lash/config.toml
- Add
- Register rules with rule engine
- Update linter tests
Success Criteria:
- Length limit enforced with clear diagnostics
- Warning at 1000 chars, error at 2000 chars
- Position and duplicate rules catch violations
- Configuration allows customization
@id: task-4-schema @priority: CRITICAL @effort: 0.5 days @depends-on: tasks.description-section.md#task-1-design-doc
Add a description column to the files table to store description text.
- Update schema definition in
lash-db/src/schema.rs- Add
description TEXTcolumn tofilestable - Make column nullable (files may not have descriptions)
- Add
- Create migration for existing databases
- Write migration using
ALTER TABLE files ADD COLUMN description TEXT - Test migration on existing test databases
- Write migration using
- Update
FileRecordstruct- Add
description: Option<String>field - Update SQL queries to include description
- Update
from_row()andto_params()methods
- Add
- Update file repository queries
-
insert_file(): include description column -
update_file(): include description column -
get_file_by_id(): retrieve description -
get_file_by_path(): retrieve description
-
Success Criteria:
- Schema migration applies cleanly
- Files table has description column
- All repository methods updated
- Existing tests pass after migration
@id: task-5-indexing @priority: CRITICAL @effort: 0.5 days @depends-on: tasks.description-section.md#task-2-parser, tasks.description-section.md#task-4-schema
Update the indexing engine to extract and store description text when indexing files.
- Update
FileIndexerin indexing engine- Extract
descriptionfield from parsedTaskFile - Pass description to file repository during insert/update
- Handle None case (files without descriptions)
- Extract
- Update incremental indexing
- Re-index file if description changes
- Update FTS5 index when description changes
- Update index verification
-
check-indexcommand verifies description matches Markdown - Report drift if description in DB doesn't match parsed file
-
- Add description to index statistics
- Count files with descriptions vs without
- Include in
lash index --verboseoutput
Success Criteria:
- Indexing extracts and stores descriptions
- Files with and without descriptions both handled
- Incremental indexing detects description changes
- Index verification includes description comparison
@id: task-6-fts5 @priority: HIGH @effort: 1 day @depends-on: tasks.description-section.md#task-4-schema, tasks.description-section.md#task-5-indexing
Update the FTS5 search index to include file description text, making descriptions searchable.
- Update FTS5 search schema
- Add description content to
search_indexvirtual table - Set column weight (higher than task body, lower than title)
- Add description content to
- Update search index population
- During indexing, extract description from
filestable - Insert description into FTS5
search_index - Handle NULL descriptions
- During indexing, extract description from
- Update search result presentation
- Include description in search results
- Show description snippet if matched
- Highlight matched terms in description
- Implement file-level search results
- When description matches but no tasks match, return file-level result
- Show file path and description excerpt
- Update search scoring
- Weight: file title > description > task title > task body
- Tune weights based on testing
Success Criteria:
- Descriptions are searchable via FTS5
- Search results show description matches
- Highlighting works in description snippets
- Scoring appropriately weights description matches
@id: task-7-cli @priority: MEDIUM @effort: 0.5 days @depends-on: tasks.description-section.md#task-5-indexing
Update CLI commands (list, show, search) to display file descriptions where relevant.
- Update
lash showcommand- Display description section after metadata, before tasks
- Format with appropriate heading and indentation
- Respect
--format=json(include description in JSON output)
- Update
lash listcommand- Add
--show-descriptionsflag - Show first 100 chars of description for each file
- Truncate with "..." if longer
- Support both flat and tree view display modes
- Support JSON output format (include/exclude based on flag)
- Handle multi-byte UTF-8 characters correctly in truncation
- Add
- Update
lash agent-promptcommand- Include descriptions in generated prompts
- Use descriptions for context-minimized prompts
- Add
--include-descriptionsflag (default: true)
Success Criteria:
- Commands display descriptions appropriately
- JSON output includes descriptions
- Formatting is clean and readable
@id: task-8-tui @priority: LOW @effort: 0.5 days @depends-on: tasks.description-section.md#task-5-indexing
Update the TUI detail pane to show file descriptions when viewing task files.
- Update detail pane layout
- Add description section after file metadata
- Show description text with word wrapping
- Use distinct styling (e.g., italic or different color)
- Show "No description available" if absent
- Handle long descriptions
- Truncate if needed to fit pane height
- Support scrolling within detail pane
Success Criteria:
- TUI shows descriptions in detail pane
- Layout is clean and readable
- Long descriptions handled gracefully
Task 1 (Design Doc)
|
v
Task 2 (Parser) -----> Task 3 (Linter)
|
v
Task 4 (Schema)
|
v
Task 5 (Indexing)
|
+-------+-------+
| | |
v v v
Task 6 Task 7 Task 8
(FTS5) (CLI) (TUI)
Parallel Opportunities:
- Task 3 (Linter) and Task 4 (Schema) can run in parallel after Task 2
- Task 6, 7, and 8 can run in parallel after Task 5
- @doc: docs/design-doc.md - Main design specification
- Depends on: tasks.markdown-parser.md - Parser implementation
- Depends on: tasks.linter.md - Linter infrastructure
- Depends on: tasks.sqlite-schema.md - Database schema
- Depends on: tasks.indexing.md - Indexing engine
- Depends on: tasks.fuzzy-search.md - FTS5 search