Skip to content

fix(detect): respect cache root for converted sidecars - #2794

Open
hopstreax wants to merge 1 commit into
Graphify-Labs:v8from
hopstreax:fix/2787-detect-converted-sidecars-cache-root
Open

fix(detect): respect cache root for converted sidecars#2794
hopstreax wants to merge 1 commit into
Graphify-Labs:v8from
hopstreax:fix/2787-detect-converted-sidecars-cache-root

Conversation

@hopstreax

Copy link
Copy Markdown
Contributor

Summary

Fixes #2787.

detect() previously wrote converted Office document sidecars to the scanned source tree even when cache_root was provided. This could mutate read-only or pinned source checkouts during detection.

This change makes converted sidecars respect cache_root while preserving the source root as the hashing/identity anchor.

Changes

  • Redirect converted sidecars to <cache_root>/graphify-out/converted/ when cache_root is provided.
  • Preserve the existing <root>/graphify-out/converted/ behavior when cache_root is not provided.
  • Continue passing the original source root to conversion helpers so sidecar filenames remain stable.
  • Added a regression test verifying that:
    • the scanned source tree is not polluted with graphify-out/
    • the converted sidecar is written under cache_root
    • detect() returns the redirected sidecar path
    • the sidecar content is generated correctly
    • the sidecar hash remains anchored to the source root

Validation

  • uv run pytest tests/test_detect.py -k "detect_office_conversion_respects_cache_root or convert_office_file_sidecar_name_stable_across_checkouts" — 2 passed
  • uv run pytest tests/test_office_incremental.py tests/test_office_limits.py tests/test_google_workspace.py tests/test_extract_cache_location.py — 22 passed
  • uv run pytest tests/test_detect.py — 235 passed, 11 skipped

@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 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() signaturegraphify/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).

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.

detect() writes converted sidecars into the scanned tree; cache_root does not redirect them

1 participant