Repository navigation
Closed
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)Package/app: mcpx (pkgs/ or apps/ in this repo)kind/testTest coverage, test infrastructure, or test-only fixesTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientNice to have; do when convenientqueue/queuedHas a queued task in the Supabase agent queueHas a queued task in the Supabase agent queuesource/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first lookNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Filed from #1963 (approach C, step 3) during its close-out — queue task 3259, 2026-10-30.
Summary
Make mcpx's id/randomness generation injectable and, in tests, derived from the run seed (#1949), so partial determinism composes with seeded inputs: the same seed reproduces the same ids.
Relationship to #1949 (checked during the #1963 close-out, not a duplicate)
- mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 decides the run seed's format (UUIDv7), derivation, and how it reaches every test process. It covers seeded test inputs.
- This issue covers the other side: production packages currently mint ids from
crypto/randdirectly (pool,tasks,elicit,artifacts,mcpserver,logging/trace— per mcpx testing: deterministic execution as a long-term aspiration (retrofit vs Rust rewrite) #1963's record at 05c78b2), so no seed can reproduce them. Until an injectable source exists, seeded inputs cannot compose with execution. - This issue therefore depends on mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949's seed format/delivery landing, but the injectable-source refactor itself is separable and can start with a test-only seed source.
Acceptance criteria
- Id/randomness generation in the named packages goes through an injectable source; production default remains
crypto/rand-backed (no behavior or security regression — ids stay unguessable in production). - A test demonstrates seed-derivation: two runs seeded identically produce identical ids from the injected source.
- Verification:
pkgs/mcpxgo test ./...passes via CI on the implementing PR. - If mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 has not landed yet, the seed source interface must not hard-code a seed format — it takes the seed as opaque bytes/string so mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949's decision drops in.
Parent record: #1963 (approach C). Depends on / related: #1949, #1956, #1896 (fuzzing tracker).
Metadata
Metadata
Assignees
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)Package/app: mcpx (pkgs/ or apps/ in this repo)kind/testTest coverage, test infrastructure, or test-only fixesTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientNice to have; do when convenientqueue/queuedHas a queued task in the Supabase agent queueHas a queued task in the Supabase agent queuesource/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first lookNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done (triage verdict)
Verdict: still live, exactly as filed. Fix enqueued as task 8034.
5bc74ff4622cf65948e9d96830534528bbe9f6e8(verified fresh 2026-11-03), every named package still mints ids fromcrypto/randdirectly, with no injectable seam:pkgs/mcpx/internal/pool/pool.go:1871rand.Readpkgs/mcpx/internal/tasks/tasks.go:414rand.Readpkgs/mcpx/internal/elicit/elicit.go:362rand.Readpkgs/mcpx/internal/artifacts/artifacts.go:294rand.Readpkgs/mcpx/internal/mcpserver/server.go:2381rand.Read;pkgs/mcpx/internal/mcpserver/state.go:39and:84rand.Readpkgs/mcpx/internal/logging/trace.go:32rand.Readpkgs/mcpx/internal/testsupport/genlanded via mcpx testing: choose the generator engine for one run-wide seed (native fuzz, testing/quick, rapid, hand-rolled) #1956 / PR feat(mcpx): testsupport/gen core (ChaCha8 streams) + FuzzStripJSONC proof target (#1956) #2636 (mergedc63e5af5), so the composition point for a seed-derived source is in place.Routing: follow-up task 8034 (small_fix, repo-health-code-pilot) carries the full scope: injectable source across the six areas, production default stays
crypto/rand-backed, plus the identical-seed → identical-ids test, verified bypkgs/mcpx go test ./...in CI. This issue stays open as the tracker until task 8034's PR lands.dezren39 commentedon Nov 3, 2026
agent-note:v1 — state: scoped, parked for the next launch (task 8034, OpenChamber scheduled lane ec118cad)
Verified at
origin/main115fe4f44. Issue is still open and the work is real: every named package mints ids straight fromcrypto/rand, so #1949's seed cannot reproduce them. Not implemented in this run — the run's remaining budget was ~10 minutes and a half-finished injectable-surface refactor across eight call sites is worse than a precise handoff. Queue task 8034 is parked with this note as the resume brief.Exact call sites (main
115fe4f44)artifactsartifacts.go:292-295NewID()ArtifactIDBytes), the artifact's whole access control until OAuth scopestaskstasks.go:412-415NewID()tsk--style ids per the spec table)elicitelicit.go:359-363NewID()loggingtrace.go:29-33NewTraceID(prefix)mcpserverserver.go:2379-2382newSessionID()sess-+ 32 hex; falls back to literalsess-0on rand failuremcpserverstate.go:37-39newStateSigner()mcpserverstate.go:83-85request-statepoolpool.go:1869-1872newTraceID(prefix)loggingdeliberately, "so the pool does not depend on the logging package")artifacts-adjacentcli/root.go:271,daemon/routes_proxy.go:303_, _ = rand.Readsecrets/board.go:207crypto/rand, never seed-derivedShape that fits the acceptance criteria
type RandSource interface { Read([]byte) (int, error) }(orio.Reader), plus a package-level defaultvar randSource RandSource = rand.Reader. Each package takes it as an optional field/param with thecrypto/randdefault, so production behaviour and unguessability are unchanged.[]byte/stringand expands it (e.g. SHA-256 in counter mode over a per-call label + counter), test-only.rand.Readeris what the default path reads (so nobody silently swaps the default in prod).loggingandpoolboth mint trace ids; make them use the same injected source where they already share the "kept here to avoid a dependency" rationale — or record why not.mcpserver'ssess-0fallback interacts with this: a deterministic test source never fails, so the fallback path needs its own injected failing reader test.Resume
Branch
queue/8034-2640-injectable-rand, worktree~/git/fleet/8034. Check #1949 first — if it has landed, take its seed format; if not, keep the seed opaque as above. Verify:pkgs/mcpxgo test ./...in CI.Links: #2640 · #1949 · #1963 · #1956
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up (implementation)
Implementing #2640 per the scoped resume brief on this issue (comment 6605630086): injectable randomness source across artifacts, tasks, elicit, logging, mcpserver, and pool, with the production default staying
crypto/rand-backed and a test-only opaque-seed source (#1949 is still open, so no seed format is hard-coded).queue/8034-2640-injectable-randdid not exist.~/git/fleet/8034at origin/mainb96333243.secrets/board.gokeeps directcrypto/rand.Merge pull request #4958 from developing-today/queue/8034-2640-inject…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done (fixed, merged)
Implemented and merged: PR #4958, merge commit
a75abab7b5b0785e485663caa38b247114c70c5a.internal/randsrc:Crypto(=crypto/rand, the production source) andSeeded(seed, label), a deterministic SHA-256 counter-mode source over an opaque seed — no seed format hard-coded, so mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 (still open) drops in when it lands.RandSourcevars (defaultrandsrc.Crypto) now feed all 10 minting sites:artifacts.NewID,tasks.NewID,elicit.NewID,logging.NewTraceID,pool.newTraceID,mcpserver.newSessionID/newStateSigner/ requestState nonce,daemon.randomHex,cli.InstanceID. Fallbacks unchanged (zero trace ids,sess-0, keyless signer →ErrNoStateKey).secrets/board.godeliberately untouched.crypto/randguards, failing-reader fallbacks formcpserver/logging, signer-key reproducibility. Laptop:go test -count=1green for all 9 touched packages; new tests also green under-race -shuffle=on -count=5.developing-today commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03