Repository navigation
UNKNOWN and Reconcile
A timed-out money call has unknown provider state. Permit never guesses.
| Trigger | Receipt reason |
|---|---|
PayPalTimeout on capture |
capture_timeout |
Capture returned PENDING
|
capture_pending |
While an escrow is UNKNOWN, release() returns unknown_reconcile_first and makes no PayPal calls.
POST /api/escrows/<id>/reconcile → ReleaseVerifier.reconcile():
- If the escrow is not UNKNOWN →
already_resolved, with no side effects (idempotent). - Query provider truth (
get_authorization). On timeout →still_unknown(retry later). - If truth is
CAPTURED(or the mock has a capture under the escrow's idempotency key) → recordCAPTUREDwithreconciled: true. This holds even if the permit has since been revoked: a completed capture cannot be voided. - Otherwise, fail closed: void the hold →
VOIDED, reservation freed. On a void timeout →still_unknown.
Outcomes: captured, voided, still_unknown, already_resolved.
If a void times out after a refusal, a failed admission, a broken chain or a failed capture, the escrow goes CLEANUP_PENDING and the reservation stays held. It is never silently released. POST /api/escrows/<id>/retry-cleanup retries the void. It returns cleanup_cleared: true on success.
-
Sandbox: transport failures only (
URLErrorthat is not anHTTPError,socket.timeout,TimeoutError). Each request usesurlopen(..., timeout=30)(30 s). HTTP error responses are not timeouts. -
Mock: fault injection.
inject_capture_timeout = "before_apply" | "after_apply",inject_void_timeout = True,capture_status = "PENDING".
-
demo_six_beat.pybeat 6 (mock,after_apply): UNKNOWN → reconcile → one capture. - Sandbox: no recorded sandbox run is in the tree at
9900817. A 2026-10-05 run log was removed from the public tree in PR #5, so it is not cited here. - Tests:
tests/test_reconcile.py(6) andtests/test_server.py::test_reconcile_route_converges_unknown.
Permit · payment authority for AI agents · MIT · Wiki facts verified against commit 9900817 on 2026-10-07 (America/Edmonton). Where this wiki and the code disagree, the code wins.
Concepts
- Overview and Problem
- The Four-Clause Gate
- Spend Pipeline
- Delegation and Sub-Permits
- Principal Approvals
- Tighten-Only Narrowing
- E-Stop and Revocation
- Claim Ledger
- UNKNOWN and Reconcile
Using it
Design and status
Reference