Skip to content

refactor: route viewer collector artifact loading through repository ports #176

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions