fix(skills): prune excluded files during update - #2909
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
Adds excluded-file pruning to the incremental update skill across all agent variants (agents, amp, claude, claw, codex, copilot, …) and their skillgen expected fixtures: reads excluded_files from the incremental result, factors it into the no-op short-circuit, prints an excluded-count line, and folds it into prune alongside deleted. Updates the build_merge/prune test suite to cover the excluded-file cases.
No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 140 functions depend on the 140 functions this change touches.
Health — this change adds coupling hotspots:
- new:
test_skill_update_prunes_excluded_files_and_preserves_reinclusion()— 0 callers, 10 callees
Verification — 140 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 140 function(s) in the blast radius were not formally verified this run
· 1 grounded finding(s) anchored inline below.
Summary
Fixes #2908.
The
--updateskill flow previously passed onlydeleted_filestobuild_merge(). When a file remained on disk but left the active scanscope (for example, after being added to
.graphifyignore), it was reportedas
excluded_filesbut was not pruned from the graph.The manifest was still updated to remove the excluded file, leaving stale
graph nodes behind. On subsequent incremental runs, the file was no longer
present in the manifest and the stale nodes could not be discovered.
What changed
excluded_filesalongsidedeleted_fileswhen constructingprune_sources.--updateearly-exit when an update contains only excludedfiles.
subsequent clean updates, and re-inclusion.
The resulting flow is:
excluded_files→prune_sources→build_merge()→ graph cleanup →manifest cleanup
Validation
python -m tools.skillgen --checkpasses.git diff --checkpasses.The fix is intentionally limited to the skill
--updateflow; no changeswere made to
detect_incremental(),save_manifest(), orbuild_merge().