feat(rcache): closure-union index reads behind index_source="closure" - #995
Conversation
Phase 2 of the per-commit index work: read the bounded per-commit closure snapshots (~40x smaller than the byte-copy, and the signed object) instead of the full-index copy. - mfile: IndexSourceMode::Closure resolves one closure object per pinned git chain link (upstream first, then sideloads); dir and unpinned links contribute nothing; no pinned links is an error. - rcache: the reader fetches each link's closure through the same immutable-snapshot path (whole-record check, cached forever) and unions them into one index. Strict by design: a missing closure is SnapshotMissing naming that link's object, never a fallback. Overlapping entries must agree; divergence logs a warning. - Rollout mirrors phase 1: "closure" is the opt-in testing mode (file setting or MINIMAL_INDEX_SOURCE); auto is unchanged until the mode is proven. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
…ired Sideload repos are typically not covered by build infrastructure and publish no index; requiring a closure from them would make closure mode unusable for exactly the projects sideloads exist for. A missing sideload closure is now logged and skipped (its specs resolve locally, as they always have); the upstream closure remains required — it is the signed catalog. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Root, | ||
| /// The union of the per-commit *closure* snapshots of every pinned chain | ||
| /// link (upstream + sideloads); a missing closure is an error. | ||
| Closure, |
There was a problem hiding this comment.
If Closure just ignores sideloads isnt it the same as Pinned ?
There was a problem hiding this comment.
Not the same on either axis: sideloads aren't ignored — each one's closure is fetched and unioned (conflict-checked); only a sideload that publishes no closure is skipped, and its specs resolve locally (sideload repos aren't covered by build infra, so requiring one would break exactly the users this mode serves). And the objects differ: pinned reads <commit>.shisha (byte copy of the whole root index); closure reads <commit>.closure.shisha (the bounded per-commit catalog — the object that gets signed). The enum doc said "missing closure is an error" for all links — stale, fixed in 75a52ec. Context: #870.
…t-effort asymmetry
77c1374 to
75a52ec
Compare
Phase 2 of #870, per the design comment: read the bounded per-commit closure snapshots (
<commit>.closure.shisha, ~53 KB and the signed object) instead of the full-index byte-copy (~3.1 MB and growing linearly — the ratio is 50× and widening).What
IndexSourceMode::Closure(index_source = "closure"/MINIMAL_INDEX_SOURCE=closure) resolves the required upstream closure plus one closure per pinned git sideload, in declaration order (CacheConfig::CommitClosures { upstream, sideloads }). Directory and unpinned links have no remote presence and contribute nothing; an unpinned upstream is a loud error.IndexFile::merge). Asymmetric strictness: the upstream closure is required (it is the signed catalog — missing isSnapshotMissingnaming the object, never a fallback to root), while sideload closures are best-effort — sideload repos are typically not covered by build infrastructure and publish no index, so a missing one is logged and skipped and its specs resolve locally, exactly as they do today. No publishing requirement is imposed on sideload authors. Overlapping entries across links must agree; divergence merges last-wins and logs a warning (an equivocation-shaped signal).new_any_configured.Rollout
Mirrors phase 1 exactly:
closureis the opt-in testing lever;autois untouched (still byte-copy → root) until the mode is proven in fleet testing, then folding closure in as the first link of the auto chain is a follow-up. Kill-switch (root) andpinnedunchanged.Sideload note: sideloaded projects work in this mode with zero requirements on the sideload repos — published closures contribute to the union, unpublished ones are skipped with an info log. The only degradation for an unpublished sideload is cache misses on its specs (local builds), which is their behavior today anyway.
Testing
IndexFile::mergeconflict counting (identical overlap ≠ conflict, changed value = conflict, other wins).[cache.verify]) — separable follow-up per the design comment;requireremains gated on the signing-side decisions.🤖 Generated with Claude Code
Note
Add closure-union index reads behind
index_source="closure"in rcacheIndexSourceMode::Closurevariant andCacheConfig::CommitClosuresconfig, parsed from the string"closure"in mfile, carrying upstream and sideload closure object paths per commit.IndexFile.mergein rcache to union two indices, with incoming values winning on overlap and a conflict count returned.RemoteCache::new_any_closure_unionin remote.rs: fetches the upstream closure snapshot (hard failure if missing), merges available sideload closures (skips missing ones with an info log), and warns on conflicting overlapping entries.SnapshotMissing) with no fallback to root.Macroscope summarized 75a52ec.