← Back to Pull requests

sync: replace storeCaps with one unexported syncBackend interface #1220

Closed
unknown closed this pull request without merging on Nov 04, 2026 16:40 UTC
View on GitHub
unknown unknown commented on Nov 03, 2026 21:42 UTC
Author

Stacked on #1219; retarget to main once that merges.

pkg/sync no longer resolves optional store capabilities. storeCaps, readerCaps, resolveStoreCaps, resolveReaderCaps, and the storeCapsMatrix oracle are gone. In their place is one unexported interface, syncBackend (pkg/sync/sync_backend.go): c1zstore.Store plus PageLedgerStore plus the small interfaces that already existed for deleters, expansion layers, ingest facts, verification markers, digest, and graph blob. setStore asserts it once; s.store is a syncBackend; every s.caps.X.M(...) is s.store.M(...).

c1zstore.Store does not change. Of its 53 methods, 37 have a caller in c1 or the baton CLI; the 47 methods this interface covers have none outside this module and one implementer, so they stay module-private. c1 is unaffected.

Sixteen nil arms are deleted, each the branch a non-Pebble store took. The largest is the ingest-invariants "referential checks skipped for this engine" path (requiresStore, logSkippedReferentialInvariants, storeCarriesTypeScopedTypes), unreachable once the ingest-fact store is required. RunIngestInvariants errors instead when handed a store without it; GraphFromStore keeps returning nil, nil, since callers outside the syncer hand it bare stores.

NewExpanderStore returns an error instead of building a degraded adapter; the compactor is its only caller. Eight one-line forwarders on *pebbleStore surface methods that lived only on Grants()/SyncMeta(). DBSizeProvider stays an optional assertion at its one call: it is Engine-only and the nil arm is real.

The Metadata().Engine == "pebble" compare in setStore survives for now; two tests build a store with the method set and a non-Pebble engine name. Whether to drop it is the next PR, with storeAttachErr and the checklist rewrite.

Production: 13 files, +202 −468. Tests: 43 files.

Diff: 237 lines (+177 / -60) across 2 files Reviewer: ggreer Review duration: 1138m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 237 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.327
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1220"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.7% · Safe to merge
14.7%