Repository navigation
Description
Summary
The --update skill flow can leave stale graph nodes behind when a file
remains on disk but leaves the active scan scope, for example after being
added to .graphifyignore.
detect_incremental() correctly classifies the file as excluded_files,
but the skill update flow only passes deleted_files to build_merge().
At the end of the update, save_manifest(..., scan_corpus=...) removes the
excluded file from the manifest. This leaves the graph and manifest
inconsistent, and on subsequent runs the stale graph nodes are no longer
detectable through incremental manifest-based detection.
Reproduction
- Build a graph containing a file
A.py. - Confirm that
A.pyis present in both the graph and manifest. - Add
A.pyto.graphifyignorewhile leaving the file on disk. - Run the
--updateskill flow.
Observed:
deleted_files = []
excluded_files = [A.py]
The current skill flow passes only deleted_files to build_merge():
prune = list(deleted) or None
G = build_merge(
[new_extraction],
...,
prune_sources=prune,
)As a result, A.py's existing graph nodes remain.
The subsequent manifest save uses the current scan scope and removes
A.py from the manifest.
After the first update:
graph.json:
A.py nodes still present
manifest.json:
A.py absent
Run --update again without changing anything else.
The second run reports:
deleted_files = []
excluded_files = []
because A.py is no longer present in the manifest.
The stale A.py graph nodes therefore remain indefinitely.
Expected behavior
When a previously indexed file leaves the scan scope, its graph
contribution should be removed during the same incremental update that
removes it from the manifest.
The expected transition is:
included file
↓
file becomes excluded
↓
excluded_files = [A.py]
↓
prune A.py from graph
↓
remove A.py from manifest
↓
clean steady state
If the file is later brought back into the scan scope, it should be treated
as a new file and indexed again.
CLI comparison
The CLI incremental path already includes both deleted_files and
excluded_files when constructing prune_sources:
_prune_sources = list(deleted_files)
for _src in list(excluded_files) + graph_stale_sources:
if _src not in _prune_sources:
_prune_sources.append(_src)Running the same scenario through the CLI correctly removes the graph
nodes for A.py while also removing its manifest entry.
The skill --update flow does not currently mirror this behavior.
Root cause
excluded_files was introduced to distinguish files that are still alive
on disk but have left the scan scope from files that have actually been
deleted.
The manifest handling was subsequently updated to remove excluded files
from the manifest, but the skill --update merge step continued to pass
only deleted_files to build_merge().
This creates an inconsistent transition:
graph:
A.py still present
manifest:
A.py removed
Once the manifest entry is removed, subsequent incremental runs have no
manifest record from which to discover the stale graph contribution.
Evidence
Reproduced on current v8 with a minimal corpus containing:
def hello():
return "world"Initial state:
A.pyexists on diskA.pyis present in the manifestA.pycontributes 2 nodes to the graph
After adding A.py to .graphifyignore and running the skill update:
deleted_files = []excluded_files = [A.py]- graph still contains 2 nodes sourced from
A.py - manifest no longer contains
A.py
After a second unchanged update:
deleted_files = []excluded_files = []- graph still contains the 2
A.pynodes - manifest remains empty
The equivalent CLI flow prunes the nodes correctly.
Related
This was discovered while investigating #2870.
The original #2870 condition — incorrectly treating live files that leave
the scan scope as deleted_files — is already handled by the current
detect_incremental() implementation.
This issue concerns the downstream handling of those correctly identified
excluded_files in the skill --update flow.
Activity
subbuonline commentedon Aug 22, 2026
+1
ChaseFlorell commentedon Sep 28, 2026
Data point from graphify 0.9.69 (macOS, Claude Code skill flow).
.graphifyignorethe next day.--update(578 changed files) left 347 nodes and ~15 hyperedges whosesource_filesits under the ignored directory. The manifest had already dropped those files, so later updates could not see them — exactly the inconsistency described above.GRAPH_REPORT.mdcame from AMBIGUOUS edges between those ignored images.--forceremoved them (the semantic cache made that cheap, but nothing in the update output hinted it was needed).The CLI
graphify updategot the #2495 fix in 0.9.35, but the skill'sreferences/update.mdstill passes onlydeleted_filestobuild_merge(prune_sources=...). Passingdeleted_files + excluded_filesthere looks like it would close this.Say a changed .graphifyignore needs a full graph rebuild, and ignore …
Stashub commentedon Oct 13, 2026
Still reproduces on 0.9.89 (released today,
v8at e8eb76e), Linux, Python 3.13, uv tool install, Claude Code skill flow.graphify/skills/claude/references/update.mdline 113 is stillprune = list(deleted) or None, and the runbook's first block exits onnew_total == 0 and not deleted, so an exclusion-only change never even reachesbuild_merge.Minimal repro (code only, no LLM needed):
Output:
Real-world case: a docs folder kept both an original
.pdfand its verified.mdconversion. Addingdocs/*.pdfto.graphifyignoreto drop the duplicate copy, then running the skill--update, would leave all 11 PDF-sourced nodes ingraph.jsonwhile reporting "Nothing to update".Suggested fix, matching the CLI path: in
update.md, countexcluded_filesas a change in the early-exit check and passdeleted + excludedasprune_sourcestobuild_merge.