Skip to content

Commit c83b08b

Browse files
committed
test: record router throttle container proof
1 parent 7d99189 commit c83b08b

5 files changed

Lines changed: 210 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Comment router throttle resilience proof
2+
3+
Production run [31697514690](https://github.com/openclaw/clawsweeper/actions/runs/31697514690)
4+
failed while prehydrating the full comment history for
5+
[openclaw/openclaw#120500](https://github.com/openclaw/openclaw/issues/120500).
6+
The exact repository dispatch had no durable router claim; recovery depended on
7+
the rolling three-hour scheduled scan, so a long enough throttle window could
8+
lose the command rather than merely delay it.
9+
10+
The fix gives scheduled scans their own per-repository `updated_at` plus
11+
same-timestamp-id cursor. Broad scans read bounded, oldest-first repository
12+
comment pages from that cursor. The wrapper persists a new watermark only after
13+
the entire router process succeeds; exact routes never advance it. Within a
14+
throttled cycle, context already fetched remains usable and affected commands
15+
are retained as waiting before the shared operator-skip classifier turns the
16+
child failure into an operator-visible exit-0 defer.
17+
18+
The cheap read-economy change applies to repository-wide discovery. Per-item
19+
comment histories remain complete because they feed source-revision hashes,
20+
linked-PR discovery, historical command/status idempotency, exact-review lease
21+
checks, and close guards. Adding `since=<routing cursor>` to those reads would
22+
silently weaken those contracts, so that more invasive optimization is not part
23+
of this fix.
24+
25+
OpenClaw Bay is unaffected: this changes an internal router workflow and its
26+
git-backed progress cursor, not Bay's public observer-only status contract.
27+
28+
## Container proof
29+
30+
The committed [run-proof.sh](run-proof.sh) is the static `jq` recipe used in the
31+
Docker-backed Crabbox container. It obtains every commit/tree id through
32+
`git rev-parse`, verifies each with `git cat-file`, runs the production loopback
33+
CLI and focused tests, and validates the generated JSON receipt.
34+
35+
The successful run used Crabbox `provider=local-container`, lease
36+
`cbx_6efbcfb3f874` (`coral-barnacle-e30e`), run `run_4fe08202fe1b`, and stopped
37+
the one-shot lease automatically. The raw Ubuntu image required NodeSource Node
38+
24 because its default package is Node 22. The raw synced workspace also needed
39+
a temporary Git bundle containing the already-committed head and base objects;
40+
the bundle was proof transport only and is not committed.
41+
42+
The receipt commit contains proof artifacts only after tested runtime commit
43+
`7d991891672e29f6f5d09961a7a34b205e2602cd`; no source, script, test, workflow,
44+
or operational documentation change follows the tested tree in this push.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"overall_behavior": "satisfies_contract",
3+
"overall_confidence": 0.98,
4+
"target": {
5+
"type": "operator CLI",
6+
"access": "loopback GITHUB_API_URL"
7+
},
8+
"checks": [
9+
{
10+
"contract_clause": "Throttle defer",
11+
"status": "pass",
12+
"severity": null,
13+
"evidence": "Installation 403, abuse 403, and 429 emitted github_throttled and exited 0; the mixed batch retained waiting work and completed the routable command.",
14+
"confidence": 0.99
15+
},
16+
{
17+
"contract_clause": "Cursor persistence",
18+
"status": "pass",
19+
"severity": null,
20+
"evidence": "The deferred cursor stayed unchanged; recovery requested issues/comments?since=2026-08-13T11%3A50%3A00.000Z&sort=updated&direction=asc and advanced to the next id.",
21+
"confidence": 0.98
22+
},
23+
{
24+
"contract_clause": "Real errors fail",
25+
"status": "pass",
26+
"severity": null,
27+
"evidence": "The non-throttle 422 scenario exited nonzero.",
28+
"confidence": 0.99
29+
}
30+
],
31+
"anti_cheat_probes": [
32+
{
33+
"probe": "Vary installation 403, abuse 403, and 429",
34+
"result": "All three classified as github_throttled"
35+
},
36+
{
37+
"probe": "Reuse a processed id at the exact cursor timestamp",
38+
"result": "The saved id was filtered and the next id advanced the cursor"
39+
},
40+
{
41+
"probe": "Replace the throttle with 422",
42+
"result": "The router remained fatal"
43+
}
44+
],
45+
"blockers": []
46+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"schema_version": 1,
3+
"provider": "local-container",
4+
"lease_id": "cbx_6efbcfb3f874",
5+
"lease_slug": "coral-barnacle-e30e",
6+
"run_id": "run_4fe08202fe1b",
7+
"lease_stopped": true,
8+
"tested_head_sha": "7d991891672e29f6f5d09961a7a34b205e2602cd",
9+
"tested_head_tree": "e5dc49da8412168a6103d4e5cc8bba8500c75efa",
10+
"base_sha": "4d41d3df4baf191dca9c385c82689425a135a5c4",
11+
"cat_file_cross_check": {
12+
"head_commit": true,
13+
"head_tree": true,
14+
"base_commit": true
15+
},
16+
"runtime": {
17+
"image": "ubuntu:26.04",
18+
"architecture": "arm64",
19+
"node": "v24.19.0",
20+
"pnpm": "11.10.0",
21+
"transport": "loopback HTTP via GITHUB_API_URL"
22+
},
23+
"command_phases_ms": {
24+
"install": 17756,
25+
"build": 2226,
26+
"proof": 4184
27+
},
28+
"assertions": {
29+
"throttle_exit_zero": true,
30+
"abuse_403_exit_zero": true,
31+
"throttle_429_exit_zero": true,
32+
"structured_skip": true,
33+
"routable_data_completed": true,
34+
"cursor_unchanged": true,
35+
"cursor_resumed_incrementally": true,
36+
"real_error_nonzero": true
37+
},
38+
"focused_tests": {
39+
"passed": 15,
40+
"failed": 0
41+
},
42+
"request_count": 32,
43+
"limits": [
44+
"The GitHub API was a deterministic loopback fixture with synthetic credentials.",
45+
"No live GitHub mutation or production workflow dispatch was performed.",
46+
"The receipt commit adds proof artifacts only after the tested runtime tree."
47+
]
48+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
provider=local-container
2+
lease=cbx_6efbcfb3f874
3+
slug=coral-barnacle-e30e
4+
run=run_4fe08202fe1b
5+
image=ubuntu:26.04
6+
node=v24.19.0
7+
pnpm=11.10.0
8+
CRABBOX_PHASE:install
9+
CRABBOX_PHASE:build
10+
CRABBOX_PHASE:proof
11+
head_sha=7d991891672e29f6f5d09961a7a34b205e2602cd
12+
head_tree=e5dc49da8412168a6103d4e5cc8bba8500c75efa
13+
base_sha=4d41d3df4baf191dca9c385c82689425a135a5c4
14+
cat_file_head_commit=true
15+
cat_file_head_tree=true
16+
cat_file_base_commit=true
17+
focused_tests_passed=15
18+
focused_tests_failed=0
19+
throttle_exit_zero=true
20+
abuse_403_exit_zero=true
21+
throttle_429_exit_zero=true
22+
structured_skip=true
23+
routable_data_completed=true
24+
cursor_unchanged=true
25+
cursor_resumed_incrementally=true
26+
real_error_nonzero=true
27+
request_count=32
28+
exit_code=0
29+
lease_stopped=true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Router throttle resilience red/green
2+
3+
## Red
4+
5+
The loopback contract was added before the production fix and run against the
6+
fresh `origin/main` implementation. The exact-comment path fetched its source
7+
comment, then received GitHub's installation-rate-limit body from the issue
8+
comment-history endpoint:
9+
10+
```text
11+
GitHubRateLimitError: GitHub API rate limited ...
12+
Command failed: gh api repos/openclaw/router-throttle-proof/issues/1/comments?per_page=100 --paginate --slurp
13+
gh: API rate limit exceeded for installation (HTTP 403)
14+
1 !== 0
15+
```
16+
17+
The process exited 1 before writing a router report or a durable command claim.
18+
19+
## Green
20+
21+
The same real loopback HTTP boundary now passes all contract probes:
22+
23+
```json
24+
{
25+
"throttle_exit_zero": true,
26+
"abuse_403_exit_zero": true,
27+
"throttle_429_exit_zero": true,
28+
"structured_skip": true,
29+
"routable_data_completed": true,
30+
"cursor_unchanged": true,
31+
"cursor_resumed_incrementally": true,
32+
"real_error_nonzero": true
33+
}
34+
```
35+
36+
The mixed batch classifies the already-fetched command as `ready`, retains the
37+
throttled command as `waiting`, writes the partial report and ledger, and then
38+
emits the structured defer. Recovery reads from the unchanged watermark with
39+
`sort=updated&direction=asc`, filters the id already recorded at that exact
40+
timestamp, and advances only after the successful cycle.
41+
42+
The repository gate `pnpm run check` also passed: static checks, formatting,
43+
builds, lint, changed-surface coverage, and the complete coverage suite.

0 commit comments

Comments
 (0)