fix(detect): respect cache root for converted sidecars - #2794
Conversation
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 1 advisory finding(s) below merit a look before merge.
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
This PR modifies detect() in graphify/detect.py so that when a cache_root argument is provided, converted document sidecars are written under cache_root/GRAPHIFY_OUT/converted instead of under the scanned root directory. It adds a new test verifying that the scanned corpus tree is left untouched, the sidecar is placed under cache_root, and the sidecar filename hash remains anchored to the scan root. The large list of changed test/rationale symbols appears to reflect line-number shifts from inserting the new test rather than substantive changes to those cases.
Worth a look
- cache_root parameter may not exist in detect() signature —
graphify/detect.py:1638· Escalate · high- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review Execution auto-disposal is off for this run; enable it (with sandbox isolation) to have Graphify try to confirm or refute this automatically.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1527 functions depend on the 482 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 463 callers, 41 callees - new:
_rebuild_code()— 95 callers, 51 callees - new:
detect()— 100 callers, 15 callees - new:
save_manifest()— 34 callers, 11 callees - new:
extract_files_direct()— 17 callers, 20 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
extract_corpus_parallel()— 26 callers, 10 callees - new:
dispatch_command()— 2 callers, 117 callees - …and 25 more
Verification — 1527 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: 785 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify detect.
The verifier did not have enough to check detect, 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
· 33 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #2787.
detect()previously wrote converted Office document sidecars to the scanned source tree even whencache_rootwas provided. This could mutate read-only or pinned source checkouts during detection.This change makes converted sidecars respect
cache_rootwhile preserving the source root as the hashing/identity anchor.Changes
<cache_root>/graphify-out/converted/whencache_rootis provided.<root>/graphify-out/converted/behavior whencache_rootis not provided.rootto conversion helpers so sidecar filenames remain stable.graphify-out/cache_rootdetect()returns the redirected sidecar pathValidation
uv run pytest tests/test_detect.py -k "detect_office_conversion_respects_cache_root or convert_office_file_sidecar_name_stable_across_checkouts"— 2 passeduv run pytest tests/test_office_incremental.py tests/test_office_limits.py tests/test_google_workspace.py tests/test_extract_cache_location.py— 22 passeduv run pytest tests/test_detect.py— 235 passed, 11 skipped