skill: graph-health gate (Step 4.5) + anchor caches on the scan root#1437
Closed
bahcgscateringsa-design wants to merge 1 commit into
Closed
Conversation
Two integrity improvements to the core skill runbook (rendered via skillgen): 1. Graph-health gate (new Step 4.5): runs diagnostics.diagnose_extraction read-only after build, before labeling, and surfaces dangling/missing/ self-loop and same-endpoint-collapsed edges — the silent-corruption modes of incremental updates and AST/LLM id mismatches. Never aborts. 2. Anchor the AST and semantic caches on the scan root (root/cache_root= 'INPUT_PATH') instead of the cwd, matching the CLI extract path (ast cache_root=out_root, check/save_semantic_cache(root=out_root)) and build_from_json/save_manifest (Graphify-Labs#1361 parity). Without this, running from a cwd != scan root cold-misses the cache and can split AST vs semantic caches. Source edited in tools/skillgen/fragments/core/core.md; artifacts + expected/ regenerated via 'python -m tools.skillgen' (+ --bless). Full suite green (2229 passed); skillgen + cache suites green (80 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
safishamsi
added a commit
that referenced
this pull request
Jun 23, 2026
…nchor merges Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Merged into |
safishamsi
added a commit
that referenced
this pull request
Jun 23, 2026
Query perf, a skill graph-health gate, and a batch of install/extraction fixes: - #1431 trigram query prefilter (faster, results unchanged) - #1437 Step 4.5 graph-health gate + semantic-cache anchored on the scan root - #1411 CUDA (.cu/.cuh) via the C++ extractor - #1402 cross-file type-annotation refs no longer duplicate nodes - #1403 hermes install -> %LOCALAPPDATA% on Windows - #1409 no punctuation-only Obsidian/Canvas filenames - #1413 opencode reminder backtick command-substitution fix - #1428 graphify extract --cargo handles missing Cargo.toml - #1429 prs.py F821 cleanup Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two integrity improvements to the core skill runbook (edited in
tools/skillgen/fragments/core/core.md, artifacts +expected/regenerated viapython -m tools.skillgen/--bless). These are independent — happy to split,drop, or cherry-pick either one (see note at the bottom).
1. Anchor the caches on the scan root (consistency fix)
The skill currently passes
cache_root=Path('.')to AST extraction and letscheck_semantic_cache/save_semantic_cachedefault to.— i.e. it keys thecache on the cwd. The CLI extract path keys on the scan root:
ast_kwargs = {"cache_root": out_root}andcheck/save_semantic_cache(root=out_root),with
out_root = out_dir or target.build_from_json()/save_manifest()alreadytake
root='INPUT_PATH'in the runbook (#1361).This change makes the runbook match the CLI: both AST and semantic caches anchor on
INPUT_PATH. Without it, running graphify from a cwd ≠ scan root cold-misses thecache (every file re-extracts) and can even split AST vs semantic cache locations.
2. Step 4.5 — read-only graph-health gate (proposal)
graphify/diagnostics.py(diagnose_extraction/format_diagnostic_report) is aready integrity checker that isn't wired into the default pipeline. This adds a
read-only Step 4.5 after build / before labeling that surfaces dangling /
missing / self-loop and same-endpoint-collapsed edges — the silent-corruption modes
of incremental updates and AST/LLM id mismatches. It never aborts; it just makes
an integrity issue visible (per the Honesty Rules) instead of letting users query a
silently-broken graph.
Tests
2229 passed, 28 skipped.tests/test_skillgen.py:53 passed(check / audit-coverage / monolith-roundtrip /lean-core invariants all hold),
tests/test_cache.py:27 passed.Note on scope
I know the skill is mid lean-core split. #1 is a straightforward CLI-parity fix and
stands alone. #2 adds a step to the core, which may be at odds with the lean-core
direction — totally fine to take only #1, or to treat #2 as a discussion. Tell me
how you'd like it sliced and I'll adjust.