Repository navigation
Strengthen Zero Trust safety, receipt recovery and wallet Host contracts - #14
Merged
Merged
Conversation
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.
A valid authorization or historical receipt can coexist with changed execution state. This PR strengthens shared Zero Trust admission, source-bound receipt recovery and wallet Host containment so authorization changes, crashes and retries cannot silently reset prior consumption.
Shared authorization and recovery
Wallet Host and disclosed-chain replay
Research and proof boundaries
The research review distinguishes continuation-aware delegated review, FAPI protocol goals, semantic-inference limitations, AAT/experimental ARCP runtime assumptions and RIFL completion-metadata requirements. The contribution is finite modeled safety; it does not inherit a discounted-utility theorem, prove liveness or exactly-once delivery, authenticate arbitrary well-formed replacement snapshots, or establish physical power-loss/external-IO atomicity. Current-head selection, protected storage, signature verification, complete mediation/key custody and chain finality remain independently qualified boundaries. Full-domain replay is a regression gate, not a claim of a complete application invariant for every domain.
Concurrent reconciliation re-crash at e9a33e2
The native subprocess replay stops two workers after the winner's receiver commit, restarts them after revocation and two writer/receiver takeovers, and kills worker B inside reconciliation at either staged or durable persistence. Worker A confirms that the OAuth writer lock is held by another process and attempts a correctly signed conflicting outcome. After B is killed, a third writer/receiver takeover fences the old writer and replica. Restarted workers then exercise conflict-first and original-first schedules followed by a concurrent repeat phase with independent original-receipt reconciliation, conflict attempts and duplicate submissions.
The Lean Contract proves that a completed independent receiver reconciliation retains the exact committed outcome across a later handoff. Four finite staged/durable and order combinations each compare eight Lean-derived snapshots with the Rust subprocess replay. The staged boundary leaves reconciliation unresolved; the durable boundary retains the original outcome. This is local simulated persistence and SIGKILL under controlled schedules, not a proof for every interleaving, physical power loss, or an external payment rail.
Exact head
e9a33e2220d84c6129cda6c0ae48acc9b943702bpassed 16 automatic CI jobs; manual history-comparison was skipped. Ubuntu executed all four new subprocess trajectories and the full Gateway gate; the 51-domain continuous replay covered 1,253 Cases and 28,989 lifecycle outcomes in 101.25 seconds under the unchanged 120-second limit. Local focused Lean, all four new trajectories, ASP and strict Clippy passed. Three local full-Gateway attempts did not close: two failed the existing 10-second worker-marker wait and one hit the existing 120-second recovery watchdog. Those failures are retained; no threshold, assertion or negative control was relaxed.Concurrent restarted payment recovery at 4a4a548
After a winner's durable OAuth reservation or receiver commit, two worker processes are stopped and restarted following revocation and two writer/receiver takeovers. They independently obtain receiver evidence. Four finite schedules cover each crash boundary with conflict-first and original-first ordering, followed by a shared release for concurrent repeated reconciliation, conflict attempts and duplicate submissions. The conflicting outcome is correctly provider-signed and differs from the original. The original receiver receipt remains exact and idempotent; absent evidence remains unresolved; stale writers and replicas are fenced and duplicate submission does not resend.
The Lean Contract proves an independently committed receiver outcome cannot be replaced by an unobserved outcome. Each of the four schedules compares six Lean-derived snapshots with the native subprocess replay. The scheduler controls two finite orders and releases the repeat phase concurrently; it does not establish all possible interleavings or physical power-loss or external payment-rail atomicity.
Exact head
4a4a548c0f2facb70588f5e3a3a87737be4d267apassed all 16 automatic CI checks; the manually dispatched history-comparison job was skipped. Ubuntu's 51-domain continuous replay covered 1,253 Cases and 28,989 lifecycle outcomes in 59.40 seconds under the unchanged 120-second limit. The clean local full Gateway gate passed: the four new subprocess schedules took 6.27 seconds and the existing bounded recovery checks took 103.78, 29.06 and 45.22 seconds. Two preceding local attempts hit the existing 120-second watchdog in the older recovery trace; those failures remain evidence. No timeout, assertion, or negative control was relaxed.Restarted payment workers at 66263b8
After the winner's durable OAuth reservation or receiver commit, two separately identified worker processes observe the protected state and are killed. The authority promotes a receiver and rotates the writer. Restarted worker A independently reconciles: for committed receiver evidence it is killed after the OAuth reconciliation is durable but before the response; for missing evidence the operation remains unresolved. Following revocation and a second receiver promotion and writer rotation, restarted worker B independently reconciles or preserves the missing outcome. A subsequent restart with A's old writer is fenced. The original signed receipt cannot be replaced by a conflicting valid receipt, the charge and hold remain, and retries cannot resend after revocation.
The Lean Contract proves two accepted recovery steps preserve existing holds and budget reservations and cannot reopen a burned operation. For each of the two crash boundaries, the native subprocess replay compares eight Lean-derived snapshots including event, worker, writer, receiver cut, charge, receiver commitment and reconciliation status. This is local simulated persistence with SIGKILL; it does not establish physical power-loss or external payment-rail atomicity.
Exact head
66263b8b9ef63bb1b235dfa29d4a4d912cbc3d17passed 16 automatic CI checks; the manual history-comparison job was skipped. The Ubuntu 51-domain continuous replay covered 1,253 Cases and 28,989 lifecycle outcomes in 85.50 seconds under the unchanged 120-second limit. The full local Gateway gate passed, with bounded recovery checks in 108.09, 20.05 and 35.68 seconds. No existing timeout or negative control was relaxed.Post-winner contenders at ddb9cca
The Lean Contract proves that a later admitted payment retains a prior OAuth hold and that refreshing the OAuth effect view cannot make a stale shared-budget revision current. The finite fixture prepares two distinct operations and sender observations against the first winner's exact OAuth image and budget, verifies each is individually admissible, and tests the losing revision against the second winner's updated image. A refreshed budget revision is admissible in the ample-capacity case. DPoP uses fresh proof IDs; mTLS uses its channel identity.
The native local-store replay commits a 30-unit payment with a lost receiver acknowledgment, then starts two workers from its current OAuth pin and budget, each attempting a 60-unit purchase under a 100-unit root cap. One is admitted; the other remains unreserved, and its retry with a refreshed pin is refused by the remaining cap. The first receiver receipt remains available for idempotent independent reconciliation. These are finite model and local simulated-storage observations, not evidence of physical power-loss or external payment-rail atomicity.
Exact head
ddb9cca58528d88b330b60a06c2444c087dcf1fapassed 16 automatic CI jobs; the manual history-comparison job was skipped. Its Ubuntu 51-domain continuous replay covered 1,253 Cases and 28,989 lifecycle outcomes in 101.22 seconds under the unchanged 120-second limit. A clean local checkout of this exact head passed the full Gateway gate, with bounded recovery checks in 104.08, 26.54 and 42.02 seconds.The earlier
8987b78Core CI failed the repository's file-responsibility gate; the replay was split into an owner module, and the final head passed the unchanged ASP and CI gates. A local full Gateway run atf14a08ctimed out in the original recovery trace under the unchanged 120-second watchdog; that failure is retained. Another local pass was made while concurrent, uncommitted edits entered the workspace and recompiled later tests; it is not treated as a clean final-head result. No timeout, assertion, or negative control was relaxed.Payment recovery and validation at afa5d1e
At
afa5d1e292fc9e16e456917beaea530cb118ced4, a two-worker delegated payment race retains one charge after a lost receiver acknowledgment, then exercises two receiver promotions and writer rotations, stale-writer and stale-replica fencing, independent receipt recovery, missing and conflicting signed receipts, and idempotent reconciliation. The Lean Contract proves the losing shared-budget revision is refused; a finite Contract fixture checks both budget views after a winning reservation, with sufficient remaining capacity and a refreshed-revision positive control. An audit-requested native control revokes only the OAuth grant while leaving the Commerce mandate active and budget sufficient, then refuses a fresh operation and proof without a new reservation or charge.The exact head passed 16 automatic CI jobs; the manually triggered history-comparison job was skipped. Ubuntu's continuous 51-domain replay covered 1,253 Cases and 28,989 lifecycle outcomes in 84.69 seconds under the unchanged 120-second limit. The same head's Ubuntu Gateway job passed both process-crash windows and all original recovery gates; the main two-order recovery trace completed in 92.70 seconds.
Local focused Lean and Rust controls passed, and a mutation that omitted OAuth revocation made the new refusal assertion fail as expected. Local full Gateway attempts at this head timed out under the existing 120-second recovery watchdog or failed an existing worker-marker wait; those failures remain evidence. A later local full Gateway rerun on the unchanged head passed all gates; its three bounded recovery checks completed in 91.28, 25.78 and 43.45 seconds. A separate original recovery trace passed in 93.62 seconds. Earlier failed samples are retained; these passing reruns do not identify the cause of the failures. A buffered-read experiment was discarded after a later sample timed out; no threshold or control was weakened. The simulations use trusted local persistence, test threads, and subprocess SIGKILL rather than physical power-loss or an external payment rail.
The earlier validation below is retained as historical evidence for its stated revision, not as proof for the current head.
Historical validation