fix(#376): use -uall in git status to detect files in pre-existing untracked dirs#377
Conversation
…tracked dirs `validate_mutation_boundary`, `record_subtask_baseline`, `record_scope_baseline`, `refresh_blueprint_affected_files`, and `_current_subtask_changed_files` all used `git status --porcelain` without `-uall`. Without that flag git collapses an untracked directory to a single `?? docs/` entry rather than listing individual files inside it. When a directory was already untracked before a subtask started the per-subtask baseline captured `docs/` (collapsed); the subtraction in validate_mutation_boundary then removed that one entry and any new file added inside `docs/` became completely invisible to the scope check — not as unexpected, not as expected-satisfied. Fix: add `-uall` to all five git status invocations so files are always recorded at file granularity. Both baseline capture and actual-set construction use the same granularity, so the subtraction correctly suppresses pre-existing files while still surfacing new additions inside a pre-existing untracked directory. 4 new regression tests cover the end-to-end scenario from the bug report and verify that baselines record individual file paths rather than collapsed directory names.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change switches Git status snapshots to ChangesUntracked file mutation tracking
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Fixes #376.
validate_mutation_boundary,record_subtask_baseline,record_scope_baseline,refresh_blueprint_affected_files, and_current_subtask_changed_filesall usedgit status --porcelainwithout-uall. Without that flag, git collapses an entire untracked directory to a single?? docs/entry rather than listing the individual files inside it.Root cause: When a directory was already untracked before a subtask started, the per-subtask baseline captured
docs/(collapsed). The subtraction invalidate_mutation_boundarythen removed that one entry, making any new file added insidedocs/completely invisible to the scope check — neither flagged asunexpectednor shown asexpected-satisfied.Fix: Add
-uallto all fivegit statusinvocations so files are always recorded at file granularity. Both baseline capture and actual-set construction now use the same granularity, so the subtraction correctly suppresses pre-existing files while still surfacing new additions inside a pre-existing untracked directory.Changes
src/mapify_cli/templates_src/map/scripts/map_step_runner.py.jinja: switched all fivegit status --porcelaincalls togit status --porcelain -uall, added inline comments explaining whysrc/mapify_cli/templates/map/scripts/map_step_runner.py+.map/scripts/map_step_runner.py: rendered output (viamake render-templates)tests/test_map_step_runner.py: 4 new regression testsTest plan
TestValidateMutationBoundary::test_new_file_in_preexisting_untracked_dir_is_visible— reproduces the exact validate_mutation_boundary: new files inside a pre-existing untracked directory are invisible (false-negative scope check) #376 scenario end-to-endTestValidateMutationBoundary::test_baseline_subtraction_file_granular_not_dir_collapsed— verifies baseline uses file granularity, not dir namesTestRecordSubtaskBaseline::test_baseline_records_individual_files_in_untracked_dirs— verifiesrecord_subtask_baselinerecordsdocs/a.md, notdocs/TestRecordScopeBaseline::test_scope_baseline_records_individual_files_in_untracked_dirs— same for branch-wide baselineAll 3816 tests pass (
make checkgreen, render check passes).Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
Tests