Skip to content

refactor(roadmap): deepen the Roadmap module - #46

Merged
frantufro merged 1 commit into
mainfrom
refactor/deepen-roadmap-module
Nov 13, 2026
Merged

frantufro merged 1 commit into
mainfrom
refactor/deepen-roadmap-module

Conversation

@frantufro

Copy link
Copy Markdown
Owner

Summary

  • New Roadmap module in src/core/roadmap.rs: Roadmap::parse(slug, src) (or load) classifies lines once (task, Milestone, other ## heading, other). It offers render_resolved(tasks), add_task(slug, milestone), next_not_done(tasks), contains_task, title and one atomic save.
  • Task lookup enters as a plain closure (slug to TaskInfo { status, title }, or slug to TaskStatus for next). The commands keep building the lookup from scan_all today, so the Task store can supply it later without changing Roadmap.
  • roadmap show, add and next parse, call one method and print. write_atomic exists once (Roadmap::save); root_for_roadmap (unused) is removed; the grammar helpers (parse_task_line, parse_milestone_heading, ...) are private.
  • About 40 unit tests moved from the command files and the helper tests now drive the Roadmap interface. tests/roadmap.rs is unchanged and passes. CLI output is byte-identical.
  • Adds the done task deepen-the-roadmap-module.

roadmap add now takes the roadmap slug as &str, which touches one line in src/main.rs.

Pairs with the Task store PR

The task asks to move TaskStatus next to the Task store. It stays in core/roadmap.rs here because that code is not merged; moving it is a small follow-up once the Task store lands.

Likely conflicts with the Task store PR: src/commands/roadmap/show.rs, add.rs and next.rs (the scan_all slug lookups), src/core/roadmap.rs (TaskStatus), and the one roadmap add line in src/main.rs. Resolution: keep the closure-based calls and replace the lookup construction with the Task store's.

Verification

  • cargo fmt
  • cargo clippy --all-targets -- -D warnings -W clippy::pedantic
  • cargo test

Roadmap::parse classifies lines once and offers render_resolved, add_task,
next_not_done and an atomic save. The line grammar helpers become private,
write_atomic exists once, and the unused root_for_roadmap is removed. Unit
tests move to the Roadmap interface.
@frantufro
frantufro force-pushed the refactor/deepen-roadmap-module branch from c691f15 to bbcf412 Compare November 13, 2026 13:00
@frantufro
frantufro merged commit ccad17b into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant