GeezerVison is showing github.com — mcpx testing: bug-shape generators -- registry, versioning, budget, first shapes · Issue #1958 · developing-today/code
mcpx testing: bug-shape generators -- registry, versioning, budget, first shapes #1958DescriptionRelocated from dezren39/darwin-nix#124 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: #93
Summary
Make generators the primary way mcpx is tested: many seeded variations per run, and every escaped bug becomes a generator for its shape, drawing from the same run seed and able to produce unlimited inputs of that shape. This issue designs the generator registry (naming, versioning, budget, the escape loop) and proposes the first six shapes from mcpx's real bug history. The engine is #123; the seed and derivation are #121.
Original notes
- testing
- 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.
- 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/ 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/<first 2 char>/<--symlink: seeds/yyyy/mm/dd/ avoiding conflicts is important.
- 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.
Context: what "a hack job of antithesis/tigerbeetle" means here
| System |
What it does |
What mcpx can borrow now |
| TigerBeetle VOPR |
Runs a whole cluster in one process with simulated time, network and disk, all driven by one PRNG seed; a failing seed replays the entire run bit-for-bit. Runs continuously on many cores. |
One seed per run, printed on failure; volume through many cheap runs; "the seed is the bug report". |
| FoundationDB simulation |
Same idea, built in from day one: all I/O and time behind interfaces, fault injection ("buggify") on seeded dice. |
Seeded fault injection at interface seams where they already exist. |
| Antithesis |
A deterministic hypervisor: runs unmodified containers deterministically, explores interleavings and faults, replays any finding. |
The goal state; not reachable by retrofit (see #126). |
The "hack job": mcpx gets the seeded, high-volume input generation half of this without the deterministic execution half. Consequence, stated plainly: a failing seed always reproduces the inputs and test order, but a failure caused by timing (goroutine scheduling, subprocess start, socket readiness) may need several tries under the same seed. Failures should say so.
Current state
Design
Registry
- Package
internal/testsupport/gen. A generator is {Name, Version, Origin, Draw func(Source, size) T}; registered in one table (gen.All) so guards can iterate it.
- Name:
<area>.<shape>, e.g. exec.flagset, config.layers, codegen.jsonschema, launcher.template, api.v1request, settings.precedence.
- Version: integer; bump on any change to output for the same stream. The substream key is
name@version (Update Rust crate sqlx to 0.8.0 [SECURITY] #121 section 2), so bumping one generator never moves another's inputs.
- Origin: the issue/PR/bug that motivated it (
#74). Makes the escape loop auditable.
- Old versions: kept while any stored seed (Update module golang.org/x/crypto to v0.52.0 [SECURITY] #122) references them, else deleted; or frozen into
gen/legacy_*.go. The golden-output guard (Update Rust crate sqlx to 0.8.0 [SECURITY] #121 section 3) runs over gen.All.
- Manifest hash of all
name@version entries goes into every stored seed record (Update module golang.org/x/crypto to v0.52.0 [SECURITY] #122).
The escape loop (bug found outside the generator system)
- Write the plain regression test (per-bug test policy: Bump unsafe-libyaml from 0.2.8 to 0.2.10 in /sources/pavex/examples/realworld #99).
- Classify the bug before building anything: generator, guard, environment axis, or none of these (with the reason recorded in
Origin or on the bug). Not every escaped bug has an input shape. Of the six on record, three do (Update Rust crate petgraph to 0.6.4 - autoclosed #74/Update Rust crate proc-macro2 to 1.0.81 - autoclosed #75, Bump build/buck/preludes/buck2-prelude from d956689 to f12c8d1 #102/Bump h2 from 0.3.19 to 0.3.24 in /sources/pavex/examples/realworld #106, Bump build/buck/preludes/buck2-prelude from d956689 to cb5dc60 #108). Update Rust crate axum to 0.6.20 #65 needs a hermeticity guard (Add omasnap upstream repository to flake inputs #129), fix(deps): update rust crate axum to 0.6.20 #35 needs an environment axis (Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /sources/chat #97), and the third-run flake is ordering or timing (-shuffle, Update Rust crate actix-files to v0.6.10 [SECURITY] #130; Update dependency @tailwindcss/typography to v0.5.20 #126). The addendum comment below has the table. A generator written for a bug no input can reach looks like coverage and is not.
- If it is a generator: ask which generator could have produced this input? If one exists and its alphabet/distribution missed it, bump its version and widen it. If none exists, create
<area>.<shape>@1 with Origin = the bug.
- Check the new generator finds the bug on the pre-fix commit within its CI budget (the red-first check). If it cannot, it is the wrong shape.
- The failing input from step 4, minimized, joins the native fuzz corpus or the regression test from step 1.
Budget per run
First shapes (from real history)
| Generator |
Target |
Property |
Origin |
Cost |
exec.flagset |
mcpx exec argv: random subsets/orders of flags from the TestEveryExecFlagChangesSomething table, --f=v vs --f v, inline vs file source |
each flag's marker appears iff the flag is present, in every combination (flags compose) |
#74/#75 |
e2e, small count |
config.layers |
random stacks of .mcpx.json layers (servers, disables, defaults, JSONC comments) through LoadFrom (internal/config/config.go:601) |
nearest wins per server; disabled is local; StripJSONC of comment-free JSON is identity (config.go:718); adding an unrelated far layer never changes a near value |
#5, #78 |
unit |
codegen.jsonschema |
random JSON Schemas (nesting, enums with hostile strings, nullable unions, $ref, keyword-named properties) through TypeFor/ArgsTypeFor (internal/codegen/ts.go:70,84) and ToolFuncName (ts.go:397) |
no panic; deterministic; output type-checks (batch all N outputs into one deno check per run); distinct tool names never collide |
codegen bugs to date |
unit + one runtime call |
launcher.template |
random templates with @placeholders, escapes, adjacency, through Expand/Used (internal/launcher/template.go:80,419) |
filling every Used placeholder never errors; no placeholder survives; text outside placeholders is preserved |
#7 |
unit |
api.v1request |
random bodies per op from the ops table (internal/api/ops*.go) / its OpenAPI |
no 5xx; responses validate against the declared schema; unknown fields rejected consistently |
extends TestEveryDeclaredRouteAnswersOverTheSocket |
e2e-lite (one daemon, many requests) |
settings.precedence |
random assignment of each registry setting (settings.Registry(), internal/settings/registry.go:13) across default/config/env/flag |
effective value = highest-precedence layer set; Validate/TypedValue agree; ParseBytes round-trips (value.go:415). This proves resolution only. Whether the resolved value changes behaviour is #129's guard (#181 collision 15); this generator can supply its non-default values |
settings registry |
unit |
Approaches
A -- sprinkle ad-hoc random loops into existing tests (least recommended)
Each test calls seed.Rand(t, "...") and invents its own inputs inline. Fast to start, but no registry means no versioning, no golden guard, no manifest in stored seeds, no reuse between a unit property and its native-fuzz target, and "make a different generator" has nowhere to live. Cross-commit replay silently breaks the first time someone edits a loop.
B -- generators per package, no central registry
Each package owns gen_test.go with its generators. Better locality; versioning by convention. But generators in _test.go files cannot be imported by e2e or other packages (config.layers is needed by both internal/config and internal/e2e), and a guard cannot enumerate them.
C -- central registry in internal/testsupport/gen, with Origin, versions, budget and the escape loop (recommended)
As designed above. It is the only option where "every escaped bug becomes a generator" is checkable (Origin + a guard that every bug-labelled fix since adoption has a regression test and, where cheap, a generator -- that audit is #99's), where versions are enforceable (golden guard), and where one generator feeds unit properties, e2e cases and native fuzz targets alike (#123).
Open questions
Ease · Impact · Related
Ease M (registry + guard S; each generator S-M; api.v1request M) · Impact high (the primary testing method per the notes)
Depends on / related: #121, #122, #123, #125 (lands the first one), #126; #74/#75, #5, #7, #78, #65, #35, #52 (closed, fixed in #182); #95 (budget), #99 (per-bug test and escape-loop policy), #129 (guards, for bugs with no input shape), #97 (e2e generators run in the environment matrix).
Security/auth deferred; see tracker. Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 History carried over from dezren39/darwin-nix#124 (verbatim, oldest first):
@dezren39 · 2026-09-30T06:44:05Z
Addendum from a second pass over the same slice (a duplicate fuzz worker ran concurrently; this issue got there first and is the one to keep). One correction to the escape loop, which otherwise over-promises.
Not every escaped bug has an input shape, and the policy should say so
The Origin field and the escape loop are the right design. But applied to the six escaped bugs on record (the list in Current state), two of them are not reachable by input generation at all — and a policy that does not say so produces generators that cannot catch the bug they were written for, which is worse than no generator because it looks like coverage.
| Escaped bug |
Found by |
Correct artifact |
| #74/#75 — flags accepted and silently ignored |
a human reading --help |
generator. exec.flagset generating non-default values for every declared flag; TestEveryExecFlagChangesSomething (internal/e2e/e2e_test.go:2743) is the hand-written special case |
| #102, #106 — a documented capability that does not exist |
a human trying it |
generator, drawn from the declared surface (the ops table internal/api/ops*.go, adapters) rather than a hand-written list — the TestEveryDeclaredRouteAnswersOverTheSocket (internal/e2e/v1ops_test.go:287) pattern |
| #108 — a wrong Node flag |
a human reading a flag |
generator. runtime invocations across script.runtime values, asserting each actually runs |
| #65 — a test reached the real internet |
CI only |
not a generator: a hermeticity guard. No input shape exists. The assertion is "no test opens a non-loopback socket" — a property of the test, not of its input |
| #35 — two tests passed on macOS, failed on Linux |
a Linux run |
not a generator: an environment axis (#97). The input was identical on both platforms; the environment was the variable |
| the flake found on the lead's third full run |
luck |
neither. Ordering is reachable by -shuffle (#121); timing is reachable by nothing here (#126) |
So the escape-loop rule should read, roughly: every escaped bug gets a regression test (#99), and then gets classified — generator, guard, environment axis, or "none of these, and here is why." Three of six get a generator. The other three get an artifact of a different kind, and recording that classification on the bug is what stops the same class escaping twice.
This makes the Origin field more valuable, not less: if Origin can record "guard, not generator — see #65" then the audit in the Open questions ("every bug-labelled fix since adoption has a regression test and, where cheap, a generator") has a well-defined answer for the cases where a generator is the wrong tool, instead of an unexplained gap.
Smaller note
The Context section's statement that a failing seed reproduces inputs and order but not timing is correct and is the single most important sentence in this tracker for setting expectations. Worth having the failure message itself print that caveat, not just the issue — it is the line someone reads at 2 a.m. when a same-seed replay passes.
@dezren39 · 2026-09-30T07:20:51Z
Integration pass. Placed in the DAG rooted at #181.
@dezren39 · 2026-09-30T12:03:26Z
Issues pass (2026-09-30, at 05c78b2).
dezren39 commented on Oct 29, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane C shift
- Session / ID: queue task 2858
- Found via: queue claim
- Task: Triage relocated mcpx bug-shape generator registry issue: dedupe, scope confirmation against current pkgs/mcpx main, enqueue implementation follow-up (split). No implementation in this task.
- Expectation: s — done = triage verdict posted, follow-up packet enqueued, labels truthful.
- Links: queue task 2858
dezren39 commented on Oct 29, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane C shift
- Session / ID: queue task 2858 (triage) → follow-up task 3256
- Found via: queue claim
- Task: Triage verdict for the relocated bug-shape generator registry issue (was mcpx testing: bug-shape generators -- registry, versioning, budget, first shapes dezren39/darwin-nix#124).
- Expectation: done = verdict posted, follow-up enqueued (split), labels truthful — all met.
- Links: follow-up queue task 3256 (small_fix, dedupe key repo-health:v1:fix:developing-today/code:issue:1958)
Triage verdict: CONFIRMED — Approach C registry; implementation SPLIT, core enqueued as task 3256
Dedupe (checked 2026-10-29): No duplicate. The registry is this issue alone: #1960 is fuzz-framework review/policy, #1971 is guard tests, #1956 is the engine the registry builds on, #1953 is the seed store that consumes the registry's manifest hash. None covers gen.All, versioning, or the budget knob.
Scope confirmed against current pkgs/mcpx main (fresh checks 2026-10-29):
Split (the issue's Ease M is really five pieces):
- Task 3256 (enqueued): registry core —
gen.All with {Name, Version, Origin, Draw}, name@version substream keys, sha256 manifest over name@version entries (feeds mcpx testing: seed store layout and collector (file per seed, artifact + scheduled collector) #1953's seed-record generators field), golden guard over gen.All, the MCPX_TEST_FUZZ=off|quick|ci|soak count-based budget knob — plus the first two unit-cost generators, config.layers and launcher.template, with their property tests. It builds on task 3251's testsupport/gen engine core (mcpx testing: choose the generator engine for one run-wide seed (native fuzz, testing/quick, rapid, hand-rolled) #1956) and names that sequencing in its packet.
- Remaining first shapes stay on this issue as follow-on splits:
exec.flagset (e2e, small count), codegen.jsonschema (unit + one deno check), api.v1request (e2e-lite), settings.precedence (unit) — to be enqueued as their own packets once the registry lands, not dropped.
- Open questions (escape-loop wording → mcpx testing: policies for agents -- what to run, a test per bug, guards per bug class #1909 family; nightly failing-seed replay; buggify scope; budget numbers → CI-budget family) are policy/budget decisions that do not block the registry core and stay recorded here.
This issue stays open as the tracking issue for task 3256 and the four remaining shapes. dezren39 commented on Oct 30, 2026 🤖 Agent note · picked up (prerequisite landed)
dezren39 commented on Oct 30, 2026 🤖 Agent note · parked (CI pending on new PR)
- Agent: queue worker (repo-worker-code), Lane B shift
- Session / ID: queue task 3256
- Found via: queue claim
- Task: Implemented and opened PR mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661 (head
c718a952): gen.All registry + manifest hash + MCPX_TEST_FUZZ budget knob + config.layers and launcher.template generators with property tests at budget counts and a golden guard over all registered generators. Laptop: gen/config/launcher tests pass, vet clean. Parked for CI on the PR (runner stall — only CodeRabbit has reported so far).
- Expectation: resume: check the Codex round on mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661 and disposition any findings, merge when CI is green, then complete 3256. mcpx testing: bug-shape generators -- registry, versioning, budget, first shapes #1958 stays open for the four remaining first shapes.
- Links: PR mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661
dezren39 commented on Oct 30, 2026
Agent note — done (queue task 3256, openchamber-scheduled-lane)
Registry core merged: PR #2661 (merge bdbcfd52, 2026-10-30T09:51Z) — gen.All + manifest + MCPX_TEST_FUZZ budget knob, first generators config.layers + launcher.template. Targeted tests re-verified at PR head by this lane: go test ./internal/testsupport/gen/ ./internal/config/ ./internal/launcher/ — all ok. Repo norm: no CI checks run on PRs (CodeRabbit skipped only, same as other merged PRs).
Follow-ups stay on this issue per the merge: the four remaining first shapes (exec.flagset, codegen.jsonschema, api.v1request, settings.precedence) PLUS the Codex P2 test-hermeticity fix (bound the loadStack fixture chain with a terminating paths.config; see the disposition reply on PR #2661).
Labels: this lane set none — existing status/queue/work labels left for the fleet monitor / follow-on claims. dezren39 commented on Oct 30, 2026 🤖 Agent note · done (resume verification)
- Agent: queue worker (repo-worker-code), Lane B shift
- Session / ID: queue task 3256
- Found via: queue claim — task was parked at awaiting_ci on PR mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661
- Task: Revalidated fresh on resume: PR mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661 is MERGED (merge commit bdbcfd5, 2026-10-30T09:51Z); mcpx testing: bug-shape generators -- registry, versioning, budget, first shapes #1958 is CLOSED. Prior lane already dispositioned the Codex P2 and recorded targeted tests passing at PR head (go test ./internal/testsupport/gen/ ./internal/config/ ./internal/launcher/). No new work needed — completing task 3256 as fixed_merged/already-done-on-resume and clearing stale queue/status/work labels.
- Links: PR mcpx: generator registry core — gen.All, manifest, budget, first generators (#1958) #2661
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|