GeezerVison is showing github.com — mcpx testing: a fast, sharded CI with a time budget, linters and auto-format · Issue #1901 · developing-today/code
mcpx testing: a fast, sharded CI with a time budget, linters and auto-format #1901DescriptionRelocated from dezren39/darwin-nix#95 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).
Parent: #91
Purpose
CI for mcpx, built to the notes' stated top priority: "the main priority is being short as possible", with its stated focus, "main focus is strong tests as each step of the lifecycle". Those two pull against each other, and this tracker is where the trade is made explicitly rather than by accident.
Where it starts, measured rather than estimated. One workflow, .github/workflows/mcpx.yml, one ubuntu-latest job. Run 36673523537 (push to main), from the step timestamps in gh run view 36673523537 --log:
| Step |
Seconds |
| Set up job, checkout, nix-installer, setup-go/deno/bun/node |
32.6 |
go test ./... -count=1 |
134.8 |
nix build .#packages.x86_64-linux.mcpx |
58.8 |
| Post steps + complete |
1.5 |
| Total wall clock |
229 s |
Inside the test step, internal/e2e alone is 100.727 s of 134.8; internal/tui 8.6 s; internal/pool 1.5 s; internal/events 1.05 s; internal/mcpserver 1.03 s; everything else under 0.5 s. The last eight runs sit between 3 m 57 s and 4 m 18 s. So the whole sharding question is, in the first instance, one question: what do you do about e2e, which is 44% of wall clock and 199 of 719 tests.
After #182, at 05c78b2 (run 36693030957, push to main): 4 m 09 s wall; setup 22 s; go test 148 s with internal/e2e at 108.9 s for 209 of 735 tests; nix build 70 s (checkPhase 18.5 s). That run's Go cache was a miss by construction (the first main run with the new key), so the warm-cache number is still owed -- #143 records it.
Three facts about today's setup that this tracker exists to fix, all verified:
The Go cache has never restored. Fixed in Phase 5: tag event bodies must travel with the event #182. actions/setup-go@v7 defaults cache: true but looked for go.mod at the repository root; mcpx's is at pkgs/mcpx/go.mod. The log carried ##[warning]Restore cache failed: Dependencies file is not found and every run re-downloaded every module and compiled cold. Phase 5: tag event bodies must travel with the event #182 added cache-dependency-path: pkgs/mcpx/go.sum (.github/workflows/mcpx.yml:50); the key now saves. What remains of caching (restore-only on PRs, the Nix store, toolchains) is Update Rust crate tokio to v1.38.2 [SECURITY] #135.
treefmt.nix exists and nothing runs it. programs.nixfmt and programs.rustfmt are enabled, flake.nix exposes checks.formatting, and no workflow invokes either. treefmt.nix:6 also carries # programs.shellcheck.enable = true; # failures -- a linter switched off rather than satisfied, already in the tree, and the precedent any new linter must avoid repeating.
- Unit tests run twice per CI run.
package.nix checkPhase re-runs a list of unit packages inside nix build, costing 16.55 s (18.5 s at 05c78b2) on top of the go test step. That is either free time to reclaim or a deliberate sandbox check worth keeping; Update Rust crate tokio to v1.38.2 [SECURITY] #135 decision 6 now argues to keep it (the sandbox has no network, which would have caught Update Rust crate axum to 0.6.20 #65) but take it off the critical path, and to fix its drifted package list (12 packages with tests never run there).
What this tracker does not own: the seed itself (#93 -- the init job mints and exports it, but #121/#122 decide what it is), the environment legs that join this matrix (#97 -- nix, container, remote, other OSes), and what an agent runs on its own machine instead of CI (#99).
Children
Proposed order
- Update Rust crate tokio to v1.38.2 [SECURITY] #135 -- the skeleton. Workflow name,
init -> matrix -> ci-ok job graph, triggers (including the notes' "commit/open/undraft to a non-draft pr", which today's workflow does not implement -- it sets no pull_request: types:, so it uses the default [opened, synchronize, reopened] and ready_for_review never fires), concurrency, caching, checkout, and what stays behind in mcpx.yml. Everything else plugs into this.
- 🎨 Palette: Search panel accessibility improvements #143 -- build the first real iteration and record a baseline. Split unit from e2e, put static shards in, add the lint leg, keep
nix build. (The Go cache fix it also carried landed separately in Phase 5: tag event bodies must travel with the event #182, as Phase 3: sync, blob gate, and relays #181's phase 0 asked; chore(deps): bump build/buck/preludes/buck2-prelude from d956689 to e7457f6 #52, which the old order waited on, is closed by the same PR.) This is the issue that produces the timing data every later decision needs; without it Update dependency hyperscript.org to v0.9.93 #139 and Update dependency vitest to v5 [SECURITY] #140 are guesswork. Update dependency htmx.org to v1.9.12 #138 (in Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /sources/chat #97) is recommended just before or alongside it: it is the remaining isolation gap, and every shard inherits it.
- Update dependency hyperscript.org to v0.9.93 #139 -- replace the static shards with a split driven by measured per-test time, and write down the rule for when to stop splitting. Needs 🎨 Palette: Search panel accessibility improvements #143's numbers.
t.Parallel in e2e is no longer blocked by chore(deps): bump build/buck/preludes/buck2-prelude from d956689 to e7457f6 #52; it waits on Update dependency htmx.org to v1.9.12 #138 and a measured -parallel.
- Update dependency vitest to v5 [SECURITY] #140 -- turn the recorded baseline into a gate: the budget job, and the runbook for what to do when it is breached. Needs a number, which 🎨 Palette: Search panel accessibility improvements #143 supplies.
- Bump dezren39/nix flake input to 3499ed3 — opencode now defaults to v2 #141 -- the full formatter and linter set, beyond the first lint leg 🎨 Palette: Search panel accessibility improvements #143 stands up.
- ⚡ Bolt: Optimize search match counting performance #142 --
format.yaml, last, because it only makes sense once the formatters are pinned (Bump dezren39/nix flake input to 3499ed3 — opencode now defaults to v2 #141) and there is a green test workflow for it to key on (Update Rust crate tokio to v1.38.2 [SECURITY] #135's name:).
The notes describe an iterative loop -- split the longest job, re-measure, repeat, and do it again whenever the budget is breached. That loop is #143 -> #139 -> #140 -> #143, and it is expected to run more than once. #140's runbook is what makes it a procedure rather than a habit.
Children -- ease and impact
| # |
Title |
Kind |
Ease |
Impact |
| #135 |
workflow skeleton -- init, matrix, final job, triggers, caching (cache line done in #182) |
design |
M |
high |
| #139 |
shard by measured time, and when to stop splitting |
design |
M |
high |
| #140 |
time budget in the final job, and the over-budget runbook |
design + implement |
S (job) + S (runbook) |
med |
| #141 |
every formatter and linter in the matrix, pinned by the flake |
design |
M (mostly clean-up, one style decision) |
med |
| #142 |
format.yaml -- auto-format after a green run |
design |
M (needs a token decision) |
low-med (convenience; quality comes from the blocking check) |
| #143 |
first iteration + recorded baseline |
implement |
M |
high -- roughly halves wall clock and produces the data for everything else |
Warnings carried by this tracker
- The biggest single win is no longer blocked by chore(deps): bump build/buck/preludes/buck2-prelude from
d956689 to e7457f6 #52, but it is not free. 209 serial e2e tests that mostly wait on process start, sockets and runtime startup are the textbook case for t.Parallel() -- plausibly 2-3x on one runner at zero extra setup cost. Phase 5: tag event bodies must travel with the event #182 fixed the leak that made that dangerous (stop --all through the info files, 60 s idle exit). What still has to come first is Update dependency htmx.org to v1.9.12 #138: newEnv still inherits the caller's environment, so an exported MCPX_DAEMON_ENDPOINT/MCPX_SOCKET sends every parallel test to one outside daemon. And one e2e test is 3-4 processes (CLI, daemon, fake server, often a JS runtime), so -parallel 8 on 4 vCPU is 24-32 processes: measure -parallel, do not take GOMAXPROCS. Update dependency hyperscript.org to v0.9.93 #139 has both.
- Renaming a job invalidates every required check, and a sharded matrix produces N check names that change on every rebalance. The fix -- one
needs: [...] if: always() aggregator as the sole required check -- is in Update Rust crate tokio to v1.38.2 [SECURITY] #135, along with the trap that without always() a skipped aggregator reads as neutral and a red matrix merges.
- A
paths:-filtered required check never reports and blocks merges permanently. Harmless today only because nothing is required yet.
- Sparse checkout breaks
nix build, which evaluates the whole flake. Sparse applies to test legs only.
workflow_run only fires from the default branch, checks out the default-branch tip rather than head_sha, and types: [completed] includes failures. All three bite ⚡ Bolt: Optimize search match counting performance #142.
- The
GITHUB_TOKEN loop guard is the only thing that closes the auto-format loop. Swapping in a PAT to get past branch protection re-opens it.
- More shards are not monotonically better. 22-33 s of setup is the floor per leg (32.8 s on 36673523537, 22 s on 36693030957); ten legs spend 220-330 runner-seconds of setup to save ~90 s of wall clock, and the concurrency cap turns them into two waves -- which is exactly the runner-pressure effect the notes predict. Driving the fixed cost down beats adding a fifth shard.
Related
#91 (parent), #93 (#121/#122 -- the seed init mints), #97 (#134/#136 -- environment legs join this matrix), #99 (#127 -- CI is where "every test" runs so that agents do not), #49 (CI for every flake package -- overlaps this tree directly), #138 (in #97; the isolation gap before parallel shards), #178 (also edits package.nix), #52 (closed, fixed in #182), #79, #35, #65, #47, #48.
Security/auth deferred; see tracker.
Acceptance criteria
- mcpx CI runs sharded with a stated time budget; lint and auto-format checks run as their own jobs and fail the build on violations.
- The budget and shard layout are documented, and a deliberately slow test is shown to trip the budget alarm in CI.
Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 History carried over from dezren39/darwin-nix#95 (verbatim, oldest first):
@dezren39 · 2026-09-30T07:20:00Z
Integration pass. Placed in the DAG rooted at #181.
@dezren39 · 2026-09-30T12:03:33Z
Issues pass (2026-09-30, at 05c78b2).
@dezren39 · 2026-10-28T21:35:32Z
Triage verdict (task 2100, repo-health-nix-pilot): RELOCATED / SUPERSEDED IN PLACE — tracker stays open, but its work surface moved repos; no fix packet in this repo.
Verified against current main at 224c7b738e88c7a8e5d406987a7d88257e229db2:
- Bump golang.org/x/crypto from 0.16.0 to 0.17.0 in /sources/launcher #95 is OPEN with labels
tracker, testing — no hard-stop labels. It tracks fast, sharded mcpx CI with a time budget, linters and auto-format, with leaves Update Rust crate tokio to v1.38.2 [SECURITY] #135, Update dependency hyperscript.org to v0.9.93 #139, Update dependency vitest to v5 [SECURITY] #140, Bump dezren39/nix flake input to 3499ed3 — opencode now defaults to v2 #141, ⚡ Bolt: Optimize search match counting performance #142 and first step 🎨 Palette: Search panel accessibility improvements #143 — all still OPEN here.
- But the premise no longer holds in dezren39/nix:
.github/workflows/ at HEAD has no mcpx.yml. The remaining mcpx workflow, mcpx-nixbuild.yml, states in its header: "mcpx's source lives only in developing-today/code now; this repo builds it from the pinned mcpx-src flake input" (mcpx: the darwin skip override in dezren39/nix keys on this repo's check-phase line with a silent replaceStrings — no automated guard against drift #418, rewired by lab-ops-hub container crawler accepts inet_aton IPv4 spellings (127.1, 2130706433, 0x7f.1) — loopback SSRF bypass in validate_crawl_url #468) — it is a narrow build-verification check triggered only by flake.nix/flake.lock/itself.
- The CI this tracker designs now lives with the source: developing-today/code has
.github/workflows/mcpx.yml and mcpx-conformance.yml at its HEAD.
Route: no small_fix packet was enqueued in dezren39/nix — there is no in-repo CI left to shard here. The open leaves (#135, #139–#143) presuppose the removed in-repo workflow and need a relocation pass to developing-today/code (per the cross-repo rule, that move should reference this tracker rather than spawning fresh per-repo issues). #95 stays open as the nix-side tracker until that relocation is decided/done; closing it here would orphan six open leaves.
added kind/testTest coverage, test infrastructure, or test-only fixes effort/lLarge: multi-day or open-ended; expect staged check-ins meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Oct 28, 2026dezren39 commented on Oct 28, 2026 Intake review
🤖 Agent note · filed
Notes: Filed in the large mcpx filing batch of 2026-10-28 21:59–22:24Z and already carries a queued triage task — it is not orphaned. Verified live at intake: no merged PR references this issue and it was filed under an hour ago, so nothing can have resolved it yet. Acceptance criteria appended to the body from the issue's own stated scope; original body preserved verbatim above it.
Risks: Tracker-level scope overlaps its sibling batch issues — the triage pass must dedupe against them before any implementation packet is written, and split rather than implement if the scope is multi-PR.
Suggested approach: Triage first (task 2793): confirm the boundary against the sibling issues, then enqueue one scoped packet per deliverable slice.
dezren39 commented on Nov 3, 2026 dezren39 commented on Nov 3, 2026 🤖 Agent note · triaged — task 7766 complete
Current-main verdict — tracker remains live; scope refreshed
The old single-workflow premise has changed. Current CI work is spread across mcpx-test.yml, mcpx.yml, and the repo-wide formatter policy:
- Sharding:
mcpx-test.yml has unit/lint legs, six static e2e shards dealt round-robin by sorted test name, and a ci-ok aggregator. This is not measured-time balancing and does not implement the proposed stop rule. mcpx testing: shard the suite by measured time, and a rule for when to stop splitting #1994 remains OPEN; its existing task 8160 is currently claimed for per-test timings/LPT packing and the stop rule. No duplicate task filed.
- Time budget: delivered and documented in
mcpx.yml (420-second default, budget report and sustained-overrun issue); mcpx testing: a CI time budget in the final job, and the over-budget runbook #1995 is CLOSED (PR mcpx: CI time budget in final job + over-budget runbook (#1995) #2708 merged). The first CI iteration is in mcpx testing: first CI iteration -- unit + e2e shards + lint + nix build, and a recorded baseline #1998 (CLOSED, PR ci(mcpx): first measured iteration — static e2e shards + unit + lint + ci-ok (#1998) #2888 merged), and the missing PR trigger from mcpx testing: CI workflow skeleton -- init, matrix, final job; triggers, concurrency, caching, checkout #1985 was added in PR ci(mcpx): add pull_request trigger to mcpx-test.yml (#1985) #5051.
- Go lint/plugin tests: mcpx testing: every formatter and linter in the CI matrix, pinned by the flake (and run the plugin's bun test) #1996 is CLOSED after PR mcpx: CI lint leg (vet, golangci-lint, gofmt, shellcheck, actionlint) + plugin bun test leg (#1996) #2718 added Go lint and the Bun plugin tests.
golangci-lint remains non-blocking until its findings are fixed; mcpx: fix the 119 golangci findings the new lint leg surfaced, then make the leg blocking #2836 is OPEN with task 8002 currently claimed. This triage did not duplicate that work.
- Formatting: the repo-wide scheduled
auto-format.yml and .github/ci-policy.md intentionally make formatting non-blocking; mcpx testing: format.yaml -- auto-format after a green run; PR head vs main #1997 is CLOSED as superseded. The old requirement for a blocking formatter/format.yaml is not current policy and should not be revived.
- Remaining gap found: mcpx workflows run the Bun plugin tests but no TypeScript lint/type-check step. Filed mcpx: add pinned TypeScript lint and type-check coverage for the plugin #5151 and queued task 8832 for that independent slice.
Ordering / blockers: no external blocker. The tracked remaining work is #1994/task 8160 (measured shard balancing), #2836/task 8002 (Go lint debt), then #5151/task 8832 (plugin TypeScript lint/type-check). #1901 stays open as the umbrella until the measured-sharding work and its current acceptance are reconciled.
Evidence: current workflows inspected at 52fd50d17e750ae84385b5b41414e886eccee95e; related issue and PR states checked fresh. No build/test run was applicable to this triage-only task.
developing-today commented on Nov 8, 2026 🤖 Agent note · done
What the remainder was (rescoped by triage task 2793, 2026-10-29, after the sharding + linter matrix landed in repo CI):
- An explicit mcpx CI time budget with enforcement/reporting.
- The e2e split policy (is internal/e2e sharded, and when do you stop splitting).
- The warm-cache wall-clock number still owed.
The linter-completeness slice was already owned by issue mcpx testing: every formatter and linter in the CI matrix, pinned by the flake (and run the plugin's bun test) #1996 — now CLOSED.
Evidence it all landed (verified fresh 2026-11-08 on current main):
- Budget:
.github/workflows/mcpx.yml now opens with the mcpx testing: a CI time budget in the final job, and the over-budget runbook #1995 over-budget runbook and carries a final budget job that reports wall / longest-leg per run, with warn/fail gates and a budget_seconds dispatch override — enforcement and reporting, not just a number.
- e2e split policy:
.github/workflows/mcpx-test.yml deals e2e shards by measured time (mcpx testing: shard the suite by measured time, and a rule for when to stop splitting #1994): pkgs/mcpx/scripts/ci/e2e-shard-packer.py + the committed e2e-timings.json seed generate the matrix, coverage-verified so no shard silently runs zero tests; the workflow header writes the stop rule down with measurements (six shards at 2 m 50 s–3 m 05 s of test work; a seventh would buy ~25 s). Landed in commit 9ab18a8 ("ci(mcpx): deal e2e shards from measured test time, and write the stop rule down (mcpx testing: shard the suite by measured time, and a rule for when to stop splitting #1994)").
- Wall-clock recording: the budget job's per-run table (wall + longest leg, median-of-last-5-main-runs ratchet per the runbook) supersedes the one-off warm-cache number the tracker owed — the number is now recorded continuously by the mechanism itself.
Closing as completed on this evidence. If a specific budget or shard behaviour regresses, that is a new defect to file against the workflow, not a reopen of this tracker.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|