Repository navigation
chore(ci): repeat a PR's changed Vitest specs under load in the pinned container before merge (#4163) - #4175
Merged
Merged
Conversation
The repetition count is decided over the whole selection; the selection is then split into the fewest partitions that each fit one job's capacity. A file whose repetitions alone exceed the capacity runs by itself, and a selection that needs more than the maximum is refused with its weight and the limit. DETERMINISM_PARTITIONS owns the capacity, the maximum, the step limit and the measured load ratio; the repetition budget is the capacity, recalibrated from 600 to 300 weighted seconds. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ns (#4117) The planner publishes determinism_shards and the determinism job becomes a matrix over it; each partition's command reads its files from the same plan and refuses a divisor that is not the planned count. The hosted aggregate refuses a published set that differs from the plan, the merge path requires one successful job per published partition, and the workflow guard refuses a literal matrix, divisor, shared artifact name or foreign step limit. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…4117) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…to feat/repeat-browser-specs-under-load
…ted partitions (#4163) Select the Vitest browser, layout and story specs a pull request adds or modifies, expand each to the project/file pairs Vitest's own listing reports, and plan their repetitions and hosted partitions with the Bun gate's functions. One table owns the capacity, the maximum partition count, the step limit and the cost of a pair without a reviewed weight. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…container (#4163) Enter the container through the browser suite's launcher and run exactly the selected project/file pairs as further passes in one Vitest process, one project at a time, with one CPU burner per CPU started inside the container. The first failing repetition fails the command and names the spec, the project, the repetition and the case. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ec changes (#4163) A matrix job at every pull-request cadence and in draft heavy feedback, never on main. The matrix is the planner's published partition set; both aggregates, the merge path and the workflow lint require it when selected and its skip otherwise. The merge path's job inventory bound is now derived from every proof job's widest matrix. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rid split (#4163) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 17, 2026
This was referenced Nov 17, 2026
…to feat/repeat-browser-specs-under-load
…pecs-under-load # Conflicts: # .agents/skills/work-issue/references/ci-and-merge.md # .github/workflows/ci.yml # .github/workflows/heavy-feedback.yml # docs/decisions/ci-utility.md # docs/decisions/test-health.md # scripts/candidate-proof.ts # scripts/check-ci-workflows.ts # scripts/ci-plan.ts # scripts/ci-proof.ts # scripts/determinism-plan.ts # scripts/integration-proof.ts # scripts/proof-shards.ts # tests/ci-plan.test.ts # tests/ci-workflows.test.ts # tests/hosted-proof.test.ts # tests/integration-proof.test.ts
…ze (#4163) The control asserted more than 400 recorded project/file pairs, true only for the refreshed browser weights. That refresh was reverted (#4182), the table is back to 387 rows, and the test failed under the Bun determinism gate on the first hosted run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2 tasks
Twelve scenarios, each a child process, shared one 27-second work deadline and overran it under the determinism gate's CPU load (run 44104941268, 27.2 s). Each is now its own test with the assertions it had; no deadline changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
6 tasks
schlessera
marked this pull request as ready for review
November 17, 2026 15:55
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4163
Closes #4189
Lands after #4157: this branch contains that PR's commits (the
determinismpartitions) and builds on its planner, so its own diff is what remains once #4157 has merged.What changed
A pull request that adds or modifies a Vitest browser, layout or story spec now gets a hosted
browser_determinismjob at every pull-request cadence, drafts and draft heavy feedback included, and never on main. The job repeats each changed spec in the pinned container, in every Vitest project that includes it, while one CPU burner per CPU runs inside the container: five repetitions, two at ready confirmation. The first failing repetition fails the job and names the spec, the project, the repetition and the case.draft gates,proof, the heavy-feedback aggregate and the merge path require the job when the plan selects it and require its skip otherwise.*.visual.tsx,*.stories.tsx,*.pointer.tsx,*.layout.tsxand*.offline.tsxin the three spec directories; not the endurance spec, and a changed helper selects nothing. The planner expands each file to the project/file pairs Vitest's own listing reports, from one listing per plan shared with category selection. A changed spec that no project lists, or an unreadable listing, fails the plan.bun scripts/browser-determinism.tsenters the container throughscripts/visual.mjs(one new flag,--repeat-plan), so image, mounts and network are the browser suite's. Inside,scripts/browser-determinism-inside.mjsstarts Vitest once throughvitest/nodeand callsrunTestSpecificationswith exactly the selected pairs for every pass, one project at a time. Notrepeats, and not a loop ofvitest run.scripts/browser-shard-costs.json, reduced uniformly to a floor of two; a pair without a weight costs 10 seconds and the report names it. A selection over capacity at two repetitions is split into planned partitions with the Bun gate's functions; beyond 15 the planner refuses in the metadata job.BROWSER_DETERMINISM_PARTITIONSowns the numbers.MAX_RUN_JOBS), because a third matrix job would have outgrown it.Nothing under
packages/changes: no spec, story, config or product source. The gate's fixture specs and their Vitest config live intests/fixtures/browser-determinism/, which no project inpackages/ui-kit/vitest.config.tsincludes.Why this shape
The issue and the #4116 spike decide most of it; the decision record section "Changed browser specs repeat under load before merge" states the rest with its evidence. Four choices were mine:
vitest runloop. The spike measured the catch rate and its false-failure sample with in-process passes, and never timed a loop. Only the in-process API can run exactly the selected pairs: a command line names projects and files and runs their cross product, which would repeat pairs that belong to another partition.Proof
Focused suites on the merged head
09633b126, 492 pass and 1 fail across 19 files:tests/red-main.test.ts,hosted-proof,ci-workflows,integration-proof,ci-plan,heavy-feedback,candidate-proof,local-checks,check-receipt,integration-command,visual-runner,browser-input-closure,test-determinism,browser-image-pin,visual-dictation-isolation,refresh-browser-costs, the two new files andworkspace-lease. The one failure is the existing lease container test: under this host's rootless Docker the container cannot read its private fixture directory (Cannot find module '/repo/brain-workspace-lease-…/scripts/visual.mjs'). It does not run this change's code. Strict typecheck andbun run lintpass.Racy fixture, pinned container, under load (four burners on four CPUs,
--cpu-list 12-15, through the full command and launcher):The same spec made deterministic (
landing-steady.repeat.js, same command): five of five repetitions passed in both projects,Passed: 2 project/file pair(s), 5 repetition(s) each, exit 0.The fixture is a real-time race on a fixed schedule, as the Bun gate's is: a 150 ms timer against a crew that is slow on every third landing, counted in
localStorage. That makes the mutation below deterministic, and it also pins the documented carry-over: storage survives a further pass.tests/browser-determinism-container.test.tsruns both fixtures through the real container side, the installed Vitest and a real Chromium in the pinned image on every unit run (about 4 s).Mutations. Each guard broken, the named test red on the named assertion, the source restored:
SPEC_PROJECT_AND_REPETITION_NAMED, receivednull: the racy fixture got through, every timeSPEC_PROJECT_AND_REPETITION_NAMED, receivednullSEVERAL_PARTITIONS:draft, expected 3, received 2DROPPED_PARTITION:draft=true, did not throwLITERAL_DIVISOR_VALUE, received[]draft, expected false, received trueCONFIRMATION_ASKS_FOR_THE_FLOOR, expected 2MAIN_NEVER_REPEATSADDED_AND_MODIFIED_SPECS_AS_LISTED_PAIRS, receivedundefinedONE_PROJECT_AT_A_TIMEONE_PASS_IS_NOT_FIVE, receivedpassedBURNER_KILLED_BY_PIDA plain failing-first run on the base is not possible for the new test files: they import modules that do not exist there, which is a module-load error and not a receipt. "The selection is never populated" is the behavioural equivalent for the planner.
A real selection, locally. One visual spec, one pointer spec in three projects, one layout spec and one story in two themes (the four specs the spike measured), five repetitions, four burners on four pinned CPUs of a shared host: 35 pair passes, none failed. 52.9 weighted s per pass; passes took 102.8, 69.3, 68.8, 66.1 and 66.2 s (about 1.3 times the weight after the first). The spike's hosted figures for the same specs sum to about 61 s per further pass.
Off-main qualification
CI run 44064090479 is this draft's run on head
09633b1269f2cc91404855da94d08e87277e7225.changesetjob passed, so the new planner planned this change on a hosted runner andbun run lintaccepted the new workflow job and the regenerated heavy-feedback workflow. The planner did not selectbrowser_determinism, and that job was skipped, as it must be for a change that touches no spec.determinism (1), which repeats this change's Bun test files under CPU load (the gate's own unit and pinned-container tests among them), anddraft gates, which must accept that selection.{"version":1,"kind":"brain-check-pr-receipt","head":"03b28f9e7f5dbfcdb5c4fce5379537fcb6b8bcfc","base":"origin/main","mode":"focused","startedAt":"2026-11-17T14:56:41.049Z","finishedAt":"2026-11-17T14:58:14.173Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":14099.401065999999},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":123.4472910000004},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":89.78916200000094},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.456274999996822},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":78775.36463299999}]}The job on real specs, on a hosted runner. This PR changes no spec, so a throwaway draft (#4188, closed unmerged) added a comment to one visual, one pointer, one layout and one story spec on top of this branch. Run https://github.com/schlessera/brain-kit/actions/runs/44104948265 on
f24f7fb9c:browser_determinism (1)determinism (1)draft gatesFive repetitions were requested and the 300 weighted-second budget reduced them to three (81.3 weighted seconds per pass). The spike estimated about 12 minutes for a job at the budget; this one, at 244 of 300 weighted seconds, took 6.4. An earlier run of the same draft, 44103013009, took 450 s for the same job.
Two things those hosted runs found in this PR, both fixed here:
tests/browser-determinism.test.tsrequired more than 400 rows in the browser weight table, true only for the refreshed weights that revert: refresh the reviewed browser and layout weights (#4165) #4182 reverted. It is now a floor both tables meet.tests/integration-command.test.ts: the proof-system lane case ran twelve scenarios under one 27-second deadline and overran it under the gate's load (run 44104941268). Each scenario is now its own test (ci: the proof-system lane test packs twelve scenarios under one deadline and overruns it under load #4189).This head: https://github.com/schlessera/brain-kit/actions/runs/44108610729 (draft, head
03b28f9e7f5dbfcdb5c4fce5379537fcb6b8bcfc).Checklist
packages/ui-react/,packages/ui-kit/,packages/ui-server/orpackages/core/carries a recorded independent review of its head (bun scripts/review-receipt.ts check <pr>), or it touches none of them. It touches none of them.docs/reflect the change: the decision record section, the amendment to the hybrid ruling,docs/process/testing.md,docs/process/test-authoring.mdand the work-issue merge reference.Anything left open
browser_determinism. The orchestrator opens a throwaway draft on top of this branch that touches one visual, one pointer, one layout or offline and one story spec, and records the job's duration beside the spike's estimate of about 12 minutes at 300 weighted seconds. Until then the job has never run on a hosted runner, and the hosted load ratio with the refreshed weights is unmeasured.diagrams-*projects under repetition, including their native preparation time; peak memory; whether the gate's own new Bun test files pass five repetitions under the Bun gate's burners (this draft'sdeterminismjob is the first measurement).tests/workspace-lease.test.tscontainer case fails under rootless Docker here for an unrelated permission reason; hosted Docker is rootful.bun scripts/issue-queue.ts claim 4163refused the issue because it lacksagent-ready(it carriesblockeduntil chore(ci): shard an oversized determinism selection by reviewed weight (#4117) #4157 merges). No label was added and the issue is not self-assigned.🤖 Generated with Claude Code