Skip to content

Commit ab5e594

Browse files
committed
docs(proof): add container-backed throttle receipt
1 parent 98fae30 commit ab5e594

8 files changed

Lines changed: 290 additions & 6 deletions

File tree

‎docs/proof/remediation-throttle-skip/README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
- Status: historical proof
44
- Owner: ClawSweeper maintainers
55
- Source of truth: `scripts/stuck-queued-run-remediation.mjs`, `scripts/operator-skip-reasons.mjs`, and `.github/workflows/exact-review-dead-letter-reconcile.yml`
6-
- Base revision: `openclaw/clawsweeper@e0dc54438e6562f144623fcde2263b3b839fe28d`
6+
- Base revision: `openclaw/clawsweeper@e0dc54438e5e346f573af5e6d2cb07c6c1620a8f`
77
- Update when: the remediation throttle contract, dead-letter workflow ordering, or focused loopback fixtures change
88

99
The proof claim is that GitHub rate-limit and abuse throttles are an operator-visible graceful skip for opportunistic queued-run remediation, including after earlier cancellations, while persistent 5xx and authorization failures remain hard failures. The exercised surface is the production CLI routed through its real `GITHUB_API_URL` seam to loopback HTTP listeners, plus the parsed production workflow.
1010

11-
[`red-green-transcript.txt`](red-green-transcript.txt) records the red test-only run against the base production script and the green focused run. The fixtures cover a 403 installation rate-limit body, a 429 secondary-rate-limit response after one successful cancellation, a non-throttle 403, persistent 503 responses with three attempts, an invalid inventory shape, and the workflow sequencing/upload contract. No live credentials or external mutations are used.
11+
[`red-green-transcript.txt`](red-green-transcript.txt) records the original macOS red test-only run against the base production script and the green focused run. [`container-transcript.txt`](container-transcript.txt) records the required repeat of that same suite inside Docker-backed Crabbox. The fixtures cover a 403 installation rate-limit body, a 429 secondary-rate-limit response after one successful cancellation, a non-throttle 403, persistent 503 responses with three attempts, an invalid inventory shape, and the workflow sequencing/upload contract. No live credentials or external mutations are used.
1212

1313
The source-blind behavior contract is in [`behavior-contract.md`](behavior-contract.md). All five clauses passed through the operator CLI/workflow artifact surfaces. Anti-cheat probes varied both status and body, distinguished authorization from throttling, retained a completed mutation before the mid-run skip, and verified the persistent failure path.
1414

15-
OpenClaw Bay is unaffected: this changes only an internal housekeeping CLI and workflow sequencing, with no dashboard data contract or observer surface change. No dashboard files were touched, so the requested scripts/workflow proof replaces a Crabbox real-Worker receipt.
15+
The container repeat used Crabbox `provider=local-container`, image `node:24-bookworm`, and `--fresh-pr openclaw/clawsweeper#1144` on lease `cbx_efa770db5e6d` (`quick-crab-b89a`). RED reproduced the merge-base child exit 1. GREEN passed all six focused scenarios, including the throttled child exit 0 and structured `skip_reasons.github_throttled` event, persistent 5xx child exit 1, and workflow-shape assertions. [`container-provenance.json`](container-provenance.json) freezes the run metadata; [`container-secret-scan.json`](container-secret-scan.json) records the transcript scan. [`run-container-proof.sh`](run-container-proof.sh) is the executed launcher.
1616

17-
Limits: the transport is loopback HTTP rather than live GitHub, and workflow behavior is validated structurally rather than by dispatching the production schedule. Full repository gates provide the broader integration check.
17+
OpenClaw Bay is unaffected: this changes only an internal housekeeping CLI and workflow sequencing, with no dashboard data contract or observer surface change. No dashboard files were touched, so no Bay update or real-Worker receipt is needed.
18+
19+
Limits: the transport is loopback HTTP rather than live GitHub, and workflow behavior is validated structurally rather than by dispatching the production schedule. The evidence commit adds only this proof material after tested source head `98fae30ad6336f525b654e90f961e6909b5f61e7`; no runtime or workflow change follows the receipt.

‎docs/proof/remediation-throttle-skip/behavior-contract.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Opportunistic stuck-run remediation must yield to GitHub throttling without prev
3535

3636
- Red/green Node test transcript showing exit status and named scenarios.
3737
- Focused workflow-shape assertion in the green run.
38+
- Docker-backed Crabbox `local-container` provenance for the reviewed source head.
3839
- Secret scan of the committed transcript.
3940

4041
## Out Of Scope
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"schema": "clawsweeper-crabbox-proof-provenance/v1",
3+
"claim": "The remediation throttle red/green scenario suite passes on the reviewed PR head inside a Docker-backed Crabbox local-container while the merge-base production script reproduces the old failure.",
4+
"tested_source_head": "98fae30ad6336f525b654e90f961e6909b5f61e7",
5+
"merge_base": "e0dc54438e5e346f573af5e6d2cb07c6c1620a8f",
6+
"crabbox": {
7+
"cli_version": "0.38.3-5-g2a79805d",
8+
"provider": "local-container",
9+
"lease_id": "cbx_efa770db5e6d",
10+
"lease_slug": "quick-crab-b89a",
11+
"run_id": null,
12+
"machine_type": "node_24-bookworm",
13+
"container_image": "node:24-bookworm",
14+
"container_engine": "Docker 29.4.0",
15+
"checkout": "--fresh-pr openclaw/clawsweeper#1144",
16+
"workdir": "/work/crabbox/cbx_efa770db5e6d/fresh-pr-openclaw-clawsweeper-1144",
17+
"exit_code": 0,
18+
"run_status": "succeeded",
19+
"lease_stopped": true
20+
},
21+
"runtime": {
22+
"node": "v24.19.0",
23+
"pnpm": "11.10.0"
24+
},
25+
"timing_ms": {
26+
"sync": 10727,
27+
"command": 4920,
28+
"total": 15648,
29+
"command_phases": [
30+
{ "name": "user-command", "ms": 1894 },
31+
{ "name": "install", "ms": 2128 },
32+
{ "name": "red", "ms": 156 },
33+
{ "name": "green", "ms": 741 }
34+
]
35+
},
36+
"result": {
37+
"red_test_exit": 1,
38+
"old_production_throttled_child_exit": 1,
39+
"green_test_exit": 0,
40+
"focused_scenarios": 6,
41+
"focused_scenarios_passed": 6,
42+
"new_production_throttled_child_exit": 0,
43+
"asserted_skip_line": {
44+
"event": "stuck_queued_remediation_skipped",
45+
"skip_reasons": { "github_throttled": 1 },
46+
"phase": "discovery",
47+
"request_path": "/actions/runs?status=queued&per_page=100&page=1"
48+
},
49+
"persistent_5xx_child_exit": 1,
50+
"persistent_5xx_attempts": 3,
51+
"workflow_shape": "pass",
52+
"production_script_restored": true,
53+
"proof_marker": "PROOF_EXIT=0",
54+
"transcript": {
55+
"path": "docs/proof/remediation-throttle-skip/container-transcript.txt",
56+
"bytes": 4325,
57+
"sha256": "9164bc9f37c2e9f815261c4174dd5e94a99661da909d422d3fd878b5e65e65c1",
58+
"secret_scan": "docs/proof/remediation-throttle-skip/container-secret-scan.json"
59+
},
60+
"launcher": {
61+
"path": "docs/proof/remediation-throttle-skip/run-container-proof.sh",
62+
"bytes": 3635,
63+
"sha256": "7e702a4322269238884b60e8594deeda82ec34b1b7aec909ed2d06719b7768a6"
64+
}
65+
},
66+
"discarded_attempts": [
67+
{
68+
"lease_id": "cbx_12a0f57a1b2c",
69+
"lease_slug": "amber-hermit",
70+
"exit_code": 128,
71+
"reason": "The pre-existing proof named a non-existent base SHA; the launcher stopped before dependency installation or tests.",
72+
"lease_stopped": true
73+
},
74+
{
75+
"lease_id": "cbx_38a3bb9d35e3",
76+
"lease_slug": "coral-prawn-c06a",
77+
"exit_code": 1,
78+
"reason": "The evidence extractor expected TAP ok lines, but Node 24 emitted the Unicode spec reporter; RED ran and GREEN executed before the extractor rejected the output format.",
79+
"lease_stopped": true
80+
}
81+
],
82+
"limits": [
83+
"The GitHub API is a loopback fixture; no production workflow run was cancelled.",
84+
"Workflow behavior is parsed and asserted structurally rather than proven by dispatching the production schedule.",
85+
"The receipt-containing evidence commit changes proof files only; the tested runtime and workflow source remain the recorded source head."
86+
]
87+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"schema": "clawsweeper-proof-secret-scan/v1",
3+
"scanner": "trufflehog 3.96.0",
4+
"command": "trufflehog filesystem docs/proof/remediation-throttle-skip/container-transcript.txt --results=verified,unknown --json",
5+
"source": {
6+
"path": "docs/proof/remediation-throttle-skip/container-transcript.txt",
7+
"bytes": 4325,
8+
"sha256": "9164bc9f37c2e9f815261c4174dd5e94a99661da909d422d3fd878b5e65e65c1"
9+
},
10+
"result": {
11+
"exit_code": 0,
12+
"verified_secrets": 0,
13+
"unverified_secrets": 0
14+
}
15+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Remediation throttle skip Docker-backed proof
2+
provider=local-container
3+
image=node:24-bookworm
4+
checkout_head=98fae30ad6336f525b654e90f961e6909b5f61e7
5+
expected_head=98fae30ad6336f525b654e90f961e6909b5f61e7
6+
base_head=e0dc54438e5e346f573af5e6d2cb07c6c1620a8f
7+
node=v24.19.0
8+
Installing [email protected]...
9+
pnpm=11.10.0
10+
docker=host-backed local-container
11+
12+
CRABBOX_PHASE:install
13+
? Verifying lockfile against supply-chain policies (79 entries)...
14+
Lockfile is up to date, resolution step is skipped
15+
Progress: resolved 1, reused 0, downloaded 0, added 0
16+
Packages: +19
17+
+++++++++++++++++++
18+
19+
╭───────────────────────────────────────────────╮
20+
│ │
21+
│ Update available! 11.10.0 → 11.21.0. │
22+
│ Changelog: https://pnpm.io/v/11.21.0 │
23+
│ To update, run: corepack use [email protected] │
24+
│ │
25+
╰───────────────────────────────────────────────╯
26+
27+
✓ Lockfile passes supply-chain policies (79 entries in 716ms)
28+
Progress: resolved 19, reused 0, downloaded 16, added 16
29+
Progress: resolved 19, reused 0, downloaded 19, added 19, done
30+
31+
dependencies:
32+
+ typescript 7.0.2
33+
+ yaml 2.9.0
34+
35+
devDependencies:
36+
+ @types/node 24.13.3
37+
+ markdown-it 15.0.0
38+
+ oxfmt 0.58.0
39+
+ oxlint 1.73.0
40+
+ oxlint-tsgolint 0.24.0
41+
42+
Done in 2s using pnpm v11.10.0
43+
44+
CRABBOX_PHASE:red
45+
RED: PR test fixture against merge-base production script
46+
command=node --test --test-name-pattern=discovery_GitHub_throttling test/stuck-queued-run-remediation.test.ts
47+
✖ discovery GitHub throttling exits successfully with a structured skip reason (58.77242ms)
48+
ℹ tests 1
49+
ℹ suites 0
50+
ℹ pass 0
51+
ℹ fail 1
52+
ℹ cancelled 0
53+
ℹ skipped 0
54+
ℹ todo 0
55+
ℹ duration_ms 130.638469
56+
✖ discovery GitHub throttling exits successfully with a structured skip reason (58.77242ms)
57+
AssertionError [ERR_ASSERTION]: GET /actions/runs?status=queued&per_page=100&page=1 returned 403: {"message":"API rate limit exceeded for installation"}
58+
59+
60+
1 !== 0
61+
62+
at TestContext.<anonymous> (file:///work/crabbox/cbx_efa770db5e6d/fresh-pr-openclaw-clawsweeper-1144/test/stuck-queued-run-remediation.test.ts:222:12)
63+
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
64+
at async Test.run (node:internal/test_runner/test:1389:7)
65+
at async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) {
66+
generatedMessage: false,
67+
code: 'ERR_ASSERTION',
68+
actual: 1,
69+
expected: 0,
70+
operator: 'strictEqual',
71+
diff: 'simple'
72+
}
73+
red_test_exit=1
74+
old_production_child_exit=1 (reported by the failed assertion above)
75+
76+
CRABBOX_PHASE:green
77+
GREEN: PR implementation plus workflow isolation
78+
command=node --test --test-name-pattern=discovery GitHub throttling|persistent discovery 5xx|non-throttle discovery 403|unexpected discovery response shape|mid-remediation throttling|queued workflow remediation test/stuck-queued-run-remediation.test.ts test/review-reliability-workflow.test.ts
79+
✔ queued workflow remediation shares the guarded dead-letter cadence (8.372814ms)
80+
✔ discovery GitHub throttling exits successfully with a structured skip reason (55.655359ms)
81+
✔ persistent discovery 5xx still exits unsuccessfully after bounded retry (400.823133ms)
82+
✔ a non-throttle discovery 403 remains a hard failure (55.087567ms)
83+
✔ an unexpected discovery response shape remains a hard failure (46.30671ms)
84+
✔ mid-remediation throttling stops after completed actions and exits successfully (81.621181ms)
85+
ℹ tests 6
86+
ℹ suites 0
87+
ℹ pass 6
88+
ℹ fail 0
89+
ℹ cancelled 0
90+
ℹ skipped 0
91+
ℹ todo 0
92+
ℹ duration_ms 716.575159
93+
green_test_exit=0
94+
new_production_throttled_child_exit=0 (asserted by passing scenario)
95+
asserted_skip_line={"event":"stuck_queued_remediation_skipped","skip_reasons":{"github_throttled":1},"phase":"discovery","request_path":"/actions/runs?status=queued&per_page=100&page=1"}
96+
persistent_5xx_child_exit=1 (asserted after three bounded attempts)
97+
workflow_shape=pass (remediation isolated; both reconcile stages precede deferred failure; absent artifacts ignored)
98+
production_script_restored=true
99+
PROOF_EXIT=0

‎docs/proof/remediation-throttle-skip/red-green-transcript.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Remediation throttle skip red/green transcript
2-
Base: openclaw/clawsweeper@e0dc54438e6562f144623fcde2263b3b839fe28d
2+
Base: openclaw/clawsweeper@e0dc54438e5e346f573af5e6d2cb07c6c1620a8f
33
Environment: Node v24.19.0, macOS, loopback HTTP via GITHUB_API_URL
44

55
RED (test-only patch; production script still at base behavior)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
expected_head="${1:?expected PR head is required}"
5+
base_head="${2:?merge-base head is required}"
6+
proof_pattern='discovery GitHub throttling|persistent discovery 5xx|non-throttle discovery 403|unexpected discovery response shape|mid-remediation throttling|queued workflow remediation'
7+
remediation_script="scripts/stuck-queued-run-remediation.mjs"
8+
scratch_dir="$(mktemp -d)"
9+
10+
cleanup() {
11+
git show "${expected_head}:${remediation_script}" >"${remediation_script}"
12+
rm -rf "${scratch_dir}"
13+
}
14+
trap cleanup EXIT
15+
16+
export PNPM_HOME="${HOME}/.local/bin"
17+
export PATH="${PNPM_HOME}:${PATH}"
18+
mkdir -p "${PNPM_HOME}"
19+
20+
printf 'Remediation throttle skip Docker-backed proof\n'
21+
printf 'provider=local-container\n'
22+
printf 'image=node:24-bookworm\n'
23+
printf 'checkout_head=%s\n' "$(git rev-parse HEAD)"
24+
printf 'expected_head=%s\n' "${expected_head}"
25+
printf 'base_head=%s\n' "${base_head}"
26+
printf 'node=%s\n' "$(node --version)"
27+
28+
test "$(git rev-parse HEAD)" = "${expected_head}"
29+
git fetch --quiet --no-tags origin main
30+
git cat-file -e "${base_head}^{commit}"
31+
32+
corepack enable --install-directory "${PNPM_HOME}"
33+
corepack install --global [email protected]
34+
printf 'pnpm=%s\n' "$(pnpm --version)"
35+
printf 'docker=%s\n' "$(docker --version 2>/dev/null || printf 'host-backed local-container')"
36+
37+
printf '\nCRABBOX_PHASE:install\n'
38+
pnpm install --frozen-lockfile
39+
40+
printf '\nCRABBOX_PHASE:red\n'
41+
printf 'RED: PR test fixture against merge-base production script\n'
42+
printf 'command=node --test --test-name-pattern=discovery_GitHub_throttling test/stuck-queued-run-remediation.test.ts\n'
43+
git show "${base_head}:${remediation_script}" >"${remediation_script}"
44+
set +e
45+
node --test \
46+
--test-name-pattern='discovery GitHub throttling' \
47+
test/stuck-queued-run-remediation.test.ts \
48+
>"${scratch_dir}/red.log" 2>&1
49+
red_exit=$?
50+
set -e
51+
sed -n '/discovery GitHub throttling exits successfully/,/duration_ms/p' "${scratch_dir}/red.log"
52+
printf 'red_test_exit=%s\n' "${red_exit}"
53+
printf 'old_production_child_exit=1 (reported by the failed assertion above)\n'
54+
test "${red_exit}" -eq 1
55+
grep -Fq '1 !== 0' "${scratch_dir}/red.log"
56+
grep -Fq 'returned 403' "${scratch_dir}/red.log"
57+
58+
printf '\nCRABBOX_PHASE:green\n'
59+
printf 'GREEN: PR implementation plus workflow isolation\n'
60+
printf 'command=node --test --test-name-pattern=%s test/stuck-queued-run-remediation.test.ts test/review-reliability-workflow.test.ts\n' "${proof_pattern}"
61+
git show "${expected_head}:${remediation_script}" >"${remediation_script}"
62+
node --test \
63+
--test-name-pattern="${proof_pattern}" \
64+
test/stuck-queued-run-remediation.test.ts \
65+
test/review-reliability-workflow.test.ts \
66+
>"${scratch_dir}/green.log" 2>&1
67+
sed -n '1,240p' "${scratch_dir}/green.log"
68+
printf 'green_test_exit=0\n'
69+
printf 'new_production_throttled_child_exit=0 (asserted by passing scenario)\n'
70+
printf 'asserted_skip_line=%s\n' '{"event":"stuck_queued_remediation_skipped","skip_reasons":{"github_throttled":1},"phase":"discovery","request_path":"/actions/runs?status=queued&per_page=100&page=1"}'
71+
printf 'persistent_5xx_child_exit=1 (asserted after three bounded attempts)\n'
72+
printf 'workflow_shape=pass (remediation isolated; both reconcile stages precede deferred failure; absent artifacts ignored)\n'
73+
74+
test "$(grep -c '^✔ ' "${scratch_dir}/green.log")" -eq 6
75+
grep -Fq 'ℹ tests 6' "${scratch_dir}/green.log"
76+
grep -Fq 'ℹ pass 6' "${scratch_dir}/green.log"
77+
grep -Fq 'ℹ fail 0' "${scratch_dir}/green.log"
78+
test "$(git hash-object "${remediation_script}")" = "$(git rev-parse "${expected_head}:${remediation_script}")"
79+
printf 'production_script_restored=true\n'
80+
printf 'PROOF_EXIT=0\n'

‎docs/proof/remediation-throttle-skip/secret-scan.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"source": {
66
"path": "docs/proof/remediation-throttle-skip/red-green-transcript.txt",
77
"bytes": 1447,
8-
"sha256": "3ac36e6b3bebba57c7064966eb04715f85276a6759912dbee5b335f4a3cac38d"
8+
"sha256": "ce64d13f0c8b152280a82309369a0d6bea26ca3e61a2f5dd03f994400c86c0a5"
99
},
1010
"result": {
1111
"exit_code": 0,

0 commit comments

Comments
 (0)