Skip to content

fix: materialize extraction for code-only incremental updates - #4313

Closed
vibhanshu-mishra wants to merge 1 commit into
Graphify-Labs:v8from
vibhanshu-mishra:fix/codex-code-only-update
Closed

vibhanshu-mishra wants to merge 1 commit into
Graphify-Labs:v8from
vibhanshu-mishra:fix/codex-code-only-update

Conversation

@vibhanshu-mishra

@vibhanshu-mishra vibhanshu-mishra commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Refs #4447.

This PR fixes the code-only incremental update path for all 14 generated skills reported in #3232. The remaining two monolith skills (aider and devin) are addressed separately in #4456. Together, these changes address #4447 across all 16 skills.

Code-only incremental updates previously ran AST extraction and skipped semantic extraction, but then entered a shared merge step requiring .graphify_extract.json.

Because this file was never created in the code-only path, updates could fail with FileNotFoundError after normal intermediate-file cleanup.

Changes

  • Run Part B's semantic fast path to generate a fresh empty semantic result.
  • Run Part C to materialize .graphify_extract.json from the fresh AST extraction.
  • Continue the incremental merge only after the required extraction artifact exists.
  • Skip unnecessary semantic cache operations, LLM calls, and subagent dispatch for code-only updates.
  • Preserve existing semantic graph data and cache entries.
  • Regenerate all 14 platform-specific update references and corresponding snapshots from the shared source fragment.
  • Add a regression test for added, modified, and deleted code files.

Type of change

  • Bug fix
  • Tests or CI
  • Documentation (generated skill instructions)

Verification & Invariants

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test.
  • Kept the PR description synchronized with the implementation.

@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @vibhanshu-mishra. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Tightens the code-only branch of graphify update so it no longer jumps straight from AST to merge. It now runs Part B's fast path to overwrite .graphify_semantic.json with an empty result, then runs Part C to rebuild .graphify_extract.json from the fresh AST output, without touching the semantic cache or reusing semantic sidecars from earlier runs. The change lives in the shared skillgen fragment, so every agent's generated update.md and its expected copy pick it up, and a new test checks the code-only incremental update section and its rationale.

Review partial — this diff was larger than one review pass covers, so later files were not reviewed; some findings may be missing.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 123 functions depend on the 123 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 123 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: 123 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

368 of 368 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_defines.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_located_semantic_identity.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_cache_stale_import_target.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cloud_cta.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cluster_ambiguous_scale.py — full-run-safety
  • tests/test_cluster_exclude_hubs.py — full-run-safety
  • tests/test_cobol_extractor.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • … and 318 more

non-code file(s) changed (graphify/skills/agents/references/update.md, graphify/skills/amp/references/update.md, graphify/skills/claude/references/update.md, graphify/skills/claw/references/update.md, graphify/skills/codex/references/update.md …) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (graphify/skills/agents/references/update.md, graphify/skills/amp/references/update.md, graphify/skills/claude/references/update.md, graphify/skills/claw/references/update.md, graphify/skills/codex/references/update.md …) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

Ensure code-only incremental updates generate a fresh AST-only extraction before merging.

Prevent FileNotFoundError when semantic extraction is skipped.

Preserve existing semantic graph data and cache entries.

Add regression coverage for added, modified, and deleted code files.

Refs Graphify-Labs#3232

Co-authored-by: OpenAI Codex <[email protected]>
@Deepjyoti-Sarmah

Copy link
Copy Markdown
Contributor

I ran this against #4447 on all 16 skills. It works for the 14 generated ones, thanks.

I applied only your change to the shared fragment on v8 (fe085ce), regenerated, and ran a test that reads each skill's code-only paragraph, runs the steps it names, and checks the merge. All 14 generated skills pass, including windows. Your branch also merges cleanly into v8.

Two things I found:

  1. aider and devin still fail. They are monolith skills with their own copy of the update text (core/aider.md and core/devin.md), so this change doesn't reach them. Neither has a fast-path block, only prose, so Part C still raises FileNotFoundError for .graphify_semantic.json. I opened fix(skill): aider and devin code-only --update reach the merge (#4447) #4456 for those two. It doesn't touch your files.

  2. The test only builds the Codex skill. It passes on your branch, but nothing checks the other 13. Mine covers all of them. If you want it, I can send it as a PR or paste it here.

The description links #3232 and not #4447, which is the same bug. Adding "Fixes #4447" would connect them.

@vibhanshu-mishra

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough validation across all 16 skills! Appreciate you checking this against v8 and confirming that all 14 generated skills pass, including Windows.

Good catch on aider and devin. Since they're maintained separately from the shared fragment, addressing them in #4456 makes sense. Thanks for opening that PR.

I'd definitely like to include your broader test coverage. Please open a PR for it so we can keep all 14 generated skills covered against future regressions. I'll also update the description to reference #4447. Since #4456 is still needed to cover the remaining two skills, I'd prefer to use Refs #4447 for now and close the issue once both fixes land.

@Deepjyoti-Sarmah

Copy link
Copy Markdown
Contributor

Thanks, and thanks for switching to Refs #4447.

The test needs your change to pass on the 14 generated skills, so a separate PR against v8 would fail until yours lands. It already lives in #4456 (tests/test_code_only_update_all_hosts.py), where it runs aider and devin. The anchors for the other 14 skills, windows included, are already in that file. Once your PR merges, I'll add the 14 skills to it, so all 16 are covered in one test.

safishamsi pushed a commit that referenced this pull request Oct 16, 2026
On aider and devin nothing wrote .graphify_semantic.json for a code-only
run, so Part C raised FileNotFoundError, and the --update paragraph sent
the agent from Part A to a merge that reads .graphify_extract.json.

Part B now has the fast-path block, the paragraph names Step 3A, the
fast path, Part C and the merge, and aider's only-deletions guard writes
the file its merge reads.

Adds tests/test_code_only_update_all_hosts.py for the two monoliths and
a skillgen audit entry for the new lines; the 14 generated hosts are
left to #4313.

(cherry picked from commit bbe1a7c)
@safishamsi

Copy link
Copy Markdown
Member

@safishamsi safishamsi closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants