feat(mapper): support incremental mapping via --since and --include-d… - #172
feat(mapper): support incremental mapping via --since and --include-d…#172Tanmay-008 wants to merge 7 commits into
Conversation
…irty flags - Add `--since` and `--include-dirty` flags to `clawpatch map` - Introduce `changedFiles` filter in `mapFeatureSeeds` to skip unaffected files - Preserve existing feature states and locks for unchanged files during the write phase This dramatically reduces mapping execution time on large repositories by only scanning and writing features touched by recent git diffs.
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 9:42 PM ET / August 2, 2026, 01:42 UTC. ClawSweeper reviewWhat this changesThe branch adds Merge readiness⛔ Blocked until real behavior proof is added - 10 items remain This PR remains the active candidate for the paired incremental-mapping feature request, so it should stay open. It is not ready to merge: changed-file filtering occurs after heuristic discovery and does not constrain the agent mapper’s inventory or provider prompt, while no inspectable real-run proof demonstrates the claimed scope reduction. Priority: P2 Review scores
Verification
How this fits together
flowchart LR
A[Map CLI flags] --> B[Git changed paths]
B --> C[Mapping workflow]
C --> D[Heuristic discovery]
C --> E[Agent inventory and prompt]
D --> F[Feature reconciliation]
E --> F
F --> G[Stored feature records]
Decision needed
Why: The repair is mechanically bounded, but accepting these new flags commits the project to a user-facing workflow and stated performance behavior that need maintainer sponsorship. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: If maintainers sponsor the CLI mode, apply changed-path selection before heuristic discovery and agent inventory/prompt construction; preserve the full-map default; document both flags; and prove reduced scope plus unchanged-record safety with focused tests and a redacted real run. Do we have a high-confidence way to reproduce the issue? Yes for the source-level defect: Is this the best way to solve the issue? No: filtering generated feature seeds after discovery cannot fulfill a feature whose stated purpose is avoiding repository-wide mapper and provider work; selection must happen before those stages. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4a5028c27f01. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
|
I built and live-tested this branch. Triage outcome: recommend CLOSE. The focused checks pass (121 workflow tests, formatting, type-checking, linting, and production build), but the real incremental path violates both core promises:
This needs a persisted incremental-reconciliation contract and mapper-specific scoped discovery, not output filtering after a full map. Landing the current branch would risk corrupting feature status on ordinary incremental runs. |
Description
This PR introduces incremental mapping support for the
clawpatch mapcommand. By using git diffs to identify modified files, the mapper now only re-evaluates and updates features that have actually changed.This addresses a major bottleneck in CI and local workflows on large codebases where scanning 10,000+ files for a 2-file change was previously required.
Changes Made
--sinceand--include-dirtyflags tosrc/cli.tsfor themapcommand.MapOptionsandmapFeatureSeedsinsrc/mapper.tsto filter out seeds whoseentryPathorownedFilesdo not intersect with the changed files.src/app.tsto ensure that unchanged features are preserved exactly as-is (including their locks and status). Only features that were part of the diff but are no longer present in the new seeds are marked asskipped.Testing & Validation
clawpatch map --since HEAD~1.📈 Impact
Expect up to a 10x reduction in mapping time for iterative changes!
Closes #171