Repository navigation
fix(skill): aider and devin code-only --update reach the merge (#4447) - #4456
Deepjyoti-Sarmah wants to merge 3 commits into
Conversation
…Labs#4447) 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 Graphify-Labs#4313.
Part A reads .graphify_detect.json and Step 9 deletes it, but the aider and devin --update sections never wrote it again, so Part A raised FileNotFoundError after any full build. The sections now write it from .graphify_incremental.json, as the generated references/update.md does, with each file's own path convention. The test no longer seeds the file; it asserts the update section wrote it.
|
Thanks for the pull request, @Deepjyoti-Sarmah. 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. |
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 2 advisory finding(s) below merit a look before merge.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Fixes the code-only --update path in the aider and devin skills so it reaches the merge with this run's AST. The Part B fast path now writes an empty .graphify_semantic.json so Part C's unconditional read no longer hits FileNotFoundError, and the code_only paragraph now names the fast path and Part C, which builds .graphify_extract.json from the fresh AST result. Incremental runs also rewrite .graphify_detect.json with the changed subset in files and the full corpus in all_files, but total_files comes from the changed subset while total_words comes from the full corpus. The deletion-only branch in aider now checks for .graphify_extract.json at the cwd-relative path, which can pick up a stale extraction from a prior run. Adds a test that reads the rendered code_only paragraph, runs only the blocks it names, then runs the merge. It currently covers devin and aider; the 14 shared hosts are deferred until #4313 lands. The skillgen drift guard gains line predicates that sanction the new text in the monoliths, but some of them also accept generic lines like })) anywhere in the file.
Worth a look
- Deletion-only update can reuse stale extraction —
graphify/skill-aider.md:855· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- Drift-guard predicate sanctions generic lines (code fences,
import json,",}))) anywhere in the monolith —tools/skillgen/gen.py:1290· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 415 functions depend on the 335 functions this change touches.
Health — this change adds coupling hotspots:
- new:
test_code_only_update_follows_its_paragraph_and_merges_the_new_function()— 0 callers, 6 callees
Verification — 415 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: 415 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
419 of 419 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/pi.test.ts— full-run-safetytests/test_affected_cli.py— full-run-safetytests/test_affected_defines.py— full-run-safetytests/test_affected_member_seed.py— full-run-safetytests/test_affected_overrides.py— full-run-safetytests/test_agents_platform.py— full-run-safetytests/test_alias_folding.py— full-run-safetytests/test_analyze.py— full-run-safetytests/test_anthropic_custom_endpoint.py— full-run-safetytests/test_antigravity_install.py— full-run-safetytests/test_apm_fallback_version.py— full-run-safetytests/test_architecture_doc.py— full-run-safetytests/test_astro_extraction.py— full-run-safetytests/test_astro_import_ids.py— full-run-safetytests/test_atomic_canvas_export.py— full-run-safetytests/test_atomic_version_stamp.py— full-run-safetytests/test_atomic_writes.py— full-run-safetytests/test_backend_env_isolation.py— full-run-safetytests/test_backend_extras.py— full-run-safetytests/test_benchmark.py— full-run-safetytests/test_benchmark_raw_graph.py— full-run-safetytests/test_benchmark_real_query.py— full-run-safetytests/test_blade_extractor.py— full-run-safetytests/test_build.py— full-run-safetytests/test_build_located_semantic_identity.py— full-run-safetytests/test_build_merge_dedup_scope.py— full-run-safetytests/test_build_merge_hyperedges_and_prune.py— full-run-safetytests/test_build_merge_shrink_guard.py— full-run-safetytests/test_builtin_global_type_refs.py— full-run-safetytests/test_c_include_resolution.py— full-run-safetytests/test_cache.py— full-run-safetytests/test_cache_stale_import_target.py— full-run-safetytests/test_callflow_html.py— full-run-safetytests/test_cargo_introspect.py— full-run-safetytests/test_cargo_missing_manifest.py— full-run-safetytests/test_carried_hyperedge_remap.py— full-run-safetytests/test_case_sensitive_resolution.py— full-run-safetytests/test_charmap_encoding.py— full-run-safetytests/test_chunking.py— full-run-safetytests/test_cjs_module_extension.py— full-run-safetytests/test_claude_cli_backend.py— full-run-safetytests/test_claude_md.py— full-run-safetytests/test_cli_broken_pipe.py— full-run-safetytests/test_cli_export.py— full-run-safetytests/test_cli_help.py— full-run-safetytests/test_cloud_cta.py— full-run-safetytests/test_cluster.py— full-run-safetytests/test_cluster_ambiguous_scale.py— full-run-safetytests/test_cluster_exclude_hubs.py— full-run-safetytests/test_cobol_extractor.py— full-run-safety- … and 369 more
non-code file(s) changed (
graphify/skill-aider.md,graphify/skill-devin.md,tools/skillgen/expected/graphify__skill-aider.md,tools/skillgen/expected/graphify__skill-devin.md,tools/skillgen/fragments/core/aider.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/skill-aider.md,graphify/skill-devin.md,tools/skillgen/expected/graphify__skill-aider.md,tools/skillgen/expected/graphify__skill-devin.md,tools/skillgen/fragments/core/aider.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.
Docs that may be stale (advisory)
CHANGELOG.md§ 0.9.84 (2026-10-10) (lines 131-144): references changed symbols__init__CHANGELOG.md§ 0.9.77 (2026-10-05) (lines 225-244): references changed symbols__init__CHANGELOG.md§ 0.9.58 (2026-09-10) (lines 477-494): references changed symbols__init__CHANGELOG.md§ 0.9.42 (2026-08-13) (lines 696-714): references changed symbols__init__CHANGELOG.md§ 0.9.23 (2026-07-21) (lines 909-918): references changed symbols__init__CHANGELOG.md§ 0.9.22 (2026-07-20) (lines 919-928): references changed symbols__init__,_envREADME.md§ See it in action (lines 80-110): references changed symbols__init__docs/superpowers/plans/2026-05-04-incremental-updates-dedup.md§ Task 2: Create graphify/dedup.py — entropy gate + MinHash/LSH + Jaro-Winkler (lines 71-468): references changed symbols__init__docs/superpowers/plans/2026-05-04-incremental-updates-dedup.md§ Task 4: Incremental updates — semantic cache + manifest in __main__.py (lines 603-911): references changed symbols_rundocs/translations/README.ar-SA.md§ See it in action (lines 80-110): references changed symbols__init__
…and 10 more.
· 1 grounded finding(s) anchored inline below.
|
|
||
|
|
||
| @pytest.mark.parametrize("host,anchors", HOSTS) | ||
| def test_code_only_update_follows_its_paragraph_and_merges_the_new_function(host, anchors, tmp_path): |
There was a problem hiding this comment.
test_code_only_update_follows_its_paragraph_and_merges_the_new_function()
fans out to 6 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
… test bash runs the backticked text in Part C's comment when graphify is on PATH, which broke the test in CI. The blocks do not need it. Also narrow three Optional values for pyright. The test checks the same things.
|
Landed in 0.9.92 (authorship-preserving cherry-pick, so it shows on your contributions). Thanks @Deepjyoti-Sarmah! Released to PyPI: https://pypi.org/project/graphifyy/0.9.92/ · https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.92 |
What does this PR do?
Part of #4447: this fixes the aider and devin skills only. The 14 generated hosts are fixed by #4313, and this PR does not touch that file (
tools/skillgen/fragments/references/shared/update.md) or any generatedreferences/update.md.Merge order: independent of #4313. Either can land first, and they touch different files. #4313 fixes the 14 generated skills, this PR fixes aider and devin. Once both are in, I'll add the 14 skills to this PR's test so all 16 are covered.
Summary
On a code-only
--updatethe aider and devin runbooks said "run only Step 3A, then go straight to merge". Part A writes.graphify_ast.json, the merge reads.graphify_extract.json, and nothing wrote it. Part C would write it, but it reads.graphify_semantic.jsonunconditionally, and in these two files the Part B fast path is prose only.Three commits:
fix(skill): aider and devin code-only runs reach the merge (#4447): the paragraph, the fast-path block, aider's guard path, the test, and thegen.pyaudit entry for these lines.fix(skill): aider and devin --update populate .graphify_detect.json: a separate bug found while testing. Fixes [Bug]: aider and devin --update never write .graphify_detect.json, so Part A fails #4455. Without it Part A fails first after any full build. It can be dropped without affecting commit 1.test(skill): keep graphify off PATH and satisfy pyright in the update test: bash runs the backticked text in Part C's comment whengraphifyis on PATH, which broke the test in CI. The test keepsgraphifyoff PATH for the blocks it runs, and three Optional values are narrowed for pyright. The test checks the same things.Plain first-time code-only builds on aider and devin also failed. The full-build text says "skip Part B entirely and go straight to Part C", and Part C then raised
FileNotFoundErrorfor the semantic file. The fast-path block fixes that when the agent runs it. The literal "skip Part B" sequence without the block still fails. Project with two.pyfiles, detect, Part A, Part C:Evidence
Before:
tests/test_code_only_update_all_hosts.pyon unfixed v8, 2 failed and 7 passed. The reader's unit tests are the 7; devin and aider fail at the merge:FileNotFoundError: [Errno 2] No such file or directory: 'graphify-out/.graphify_extract.json'FileNotFoundError: [Errno 2] No such file or directory: '.graphify_extract.json'After: 9 passed. The route the test runs is the one the rendered paragraph names,
['A', 'B', 'C', 'merge']. After the merge, Step 4 also ran on both skills (Graph: 5 nodes, 3 edges, 2 communities,graph.jsonlabelsa.py, b.py, f(), f_new(), g()).Commit 2 on its own: with the detect block removed the same test fails on both skills with
the --update section never wrote .graphify_detect.json; with it, 9 passed.Merge Danger
Door: two-way. Instruction text, one new block per skill and one new
gen.pyaudit entry per commit. No stored format changes. Reverting is one commit each.Blast Radius: narrow. Two skills, aider and devin. Nothing in
graphify/*.pychanges.check_semantic_cache(all_files)andsave_semantic_cache(...)with no prompt argument, so the key does not derive from the skill text. No node ids, graph format or manifest change.core/aider.md,core/devin.md), each commit regeneratesgraphify/skill-aider.md,graphify/skill-devin.mdand their twotools/skillgen/expected/files with--bless. The 14 generated hosts are not touched.gen.pyaudit entries:--monolith-roundtripcompares each monolith with a pinned v8 body and only accepts changes a predicate names. Commit 1 adds_is_code_only_fast_path_fix_lineand commit 2 adds_is_update_detect_populate_fix_line, both registered in_SANCTIONED_MONOLITH_DIFFS. The first one lets six generic shell lines of the new block pass once each anywhere in the monoliths (a code fence,```bash,import json,from pathlib import Path,", the unquoted$(cat graphify-out/.graphify_python) -c "line). Every content line is matched by specific text.git merge-tree --write-tree:tools/skillgen/gen.py, at the tail of_SANCTIONED_MONOLITH_DIFFS. Both sides append entries; keep all of them (this PR's two, plus_is_labels_json_fix_lineand_is_scan_root_fix_line). The fragments and generated skill files auto-merge.$(cat graphify-out/.graphify_python) -c "to the quoted form in the other blocks. Whoever lands second should quote this PR's new interpreter calls too: the fast-path block and the detect block in each ofcore/aider.mdandcore/devin.md, 4 in total.Not covered
# shared hosts: add the params back once #4313 lands.code_extslacks.luaand.toc, which devin has, so a Lua change makes aider'scode_onlyFalse..graphify_detect.jsonin the cwd but the video transcribe block readsgraphify-out/.graphify_detect.json. Only the video path is affected..graphify_*.jsonin the project root, wheredetect_incrementalscans them. A leftover.graphify_semantic.jsonfrom an interrupted run lands undernew_files.codeand flipscode_onlyto False.python -cblock, for example# `graphify update` deleted it .... Withgraphifyon PATH, bash runs that text and pastes its output into the Python source. This is why the test keepsgraphifyoff PATH. Not fixed here: it touches the shared fragments for all hosts.Type of change
Verification & Invariants
Invariant: when the code-only paragraph of an aider or devin runbook is followed as written, the merge reads a
.graphify_extract.jsonthat this run's Part C built from the fresh AST, and a stale.graphify_semantic.jsonor the semantic cache cannot reach the result.tests/test_code_only_update_all_hosts.pyrenders the skill, reads the code-only paragraph, runs only the blocks it names (Part A, the Part B fast path if named, Part C if named, then the merge), and checks: the merge exits 0; the printed node count is the baseline plus the new function; where the merge writes the extraction,f_new()is in it and a seeded stale semantic label is not; the semantic cache files are byte-identical before and after.The paragraph is read by a small reader: first mention of each step counts, code spans and clauses with a negation are dropped, and an unmapped step name raises. It has its own unit cases, including fix: materialize extraction for code-only incremental updates #4313's paragraph verbatim and the issue's second route (the merge builds from the AST file).
The test does not hard-code the route. A paragraph that names too little fails, which is the bug.
Generated or persisted state this invalidates: none.
--blessrewrites only the aider and devin entries inexpected/(the other 132 are content-identical).Read the CONTRIBUTING.md guide.
Reproduced the issue and identified the invariant.
Made the smallest fix necessary.
Added a regression test (if bug fix) or isolated boundary test.
Kept the PR description synchronized with the final implementation.
Documented any limitations / unsupported cases explicitly.
How was this tested?
Run from
/var/tmpor the worktree withPYTHONPATH=/var/tmp/wt-4447-fixand the repo venv's Python, so the code under test is this branch.graphify.__file__was checked to be inside the worktree.Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments.