Skip to content

Commit 2362381

Browse files
committed
test: prove durable review branch authority
1 parent 766d2df commit 2362381

3 files changed

Lines changed: 639 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Durable branch-authority proof
2+
3+
## Claim
4+
5+
A signed branchless legacy review reaches the real dashboard Worker and its
6+
SQLite-backed `ExactReviewQueue` Durable Object. The first target-owner GitHub
7+
quota response opens the existing reset-aware circuit. Later reservations for
8+
that owner stay durable without another GitHub request, another owner continues,
9+
and the deferred reservations recover after the reset, including across a local
10+
Worker restart.
11+
12+
## Exercised surface
13+
14+
- Real `wrangler dev --local` Worker HTTP routing and webhook-signature check
15+
- Real `ExactReviewQueue` Durable Object storage, alarms, and restart persistence
16+
- The production GitHub App JWT, installation-token, and repository-read client
17+
- The loopback-only `GITHUB_API_URL` seam and real HTTP request/response transport
18+
- Public `/api/exact-review-queue` authority, circuit, request-metric, and Bay data
19+
20+
## Controlled scenario and required observations
21+
22+
The loopback GitHub endpoint accepts synthetic App JWTs and installation-token
23+
requests. Its first `openclaw/openclaw` repository read returns a reset-aware 403. It returns authoritative branches after reset and remains healthy for
24+
`other/repo`.
25+
26+
1. Send a signed branchless `openclaw/openclaw` event and observe exactly one
27+
token request and one throttled repository read.
28+
2. Send another branchless event plus a source-head reservation for the same
29+
owner and a branchless `other/repo` event. Before reset, the two new
30+
`openclaw` reservations make no GitHub request or spend an attempt;
31+
`other/repo` is admitted as `stable`.
32+
3. Verify three authority reservations and three affected pending records under
33+
`target_app:openclaw`, stop the Worker, and restart it with the same local
34+
persistence directory.
35+
4. After reset, verify all `openclaw` reservations are admitted as `trunk`, the
36+
pull-request head is verified, the authority backlog reaches zero, and the
37+
circuit is recovered.
38+
39+
## Command and artifacts
40+
41+
Run from the repository root on Node 24 or newer:
42+
43+
```bash
44+
docs/proof/review-branch-authority/run-proof.sh
45+
```
46+
47+
The proof uses pinned Wrangler 4.107.0, a synthetic webhook secret and App key,
48+
and loopback HTTP only. It writes redacted requests, before/after queue
49+
snapshots, resolved durable queue records, Worker logs, and `proof-summary.json` under
50+
`.artifacts/review-branch-authority/` by default. No token or private key is
51+
written to an artifact.
52+
53+
## Limits
54+
55+
The Worker and Durable Object boundaries are real local runtime instances. The
56+
GitHub endpoint is a controlled HTTP fault server, not GitHub production. The
57+
proof performs no production GitHub write, workflow dispatch, queue mutation,
58+
deployment, gate change, or other production action. It mutates only the
59+
disposable local queue created for the proof.
60+
61+
## OpenClaw Bay impact
62+
63+
Bay remains observer-only. Its existing credential-circuit health card reads
64+
the same `affected_pending` value proven here; no Bay controls, polling, lane,
65+
or durable-lifecycle semantics change.

0 commit comments

Comments
 (0)