Title: mcpx testing: a fast, sharded CI with a time budget, linters and auto-format · Issue #1901 · developing-today/code · GitHub
Open Graph Title: mcpx testing: a fast, sharded CI with a time budget, linters and auto-format · Issue #1901 · developing-today/code
X Title: mcpx testing: a fast, sharded CI with a time budget, linters and auto-format · Issue #1901 · developing-today/code
Description: Relocated 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...
Open Graph Description: Relocated 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 reference...
X Description: Relocated 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 refer...
Opengraph URL: https://github.com/developing-today/code/issues/1901
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx testing: a fast, sharded CI with a time budget, linters and auto-format","articleBody":"Relocated from dezren39/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).\n\nParent: #91\n\n## Purpose\n\nCI 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.\n\nWhere 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`:\n\n| Step | Seconds |\n| --- | --- |\n| Set up job, checkout, nix-installer, setup-go/deno/bun/node | 32.6 |\n| `go test ./... -count=1` | **134.8** |\n| `nix build .#packages.x86_64-linux.mcpx` | 58.8 |\n| Post steps + complete | 1.5 |\n| **Total wall clock** | **229 s** |\n\nInside 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.\n\nAfter #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.\n\nThree facts about today's setup that this tracker exists to fix, all verified:\n\n- ~~**The Go cache has never restored.**~~ **Fixed in #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. #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 #135.\n- **`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.\n- **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; #135 decision 6 now argues to keep it (the sandbox has no network, which would have caught #65) but take it off the critical path, and to fix its drifted package list (12 packages with tests never run there).\n\nWhat 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).\n\n## Children\n\n- [ ] #135 mcpx testing: CI workflow skeleton -- init, matrix, final job; triggers, concurrency, caching, checkout (its cache one-liner landed in #182)\n- [ ] #139 mcpx testing: shard the suite by measured time, and a rule for when to stop splitting\n- [ ] #140 mcpx testing: a CI time budget in the final job, and the over-budget runbook\n- [ ] #141 mcpx testing: every formatter and linter in the CI matrix, pinned by the flake (and run the plugin's bun test)\n- [ ] #142 mcpx testing: format.yaml -- auto-format after a green run; PR head vs main\n- [ ] #143 mcpx testing: first CI iteration -- unit + e2e shards + lint + nix build, and a recorded baseline\n\n## Proposed order\n\n1. **#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.\n2. **#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 #182, as #181's phase 0 asked; #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 #139 and #140 are guesswork. #138 (in #97) is recommended just before or alongside it: it is the remaining isolation gap, and every shard inherits it.\n3. **#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 #143's numbers. `t.Parallel` in e2e is no longer blocked by #52; it waits on #138 and a measured `-parallel`.\n4. **#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 #143 supplies.\n5. **#141** -- the full formatter and linter set, beyond the first lint leg #143 stands up.\n6. **#142** -- `format.yaml`, last, because it only makes sense once the formatters are pinned (#141) and there is a green test workflow for it to key on (#135's `name:`).\n\nThe 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.\n\n## Children -- ease and impact\n\n| # | Title | Kind | Ease | Impact |\n| --- | --- | --- | --- | --- |\n| #135 | workflow skeleton -- init, matrix, final job, triggers, caching (cache line done in #182) | design | M | **high** |\n| #139 | shard by measured time, and when to stop splitting | design | M | **high** |\n| #140 | time budget in the final job, and the over-budget runbook | design + implement | S (job) + S (runbook) | med |\n| #141 | every formatter and linter in the matrix, pinned by the flake | design | M (mostly clean-up, one style decision) | med |\n| #142 | format.yaml -- auto-format after a green run | design | M (needs a token decision) | low-med (convenience; quality comes from the blocking check) |\n| #143 | first iteration + recorded baseline | implement | M | **high** -- roughly halves wall clock and produces the data for everything else |\n\n## Warnings carried by this tracker\n\n- **The biggest single win is no longer blocked by #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. #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 #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. #139 has both.\n- **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 #135, along with the trap that without `always()` a skipped aggregator reads as neutral and a red matrix merges.\n- **A `paths:`-filtered required check never reports and blocks merges permanently.** Harmless today only because nothing is required yet.\n- **Sparse checkout breaks `nix build`**, which evaluates the whole flake. Sparse applies to test legs only.\n- **`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 #142.\n- **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.\n- **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.\n\n## Related\n\n#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.\n\nSecurity/auth deferred; see tracker.\n\n## Acceptance criteria\n- 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.\n- The budget and shard layout are documented, and a deliberately slow test is shown to trip the budget alarm in CI.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:21:35Z","url":"https://github.com/developing-today/code/issues/1901"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a915da4-3f55-13fa-0e44-a3c40555c542 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E512:1B0DA8:302616:3F9004:6B06169C |
| html-safe-nonce | 790508e9e450da7e0b077cdaf15898f2867e3e600a98c86a4af922c9756c5eb1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTEyOjFCMERBODozMDI2MTY6M0Y5MDA0OjZCMDYxNjlDIiwidmlzaXRvcl9pZCI6IjMzNjIyMDQyMTQ3NTg4NzI3MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bd31707bcdee01b31dc642d26d857abb2cc840b213a18cabed51d0d359354159 |
| hovercard-subject-tag | issue:6088571616 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1525be7f31919dd9ac65f16761368531c1df5f504db3cb69dbfe44659abe0b4f/developing-today/code/issues/1901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1525be7f31919dd9ac65f16761368531c1df5f504db3cb69dbfe44659abe0b4f/developing-today/code/issues/1901 |
| og:image:alt | Relocated 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 reference... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width