Repository navigation
feat(worker): Gate P4 backend convergence and adapter replacement - #30
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
oneshot | 01ec3db | Sep 08 2026, 01:03 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gate P4: Backend Convergence and Simulator Replacement.
Wires real
@oneshot/privy-adapter(ArcSettlementAdapter,PrivyAuthorizationAdapter) and@oneshot/reconciliation(RecoveryService) intoapps/worker. Replaces mock settlement / authorization types and simulator recovery engine with production bridges:PostgresIntentLedger.completeSubmission: Supports atomic rowCount-checked CAS transitions forUNKNOWN -> COMMITTEDandUNKNOWN -> FAILED_SAFEalongsideSUBMITTING, failing closed on invalid states. Fixes no-opUNKNOWN -> UNKNOWNversion calculation.IntentLedgerRecoveryCommandStore: ImplementsRecoveryCommandStorePortoverIntentLedgerwith durable atomic deduplication viaoutbox_jobsunique constraint (job_key: 'recovery-event:<eventId>',status: 'DELIVERED'),expectedStateVersionCAS check, and fails closed on unconfirmed completion.PrivyArcEvidenceBridge: Derives verified proof envelopes strictly from realTransactionReceipt/ReceiptSourcewithout synthetic fallback data (arc: nullwhen unobserved), decodesTransferlogs to match exact binding, synchronizessubmissionReference: 'sub-' + binding.businessIntentIdacross local and arc evidence, and refusesMARK_COMMITTEDwithout authoritative Arc tx reference and block number.apps/worker/src/composition.ts: ExportscreateProductionRecoveryServiceand composes real settlement and authorization adapters.reconcile_intentexecutes throughRecoveryServicewithexternalSubmissionCount: 0andsettlementPermission: 'NEVER'. Logs actual updated post-reconciliation ledger state.apps/worker/tsconfig.json&tsconfig.json: Added missing project references to@oneshot/arc-adapter,@oneshot/privy-adapter, and@oneshot/reconciliationto preserve clean build topological ordering.Scope and acceptance criteria
Product and security invariants
Invariant notes:
reconcile_intentstrictly resolves ambiguous or unobserved intents without blind submission retries (externalSubmissionCount: 0,settlementPermission: 'NEVER').recordRecoveryEventenforces idempotency atomically via PostgreSQLoutbox_jobstable unique constraint (job_key: 'recovery-event:<eventId>').completeSubmissionchecks CAS row count and fails closed (SUBMISSION_NOT_FOUND/INVALID_STATE) on stale retries.Validation
Commands and results:
Independent review evidence
Gate A — exact candidate tree before push
Base commit SHA:
50d8e7b4ba9ff247464ff9b0b36c19227c4c538dCandidate tree SHA:
c81eac4bdb47673913e1f18e35ff6b86045560b8Candidate commit SHA:
01ec3db99fcbbb5fdfff8ee05efcb3da11b7b9f3Reviewer tool:
free-pi-cliReviewer model:
glm-5.3-flashVerdict:
VERDICT: PASSFindings or residual risks:
PrivyArcEvidenceBridgedoes not comparelog.addressagainstbinding.tokenContract; foreign-token transfers rejected by deterministic core as hold.transfer_log_index: 0recorded onMARK_COMMITTEDpath; uniqueness safe via state CAS.The reviewed tree equals the committed tree.
Gate B — exact remote PR head
Pull request URL/number: feat(worker): Gate P4 backend convergence and adapter replacement #30 (feat(worker): Gate P4 backend convergence and adapter replacement #30)
Remote head commit SHA:
01ec3db99fcbbb5fdfff8ee05efcb3da11b7b9f3Remote head tree SHA:
c81eac4bdb47673913e1f18e35ff6b86045560b8Reviewer tool:
free-pi-cliReviewer model:
glm-5.3-flashVerdict:
VERDICT: PASSFindings or residual risks:
RecoveryServiceonly whenrecoveryBridgeOptionsis provided; otherwisereconcile_intentsilently no-ops (fail-safe).recordRecoveryEventcan duplicate evidence observations on retry (state CAS guarantees at-most-once settlement).Gate B reviewed the current remote head and matches Gate A's approved tree, or a fresh Gate A was run for the changed tree.
Agent policy / repository-policyand all applicable CI checks pass.Risk and rollback
Human merge