diff --git a/.github/scripts/check-id-pr-checks.sh b/.github/scripts/check-id-pr-checks.sh index 2d2562b9b..51592dc37 100755 --- a/.github/scripts/check-id-pr-checks.sh +++ b/.github/scripts/check-id-pr-checks.sh @@ -15,9 +15,11 @@ # checks that run nightly in id-e2e-nightly.yml (which also runs the # full `nix flake check` as a safety net), and the aggregate test # recipes `test`, `test-web` and `test-int` — on PRs their content is -# covered by composition instead: test-unit + test-shard-0/1/2 + +# covered by composition instead: test-unit + test-shard-0/1/2/3 + # test-web-unit + test-web-typecheck run every test they run (#869). -# They still run in the nightly full flake check. +# The aggregate `crash-gate` is likewise covered by composition on +# PRs: crash-gate-sampled/-sweep/-control/-ingest partition its tests +# by name filter (#551). They still run in the nightly full flake check. # # Usage: check-id-pr-checks.sh [list-file] # For tests, ID_FLAKE_CHECKS_FILE names a file with one flake check @@ -37,6 +39,7 @@ excluded=( test test-web test-int + crash-gate ) if [[ -n ${ID_FLAKE_CHECKS_FILE:-} ]]; then diff --git a/.github/scripts/id-pr-checks.txt b/.github/scripts/id-pr-checks.txt index 87f941c8f..63812a098 100644 --- a/.github/scripts/id-pr-checks.txt +++ b/.github/scripts/id-pr-checks.txt @@ -13,6 +13,8 @@ # listed: the aggregate test recipes `test`, `test-web` and `test-int` # — the test-shard-* checks below plus test-unit, test-web-unit and # test-web-typecheck cover every test they run, in parallel (#869). +# Also not listed: the aggregate `crash-gate` — the crash-gate-* +# checks below partition its tests by name filter in parallel (#551). cargo-fmt-check rustfmt-check web-fmt-check @@ -31,7 +33,11 @@ test-unit test-shard-0 test-shard-1 test-shard-2 +test-shard-3 test-web-unit test-web-typecheck -crash-gate +crash-gate-sampled +crash-gate-sweep +crash-gate-control +crash-gate-ingest doc diff --git a/.github/workflows/id-check.yml b/.github/workflows/id-check.yml index e9af5d9f9..1d1032ff3 100644 --- a/.github/workflows/id-check.yml +++ b/.github/workflows/id-check.yml @@ -26,9 +26,16 @@ # aggregates the matrix result and keeps the historical required status # name "nix flake check". The integration suite itself is sharded too: # the old `test`/`test-web` checks each re-ran the whole cargo suite in -# one derivation (~25 minutes); test-shard-0/1/2 split its targets three -# ways (see the justfile's test-shard-sandbox) and, with test-unit and -# the web checks, cover the same tests by composition. +# one derivation (~25 minutes); test-shard-0/1/2/3 split its targets +# four ways (see the justfile's test-shard-sandbox) and, with test-unit +# and the web checks, cover the same tests by composition. +# +# Shape (2026-10, #551): crash-gate was the slowest single PR check +# (~15 min) because it ran every heavy crash sweep serially in one +# derivation. It is now split by test-name filter into four parallel +# checks (crash-gate-sampled/-sweep/-control/-ingest in +# id-pr-checks.txt); the aggregate still runs nightly via the full +# flake check. name: id @@ -94,7 +101,7 @@ jobs: echo "PR checks: $checks" # One parallel job per PR check. Fast PR set: unit + integration - # tests, lint, format, typecheck, doc and the crash gate, listed in + # tests, lint, format, typecheck, doc and the crash gates, listed in # id-pr-checks.txt. The heavy remainder — test-e2e (Playwright), # nixos-serve, nixos-e2e, nixos-integration and nixos-playwright-e2e — # runs nightly in id-e2e-nightly.yml, which also runs the full diff --git a/.opencode/plans/2026-10-20_phase-11-status.md b/.opencode/plans/2026-10-20_phase-11-status.md index 111e7ecb1..03df25be9 100644 --- a/.opencode/plans/2026-10-20_phase-11-status.md +++ b/.opencode/plans/2026-10-20_phase-11-status.md @@ -11,7 +11,7 @@ This document audits the completion status of all eighteen Phase 11 tasks (F11.1 | **F11.1** | Relay kit location | **Done** | [PR #249](https://github.com/developing-today/code/pull/249) | Vendored under `pkgs/id/tests/fixtures/relay` with automated drift test. Issue #238 resolved. | | **F11.2** | Firefox E2E isolation | **In Progress** | [Issue #229](https://github.com/developing-today/code/issues/229), [Workflow](https://github.com/developing-today/code/blob/main/.github/workflows/id-e2e-nightly.yml) | Split out into nightly workflow; per-spec ephemeral server isolation tracked in #229. | | **F11.3** | Explain LogSync flakes | **In Progress** | [PR #224](https://github.com/developing-today/code/pull/224), [PR #254](https://github.com/developing-today/code/pull/254), [PR #255](https://github.com/developing-today/code/pull/255) | Shared deadline aligned to 60s (#224); interrupted session test fixed (#254); ingest batching coalesced in open PR #255. Issue #241 open. | -| **F11.4** | A fast lane | **Done** | [PR #224](https://github.com/developing-today/code/pull/224), [Workflow](https://github.com/developing-today/code/blob/main/.github/workflows/id-check.yml) | Fast checks (fmt, clippy, unit tests) gate PRs with `--keep-going`; E2E split to nightly. | +| **F11.4** | A fast lane | **In Progress** | [Issue #551](https://github.com/developing-today/code/issues/551), [Workflow](https://github.com/developing-today/code/blob/main/.github/workflows/id-check.yml) | Corrected 2026-10-27: this row previously read Done, but the exit — median fast-lane PR feedback under 15 min over ten runs — was never measured. The lane split itself landed in #869 (parallel per-check matrix; E2E/NixOS to nightly). Measured 2026-10-27: median ≈16.6 min over the last 10 successful PR runs (slowest jobs: crash-gate ~15 min, test shards ~12.5 min), so the exit is not yet met; #551 tracks the split/rebalance and the re-measurement. | | **F11.5** | Injected time | **Done** | [PR #808](https://github.com/developing-today/code/pull/808) | `Clock` trait + `SystemClock`/`ManualClock`; schedule/tick/expiry decisions read the injected clock; 11 sleeps removed. | | **F11.6** | Per-call fuel metrics & budgets | **Done** | [PR #247](https://github.com/developing-today/code/pull/247) | Added `id world measure` and baseline+25% `FUEL_BUDGETS` test guards. | | **F11.7** | Host metrics & tracing | **Planned** | Tracked in roadmap | Actor queue depth, command latency, and Prometheus metrics endpoint. | @@ -29,6 +29,6 @@ This document audits the completion status of all eighteen Phase 11 tasks (F11.1 ## Progress Summary -- **Completed Tasks (6)**: F11.1 (relay kit), F11.4 (fast lane), F11.6 (fuel budgets), F11.11 (client projection), F11.14 (cheaper screen), and F11.12 initial fail-loud check (#244). -- **In Progress Tasks (3)**: F11.2 (Firefox E2E), F11.3 (LogSync flakes / #255), F11.16 (replay fixtures / #239). +- **Completed Tasks (5)**: F11.1 (relay kit), F11.6 (fuel budgets), F11.11 (client projection), F11.14 (cheaper screen), and F11.12 initial fail-loud check (#244). +- **In Progress Tasks (4)**: F11.2 (Firefox E2E), F11.3 (LogSync flakes / #255), F11.4 (fast lane — lane split landed in #869, but the <15 min median exit is not yet met; corrected 2026-10-27, tracked in #551), F11.16 (replay fixtures / #239). - **Planned / Next Tasks (9)**: F11.5 (injected time), F11.7 (host metrics), F11.8 (benchmarks), F11.9 (frame bytes), F11.10 (split large modules), F11.12 (journal CLI), F11.13 (error codes), F11.15 (smaller modules), F11.17 (view trap resilience), F11.18 (pinned toolchain). diff --git a/pkgs/id/flake.nix b/pkgs/id/flake.nix index e12c5b248..89edb4b20 100644 --- a/pkgs/id/flake.nix +++ b/pkgs/id/flake.nix @@ -318,18 +318,31 @@ test = mkCheck "test" "test-sandbox"; test-unit = mkCheck "test-unit" "test-unit"; test-int = mkCheck "test-int" "test-int-sandbox"; - # PR-gate shards of the integration suite (#869): the three + # PR-gate shards of the integration suite (#869): the four # shards together run every target test-sandbox runs, in # parallel jobs instead of one serial ~25-minute check. - test-shard-0 = mkCheck "test-shard-0" "test-shard-sandbox 0 3"; - test-shard-1 = mkCheck "test-shard-1" "test-shard-sandbox 1 3"; - test-shard-2 = mkCheck "test-shard-2" "test-shard-sandbox 2 3"; + # (3 → 4 shards in #551: the 3-way shards had drifted to + # ~12.5 min, close to the fast-lane exit.) + test-shard-0 = mkCheck "test-shard-0" "test-shard-sandbox 0 4"; + test-shard-1 = mkCheck "test-shard-1" "test-shard-sandbox 1 4"; + test-shard-2 = mkCheck "test-shard-2" "test-shard-sandbox 2 4"; + test-shard-3 = mkCheck "test-shard-3" "test-shard-sandbox 3 4"; test-web = mkCheck "test-web" "test-web-sandbox"; test-web-unit = mkCheck "test-web-unit" "test-web-unit"; test-web-typecheck = mkCheck "test-web-typecheck" "test-web-typecheck"; doc = mkCheck "doc" "doc"; cargo-check = mkCheck "cargo-check" "cargo-check"; crash-gate = mkCheck "crash-gate" "crash-gate"; + # PR-gate splits of crash-gate (#551): the aggregate above runs + # every heavy full sweep serially (~15 min, the slowest PR + # check). These four checks partition the same tests by name + # filter and run in parallel on PRs; crash-gate itself stays + # for local use and the nightly full flake check, and is + # excluded from the PR list in check-id-pr-checks.sh. + crash-gate-sampled = mkCheck "crash-gate-sampled" "crash-gate-sampled"; + crash-gate-sweep = mkCheck "crash-gate-sweep" "crash-gate-sweep"; + crash-gate-control = mkCheck "crash-gate-control" "crash-gate-control"; + crash-gate-ingest = mkCheck "crash-gate-ingest" "crash-gate-ingest"; # Playwright E2E tests (requires building the binary + browser binaries) test-e2e = pkgs.stdenv.mkDerivation { diff --git a/pkgs/id/just-recipes.json b/pkgs/id/just-recipes.json index 86e01a438..654c17d7c 100644 --- a/pkgs/id/just-recipes.json +++ b/pkgs/id/just-recipes.json @@ -665,7 +665,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/hatch/git/wt-869/root.just", + "source": "/home/hatch/git/worktrees/queue-1283-551/root.just", "unexports": [], "warnings": [] } @@ -1384,6 +1384,72 @@ "namepath": "crash-gate", "shebang": false }, + "crash-gate-control": { + "attributes": [{ "group": "test" }], + "body": [ + [ + "cargo test --release --features web --test crash -- --include-ignored full_lying_sync_control_produces_failures" + ], + ["@echo \"✓ Crash gate (full lying-sync controls) passed\""] + ], + "dependencies": [], + "doc": null, + "name": "crash-gate-control", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "crash-gate-control", + "shebang": false + }, + "crash-gate-ingest": { + "attributes": [{ "group": "test" }], + "body": [ + ["cargo test --release --features web --test crash -- --include-ignored ingest_survives_every_crash_point"], + ["@echo \"✓ Crash gate (full ingest sweep) passed\""] + ], + "dependencies": [], + "doc": null, + "name": "crash-gate-ingest", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "crash-gate-ingest", + "shebang": false + }, + "crash-gate-sampled": { + "attributes": [{ "group": "test" }], + "body": [ + ["cargo test --release --features web --test crash -- --skip write_corpus"], + ["@echo \"✓ Crash gate (sampled + corpus replay) passed\""] + ], + "dependencies": [], + "doc": "excluded everywhere (they rewrite the checked-in corpus files).", + "name": "crash-gate-sampled", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "crash-gate-sampled", + "shebang": false + }, + "crash-gate-sweep": { + "attributes": [{ "group": "test" }], + "body": [ + ["cargo test --release --features web --test crash -- --include-ignored full_sweep_has_no_failures"], + ["@echo \"✓ Crash gate (full sweeps) passed\""] + ], + "dependencies": [], + "doc": null, + "name": "crash-gate-sweep", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "crash-gate-sweep", + "shebang": false + }, "default": { "attributes": [], "body": [], @@ -2169,7 +2235,11 @@ }, "test-e2e": { "attributes": [{ "group": "e2e" }], - "body": [["cd e2e && bun install --frozen-lockfile && bunx playwright test"]], + "body": [ + [ + "cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test \"$spec\" || exit 1; done" + ] + ], "dependencies": [{ "arguments": [], "recipe": "build", "star": null }], "doc": "[bun] Run Playwright E2E tests (both chromium and firefox)", "name": "test-e2e", @@ -2182,7 +2252,11 @@ }, "test-e2e-chromium": { "attributes": [{ "group": "e2e" }], - "body": [["cd e2e && bun install --frozen-lockfile && bunx playwright test --project=chromium"]], + "body": [ + [ + "cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test --project=chromium \"$spec\" || exit 1; done" + ] + ], "dependencies": [{ "arguments": [], "recipe": "build", "star": null }], "doc": "[bun] Run Playwright E2E tests (chromium only)", "name": "test-e2e-chromium", @@ -2195,7 +2269,11 @@ }, "test-e2e-firefox": { "attributes": [{ "group": "e2e" }], - "body": [["cd e2e && bun install --frozen-lockfile && bunx playwright test --project=firefox"]], + "body": [ + [ + "cd e2e && bun install --frozen-lockfile && for spec in tests/*.spec.ts; do bunx playwright test --project=firefox \"$spec\" || exit 1; done" + ] + ], "dependencies": [{ "arguments": [], "recipe": "build", "star": null }], "doc": "[bun] Run Playwright E2E tests (firefox only)", "name": "test-e2e-firefox", @@ -2407,7 +2485,7 @@ "attributes": [{ "group": "test" }], "body": [["bash scripts/test-shard-sandbox.sh ", [["variable", "SHARD"]], " ", [["variable", "COUNT"]]]], "dependencies": [], - "doc": "pair (#869).", + "doc": "pair (#869; 3 → 4 shards in #551 to rebalance the ~12.5 min shards).", "name": "test-shard-sandbox", "parameters": [ { @@ -2989,7 +3067,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/hatch/git/wt-869/pkgs/id/justfile", + "source": "/home/hatch/git/worktrees/queue-1283-551/pkgs/id/justfile", "unexports": [], "warnings": [] } diff --git a/pkgs/id/justfile b/pkgs/id/justfile index f2a515a0a..ed5fbc785 100644 --- a/pkgs/id/justfile +++ b/pkgs/id/justfile @@ -236,6 +236,32 @@ crash-gate: cargo test --release --features web --test crash -- --skip write_corpus --include-ignored @echo "✓ Crash gate passed" +# PR-gate splits of crash-gate (#551): the full gate ran every heavy sweep +# serially in one check (~15 min, the slowest PR job). The four recipes +# below partition the same tests by name filter so the PR gate runs them +# in parallel; together with the nightly full `crash-gate` they cover +# every test crash-gate runs. write_corpus / write_corpus_identity stay +# excluded everywhere (they rewrite the checked-in corpus files). +[group('test')] +crash-gate-sampled: + cargo test --release --features web --test crash -- --skip write_corpus + @echo "✓ Crash gate (sampled + corpus replay) passed" + +[group('test')] +crash-gate-sweep: + cargo test --release --features web --test crash -- --include-ignored full_sweep_has_no_failures + @echo "✓ Crash gate (full sweeps) passed" + +[group('test')] +crash-gate-control: + cargo test --release --features web --test crash -- --include-ignored full_lying_sync_control_produces_failures + @echo "✓ Crash gate (full lying-sync controls) passed" + +[group('test')] +crash-gate-ingest: + cargo test --release --features web --test crash -- --include-ignored ingest_survives_every_crash_point + @echo "✓ Crash gate (full ingest sweep) passed" + # Run unit tests only (fast) [group('test')] test-unit: @@ -256,8 +282,8 @@ test-int-sandbox: # Run one COUNT-th slice of the integration tests (sandbox-safe: # excludes serve_tests requiring network) — see # scripts/test-shard-sandbox.sh for the sharding logic. The PR gate -# runs 3 shards in parallel instead of the single serial test/test-web -# pair (#869). +# runs 4 shards in parallel instead of the single serial test/test-web +# pair (#869; 3 → 4 shards in #551 to rebalance the ~12.5 min shards). [group('test')] test-shard-sandbox SHARD COUNT: bash scripts/test-shard-sandbox.sh {{SHARD}} {{COUNT}} diff --git a/pkgs/id/scripts/test-shard-sandbox.sh b/pkgs/id/scripts/test-shard-sandbox.sh index 629ec7600..b9816196d 100755 --- a/pkgs/id/scripts/test-shard-sandbox.sh +++ b/pkgs/id/scripts/test-shard-sandbox.sh @@ -7,7 +7,7 @@ # automatically. The shards together cover every target test-sandbox # covers; shard 0 also runs the bin unit tests and the doc tests, which # the per-target shards skip. Lib unit tests stay in test-unit. The PR -# gate runs 3 shards in parallel instead of the single serial +# gate runs 4 shards in parallel instead of the single serial # test/test-web pair (#869). set -euo pipefail