fix(watch): Track configured file counts separately - #95
Conversation
Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
|
Reviewed — this is careful work. Using One functional finding:
Minor: Nice catch excluding |
refreshConfiguredFiles invalidated the dependency graph and left it that way, with a comment deferring the rebuild to "restart". Nothing rebuilds it lazily, so a single edit to .codemap/config.json — or a touch of any .gitignore, which filterControlEvent matches by basename anywhere in the tree — permanently stripped hub and importer intelligence from the running daemon. Every hook that reads daemon state silently degraded from that point on. Rebuild after invalidating, behind the same shouldComputeDependencyGraph guard Start uses so large repos still skip the work. computeDeps takes the graph lock itself, so it is called after the unlock. TestConfiguredFilterChangeInvalidatesDependencyState asserted the graph stayed nil, which encoded the defect rather than the intent. Its real invariant is that state computed under the old filters is discarded, so it now asserts the stale entries are gone; the published-state check is unchanged. A new test covers the rebuild, using a sentinel entry so a rebuilt graph is distinguishable from the startup graph. Follow-up to #95 by @reneleonhardt. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
What does this PR do?
Tracks configured files separately from the full watch inventory, including live config and
.gitignorechanges.Session hooks therefore size agentic coding context from active sandbox filters without changing the legacy
file_countfield or publishing stale dependency state.Type of change
Checklist
go build && ./codemap .Additional notes
Verification:
go test ./watch ./cmd -count=1.Developed with carefully directed, manually reviewed AI assistance.
Co-Authored-By: GPT-5.6 Sol codex@openai.com