Gralph is a Rust CLI for autonomous AI coding loops. This branch refactors a large src/main.rs into more modular entrypoint wiring while preserving CLI behavior, and lifts test coverage from 66% to at least 70% for the Rust codebase.
- The current
src/main.rsis too large and mixes CLI parsing, dependency wiring, and command dispatch, making maintenance harder. - Coverage dropped to 66% during the refactor, below the 70% recovery target and below existing quality expectations noted in repo docs.
Extract entrypoint wiring from src/main.rs into existing library modules, keep the CLI interface stable, and add focused tests to raise tarpaulin coverage to >=70% using the configured coverage command.
The CLI entrypoint remains stable, with src/main.rs reduced to a thin wrapper that delegates to library helpers for parsing and command dispatch.
Add tests around refactored entrypoint logic and related helpers so that workspace coverage meets or exceeds 70%.
- Preserve current CLI startup behavior and response times; no new blocking work added to the entrypoint path.
- All changes must pass
cargo test --workspaceand the tarpaulin coverage command defined inconfig/default.yaml, with coverage >= 70%. - Maintain doc and module map accuracy per existing process guardrails.
Each task must use a ### Task <ID> block header and include the required fields.
Each task block must contain exactly one unchecked task line.
- ID MR-1
- Context Bundle
src/main.rs,src/lib.rs,src/cli.rs,ARCHITECTURE.md - DoD
src/main.rsis a thin wrapper calling library entrypoint helpers, command dispatch and dependency wiring live in library modules, andARCHITECTURE.mdreflects the updated entrypoint flow. - Checklist
- Keep CLI behavior stable with existing
src/cli.rsparsing tests. - Update the module map in
ARCHITECTURE.mdto match the new entrypoint wiring.
- Keep CLI behavior stable with existing
- Dependencies None
- MR-1 Extract main entrypoint wiring into library modules
- ID DOC-1
- Context Bundle
CHANGELOG.md,PROCESS.md,ARCHITECTURE.md - DoD Shared docs record the refactor and coverage recovery without violating ASCII and process requirements.
- Checklist
- Add a changelog entry tagged with this task ID.
- Ensure documentation remains ASCII-only and consistent with module layout.
- Dependencies MR-1
- DOC-1 Update shared docs for refactor and coverage recovery
- ID COV-1
- Context Bundle
src/lib.rs,src/cli.rs,src/config.rs,config/default.yaml - DoD Targeted tests are added to lift tarpaulin coverage to >= 70% using the configured coverage command.
- Checklist
- Add or extend unit tests in
src/lib.rsorsrc/cli.rsfor refactored entrypoint helpers. - Verify coverage with
cargo tarpaulin --workspace --exclude-files src/main.rs src/core.rs src/notify.rs src/server.rs src/backend/*.
- Add or extend unit tests in
- Dependencies MR-1
- COV-1 Add tests to raise coverage to 70 percent
src/main.rsdelegates to library entrypoint helpers and remains minimal.- Workspace tests pass with
cargo test --workspace. - Tarpaulin coverage reaches or exceeds 70% using the configured coverage command.
ARCHITECTURE.mdandCHANGELOG.mdreflect the refactor and coverage recovery.
- None.
- No reliable external sources were provided. Verify requirements and stack assumptions before implementation.