Module: Foundation & Infrastructure Priority: CRITICAL Estimated Duration: 3-5 days Dependencies: None (starting point)
These tasks establish the project structure, development tooling, and foundational infrastructure that everything else depends on.
- Create workspace
Cargo.tomlwith all planned crates- Define workspace members:
lash-types,lash-core,lash-db,lash-agent,lash-tui,lash-cli - Add workspace-level dependencies (shared versions)
- Configure workspace-level settings (edition = "2021", rust-version)
- Set up workspace-level features
- Define workspace members:
- Create individual crate directories
-
crates/lash-types/- Shared types -
crates/lash-core/- Core parsing and validation -
crates/lash-db/- Database layer -
crates/lash-agent/- Agent integration -
crates/lash-tui/- Terminal UI -
crates/lash-cli/- CLI binary
-
- Add initial dependencies
-
serdewithderivefeature (workspace) -
thiserrorfor error handling (workspace) -
anyhowfor CLI error propagation (lash-cli only) -
clapv4 withderivefeature (lash-cli) - Add dependency versions to workspace
-
- Configure git repository
- Update
.gitignorefor Rust (target/, Cargo.lock for libs) - Add
rust-toolchain.tomlfor version consistency (stable) - Initial commit with project structure
- Update
- Verify build
- Run
cargo build --workspacesuccessfully - Run
cargo test --workspacesuccessfully
- Run
Priority: CRITICAL
Estimate: 1 day
Dependencies: None
Success Criteria: cargo build succeeds for all crates
- Configure code formatting
- Create
rustfmt.tomlat workspace root - Set max_width = 100
- Set edition = "2021"
- Enable format_strings, imports_granularity = "Crate"
- Verify
cargo fmt --all -- --checkworks
- Create
- Configure linting
- Create
clippy.tomlat workspace root - Enable strict lints (warn on all clippy::pedantic)
- Allow specific lints as needed (document why)
- Verify
cargo clippy --workspace -- -D warningsworks
- Create
- Set up dependency auditing
- Add
deny.tomlconfiguration - Configure for security advisories
- Configure license compliance checks
- Set up bans for duplicate dependencies
- Add
- Create pre-commit hook
- Create
.git/hooks/pre-commitscript - Run
cargo fmt --all -- --check - Run
cargo clippy --workspace -- -D warnings - Run
cargo test --workspace - Make hook executable
- Test hook blocks commits with issues
- Create
- Add editor configuration
- Create
.editorconfigfor cross-editor consistency - Set indent_size = 4 for Rust
- Set trim_trailing_whitespace = true
- Set insert_final_newline = true
- Create
Priority: HIGH Estimate: 0.5 day Dependencies: Task #1 Success Criteria: Pre-commit hook blocks commits with formatting/lint issues
- Create test fixture structure
- Create
tests/fixtures/directory - Create
tests/fixtures/valid/for valid examples - Create
tests/fixtures/invalid/for error cases - Create
tests/fixtures/repos/for complete test repositories - Add README explaining fixture organization
- Create
- Create initial test fixtures
-
valid/simple-task.md- minimal valid task file -
valid/with-dependencies.md- file with dependencies -
valid/with-labels.md- file with labels -
valid/nested-hierarchy.md- deep task hierarchy -
invalid/bad-checkbox.md- malformed checkbox syntax -
invalid/depth-exceeded.md- exceeds max depth -
invalid/unknown-annotation.md- unknown @key -
invalid/broken-dependency.md- references non-existent task
-
- Set up test helpers
- Create
tests/helpers/mod.rs - Add
fn load_fixture(path)helper - Add
fn temp_test_dir()helper - Add
fn assert_error_contains(result, text)helper - Add
fn init_test_db()helper
- Create
- Configure test running
- Add
cargo-nextestto project (optional but recommended) - Configure test timeouts
- Set up test output formatting
- Add
- Set up code coverage
- Add
cargo-llvm-covto CI toolchain - Create coverage script
- Set coverage threshold (aim for 80%+)
- Configure coverage excludes (test code, generated code)
- Add
Priority: HIGH Estimate: 1 day Dependencies: Task #1 Success Criteria: Can run tests with coverage reporting; fixtures loadable
- Create base error types in
lash-types- Define
LashErrorenum with variants:-
ParseError- Markdown parsing failures -
LintError- Validation failures -
IoError- File system errors -
DatabaseError- SQLite errors -
ConfigError- Configuration issues -
DependencyError- Broken references, cycles
-
- Derive
Debug,Clonefor error types - Implement
Displayfor human-readable messages - Implement
std::error::Errortrait
- Define
- Define error codes
- Create
error_codes.rswith constants -
E_PARSE_*- Parsing errors (E_PARSE_BAD_CHECKBOX, etc.) -
E_LINT_*- Linting errors (E_LINT_DEPTH_EXCEEDED, etc.) -
E_DEP_*- Dependency errors (E_DEP_NOT_FOUND, E_DEP_CYCLE, etc.) -
E_IO_*- I/O errors (E_IO_FILE_NOT_FOUND, etc.) -
E_DB_*- Database errors (E_DB_CONSTRAINT, etc.) - Document each code with description and example
- Create
- Create diagnostic structure
- Define
Diagnosticstruct with fields:-
code: &'static str- Error code -
severity: Severity- Error/Warning/Info -
message: String- Human-readable message -
location: Option<Location>- File, line, column -
suggestion: Option<String>- How to fix
-
- Define
Locationstruct (file_path, line, column, span) - Define
Severityenum (Error, Warning, Info, Help)
- Define
- Add JSON serialization
- Derive
Serializeon all error types (via serde) - Create
to_json()method onDiagnostic - Test JSON output format
- Ensure stable field names for machine parsing
- Derive
- Create
Result<T>type alias-
pub type Result<T> = std::result::Result<T, LashError>; - Export from
lash-typesfor use across crates
-
- Document error codes
- Create
docs/error-codes.md - Document each error code with:
- Code and name
- Description
- Example that triggers it
- How to fix
- Organize by category (parse, lint, dependency, etc.)
- Create
Priority: CRITICAL Estimate: 1 day Dependencies: Task #1 Success Criteria: All error codes documented; JSON serialization works
- Define
LashConfigstruct inlash-types-
root_path: PathBuf- Project root directory -
index_file: String- Root index filename (default: "lash.index.md") -
max_depth: u8- Maximum task nesting (default: 3) -
indent_spaces: u8- Indentation size (default: 2) -
db_path: Option<PathBuf>- Database location (default: .lash/lash.db) - Derive
Debug,Clone,Serialize,Deserialize
-
- Implement root detection
- Create
find_project_root(start_dir: &Path) -> Result<PathBuf> - Search upward from start_dir for
lash.index.mdor.lash/ - Stop at filesystem root or home directory
- Return
ConfigError::RootNotFoundif not found - Add tests for various directory structures
- Create
- Implement config file loading
- Create
.lash/config.tomlsupport - Parse TOML using
tomlcrate - Merge with default config
- Validate config values (e.g., max_depth in range 2-5)
- Return errors for invalid values
- Create
- Add CLI override support
- Accept
--rootargument to override detection - Validate that provided root contains index file
- Create
Config::from_cli_args(args)method
- Accept
- Create config builder
- Implement builder pattern for
LashConfig -
ConfigBuilder::default()-> uses defaults -
.root(path)- override root -
.max_depth(n)- override depth -
.build() -> Result<LashConfig>- validate and build
- Implement builder pattern for
- Add validation
- Validate root path exists and is readable
- Validate index file exists (or can be created)
- Validate max_depth in reasonable range (2-5)
- Validate indent_spaces is 2 or 4
- Return detailed validation errors
Priority: HIGH Estimate: 1 day Dependencies: Task #4 (error types) Success Criteria: Can detect project root; config loads and validates correctly
3-5 days total for all foundation tasks
- All tasks above completed
-
cargo build --workspacesucceeds -
cargo test --workspacesucceeds -
cargo clippy --workspace -- -D warningspasses - Pre-commit hook installed and working
- Test fixtures created and loadable
- Error taxonomy documented
- Config system working with root detection
After completing project setup, proceed to:
- tasks.core-data-model.md - Define core data structures
- tasks.markdown-parser.md - Implement parsing (depends on data model)