Summary
collect_proposal_artifacts in ito-rs/crates/ito-core/src/viewer/collector.rs (introduced in #175) currently hard-codes .ito/changes/<id> paths and reads proposal.md, tasks.md, and specs/*/spec.md directly from the filesystem via ito_common::paths and ito_common::io::read_to_string.
This bakes the local markdown layout into ito-core and means ito view proposal will not compose cleanly with alternate repository backends or non-filesystem storage implementations.
Required Work
- Replace
artifact_paths filesystem enumeration with calls into ChangeRepository / ModuleRepository to list proposal, tasks, and spec module artifacts for a given change_id.
- Replace direct file reads in
collect_proposal_artifacts with content retrieval through the appropriate repository read/get methods.
- Retain the
render_section rendering helper behaviour (section headers, separators) — only the data-access layer should change.
- Update
handle_view_proposal in ito-rs/crates/ito-cli/src/commands/view.rs to pass the repository handle through to the collector.
- Adjust integration tests in
ito-rs/crates/ito-cli/tests/view_proposal.rs accordingly.
Coding Guideline
Applies to ito-rs/**/*.rs: Use repository abstractions for all data access — never parse markdown files directly; use ChangeRepository, ModuleRepository, TaskRepository.
References
Summary
collect_proposal_artifactsinito-rs/crates/ito-core/src/viewer/collector.rs(introduced in #175) currently hard-codes.ito/changes/<id>paths and readsproposal.md,tasks.md, andspecs/*/spec.mddirectly from the filesystem viaito_common::pathsandito_common::io::read_to_string.This bakes the local markdown layout into
ito-coreand meansito view proposalwill not compose cleanly with alternate repository backends or non-filesystem storage implementations.Required Work
artifact_pathsfilesystem enumeration with calls intoChangeRepository/ModuleRepositoryto list proposal, tasks, and spec module artifacts for a givenchange_id.collect_proposal_artifactswith content retrieval through the appropriate repository read/get methods.render_sectionrendering helper behaviour (section headers, separators) — only the data-access layer should change.handle_view_proposalinito-rs/crates/ito-cli/src/commands/view.rsto pass the repository handle through to the collector.ito-rs/crates/ito-cli/tests/view_proposal.rsaccordingly.Coding Guideline
References