Skip to content

fix(intelligence): VOR read-path skips prose scan when explicit anchors exist - #34

Merged
ManSio merged 3 commits into
mainfrom
fix/vor-read-path-trust-explicit-anchors
Sep 11, 2026
Merged

ManSio merged 3 commits into
mainfrom
fix/vor-read-path-trust-explicit-anchors

Conversation

@ManSio

@ManSio ManSio commented Sep 11, 2026

Copy link
Copy Markdown
Owner

What

Fix false REFUTED in VOR (VerifyOnRead, ADR-0003): read-path re-scanned the prose of ADR body via _PATH_RE even when the node already had explicit data.anchors captured at write-time. ADR bodies contain historical X -> Y paths, so a rename-sweep resurrected the old path as a checkable anchor and falsely refuted live nodes.

Real case found: ADR-7232a6e2ba34 — its stored anchors (adapters/zed/zed_config.py, src/main.py, pkg:MCP) all still exist, but it was auto-REFUTED because prose /src/utils/paths.py → adapters/local_fs/windows.py (a git R083 rename) leaked into the anchor set.

Root Cause

extract_anchors() (verify_on_read.py:290) extracted explicit data.anchors first, then ALSO scanned prose text. A rename described as old_path -> new_path in the ADR body adds BOTH paths as anchors. The old path no longer exists → classify → SILENT_ABSENCE → REFUTED.

Fix

  • extract_anchors(..., read_path: bool = False) — new param.
  • VerifyOnRead.run() passes read_path=True for the read-path call.
  • When the node has explicit data.anchors, prose is NOT scanned: historical paths never become checkable anchors. Explicit anchors remain authoritative.
  • Legacy nodes WITHOUT explicit anchors (auto-collect stored before write-time capture) keep prose scanning → intentional drift detection still works (verified by test).
  • Write-path callers in layer.py are unchanged (default read_path=False).

Tests

  • test_extract_anchors_read_path_trusts_explicit_anchors — prose history not extracted on read-path, backward compat without flag.
  • test_read_path_prose_history_not_refuting_live_node — live node with explicit anchors stays VERIFIED despite historical path in body.
  • test_read_path_prose_history_legacy_node_keeps_refuting — legacy node without anchors still refutes on real drift.

Numbers (from EXPERIMENTS_LOG 2026-09-11)

Metric Value
Auto-REFUTED nodes audited 24
Junk prose anchors (54%) 13
True deletions 10
FALSE rename refute 1 (ADR-7232a6e2ba34)
Synthetic sweep after ONE git mv 30/30 REFUTED → after fix keeps explicit-anchor nodes verified
Latency extract_anchors ~5.6ms fingerprinted

Verification

  • tests/test_verify_on_read.py: 53 passed
  • tests/test_memory_retraction.py: 28 passed
  • All pre-commit hooks green (verify_diary, stale_detector, check_tool_names, negative_controls, layer boundaries, architecture_linter, ruff)
  • Live repro: node with explicit anchors + historical prose → VERIFIED (was REFUTED pre-fix)

…rs exist

Read-path re-scanned prose via _PATH_RE even when data.anchors were already
captured at write-time. ADR body prose contains historical "X -> Y" paths,
so a rename-sweep resurrected the old path and falsely REFUTED live nodes
(ADR-7232a6e2ba34: src/utils/paths.py -> adapters/local_fs/windows.py).

extract_anchors now accepts read_path=True; VerifyOnRead.run() passes it.
When the node has explicit anchors the prose is not scanned, so historical
paths never become checkable anchors. Legacy nodes without explicit anchors
keep prose scanning (backward compat).

Add regression tests: explicit anchors trusted on read-path, historical
prose path not refuting live node, legacy node still refutes on real drift.

Verified: 53 tests in test_verify_on_read.py + 28 in test_memory_retraction.py.
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 4ddec30c-d2bc-42e8-8aac-bbc8870621ed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

MSCodeBase Agent added 2 commits September 11, 2026 21:47
- AGENT_DIARY: session entry for PR #34 (extract_anchors read_path=True,
  prose skip when explicit anchors exist) + decision that 178s gate-zero
  is normal and pytest stays single-threaded.
- WISDOM: "Commit overhead — НЕ баг" — 8-min commit = llama-server
  contention, not slow tests; basetemp race is known, do not fix.
@ManSio
ManSio merged commit 8a05b59 into main Sep 11, 2026
12 of 13 checks passed
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