Skip to content

fix(cache): skip caching edges-but-no-nodes semantic results so model… - #2936

Open
SinghAman21 wants to merge 1 commit into
Graphify-Labs:v8from
SinghAman21:fix/2927-skip-empty-node-cache-writes
Open

fix(cache): skip caching edges-but-no-nodes semantic results so model…#2936
SinghAman21 wants to merge 1 commit into
Graphify-Labs:v8from
SinghAman21:fix/2927-skip-empty-node-cache-writes

Conversation

@SinghAman21

Copy link
Copy Markdown
Contributor

…-omitted files re-dispatch instead of freezing out of the graph (#2927)

On large batches the model sometimes omits a file from its response but still emits edges attributed to it. We cached that {"nodes": [], "edges": [...]} result keyed by content hash, so every later run was a cache hit and the file never got extracted again — its edges dangled and were pruned, and the "a re-run will retry them" warning wasn't actually true.
What changed

  • save_semantic_cache skips writing per-file entries that have edges but zero nodes (with a warning), so the file genuinely re-dispatches next run
  • load_cached treats already-poisoned entries (from older versions) as a miss, so existing caches self-heal on the next complete extraction
  • _stamped_manifest_files no longer stamps an edges-only file as up-to-date — otherwise warm incremental runs would skip it even with the cache fixed
    Hyperedge-only results are untouched and still cache normally (hyperedge-only doc output never stamped in manifest — perpetual re-extraction #1920). Multi-chunk merges are unaffected since the check runs on the merged result.

…-omitted files re-dispatch instead of freezing out of the graph (Graphify-Labs#2927)

@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.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 2 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Treats a semantic result with edges but zero nodes as a model-omission artifact (#2927): save_semantic_cache skips writing such entries (with a RuntimeWarning), load_cached reads existing poisoned entries as a miss for self-healing re-dispatch, and _stamped_manifest_files drops edges from stamping so those files re-queue. Preserves multi-chunk accumulation onto node-bearing entries and keeps hyperedge-only results (#1920) valid. Adds cache and CLI tests covering the skip, merge, self-heal, and hyperedge/AST exemptions.

Worth a look

  • save_semantic_cache drops edge-only resultsgraphify/cache.py:1552 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Semantic save skips valid hyperedge-bearing results when edges are also presentgraphify/cache.py:1561 · 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 — 1460 functions depend on the 373 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 474 callers, 42 callees
  • new: _rebuild_code() — 98 callers, 50 callees
  • new: detect() — 108 callers, 15 callees
  • new: save_semantic_cache() — 59 callers, 11 callees
  • new: load_cached() — 45 callers, 7 callees
  • new: extract_corpus_parallel() — 26 callers, 11 callees
  • new: file_hash() — 45 callers, 6 callees
  • new: dispatch_command() — 2 callers, 119 callees
  • …and 19 more — each is listed as a finding

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

Formal verification

Could not verify: Could not verify load\_cached.

The verifier did not have enough to check load\_cached, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify save\_semantic\_cache.

The verifier did not have enough to check save\_semantic\_cache, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_stamped\_manifest\_files.

The verifier did not have enough to check \_stamped\_manifest\_files, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set

· 27 more finding(s) on lines outside this diff (see the check run).

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.

1 participant