GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx testing: injectable, seed-derived id/randomness sources for pool, tasks, elicit, artifacts, mcpserver, logging/trace · Issue #2640 · developing-today/code

mcpx testing: injectable, seed-derived id/randomness sources for pool, tasks, elicit, artifacts, mcpserver, logging/trace #2640

New issue
Copy link
New issue
Copy link
Closed
#4958
Closed
mcpx testing: injectable, seed-derived id/randomness sources for pool, tasks, elicit, artifacts, mcpserver, logging/trace#2640
#4958
Copy link
Assignees
dezren39
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)kind/testTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 30, 2026
Issue body actions

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/rand directly (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/mcpx go 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).

Activity

  1. dezren39
    added
    kind/testTest coverage, test infrastructure, or test-only fixes
    priority/lowNice to have; do when convenient
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    on Oct 30, 2026
  2. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  3. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (triage verdict)

    • Agent: queue worker (repo-worker-code), Lane A
    • Session / ID: task 7945 (triage)
    • Found via: queue claim (coverage pass 2026-11-03)
    • Task: triage mcpx testing: injectable, seed-derived id/randomness sources for pool, tasks, elicit, artifacts, mcpserver, logging/trace #2640 at current main — confirm still live, scope the fix, or close with evidence.

    Verdict: still live, exactly as filed. Fix enqueued as task 8034.

    • At origin/main 5bc74ff4622cf65948e9d96830534528bbe9f6e8 (verified fresh 2026-11-03), every named package still mints ids from crypto/rand directly, with no injectable seam:
      • pkgs/mcpx/internal/pool/pool.go:1871 rand.Read
      • pkgs/mcpx/internal/tasks/tasks.go:414 rand.Read
      • pkgs/mcpx/internal/elicit/elicit.go:362 rand.Read
      • pkgs/mcpx/internal/artifacts/artifacts.go:294 rand.Read
      • pkgs/mcpx/internal/mcpserver/server.go:2381 rand.Read; pkgs/mcpx/internal/mcpserver/state.go:39 and :84 rand.Read
      • pkgs/mcpx/internal/logging/trace.go:32 rand.Read
    • The seed side already exists test-side: pkgs/mcpx/internal/testsupport/gen landed 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 (merged c63e5af5), so the composition point for a seed-derived source is in place.
    • Dependency mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 (run-seed format/delivery) is still OPEN. Per this issue's own acceptance criteria that does not block the refactor: the injected source takes the seed as opaque bytes/string and must not hard-code a format.

    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 by pkgs/mcpx go test ./... in CI. This issue stays open as the tracker until task 8034's PR lands.

  4. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1 — state: scoped, parked for the next launch (task 8034, OpenChamber scheduled lane ec118cad)

    Verified at origin/main 115fe4f44. Issue is still open and the work is real: every named package mints ids straight from crypto/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)

    package site what is minted
    artifacts artifacts.go:292-295 NewID() 128-bit handle (ArtifactIDBytes), the artifact's whole access control until OAuth scopes
    tasks tasks.go:412-415 NewID() 16-byte task handle (tsk--style ids per the spec table)
    elicit elicit.go:359-363 NewID() 8 bytes
    logging trace.go:29-33 NewTraceID(prefix) 8 bytes + readable prefix
    mcpserver server.go:2379-2382 newSessionID() 16 bytes, sess- + 32 hex; falls back to literal sess-0 on rand failure
    mcpserver state.go:37-39 newStateSigner() 32-byte HMAC key
    mcpserver state.go:83-85 request-state 8-byte nonce
    pool pool.go:1869-1872 newTraceID(prefix) 8 bytes (duplicated from logging deliberately, "so the pool does not depend on the logging package")
    artifacts-adjacent cli/root.go:271, daemon/routes_proxy.go:303 raw 16-byte tokens, _, _ = rand.Read
    out of scope secrets/board.go:207 secret material — must stay crypto/rand, never seed-derived

    Shape that fits the acceptance criteria

    • One tiny interface, e.g. type RandSource interface { Read([]byte) (int, error) } (or io.Reader), plus a package-level default var randSource RandSource = rand.Reader. Each package takes it as an optional field/param with the crypto/rand default, so production behaviour and unguessability are unchanged.
    • Do not put the seed type in the interface: mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 has not landed, so the seed source must be an implementation that takes opaque []byte/string and expands it (e.g. SHA-256 in counter mode over a per-call label + counter), test-only.
    • Test that proves the criterion: two freshly constructed sources from the same seed produce identical ids for each package; and a production-default test asserts rand.Reader is what the default path reads (so nobody silently swaps the default in prod).
    • logging and pool both 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's sess-0 fallback 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/mcpx go test ./... in CI.

    Links: #2640 · #1949 · #1963 · #1956

  5. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 3, 2026
  6. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up (implementation)

    • Agent: queue worker (repo-worker-code), Lane C
    • Session / ID: task 8034 (small_fix)
    • Found via: queue claim (repo-health-code-pilot)

    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).

    • Revalidated fresh 2026-11-03: issue mcpx testing: injectable, seed-derived id/randomness sources for pool, tasks, elicit, artifacts, mcpserver, logging/trace #2640 OPEN, no hard-stop labels, no competing PR, branch queue/8034-2640-injectable-rand did not exist.
    • Worktree (laptop): ~/git/fleet/8034 at origin/main b96333243.
    • Out of scope stays out: secrets/board.go keeps direct crypto/rand.
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 3, 2026
  8. dezren39
    added a commit that references this issue on Nov 3, 2026

    Merge pull request #4958 from developing-today/queue/8034-2640-inject…

    a75abab
  9. dezren39
    closed this as completedin #4958on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (fixed, merged)

    • Agent: queue worker (repo-worker-code), Lane C
    • Session / ID: task 8034 (small_fix)
    • Found via: queue claim (repo-health-code-pilot)

    Implemented and merged: PR #4958, merge commit a75abab7b5b0785e485663caa38b247114c70c5a.

    • New internal/randsrc: Crypto (= crypto/rand, the production source) and Seeded(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.
    • Per-package RandSource vars (default randsrc.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.go deliberately untouched.
    • Tests: same seed → identical ids per package, different seed → different id, default-is-crypto/rand guards, failing-reader fallbacks for mcpserver/logging, signer-key reproducibility. Laptop: go test -count=1 green for all 9 touched packages; new tests also green under -race -shuffle=on -count=5.
    • Codex review hit its usage limit with zero inline findings — nothing to disposition. The line-limit check was still queued at merge; the change is verified per the standing merge criteria.
  11. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    task/triageQueue packet kind: verify, reproduce, and route this item
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  12. developing-today commented on Nov 3, 2026

    @developing-today
    developing-todayBot
    on Nov 3, 2026 – with developing.today
    Contributor
    More actions

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)kind/testTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.