Repository navigation
fix #837: populate .graphify_detect.json in --update flow - #838
Closed
Adriftnote wants to merge 1 commit into
Closed
Adriftnote wants to merge 1 commit into
Adriftnote wants to merge 1 commit into
Conversation
The `## For --update` section writes only `.graphify_incremental.json`. Subsequent stages (Step 3A AST extract, Step 3B0 cache check, Step 5 timing estimate, etc.) all read `.graphify_detect.json` and either crash (FileNotFoundError) when no prior full-rebuild has populated it, or silently operate on stale corpus data from a prior run. This patch adds a small block right after `detect_incremental` writes `.graphify_incremental.json` that derives `.graphify_detect.json` from the same data: - `files` = new/changed only — drives Step 3A AST + Step 3B0 cache check - `all_files` = full corpus from detect_incremental — for any step that needs corpus-wide context The new-merge block at line 839 already handles manifest persistence correctly via `save_manifest(incremental['files'])`, so no Step 9 change is required for --update mode. Full-rebuild path is unaffected (it never writes `all_files`). Verified locally: after applying this patch, `/graphify --update` on an unchanged corpus produces zero re-extraction and the manifest round-trips across runs.
Member
|
Hey @Adriftnote — thanks for the correct diagnosis and the fix! Your approach was right. We merged a slightly extended version of this directly in commit
Your PR was the right call — we just bundled the extra line in directly rather than merging separately. Really appreciate the detailed root-cause write-up and the local verification. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #837.
What changes
Adds one bash block to
## For --update (incremental re-extraction)ingraphify/skill.mdthat derives.graphify_detect.jsonfrom.graphify_incremental.jsonright afterdetect_incrementalruns.Both keys carried:
files = new_files— drives the incremental path: Step 3A AST extracts only changed code, Step 3B0 cache check is bounded to the changed set, etc.all_files = files(fromdetect()) — kept for any stage that wants the full corpus (Step 5 timing estimate header, future audits, etc.)Why
In v7 / 0.7.14, every step from 3A onward reads
.graphify_detect.jsonunconditionally:The
--updateflow currently only writes.graphify_incremental.json, so those reads either fail (no prior full-rebuild) or operate on stale corpus data from a prior run.The downstream merge block (
save_manifest(incremental['files'])at line 839) already handles manifest persistence correctly, so this PR doesn't need to touch Step 9 or the manifest path.Repro that prompted the issue
Mixed wiki+code+raw archive (~1028 files). After a clean full rebuild + a small
--update, the next--updatewas reporting 1008 "new" files instead of 0. Tracing showed:.graphify_detect.jsonwas either absent or stale, and the agent ended up populating it ad-hoc with{'files': new_files}to make Step 3A run.save_manifest(detect['files'])shrunk the manifest to the changed subset — root cause of the false-positive cascade.On v0.7.14 the new merge block sidesteps (2). This PR addresses (1) directly so the flow stops depending on ad-hoc rescue.
Verification
After this patch, on my corpus:
manifest.jsonretains all 1028 corpus entries across consecutive--updaterunsdetect_incrementalreportsnew_total: 0against an unchanged corpus (was reporting 1008 before)--updateafter touching ~20 wiki files extracts only those 20 (verified via cache-hit count)Notes / alternatives
.graphify_detect.jsonsynthesis intodetect.py(e.g. anas_detect_dict()helper). Kept it inskill.mdto match the existing per-stage scratchpad convention, but happy to refactor if you'd prefer.save_manifestdefensive fallback at Step 9 — current--updateflow never reaches Step 9 (Steps 4–8 only), and adding one would muddle the diff. Worth a follow-up if you want belt-and-suspenders for future flow changes.🤖 Generated with Claude Code