← Back to Pull requests

sync: replace storeCaps with one unexported syncBackend interface; drop WriteHookStore #1219

Open
unknown opened this pull request with 286 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 03, 2026 19:58 UTC
Author

Two commits; #1220 was squashed into this branch.

syncBackend replaces storeCaps. 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 syncBackend 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. Dropping it, storeAttachErr, and the checklist rewrite are the next PR.

WriteHookStore deleted. SetWriteHook is a test-only tripwire: tests install it to fail any store write that bypasses the page ledger. Nothing in production calls it. The exported c1zstore.WriteHookStore interface and the storeCaps.writeHook field are gone; the method stays on the unexported dotc1z.pebbleStore and tests reach it through a _test.go-local writeHookSetter. No assertion was weakened.

Diff: 286 lines (+214 / -72) across 3 files Reviewer: ggreer Review duration: 45605m
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 286 lines diff across 3 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
44%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.339
Real PR Conversation Timeline
1 comments
"Review active on #1219"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.7% 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: 46.8% (MEDIUM) · Higher = larger blast radius
46.8%
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: 44.7% · Lower = rushed or shallow review
44.7%
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: 25.9% · Safe to merge
25.9%