Title: mcpx testing: review all tests, set up the fuzz framework and its policies · Issue #1960 · developing-today/code · GitHub
Open Graph Title: mcpx testing: review all tests, set up the fuzz framework and its policies · Issue #1960 · developing-today/code
X Title: mcpx testing: review all tests, set up the fuzz framework and its policies · Issue #1960 · developing-today/code
Description: Relocated from dezren39/darwin-nix#125 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/ni...
Open Graph Description: Relocated from dezren39/darwin-nix#125 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 referenc...
X Description: Relocated from dezren39/darwin-nix#125 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 refe...
Opengraph URL: https://github.com/developing-today/code/issues/1960
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx testing: review all tests, set up the fuzz framework and its policies","articleBody":"Relocated from dezren39/nix#125 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: #93\n\n## Summary\n\nThe simple, explicitly requested issue: **review all existing tests, set up the fuzz framework, and write its policies** -- i.e. execute #121-#124 in the smallest useful slice. Three deliverables: an inventory of the 735 tests (at 05c78b2; which become generators, which hide time/randomness/ports, which are flake-prone), the seed helper + wrapper + first generator landed, and the policy text handed to #99.\n\n## Original notes\n\n> - testing\n> - agents should make at least 1 simple, new test for every bug observed from any source, when cheap to do so-- aggresively test many permutations. \n> - you can absolutely rely on fuzzing anywhere you can fit it and you should whenever you can-- but you _must_ use a single seed per-run to generate all inputs. (this could eventually be discussed with careful consideration.) it should be appended into a test tracking structured file in the repo and it can be committed. ideally main branch commit's seed or pr merge seed should make it back into file eventually. to prevent churn, maybe ci appends the seed into a gha var (race/overwrite risk?), or attached as artifact to each workflow in init job before tests begin-- a collector job can scoop them up sometime later. once a day/week/on-release/every-100-commits. im thinking touch tests/seeds/\u003cseed> or uv has a seed generate job. anyways ci it should end up in that dir, then as an artifact if gha and main branch, then passed into the test matrix. if uv test without arg- warn, generate and write it yourself pass it to all tests, if some other testing method there should not be a static seed, throw for empty or setup should make the seed. avoid changing how seed generates data. im not sure if a convenient uuid with time, v7?, is valid, but as long as its enough entropy whatever works. either put nothing in their or compact json, consider seeds/v1/id/\u003cfirst 2 char>/\u003cseed>\u003c--symlink: seeds/yyyy/mm/dd/\u003cseed> avoiding conflicts is important.\n> - think a hack job of antithesis/tigerbeetle. this is the primary testing method is throw insane amount of variations. if something is found outside this system and a test that could have had missed it, make a different generator that uses the same seed and makes an infinite amount of things matching the offensive shape.\n> - make a simple issue for reviewing all tests, setting up framework and policies for the fuzz.\n\n## Current state (initial inventory from `rg`, re-counted at 05c78b2 -- the review deepens it)\n\n| Package | Tests | Generator candidates | Hidden time / randomness / ports |\n| --- | --- | --- | --- |\n| `internal/e2e` | 209 | `exec.flagset` (from the `TestEveryExecFlagChangesSomething` table, `e2e_test.go:2877`), `api.v1request` (`v1ops_test.go:287`) | `time.Sleep`/`time.Now` polling loops in `e2e_test.go`, `v1ops_test.go:420-429`, `consumer_test.go:286-358` (60 s/30 s waits), `proto_test.go:411-426`. Daemon leaks are fixed (#182: `stop --all` cleanup, 60 s idle exit, guarded by `TestEnvCleanupStopsTheDaemonItStarted`, `e2e_test.go:2630`); `testsupport` still never removes its `mcpx-bin-*`/`mcpx-fake-*` temp dirs (`internal/testsupport/build.go:27,57`) |\n| `internal/config` | 66 | `config.layers` (merge/scope: `merge_test.go:42-157` are hand-picked layer stacks) | none seen |\n| `internal/mcpserver` | 45 | request shapes | `server_test.go:621-632` polls with 2 s deadlines and 20 ms sleeps |\n| `internal/codegen` | 42 | `codegen.jsonschema` (`codegen_test.go:16-50` is one schema per test) | none |\n| `internal/logging` | 35 | redaction inputs (`redact_test.go` table) | `file_test.go:45-138` build timestamps from `time.Now().Truncate(time.Hour)` -- check for hour/day-boundary sensitivity |\n| `internal/settings` | 28 | `settings.precedence` (`registry_test.go` already iterates the registry) | env reads |\n| `internal/launcher` | 25 | `launcher.template` (`define_test.go`, `template_test.go`) | none |\n| `internal/pool` | 21 | -- | `pool_test.go:423-424` sleeps 50 ms then `ReapIdle(time.Now())`: timing-dependent; `ReapIdle` already takes `now` as a parameter, so a fixed clock is a one-line change |\n| others (22 packages) | 264 | parsers: `openapi`, `searchpath`, `artifacts/name`, `diagnose` | `tasks_test.go:16` sleep, `elicit`, `mcpclient/modern_test.go` |\n\nTotals: 9 test files call `time.Sleep`, 14 call `time.Now`; at least 9 files use `[]struct` tables (37 match a looser table/range pattern); no `t.Parallel()` anywhere; network use is unix sockets and `httptest` (`daemon/routes_resolve_test.go`, `openapi`, `registry`), plus the stub registry in e2e after #65.\n\n## Plan (small steps; each a PR)\n\n1. **Inventory**: finish the table above for every package as a checklist in this issue (or `docs/testing/inventory.md` if #99 picks a docs home). Per test file: *generator candidate* / *hidden time* / *hidden randomness* (production code mints ids with `crypto/rand` in `pool`, `tasks`, `elicit`, `artifacts`, `mcpserver`, `logging/trace`, so outputs differ per run; flag any test that asserts on them) / *flake-prone* (sleep-then-assert) / *fine*. No rewrites in this step.\n2. **Seed helper + wrapper** (#121 option C): `internal/testsupport/seed` (`Rand(t, gen)`, failure reproduce line, CI fail-closed), the wrapper recipe, `.gitignore` for `.cache/test-seed/`. Unit-test the helper itself (derivation is stable: golden root/stream for a test-vector id).\n3. **Registry + first generator** (#123 option C, #124): `internal/testsupport/gen` with `Source`, `bytesSource`, golden-output guard, and **one** generator. Proposed first: `launcher.template` or `codegen.jsonschema` -- pure functions, fast, rich shapes. Plus its `Fuzz*` twin with a small seed corpus.\n4. **CI init job** (#121 section 7): mint + artifact + `MCPX_TEST_SEED` on the test step; coordinate the edit with #95 (who owns the workflow).\n5. **Policy text** handed to #99 (which owns where it lives and the per-bug-test policy): the rules below.\n6. Fix the two cheapest flake-prone spots found in step 1 (e.g. `pool_test.go:423` with a fixed `now`), as proof the inventory pays.\n\nDeferred to follow-ups: remaining generators from #124, the collector (#122), soak fuzzing (#95).\n\n## Proposed policy text (for #99 to place)\n\n- Every random input in a test comes from `seed.Rand(t, ...)`. No `math/rand` top-level functions, no `time.Now().UnixNano()` seeds, no `crypto/rand` for test data. (A guard test can `rg` for these in `_test.go`.)\n- Never hard-code a run seed. Test vectors inside generator golden tests are the only fixed keys.\n- Run tests through the wrapper; in CI a missing seed is a failure.\n- A failing seeded test is reported with its seed and reproduce command; do not re-run to green without recording the seed (#122 keeps failing seeds).\n- Changing a generator's output means bumping its version.\n- When a bug escapes, add the regression test and answer \"which generator could have caught this?\" (#124 escape loop).\n\n## Approaches\n\nNo real three-way choice: the user asked for one simple issue that executes the designs. The one judgement call is order -- **inventory first** (read-only, cheap, informs which generator goes first) vs **helper first** (unblocks everyone). Proposed: helper and inventory in parallel, since neither depends on the other; first generator after both.\n\n## Open questions\n\n- Inventory as an issue checklist (cheap, dies with the issue) or a committed doc (maintained, discoverable)? Defer to #99's decision on where testing docs live.\n- First generator: `launcher.template` (smallest) or `codegen.jsonschema` (highest yield, needs one `deno check`)?\n- Guard test banning unseeded randomness in `_test.go`: now, or once the first generators exist?\n\n## Ease · Impact · Related\n\n**Ease** S-M (inventory S, helper S, registry + first generator S-M) · **Impact** high (turns the design into something every later test uses)\n**Depends on / related:** #121, #122, #123, #124, #126; #99 (policy home, per-bug test, flake policy), #95 (CI init job), #52 (closed, fixed in #182; the leftover temp dirs are a #129 guard candidate), #65, #35.\n\nSecurity/auth deferred; see tracker.\n\n## Acceptance criteria\n\n- An inventory of the existing tests (735 at 05c78b2) is recorded: which become generators, which hide time/randomness/ports, and which are flake-prone.\n- The fuzz framework's first slice is landed via PR: the seed helper, the wrapper, and the first generator.\n- The fuzz policy text is written and handed to #99 (linked here).\n- The work described in the Summary/Scope above is delivered via a branch + PR (no direct push to main); verification runs in GitHub Actions CI, not on the sandbox.\n- Evidence (CI links and the inventory location) is recorded on this issue before it is closed.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:46:23Z","url":"https://github.com/developing-today/code/issues/1960"}
| 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:8733e6da-2dac-24bf-fcd4-bebcb5fc31cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B812:1CA0E6:1CEB34:270D55:6B061300 |
| html-safe-nonce | d8565028288c6cde498990a8ba44bbfa80d510b81571a41f68d50f8ed257993c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODEyOjFDQTBFNjoxQ0VCMzQ6MjcwRDU1OjZCMDYxMzAwIiwidmlzaXRvcl9pZCI6Ijc0MTIyMDI0MzMyMTQyODg2NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 483e61edc10e01c89bfaf318a0e4f3764b7907b7fce4f709f0c4b730112d595a |
| hovercard-subject-tag | issue:6088902520 |
| 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/1960/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9b2a84c17f73642b98d2065d74e8adb6acda72ba4f7b54f9492346e9ad3e2d57/developing-today/code/issues/1960 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9b2a84c17f73642b98d2065d74e8adb6acda72ba4f7b54f9492346e9ad3e2d57/developing-today/code/issues/1960 |
| og:image:alt | Relocated from dezren39/darwin-nix#125 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 referenc... |
| 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 | e58943f0186bb8d97b217393c2724a49ab47e4aefefc43595a90fa04699066c9 |
| 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 | 23517473abc6d5da019b4958bd421644e98a418b |
| 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