You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V29 Gate 6: Close settlement reconciliation repair
Specify and implement settlement reconciliation repair as a first-class V29 Terminal workflow. BTD reports now classify projection drift, emit repair actions, surface proof roots, and block settlement conservation drift. The API, Sandbox harness, Terminal journal projection, and detail card now carry that evidence through to operator-visible repair actions and proof roots.
Add focused API, BTD, harness, and Terminal tests plus the Gate 6 checker and gate-quality workflow wiring.
- database projected facts: the Supabase readback rows that claim those ledger facts are durable in the application projection;
235
+
- private metaphysical canonical facts: protected source metadata, need/fit context, access policy documents, encrypted storage pointers, disputes, and telemetry context represented only by roots;
236
+
- settlement conservation checks: BTC debit/credit and fee/payment roots that must conserve before unlock;
237
+
- delivery evidence: post-settlement pull-request visibility and recovery posture.
238
+
239
+
Drift is classified before repair:
240
+
241
+
-`missing_database_projection`: the ledger has a fact that the database projection has not read back;
242
+
-`ledger_root_mismatch`: the database projection points at a different root than the ledger observation;
243
+
-`ledger_finality_mismatch`: the projected finality differs from the observed finality;
244
+
-`database_orphan_projection`: the database projects a fact that has no matching ledger observation;
245
+
-`settlement_conservation_drift`: BTC debit/credit or fee/payment accounting does not conserve.
246
+
247
+
Repair actions are canonical and auditable:
248
+
249
+
-`retry_database_readback`;
250
+
-`project_ledger_fact`;
251
+
-`update_finality_state`;
252
+
-`quarantine_database_projection`;
253
+
-`pause_settlement_unlock`;
254
+
-`recover_delivery`.
255
+
256
+
The reconciliation state is one of aligned, retryable, repairable, approval required, or blocked.
257
+
Confirmed ledger facts that are missing from the database require operator-approved projection repair.
258
+
Reorged or failed finality, database-only orphan projection, or settlement conservation drift blocks unlock and delivery.
259
+
Delivery recovery is allowed only when settlement is otherwise aligned and the full AssetPack delivery target is not visible.
260
+
261
+
Terminal must show drift classes, blockers, repair actions, proof roots, observed facts, projected facts, canonical facts, journal entries, and repair receipts before raw payloads.
262
+
The Vercel Sandbox harness must store the reconciliation report as settlement evidence when it claims ledger readback.
263
+
The API may persist schema-compatible repair receipts while richer repair actions and proof roots remain report evidence until the registry schema is formally expanded.
- The Vercel Sandbox pipeline harness records `ledgerDatabaseReconciliation` evidence after settlement/readback and emits reconciliation state plus repair-action counts in telemetry.
Copy file name to clipboardExpand all lines: BITCODE_SPEC_V29_NOTES.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,23 @@ Accepted Gate 5 posture:
151
151
- Gate pull request titles must carry the uppercase version and gate prefix so gate closure can be audited from GitHub history.
152
152
- Gate 5 does not implement reconciliation repair, organization authority, full settlement UI depth, or browser proof; later V29 gates own those slices.
153
153
154
+
## Gate 6 working notes
155
+
156
+
Gate 6 hardens the settlement truth boundary after source-safe preview and before paid unlock/delivery are treated as admissible.
157
+
158
+
Implementation notes:
159
+
160
+
- Reconciliation must always separate ledger-observed facts from database-projected facts and private metaphysical canonical facts.
161
+
- Metaphysical facts remain private root commitments; they are not rendered as protected source.
162
+
- Repair receipts classify drift, while repair actions describe the operational next step.
163
+
- Settlement conservation drift is not a warning; it blocks unlock because BTC debit/credit truth must conserve before BTD rights are transferred or source is delivered.
164
+
- Delivery recovery is surfaced only after settlement is aligned and delivery evidence exists but the pull-request shippable is not visible in the transaction read model.
165
+
166
+
Operator notes:
167
+
168
+
- Terminal journal detail is the ordinary repair cockpit for this gate: drift classes, blockers, repair actions, proof roots, journal entries, and repair receipts must be visible without opening network logs.
169
+
- Raw payload remains audit material, not the primary operator interface.
170
+
154
171
## Later-version boundaries
155
172
156
173
- V30 remains reserved for Protocol/BTD hardening that is not necessary to close Terminal transaction depth.
| Commercial formalization | Gate 8 | packages/protocol, package tests, import scans, docs | pending | Demonstration-origin commercial internals are package-native and no runtime demo imports remain. |
59
59
| Terminal UX quality | Gate 9 | Playwright/Jest/a11y/responsive/browser QA | pending | Complete transaction cockpit is usable by default and inspectable in detail. |
@@ -182,6 +182,31 @@ Gate 4 is complete when Reading pipeline observability is package-owned, stream
182
182
183
183
- Gate 5 does not reveal protected AssetPack source before settlement.
184
184
- Gate 5 does not perform settlement reconciliation repair; Gate 6 owns ledger/database drift and repair.
185
+
186
+
## Gate 6 Parity
187
+
188
+
Gate 6 closes the settlement reconciliation slice by making drift ordinary data instead of hidden operator guesswork.
189
+
190
+
Accepted surfaces:
191
+
192
+
-`packages/btd/src/reconciliation.ts` is the canonical reconciliation primitive for ledger observed facts, database projected facts, private metaphysical canonical facts, settlement conservation checks, projection repair receipts, repair actions, drift-kind counts, report state, and proof roots.
193
+
-`packages/api/src/routes/btd-crypto.ts` accepts settlement conservation checks and binds reconciliation proof roots into the Terminal journal entry for reconciliation settlements.
194
+
-`packages/pipeline-hosts/src/asset-pack-harness.ts` stores `asset-pack/settlement.ledgerDatabaseReconciliation`, includes it in evidence, and streams reconciliation state/repair-action count after ledger readback.
195
+
-`uapi/app/terminal/terminal-journal-reconciliation.ts` projects the selected transaction into observed facts, projected facts, canonical facts, drift classes, blocking reasons, repair actions, proof roots, and repair receipts.
196
+
-`uapi/app/terminal/TerminalTransactionJournalReconciliationCard.tsx` renders the above as a low-detail operator surface with raw payload still available behind expansion.
0 commit comments