Skip to content

update.md: code-only --update never writes .graphify_extract.json (FileNotFoundError or silently dropped AST) #4447

Open

Description

@artosalminen

Summary

In the skill's --update runbook (references/update.md), the code-only branch never produces graphify-out/.graphify_extract.json, but the incremental merge step that follows reads it unconditionally. Following the runbook literally after a normal full build therefore either fails with FileNotFoundError, or, if the agent applies the "only deletions" guard, silently merges an empty extraction and discards the re-extracted AST.

Seen in the opencode skill as installed by v0.9.86. The same text is unchanged in graphify/skills/opencode/references/update.md on v8 (v0.9.90). Other platforms are likely affected too, since the skill files are generated from shared sources.

Steps (as written in the runbook)

  1. Run a full build (/graphify .). Step 9 cleanup deletes .graphify_extract.json, .graphify_ast.json and .graphify_semantic.json.
  2. Change one code file and run /graphify . --update.
  3. code_only is True, so the runbook says: "run only Step 3A (AST) on the changed files, skip Step 3B entirely (no subagents), then go straight to merge and Steps 4–8."
  4. Step 3A (SKILL.md Part A) writes only .graphify_ast.json. Nothing writes .graphify_extract.json:
    • Part C, which would merge AST and semantic output into it, is not mentioned on the code-only path.
    • Part C would itself fail, because it reads .graphify_semantic.json unconditionally, and that file is only written by Part B's "Fast path", which was skipped.
  5. The merge block reads new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(...)) → FileNotFoundError.

The guard just above the merge (if [ ! -f graphify-out/.graphify_extract.json ] → write an empty extraction) is documented as being for "only deletions". If an agent runs it on the code-only path to get past step 5, the merge succeeds but with zero new nodes, so the changed files' fresh AST is silently dropped.

Expected

On the code-only path, after Step 3A, write the empty semantic file (Part B "Fast path") and run Part C, so .graphify_extract.json contains the new AST before the incremental merge. Alternatively, make the merge read .graphify_ast.json directly when code_only is True.

Notes

Activity

  1. github-actions commented on Oct 14, 2026

    @github-actions

    Thanks for opening this issue, @artosalminen. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. Deepjyoti-Sarmah commented on Oct 14, 2026

    @Deepjyoti-Sarmah
    Contributor

    I reproduced this on v8 (fe085ce) and ran it on all 16 skills.

    I built a small project, ran Step 9's cleanup, and edited one file. Then I followed the --update runbook. code_only comes out True and Part A finds the new function. From there:

    • The merge as written fails with FileNotFoundError for .graphify_extract.json.
    • Running Part C first fails with FileNotFoundError for .graphify_semantic.json. Only Part B's fast path writes that file, and the code-only line skips Part B.
    • Using the "only deletions" guard before the merge raises no error, but the merged graph has 4 nodes and the new function is gone.
    • Running Part B's fast path, then Part C, then the merge gives 5 nodes, with the new function.

    I wrote a test that reads the code-only paragraph from each rendered skill, runs the steps it names, and checks the merge. On v8 it fails on all 16 skills. With only #4313's change it passes on the 14 generated skills.

    aider and devin still fail with #4313. They have their own copy of the update text and no fast-path block. A plain first build of a code-only project also fails there, at Part C.

    I opened #4456 for those two. Their --update section also never writes .graphify_detect.json, so Part A fails before any of this. That is #4455.

    I also tried the shrink guard note from the issue. After a code-only update that deletes a file, Step 4 refuses to save the graph (3 nodes against 4 in graph.json), even on the working route. I haven't read that code, so I haven't opened an issue for it.

  3. omsenjalia commented on Oct 18, 2026

    @omsenjalia
    Contributor

    This looks fixed on the v8 branch by ea2bc68b (fix(skill): aider and devin code-only runs reach the merge (#4447)). Could a maintainer confirm and close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions