Skip to content

Commit 83dddd6

Browse files
authored
test: split the dashboard-worker monolith into eight thematic suites (#1127)
test/dashboard-worker.test.ts was a 29,073-line monolith holding 337 tests -- every iteration parsed all of it and coverage archaeology meant scrolling. It is now eight thematic files (queue-policy 54, publication-lifecycle 22, Bay-records-routes 41, observability 16, queue-runtime 137, dashboard-status 36, webhook-ingress 25, telemetry-contracts 6) over a shared harness module the test glob ignores. Mechanical split, zero test-body edits: the before/after full-suite name inventories (3,333 names) are SHA-256-identical, the runner discovers the new files by glob, and each file runs green standalone -- proving no hidden cross-suite coupling or ordering dependence existed. Full suite green locally and in a Docker-backed Crabbox container on the receipt head with committed provenance.
1 parent 4b79888 commit 83dddd6

21 files changed

Lines changed: 36275 additions & 29073 deletions
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Dashboard Worker test split proof
2+
3+
## Claim
4+
5+
The 29,073-line `test/dashboard-worker.test.ts` monolith is split into eight contiguous,
6+
thematically named test files plus one non-test harness without changing any test registration
7+
body, runtime test name, or test count.
8+
9+
## File map
10+
11+
| Test file | Runtime tests |
12+
| --- | ---: |
13+
| `dashboard-worker-queue-policy.test.ts` | 54 |
14+
| `dashboard-worker-publication-lifecycle.test.ts` | 22 |
15+
| `dashboard-worker-bay-records-routes.test.ts` | 41 |
16+
| `dashboard-worker-observability.test.ts` | 16 |
17+
| `dashboard-worker-queue-runtime.test.ts` | 137 |
18+
| `dashboard-worker-dashboard-status.test.ts` | 36 |
19+
| `dashboard-worker-webhook-ingress.test.ts` | 25 |
20+
| `dashboard-worker-telemetry-contracts.test.ts` | 6 |
21+
| **Total** | **337** |
22+
23+
Shared imports, fixtures, in-memory storage doubles, and request builders live in
24+
`test/dashboard-worker-harness.ts`. Its name deliberately does not match `*.test.ts`, so the
25+
repository test glob ignores it.
26+
27+
## Safety net
28+
29+
The untouched `origin/main` suite and the split suite each reported 3,333 tests: 3,324 passed,
30+
9 skipped, and 0 failed. `before-test-names.txt` and `after-test-names.txt` are sorted copies of
31+
the exact Node test-reporter names, including repeated names. Both files have SHA-256
32+
`72ca5bf6f1beae8a2105f3006e8316e8c038dd15e2374e6b8c0debfadb259611`.
33+
34+
`name-set.diff` is the committed zero-byte diff between those lists. The 336 source registration
35+
blocks—335 direct registrations plus one intact loop that registers two runtime tests—also compare
36+
byte-identically with the original source. See `test-registration-identity.txt`.
37+
38+
## Standalone files
39+
40+
Each split file passed when invoked alone with `node --test <file>`. This proves the cleave did not
41+
introduce execution-order coupling between files. The exact counts and durations are recorded in
42+
`standalone-results.txt`.
43+
44+
## Local gates
45+
46+
The seven proof and repository gates are recorded in `local-gates.txt`. The repository-wide gate is
47+
`pnpm run check`; the narrower entries make its build, test, lint, format, and static-check evidence
48+
explicit.
49+
50+
## Container proof
51+
52+
`container-proof.sh` is the command run from a clean PR checkout. It enables the repository-pinned
53+
Corepack/pnpm toolchain, downloads jq 1.8.2 for the container architecture, verifies that binary
54+
against jq's official published SHA-256 manifest, installs dependencies from the frozen lockfile,
55+
and runs the full suite.
56+
57+
The required clean `--fresh-pr openclaw/clawsweeper#1127 --no-hydrate` run passed at pushed head
58+
`07d5ef9528ad69b7b4a2aaafa1050c199b2506c6`. Crabbox resolved `provider=aws` and executed the
59+
proof inside `node:24-bookworm` on lease `cbx_a6899c138d00` (`jade-lobster-c3f0`), run
60+
`run_8980401fcc5d`, machine type `c7a.8xlarge`. The full suite passed 3,333 tests with 3,325
61+
passed, 8 Linux-inapplicable skips, and 0 failures. Crabbox reported exit 0 and
62+
the lease was explicitly released with Crabbox 0.41.1 after the older run wrapper's release
63+
acknowledgement timed out; a provider-specific lease listing was empty afterward.
64+
65+
The repository-pinned official jq checksum passed, Node was 24.18.1, pnpm was 11.10.0, jq was 1.8.2, and the
66+
container installed Debian rsync 3.2.7. `container-provenance.json` is the committed receipt;
67+
`container-stdout.log` retains the proof-bearing transcript. TruffleHog 3.96.0 found no verified
68+
or unknown secrets in the exact 522,855-byte stdout capture.
69+
70+
Two earlier harness-only attempts are disclosed in the receipt. The first left verified jq outside
71+
the test login-shell path; the second still lacked rsync and exposed jq only through a temporary
72+
parent-shell path. Both failed unrelated workflow fixtures and both report automatic lease cleanup.
73+
A third run passed before the review-required jq digest pin; it is retained as superseded provenance.
74+
75+
## Limits and OpenClaw Bay impact
76+
77+
This is a test-only ownership split. It changes no production source, runtime API, workflow,
78+
dashboard data contract, lifecycle publication, queue behavior, or observer/action boundary.
79+
OpenClaw Bay is unaffected.

‎docs/proof/split-dashboard-worker-tests/after-test-names.txt‎

Lines changed: 3333 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/proof/split-dashboard-worker-tests/before-test-names.txt‎

Lines changed: 3333 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
proof_tmp="$(mktemp -d)"
5+
trap 'rm -rf "$proof_tmp"' EXIT
6+
7+
jq_version="1.8.2"
8+
case "$(uname -m)" in
9+
x86_64)
10+
jq_asset="jq-linux-amd64"
11+
jq_sha256="b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f"
12+
;;
13+
aarch64 | arm64)
14+
jq_asset="jq-linux-arm64"
15+
jq_sha256="8b85c817833814ddca00a144c33705546355afccf0cf39b188f3cdb48b852309"
16+
;;
17+
*)
18+
echo "unsupported container architecture: $(uname -m)" >&2
19+
exit 1
20+
;;
21+
esac
22+
23+
curl -fsSL "https://github.com/jqlang/jq/releases/download/jq-${jq_version}/${jq_asset}" \
24+
-o "$proof_tmp/$jq_asset"
25+
printf '%s %s\n' "$jq_sha256" "$jq_asset" > "$proof_tmp/sha256sum.txt"
26+
(
27+
cd "$proof_tmp"
28+
sha256sum --ignore-missing --strict -c sha256sum.txt
29+
)
30+
chmod 0755 "$proof_tmp/$jq_asset"
31+
install -m 0755 "$proof_tmp/$jq_asset" /usr/local/bin/jq
32+
apt-get update
33+
apt-get install -y --no-install-recommends rsync
34+
35+
corepack enable
36+
pnpm install --frozen-lockfile
37+
38+
printf 'PROOF_HEAD=%s\n' "$(git -c safe.directory="$PWD" rev-parse HEAD)"
39+
printf 'PROOF_NODE=%s\n' "$(node --version)"
40+
printf 'PROOF_PNPM=%s\n' "$(pnpm --version)"
41+
printf 'PROOF_JQ=%s\n' "$(jq --version)"
42+
printf 'PROOF_JQ_ASSET=%s\n' "$jq_asset"
43+
printf 'CRABBOX_PHASE:test\n'
44+
pnpm test
45+
printf 'SPLIT_DASHBOARD_WORKER_CONTAINER_PROOF_RC=0\n'
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"schema": "clawsweeper-real-boundary-proof-provenance/v1",
3+
"claim": "The pushed dashboard Worker test split passes the full repository suite from a clean PR checkout inside a Linux Docker container with checksum-verified jq.",
4+
"pull_request": "https://github.com/openclaw/clawsweeper/pull/1127",
5+
"reviewed_head": "07d5ef9528ad69b7b4a2aaafa1050c199b2506c6",
6+
"crabbox": {
7+
"run_cli_version": "0.38.3-5-g2a79805d",
8+
"cleanup_cli_version": "0.41.1",
9+
"provider": "aws",
10+
"lease_id": "cbx_a6899c138d00",
11+
"slug": "jade-lobster-c3f0",
12+
"run_id": "run_8980401fcc5d",
13+
"machine_type": "c7a.8xlarge",
14+
"checkout": "--fresh-pr openclaw/clawsweeper#1127 --no-hydrate",
15+
"container_image": "node:24-bookworm",
16+
"sync_ms": 7979,
17+
"command_ms": 135750,
18+
"total_ms": 143928,
19+
"exit_code": 0,
20+
"run_status": "succeeded",
21+
"lease_stopped": true,
22+
"lease_stop_status": "The successful command's older run wrapper timed out awaiting the release acknowledgement and reported leaseStopped=false. Crabbox 0.41.1 explicitly released the same provider-bound lease; a subsequent provider-specific list returned empty."
23+
},
24+
"runtime": {
25+
"node": "v24.18.1",
26+
"pnpm": "11.10.0",
27+
"jq": "jq-1.8.2",
28+
"jq_asset": "jq-linux-amd64",
29+
"jq_sha256": "b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f",
30+
"jq_checksum_source": "Repository-pinned in container-proof.sh from the official jq 1.8.2 release manifest",
31+
"jq_checksum_verified": true,
32+
"rsync_package": "3.2.7-1+deb12u6"
33+
},
34+
"result": {
35+
"proof_rc": 0,
36+
"full_suite": {
37+
"tests": 3333,
38+
"passed": 3325,
39+
"skipped": 8,
40+
"failed": 0,
41+
"duration_ms": 111853.757098
42+
},
43+
"stdout": {
44+
"bytes": 522855,
45+
"sha256": "dbc6510b36b5b50ce8bc8fb7e201fde0dcc05281871e92e20433408c5520da3e",
46+
"committed_excerpt": "container-stdout.log",
47+
"secret_scan": "container-secret-scan.json"
48+
},
49+
"stderr": {
50+
"bytes": 451,
51+
"sha256": "a63eae761de33822bb804442dddbab9c488141b7e387935fb6bbc1aac6953a41"
52+
}
53+
},
54+
"discarded_attempts": [
55+
{
56+
"run_id": "run_3967f6ca93be",
57+
"lease_id": "cbx_444f2f04b612",
58+
"reviewed_head": "097ec97f40066397027514d5b59fbe61417feafa",
59+
"exit_code": 1,
60+
"reason": "Checksum-verified jq was not placed on PATH and rsync was absent; unrelated workflow fixtures took missing-tool branches.",
61+
"lease_stopped": true
62+
},
63+
{
64+
"run_id": "run_3f56ddff442a",
65+
"lease_id": "cbx_bfa511cacfcb",
66+
"reviewed_head": "a1f198c0caf25419aaab9522a32b2e87b0db6a08",
67+
"exit_code": 1,
68+
"reason": "Login-shell fixtures reset the temporary jq PATH and the container still lacked rsync.",
69+
"lease_stopped": true
70+
}
71+
],
72+
"superseded_successful_runs": [
73+
{
74+
"run_id": "run_496cd5ae7c07",
75+
"lease_id": "cbx_891cde76c278",
76+
"reviewed_head": "c54565b253df36d03e49f3acd8499e4b29f9d516",
77+
"exit_code": 0,
78+
"reason": "The full suite passed, but the run was superseded after ClawSweeper required repository-pinned jq digests.",
79+
"lease_stopped": true
80+
}
81+
],
82+
"limits": [
83+
"This proof exercises repository build and test behavior only; it does not deploy the Worker or mutate GitHub, queue, or production state.",
84+
"The successful container used Linux, so one test skipped on macOS ran and one macOS-only test skipped; the total and test-name inventory remained 3333."
85+
]
86+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tool": "trufflehog",
3+
"version": "3.96.0",
4+
"source": "/tmp/clawsweeper-1127-crabbox-stdout-4.log",
5+
"source_bytes": 522855,
6+
"source_sha256": "dbc6510b36b5b50ce8bc8fb7e201fde0dcc05281871e92e20433408c5520da3e",
7+
"results_requested": ["verified", "unknown"],
8+
"findings": 0,
9+
"exit_code": 0
10+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
jq-linux-amd64: OK
2+
PROOF_HEAD=07d5ef9528ad69b7b4a2aaafa1050c199b2506c6
3+
PROOF_NODE=v24.18.1
4+
PROOF_PNPM=11.10.0
5+
PROOF_JQ=jq-1.8.2
6+
PROOF_JQ_ASSET=jq-linux-amd64
7+
CRABBOX_PHASE:test
8+
[run-node-tests] target=all concurrency=16 files=246
9+
ℹ tests 3333
10+
ℹ suites 0
11+
ℹ pass 3325
12+
ℹ fail 0
13+
ℹ cancelled 0
14+
ℹ skipped 8
15+
ℹ todo 0
16+
ℹ duration_ms 111853.757098
17+
SPLIT_DASHBOARD_WORKER_CONTAINER_PROOF_RC=0
18+
19+
Crabbox provider=aws lease=cbx_a6899c138d00 slug=jade-lobster-c3f0 run=run_8980401fcc5d machine_type=c7a.8xlarge
20+
Crabbox sync_ms=7979 command_ms=135750 total_ms=143928 exit_code=0 run_status=succeeded
21+
Crabbox cleanup_cli=0.41.1 explicit_release=true provider_specific_list_empty=true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Node: v24.19.0
2+
pnpm: 11.10.0
3+
4+
1. Test registration byte identity: passed (336 blocks, 337 runtime tests)
5+
2. Full-suite before/after name multiset: passed (3,333 tests; empty diff)
6+
3. pnpm run build:all: passed
7+
4. pnpm run test:no-build: passed (3,333 tests; 3,324 passed; 9 skipped; 0 failed)
8+
5. pnpm run lint: passed
9+
6. pnpm run format:check: passed
10+
7. pnpm run check:static: passed
11+
12+
Repository aggregate: pnpm run check: passed
13+
Focused coverage: 12 tests; 12 passed; 0 failed; 100.00% lines; 88.61% branches; 100.00% functions
14+
Full coverage: 3,333 tests; 3,324 passed; 9 skipped; 0 failed; 81.58% lines; 74.03% branches; 87.39% functions
15+
Aggregate log SHA-256: c82d7c3d2fbdeec64b2a75e3524ad502be6a014a205428213edfa7f83b1abb80

‎docs/proof/split-dashboard-worker-tests/name-set.diff‎

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
command: node --test <split-file>
2+
node: v24.19.0
3+
4+
dashboard-worker-queue-policy.test.ts: tests=54 pass=54 fail=0 skipped=0 duration_ms=767.430042
5+
dashboard-worker-publication-lifecycle.test.ts: tests=22 pass=22 fail=0 skipped=0 duration_ms=679.617500
6+
dashboard-worker-bay-records-routes.test.ts: tests=41 pass=41 fail=0 skipped=0 duration_ms=552.993375
7+
dashboard-worker-observability.test.ts: tests=16 pass=16 fail=0 skipped=0 duration_ms=346.254667
8+
dashboard-worker-queue-runtime.test.ts: tests=137 pass=137 fail=0 skipped=0 duration_ms=4397.352166
9+
dashboard-worker-dashboard-status.test.ts: tests=36 pass=36 fail=0 skipped=0 duration_ms=432.456458
10+
dashboard-worker-webhook-ingress.test.ts: tests=25 pass=25 fail=0 skipped=0 duration_ms=1075.507292
11+
dashboard-worker-telemetry-contracts.test.ts: tests=6 pass=6 fail=0 skipped=0 duration_ms=238.860709
12+
13+
total: tests=337 pass=337 fail=0 skipped=0

0 commit comments

Comments
 (0)