|
| 1 | +# Saved lease authority repro |
| 2 | + |
| 3 | +- Status: proposed proof methodology; this folder contains no execution receipt |
| 4 | +- Owner: ClawSweeper queue maintainers |
| 5 | +- Source of truth: [queue](../../../dashboard/exact-review-queue.ts), |
| 6 | + [lifecycle tests](../../../test/dashboard-worker-publication-lifecycle.test.ts), |
| 7 | + and [workflow tests](../../../test/sweep-workflow.test.ts) |
| 8 | +- Baseline: `659dee73d0706fee9776f7986d9861e82b897d24` |
| 9 | +- Prepared candidate: `b0e75888d4341a98bc0db0b5f5cb9f3cd566eb0f` |
| 10 | +- Update when: the compared source, lease authority, terminal lifecycle, |
| 11 | + forwarding protocol, Bay projection, or pinned toolchain changes |
| 12 | + |
| 13 | +This is a focused follow-up to <https://github.com/openclaw/clawsweeper/pull/1251>. |
| 14 | +The original lost-completion repair is already in the baseline. The claim here |
| 15 | +is that direct requeue authority belongs to the saved lease's accepted or |
| 16 | +deduplicated receipt: a mutable current decision cannot invent or remove that |
| 17 | +authority, and a superseded receipt cannot authorize a requeue completion. |
| 18 | + |
| 19 | +The public source makes the experiment inspectable without access to private |
| 20 | +artifact portals. It does not establish that this integrated candidate has |
| 21 | +passed runtime proof. Record fresh execution observations in the main PR body, |
| 22 | +bound to its exact head and base; never present these expected results as an |
| 23 | +executed receipt. |
| 24 | + |
| 25 | +## Run |
| 26 | + |
| 27 | +Use an already provisioned Linux environment with Bash, Node 24, pnpm 11.10.0, |
| 28 | +Git, tar, curl, `setsid`, installed repository dependencies, and an installed |
| 29 | +Wrangler **4.107.0** executable with its Miniflare/workerd dependencies. The |
| 30 | +driver verifies versions and records the workerd binary version. It installs |
| 31 | +nothing, fetches no source, and allocates no cloud resources. For maintained |
| 32 | +proof, the operator supplies the configured AWS Crabbox environment and records |
| 33 | +the actual provider, image, lease, and run separately. |
| 34 | + |
| 35 | +From the candidate checkout, including this entire folder: |
| 36 | + |
| 37 | +```bash |
| 38 | +SAVED_LEASE_SOURCE_DIR="$PWD" \ |
| 39 | +SAVED_LEASE_OUTPUT=/tmp/saved-lease-proof-results \ |
| 40 | +SAVED_LEASE_WRANGLER=/absolute/path/to/installed/wrangler \ |
| 41 | +bash docs/proof/saved-lease-authority/run-proof.sh |
| 42 | +``` |
| 43 | + |
| 44 | +The output must be a new absolute directory. `SAVED_LEASE_SOURCE_DIR` defaults |
| 45 | +to the current directory; `SAVED_LEASE_PORT` defaults to 8795. A Git index and |
| 46 | +HEAD are required to enumerate candidate source and record its identity. Run |
| 47 | +against clean committed source for final proof; the manifest records any |
| 48 | +tracked working-tree changes and hashes the actual copied source. |
| 49 | + |
| 50 | +The baseline object must be available, or supply `SAVED_LEASE_BASELINE_ARCHIVE` |
| 51 | +with an archive created by this exact command: |
| 52 | + |
| 53 | +```bash |
| 54 | +git archive --format=tar 659dee73d0706fee9776f7986d9861e82b897d24 \ |
| 55 | + dashboard src config .github/workflows/sweep.yml package.json \ |
| 56 | + > /tmp/saved-lease-baseline.tar |
| 57 | +``` |
| 58 | + |
| 59 | +Its SHA-256 must be |
| 60 | +`f1873d20690bbc76f53257949caf6f55301f47279a844c2e416a0ed637fafd07`. |
| 61 | +The driver rejects a different digest, unsafe archive paths, and links. It |
| 62 | +extracts into temporary directories, preserves all baseline dependencies, and |
| 63 | +uses the candidate checkout's installed dependencies for both modes. |
| 64 | + |
| 65 | +## Exercised surface and expected observations |
| 66 | + |
| 67 | +[run-proof.sh](run-proof.sh) starts real workerd with isolated SQLite Durable |
| 68 | +Objects for each mode. [worker.ts](worker.ts) supplies narrow fixture operations |
| 69 | +through the real signed forwarding path. [drive-proof.mjs](drive-proof.mjs) |
| 70 | +drives publication, terminal disposition, enqueue, completion, reconciliation, |
| 71 | +and the public Bay projection over loopback HTTP. Modes are explicit; no source |
| 72 | +symbol or grep-based detection selects expected behavior. |
| 73 | + |
| 74 | +Each mode exercises 17 scenarios. Accepted/deduplicated receipts cover delivered |
| 75 | +completion and a realistic lost callback: the finalizer's terminal `requeue` |
| 76 | +is written before `/complete` is deliberately omitted. Both modes should recover |
| 77 | +those cases. The four distinguishing authority controls are: |
| 78 | + |
| 79 | +| Control | Baseline expectation | Candidate expectation | |
| 80 | +| --- | --- | --- | |
| 81 | +| Superseded receipt with requeue completion | Incorrectly accepts requeue | Rejects completion with HTTP 400 | |
| 82 | +| Missing saved lease decision | Incorrectly borrows current authority | Does not requeue | |
| 83 | +| Wrong saved source action | Incorrectly borrows current authority | Does not requeue | |
| 84 | +| Current plan changed after lease | Drops saved requeue authority | Requeues from the saved lease | |
| 85 | + |
| 86 | +Other controls cover superseded/no-lifecycle receipts, a real signed newer |
| 87 | +command, wrong run attempt or claim generation, ambiguous ownership, unsigned |
| 88 | +reconciliation, failed/cancelled publication retries, repeated reconciliation, |
| 89 | +and late old completion. Assertions inspect pending revision and decision, |
| 90 | +lease clearance, lifecycle identity, terminal outcome, counters, and public |
| 91 | +Bay projection. They retain existing newer-command and retry behavior. |
| 92 | + |
| 93 | +[annotation-proof.mjs](annotation-proof.mjs) compares the unchanged workflow |
| 94 | +failure gate across 192 feasible Boolean contexts and executes its actual Bash |
| 95 | +block for six synthetic cases in each mode. No workflow edit is claimed. |
| 96 | + |
| 97 | +OpenClaw Bay needs no schema or UI change. The proof checks the existing |
| 98 | +observer-only projection and SQLite Bay row counts, including preservation of |
| 99 | +the old terminal fact without invented success/failure, router, or |
| 100 | +acknowledgement receipts. It includes current-main telemetry dependencies. |
| 101 | + |
| 102 | +## Artifacts and limits |
| 103 | + |
| 104 | +Generated output includes source, lockfile, and driver hashes; HEAD/tree and |
| 105 | +baseline identity; toolchain versions; exact runtime commands; request/response |
| 106 | +traces; scenario assertions; workflow annotation observations; and Wrangler |
| 107 | +logs. Keep raw output outside committed source. The main PR body must record |
| 108 | +normalized observations, exact command, head/base, provider/image/lease, and |
| 109 | +limits after execution. If later source changes, rerun affected proof or state |
| 110 | +and verify exact source/hash equivalence before carrying observations forward. |
| 111 | + |
| 112 | +Admission and malformed/ambiguous authority preconditions are seeded. Terminal |
| 113 | +run observations use signed supplied `terminal_runs`, without a GitHub lookup. |
| 114 | +The harness disables alarm dispatch only after asserting exactly one pending |
| 115 | +item. Outbound Worker fetch throws and is counted; any unexpected alarm state |
| 116 | +fails. Wrangler receives an allowlisted environment and an empty temporary home. |
| 117 | +All identifiers and signing material are synthetic. No credentials, live queue |
| 118 | +mutation, GitHub writes, deployed-edge behavior, Actions admission, complete |
| 119 | +hosted workflow, or model inference are exercised. |
0 commit comments