Repository navigation
Description
Parent: #3794
Depends on: #3795
Related timeout authority: #1604
Downstream source consumer: EffortlessMetrics/ripr#1758 and #1759
Outcome
Make ordinary PR/review analysis consume an exact reusable base proof plus the bounded diff, and cache semantic classification units above per-file facts so one changed file does not invalidate the complete repository when dependencies are known.
Target model
exact base snapshot/proof
+ changed file facts
+ bounded semantic dependency closure
→ current canonical delta / review result
not:
one changed file
→ whole-repository evidence/classification recomputation
Cache unit
Start with an explicit unit such as owner/canonical-gap group:
production owner identity
production-fact digest
related test/relation/oracle fact digests
relevant config/manifest/source-role identity
analyzer/schema/language-feature identity
→ seams, evidence, classifications, canonical gaps
The exact shape may follow existing cache architecture. Individual seams are not required when an owner-level unit gives safer invalidation.
Invalidation rules
At minimum:
- changed production owner invalidates that owner;
- changed test invalidates owners reached by retained relation dependencies;
- config/manifest/source-role/schema/analyzer movement invalidates the represented scope;
- unresolved or ambiguous dependency widens conservatively and records the reason;
- corrupted/partial cache never yields clean output;
- changed test fixtures prove oracle/relation invalidation, not just file-fact recomputation.
Exact base-proof routing
For PR/review consumers:
- bind to exact repository, merge-base SHA/tree, analyzer/config/schema identity, and complete/limited state;
- consume only a reachable compatible base proof;
- analyze the bounded base→head diff;
- distinguish proof-unavailable from candidate failure;
- fail closed or explicitly fall back according to the consumer contract;
- do not run a 30-minute whole-head scan merely as freshness evidence when its result is not used in the verdict.
Main/full-audit routes may still produce whole-repository snapshots.
Required controls
- Unrelated one-file production edit reuses unaffected semantic units.
- Changed related test invalidates the correct production owners.
- Changed unrelated test does not invalidate every owner.
- Config/manifest/source-role/analyzer generation causes the correct widened invalidation.
- Ambiguous dependency records full-scope fallback rather than silently reusing.
- Cold and warm outputs are canonically identical.
- Base proof from another repository/root/config/SHA rejects.
- Missing/partial/stale base proof is typed and cannot produce a clean gate.
- Superseded PR head cannot reuse a proof as current-head evidence.
- Absolute-root movement preserves portable semantic identities.
Proof and replay
Use #3795 receipts to prove work, not only elapsed time. Replay:
- deterministic fixture cold/unchanged/one-production-file/one-related-test/one-unrelated-test;
- ripr-swarm medium/large self-dogfood;
- the authorized 4,314-file consumer case.
Retain p50/p95 only with host/run context; do not set a universal threshold from one machine.
Acceptance
- Semantic cache units and dependency fingerprints are explicit and versioned.
- One-file changes reuse unaffected units where dependencies are known.
- Changed-test/config/schema controls invalidate correctly.
- PR/review consumers can use an exact compatible base proof plus bounded diff.
- Full-scope fallback is typed, observable, and conservative.
- Cold/warm semantic parity passes.
- The 4,314-file case is replayed with file and semantic reuse counts materially different from full recomputation, or an exact unresolved blocker earns a release disposition.
- Exact PR/head/merge and receipts are handed to perf(0.11): make large-repo cache work observable and incrementally reusable #3794/release(0.11.0): qualify the exact frozen swarm candidate and retain an evidence-identity bundle #2769.
Non-goals
No general whole-program dataflow engine, persistent service, or weakening of currentness.
Activity
EffortlessSteven commentedon Sep 22, 2026
Small-edit investigation and delivered proof slice — 2026-09-22
Inspection basis: main
dc66cecc2fd8a2217e944f13723e53dac68e8f67.Draft PR #3863 is now published, head
ce8877bda19526ad6c52af6b784e14ecee8e2f61, stacked on #3855's explicit-cache builder seam. It is test-only: two files, five controls over an isolated 70-file physical workspace. It counts actual Rust syntax-adapter entries, preserves the populated cache across real edits, and compares file/function/test/package facts plus derived owner findings with a separately uncached build after each step.Controls: cold/warm → same-size production edit → revert; related-test assertion edit; previously unrelated test becoming a direct caller and reverting; related-test addition/deletion; manifest package-authority change without source reparsing. Exact expectations and native proof command are in #3863. No fixture uses process-global cache environment or timing thresholds.
Proof status: source hashes, two-file scope, whitespace-only formatter repair,
git diff --checkand reverse patch applicability are verified. The first hosted run35689636923, job106623729286, failed at formatting before Rust gates/tests. Commitce8877bdapplies its five exact rustfmt hunks. Native test execution, negative controls, installed-CLI replay, bounded whole-diff work and latency remain NOT_PROVEN. #3863 must remain draft pending current-head proof and parent acceptance; do not merge it into the active parent branch. After #3855 merges normally, retarget the child to main and qualify the resulting integration.Remaining implementation requirements
known_file_paths()scan, reading/decoding all retained file-fact JSON envelopes. Parser/hit counts omit this historical-cache work; cancellation during the scan is also not newly bounded. A future history-index optimization needs conservative invalidation attribution, schema/corruption/failure handling and entry/byte work counters, not merely a path marker treated as authoritative facts.explicit_file_fact_cache_resetbenchmark as reset proof, and add an actual populated-cache source-edit workload through the downstream diff/review path. Report file reads/hashes/parses, historical cache entries/bytes, candidate relations, classified/reused semantic units, base-proof loads and typed widenings. Require canonical cold-result parity and measured work reduction for unchanged, production/test edit, add/delete/rename and authority-change cases before closing this issue.#3863 is a bounded regression contribution, not an implementation or acceptance closeout for this issue. Proposed release selection remains
release_optional_pending_decisionunder #2766, with named dependency/proof blockers; no competing release controller or new mandatory blocker is created.EffortlessSteven commentedon Sep 22, 2026
Important
Safety prerequisite discovered during the adjacent cache audit: #3848 shows that the current aggregate stat fingerprint is not authoritative on Windows/non-Unix when a real same-size edit restores the previous mtime. This candidate therefore depends on #3848 (or an equivalent conservative admission rule). Until that repair lands and is proven natively, the no-impact shortcut must be disabled on affected platforms and fall back to content verification. Nothing below treats the current #2108 mtime/size mapping as universally exact.
Current-source audit and first bounded implementation slice
Audited against
mainatdc66cecc2fd8a2217e944f13723e53dac68e8f67.Where the diff cost actually begins
The changed-line owner resolver is already narrow.
owner_symbols_for_linesdeduplicates the files present in the diff and builds a Rust index for only that changed-file set. It is not the near-full-rescan defect.The expensive transition is the shared Rust scoped-inventory entry point:
inventory_diff_scoped_classified_seams_at_with_configcallscollect_workspace_statebefore it computes whether the changed set contains any production file.collect_workspace_state_from_filesthen performsstd::fs::read(root.join(path))for every discovered Rust file. Even an empty/non-Rust/no-owner diff therefore pays the full corpus content-read and file-fact/index path before returning an empty scoped inventory.This path is shared by at least:
review-comments, in itscanonical_analysisphase; andrerun, once each selected Rust ledger scope reaches the same scoped inventory.Existing primitive to reuse only after currentness admission
The full and compact inventory routes already have a stat-only route from #2108:
On Unix today, the signature includes ctime in addition to path, mtime, and length. On Windows/non-Unix, #3848 establishes that the current path+mtime+length signature can alias different bytes after a timestamp-preserving same-size edit. Therefore this mapping is only reusable where the #3848 validity rule says it is authoritative; otherwise the caller must read/hash contents.
Once admitted under that rule, the existing mapping reconstructs the byte-identical
RepoSeamCacheKeywithout reading source contents. The write side stores a mapping only when the signature is unchanged across the full read. A new extension-only key or a second currentness authority is not needed, but the existing shortcut must not be promoted beyond its proven platform/filesystem boundary.First candidate: exact no-impact diff fast path
Create one focused child/candidate that optimizes only diffs which are proven not to affect Rust seam/evidence semantics.
Eligibility
Take the fast path only when all are true:
changed_owner_namesis empty.scan_corpus_fingerprintsucceeds andfingerprint_cached_workspace_keyresolves the exact current workspace key. Unknown or unsupported identity is a fallback, never reusable evidence.Do not equate “not a production
.rsfile” with safe. A changed test must continue to invalidate relation/oracle evidence, and manifest/config/source-role movement must continue to widen conservatively.Fast-path behavior
For an eligible warm no-impact diff:
ScopedClassifiedSeamInventory;workspace_cache_key,total_rust_files, andtotal_production_filesfrom a compatible stored snapshot/metadata envelope;no_impact_diff_reused_exact_workspacerather than making the work invisible.If exact totals are not currently retained independently of the classified payload, add the smallest versioned metadata envelope needed to carry them. Do not fabricate totals from stale output or silently substitute zero.
Conservative fallback
Any ambiguity takes the existing path and records the reason, for example:
A cold docs-only diff may therefore remain conservative in this first slice. The claim is an exact warm no-impact fast path on an admitted identity surface, not universal cold-start elimination.
Required discriminators
Receipt and replay
Use #3795 fields to prove the optimization rather than elapsed time alone:
Replay at minimum:
Claim boundary
This first slice removes needless content reads and indexing only for exact warm no-impact diffs on a change-identity surface admitted by #3848. It does not satisfy the central one-production-file semantic-reuse acceptance item. The following candidate should introduce versioned owner/canonical-gap units and retained dependency fingerprints so unaffected owners survive production/test edits. Keeping those two claims separate gives the no-impact shortcut a small, reviewable safety boundary and prevents it from becoming an extension-based or platform-unsound false-clean optimization.
EffortlessSteven commentedon Sep 22, 2026
Focused first implementation child: #3859 — warm exact no-impact diffs skip Rust content reads and index construction while retaining truthful workspace identity/totals and typed fallback. It is explicitly blocked on #3848's native change-identity/currentness rule; the current Windows path+mtime+length fingerprint is not accepted as universally authoritative.
EffortlessSteven commentedon Sep 22, 2026
Cold-diff implementation diagnosis — 2026-09-22
I traced the current default diff path while implementing #3851. This is the residual that #3796 still needs to remove; #3851 is intentionally only the repeated relation-scan slice.
Current default path
CheckInput::default()is Draft withinclude_unchanged_tests = true.In
RustAdapter::analyze_diff_for_languages_with_generated_file_patternsthe order is currently:workspace::discover_rust_filesrecursivelyread_dirs every non-ignored directory and sorts the complete Rust path inventory before Draft package selection. After selection, the diff path still reads bytes for every selected file before the file-fact cache can decide hit/miss. In a monocrate, one changed production file can therefore make Draft select/read essentially the whole crate even with a warm fact cache; on cold start it also parses that selected set.What the current cold-path PRs do / do not remove
O(probes × tests)related-test candidate scans and per-probe same-name function scans after the Rust index exists.Those are complementary and currently file-disjoint. None changes Draft's discovery/selected-file read scope, and none is a substitute for #3796.
#3796 implementation order I recommend from this trace
Required discriminators
The most important control is not elapsed time alone:
Current status: the source-path diagnosis is proven by the live implementation; the material reduction from exact base proof is still NOT_PROVEN until #3796 lands and #3795 receipts replay the authorized 4,314-file case.
EffortlessSteven commentedon Sep 22, 2026
Second focused implementation child: #3862 — canonical-gap rerun currently rebuilds the full Rust workspace/index once per distinct
(file, owner)scope. The safe repair prepares current workspace/index once, then evaluates each original scope independently; a naïve union is explicitly rejected because it can widen callers or mask an unresolved sibling scope. This slice is independent of #3848 because it shares one content-read analysis only within the same invocation.style(cache): apply hosted formatter corrections to edit replay tests
test(cache): replay small edits against uncached facts and findings (#…
EffortlessSteven commentedon Oct 3, 2026
Downstream consumer: base/head verification impact
#5164 consumes this issue’s exact compatible base proof, semantic-unit invalidation, negative-dependency widening, and cold/fresh parity contract to derive a base/head semantic impact frontier for #5162.
It does not add a second snapshot, cache, workspace-key, or currentness authority. A stale/missing/partial base proof cannot produce a complete targeted plan. Deleted owners/edges are retained from the base model, added edges from the head model, and changed candidate domains such as unrelated→related tests or new same-name owners must invalidate conservatively.
#5169 later measures plan/full-lane economics through #3752; that downstream study does not change this issue’s correctness or currentness boundary.
EffortlessSteven commentedon Oct 3, 2026
Verification-plan consumer and index boundary
The change-verification programme now consumes this issue through two explicit downstream responsibilities:
This does not create another cache/base-proof authority. #3796 remains responsible for compatible exact base proofs, semantic-unit reuse, invalidation, and conservative fallback.
The additional invalidation families are:
A compact/report relation limit is never a semantic cache denominator. #5182 must retain the complete edge set for the declared model while allowing bounded delivery; fresh and incremental edge sets must agree. Any unresolved relation/cache dependency widens or reports
not_proventhrough this issue’s existing law.EffortlessSteven commentedon Oct 4, 2026
VP31 boundary: #5226 does not replace this issue's static semantic-unit/base-proof cache.
Keep the two cache/provenance planes separate:
Shared source/config/analyzer identities may be referenced, but neither artifact class can satisfy the other's proposition. A warm RIPR analysis cache cannot prove a test binary/listing/result. A current provider report cannot become a static base proof.
Add a negative architecture/currentness control at the integration boundary so future storage consolidation cannot flatten these meanings merely because both use content commitments.
EffortlessSteven commentedon Oct 21, 2026
Bounded invalidation review: no defect reproduced
Reviewed source/main
6be02b0bff14fe4729fdb6a39072d7ee4e9ee427, tree6294862ae28371e085d373f1b875d2edf09bf5ec; remote main read back unchanged after proof. Independent investigation of current implementation, not merge clearance or closure of #3796. No production change, PR, merge, release, graph re-benchmark, or broad performance claim.Ownership: all-state finding/path searches and this issue's eight comments inspected before temporary edits. Existing landed proof #3863 retained; #8930/#8931 reverse traversal and the semantic-cache/base-proof owners are unaffected. The temporary single-file reservation is released; no competing implementation.
Fresh Linux/Rust 1.95.0 proof:
cargo test --locked -p ripr --lib incremental_edit_tests -- --nocapture: 6/6 pass on clean source. First attempt failed before behavioral assertions because.cargo/config.tomlroutes TMPDIR to a nonexistent worktreetarget; creating the directory repaired setup. That failed attempt is not a product red witness.build_indexoracle, with two temporary controls and stronger comparisons of include parents/targets/limitations plus findings for every fixture file: 8/8 pass. Experimental tree94ea3833468da53bd2e3c36df7ae334269e842cf, onlycrates/ripr/src/analysis/facts/build/incremental_edit_tests.rsdiffers from reviewed source. Patch SHA256eec1c498eda179d5f78e1f41115cd9b93cb6870db347e646f7009a3ae4e5c215; libtest executable SHA2567db112093ad8f5ac62aaec55e2a3a1de74c8b2b10a49c00b6bfd6b19679bb0a3.src/lib.rs::newly_includedidentity. Child-only edit: 70 hits/1 parse, parent facts unchanged. Child deletion: 70 hits/0 parses, stale function/edge absent and missing-target limitation restored. Directive removal reuses original parent generation (70 hits/0 parses). All compared with fresh uncached facts/findings at each state.cache_clear_safetyfilteredit_revert_rename_delete_matches_cold: 2/2 pass (saved tests and Cargo config).rust_include_compilation_unit: 1/1 pass.findingsarrays for source edit (2 findings), related-test rename (2), deletion (2), and newly added literal include/target (5). Positive relation survives rename undertests/renamed.rs; deletion removes it; included owner is present. Twelve successful CLI executions. Binary reports exact reviewed SHA; SHA2560405ded26dd5b8ee0650b17703e653d1d896f66dcbdfd15ce0c4bc5c7c8b4c30. Initial harness schema-key mistakes were corrected before this terminal matrix; no product failure was inferred from them.Source inspection: file keys bind path/content, only the current inventory enters a fresh index, and both builders rerun include resolution plus manifest/package authority after retrieval. These observations explain the exercised parity; parser hits do not imply semantic classification reuse. Existing semantic-unit/base-proof requirements remain open.
Limits: bounded synthetic Linux fixtures, literal local
.rsincludes and retained public regression paths. No Windows proof, dynamic/generated-resource dependency closure, native full CI, large-repo campaign, general deletion/rename completeness, or performance improvement is established. No missed-analysis repair is justified by these results. Investigation stops here.EffortlessSteven commentedon Nov 2, 2026
Cursor verify claim: checking whether #3796 is satisfied on main.
EffortlessSteven commentedon Nov 2, 2026
Cursor verify result — partial (not closable on
main)Inspection basis:
origin/mainatdeab1faddc4eb9cbdbb1529ce967848376b7800a(2026-11-02).No other harness claim in the last 24h besides this verify pass. No PR opened: remaining acceptance requires owner-level semantic cache units, exact base-proof routing, and large-consumer replay — explicit architecture/defer decisions in issue comments and release ledger; not a file-disjoint slice this pass can finish without human design input.
Acceptance checklist vs current
mainbound_inventory_reusekeys whole-workspace scoped inventories (crates/ripr/src/analysis/seam_inventory.rs~1871–1948), not production-owner units.incremental_edit_tests.rs:1–6states derived findings are recomputed and tests do not claim semantic classification is incrementally cached.incremental_edit_tests.rs, merged via #3863) reuse parses only; classifier still runs on fresh index paths. Release non-claim: warm runs recompute semantic analysis (policy/release-selection.jsonperf-semantic-reuse, lines 226–239).incremental_edit_tests.rsexercises manifest authority + related/unrelated test edits at file-fact layer. Warm no-impact eligibility + typed fallbacks:try_no_impact_fast_path/no_impact_changed_path_fallback(seam_inventory.rs~1552–1664, tests ~8191+). Does not prove negative-relation-domain or owner-level invalidation from issue body.NoImpactFallbackReason, stable vocabulary test ~8191). Whole-workspace rediscovery still default for ineligible diffs (issue diagnosis comments;collect_workspace_statepath unchanged for production edits).seam_inventory.rstests (~8011+, ~9215+). Not established for owner-level semantic units (not implemented).docs/releases/0.11.0-cut-checklist.mdrow 7: #3796 semantic-unit reuse deferred for 0.11.x; landed perf children listed, not this acceptance row.release-selection.jsonproof_refs to #3794 comment).Landed complementary work (does not close #3796)
incremental_edit_tests.rs.try_no_impact_fast_path(seam_inventory.rs~1552+) landed as perf(review): skip Rust content reads and index build for warm no-impact diffs (#3859) #4100.bound_inventory_reusemodule (~1875+).Remaining (issue-owned, not started on
main)Versioned owner/canonical-gap cache units with dependency fingerprints; exact base-proof load + bounded invalidation closure for PR/review consumers; negative-relation widening; #3795 receipt replay including authorized large consumer; handoff receipts to #3794/#2769.
Verdict:
partial— stop without merge-ready PR from this leaf.