Skip to content

[codex] Fix roadmap progress sync for padded phase arguments#3380

Merged
jeremymcs merged 3 commits into
mainfrom
codex/fix-roadmap-padded-phase-progress
May 10, 2026
Merged

[codex] Fix roadmap progress sync for padded phase arguments#3380
jeremymcs merged 3 commits into
mainfrom
codex/fix-roadmap-padded-phase-progress

Conversation

@jeremymcs
Copy link
Copy Markdown
Collaborator

@jeremymcs jeremymcs commented May 10, 2026

Summary

Fixes roadmap progress sync when roadmap.update-plan-progress is called with a zero-padded phase argument such as 03 while ROADMAP.md uses unpadded phase labels such as Phase 3 and | 3. ... |.

Root cause

The roadmap progress mutation found .planning/phases/03-* through the existing phase-directory normalization path, but reused the raw phaseNum argument to build ROADMAP markdown regexes. That meant 03 matched plan IDs like 03-01, but missed the top-level phase checkbox, phase detail **Plans:** line, and progress table row written as 3.

Changes

  • Add padded/unpadded-tolerant phase markdown regex matching in the SDK query handler and CJS compatibility roadmap command.
  • Keep completed per-plan checkbox matching based on the real plan IDs.
  • Add regression coverage for both SDK and CJS command paths.
  • Add a changeset fragment.

Standards followed

Follows CONTEXT.md vocabulary for the Planning Workspace / Planning Path Projection surfaces and docs/adr/0005-sdk-architecture-seam-map.md / docs/adr/0006-planning-path-projection-module.md by keeping the SDK query handler and CJS compatibility path aligned without introducing a new seam. No ADR required: this is a scoped bugfix under confirmed issue #3378.

Validation

  • cd sdk && npm test -- roadmap-update-plan-progress.test.ts
  • node --test tests/roadmap.test.cjs
  • npm run lint:changeset
  • npm test

Closes #3378

Summary by CodeRabbit

  • Bug Fixes

    • Fixed roadmap plan progress updates to correctly handle zero-padded phase numbers when identifying and updating ROADMAP table entries and completion checkboxes.
  • Tests

    • Added test coverage for zero-padded phase number handling in roadmap plan progress updates.

Review Change Stack

@jeremymcs jeremymcs requested a review from glittercowboy as a code owner May 10, 2026 19:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR fixes roadmap progress mutations to normalize phase-number matching, allowing zero-padded phase arguments like 03 to update unpadded ROADMAP phase labels like 3. A helper function normalizes phase patterns for regex matching in both SDK and legacy implementations, with test validation covering both code paths.

Changes

Roadmap Phase-Padding Fix

Layer / File(s) Summary
Phase Regex Helper
sdk/src/query/roadmap-update-plan-progress.ts, get-shit-done/bin/lib/roadmap.cjs
Introduced phaseMarkdownRegexSource() to generate regex patterns that normalize leading zeros and support optional letter/decimal suffixes for phase-number matching.
SDK Roadmap Mutation
sdk/src/query/roadmap-update-plan-progress.ts
Updated progress table row, plan-count, and checkbox-matching regexes to use the new phase pattern helper instead of raw escaped phase numbers.
Legacy CJS Roadmap Mutation
get-shit-done/bin/lib/roadmap.cjs
Applied the same phase-pattern normalization to cmdRoadmapUpdatePlanProgress for table row, plan-count, and checkbox updates during the read-modify-write.
Test Coverage & Changelog
sdk/src/query/roadmap-update-plan-progress.test.ts, tests/roadmap.test.cjs, .changeset/clever-wasps-parade.md
Added regression tests for both implementations verifying padded phase arguments correctly update unpadded phase entries; documented the fix in a changeset.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

bug, confirmed-bug, area: core, size/S

Suggested reviewers

  • glittercowboy

Poem

🐰 A phase padded with zeros deep,
Now matches rows that phases keep.
From 03 to 3, the patterns align,
With regex helpers, progress updates shine!
Plans and checkboxes all in their place, 🎯

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main fix: addressing roadmap progress synchronization for zero-padded phase arguments, which is the core issue resolved in this PR.
Description check ✅ Passed The PR description provides a comprehensive explanation of the bug, root cause, changes made, standards followed, and validation steps, exceeding the template's core requirements.
Linked Issues check ✅ Passed All acceptance criteria from issue #3378 are addressed: progress table row updates [1], Plans count updates [2], phase checkbox marking [3], per-plan checkbox updates [4], and regression tests for both SDK and CJS paths [5].
Out of Scope Changes check ✅ Passed All changes are directly focused on fixing padded phase argument handling in roadmap progress updates with corresponding tests and changeset documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-roadmap-padded-phase-progress

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jeremymcs
Copy link
Copy Markdown
Collaborator Author

⚠️ CI Alert

The babysitter pushed changes (commit 4effa25), but CI/CD checks are still failing:

  • smoke-unpacked: Check run cancelled (details)
  • smoke (ubuntu-latest, 22, false): Check run cancelled (details)
  • test (macos-latest, 24): Check run cancelled (details)
  • test (ubuntu-latest, 24): Check run cancelled (details)
  • test (ubuntu-latest, 22): Check run cancelled (details)
  • security: Check run cancelled (details)

Manual investigation may be required.

@jeremymcs jeremymcs merged commit bead19d into main May 10, 2026
15 of 16 checks passed
@github-actions github-actions Bot deleted the codex/fix-roadmap-padded-phase-progress branch May 10, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix roadmap progress sync for padded phase arguments

1 participant