GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — mcpx: accept a flake ref as a program and as an execution environment · Issue #1921 · developing-today/code Closed Labels effort/mMedium: expected under 1 day of workenhancementNew feature or requestepic/mcpx-platformReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/pr-shepherdQueue packet kind: shepherd an open PR or PR set to mergetask/triageQueue packet kind: verify, reproduce, and route this item Milestone DescriptionRelocated from dezren39/darwin-nix#107 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: #175 Cache: deferred to #187 (#181 collision 12). #187 owns the cache mechanism SummaryTwo related asks. First, accept a flake reference anywhere mcpx currently takes Original notes
Current statemcpx has several places that name a program to run, and all of them take a
There is no environment concept at all: mcpx is packaged with Nix and developed in a Nix flake repo, so the audience for Relevant Nix surface (all stable today):
ApproachesApproach A — least recommended: document that
|
| spec | meaning |
|---|---|
tool / /usr/bin/tool |
today's behaviour, exec.LookPath |
nix:github:owner/repo#tool |
resolve and run that flake output |
nix:.#tool |
the flake in the working directory |
nix:nixpkgs#ripgrep |
the registry |
Applied uniformly: MCP server command, adapters, script.interpreter, the
registry launcher table (so a nix package type joins npm/pypi/oci), and
mcpx api --spec's fetch. "Anywhere a binary/script/remote/api/etc can be used"
is then one resolver, not N features.
Part 2 — exec.env, the execution environment. A separate setting from the
interpreter, because they are separate questions: the interpreter is what runs
the script, the environment is what the script can see.
Naming: exec.env is a working name and should change before it ships.
script.env already exists and means environment variables for the script
(internal/settings/registry.go:254, --env KEY=VALUE); two settings whose
names differ only in exec. vs script. and mean different things is a trap.
Something like script.devshell or exec.environment says what it is.
| value | behaviour |
|---|---|
host (default) |
today — inherit PATH and the environment, unchanged |
flake:<ref> |
nix develop <ref> -c <runtime> <script> |
shell:<file> |
nix develop -f shell.nix -c … for a legacy file |
auto |
use flake.nix/shell.nix in the working directory if one exists, else host |
isolated |
an ad-hoc generated flake in a temp dir with only the declared packages — no host PATH leakage |
isolated is the interesting one and is what the note's "fully isolated" asks
for: mcpx writes a minimal flake naming exactly the runtime plus whatever the
dependency set declares, and the script runs with nothing else reachable. That
is a genuine capability nothing else in mcpx has — runner.Permissions is
honest that only Deno has a sandbox and that bun and node "run with the user's
own authority whatever is asked". A Nix-provided environment is not a sandbox,
but it is a reproducible and minimal one, and it is the first answer mcpx
could give to "what did this script actually have access to".
The note's "path executed before script, script executed inside" is the
devshell's own hook — shellHook runs on entry, before the command — which
nix develop -c already honours. Nothing new is needed for it; it should be
documented rather than reimplemented as another launcher phase.
Same caching argument applies: nix develop re-evaluates every time, so the
resolved environment should be captured once (nix print-dev-env --json, or a
built profile store path) and replayed as an env diff on subsequent runs, with
the flake lock as the cache key.
Part 3 — the honest cost table, which belongs in the comparison doc:
| environment | first run | subsequent | isolation | reproducible |
|---|---|---|---|---|
host |
0 | 0 | none | no |
flake: resolved+cached |
eval + possible build | ~0 | PATH-level | yes, pinned |
flake: naive (nix run each time) |
eval | eval | PATH-level | only if pinned |
isolated |
eval + build | ~0 | strongest available | yes |
docs/dependencies.md's rule is thatnix: specs should degradex86_64-linux vs aarch64-darwin).nix build on a cold cache can take minutes. A timeout, and--offline/nix.offline setting, are probably required before this cannix develop on a flake with --impure inputs, andshell.nix files that read the ambient environment, cannot be cached by lockexec.env compose with script.interpreter and with a shebang? Thenix develop … -c bash script.sh — but the shebang case needs the interpreter to exist inside thescript.runtime = "nix:nixpkgs#deno"), replacing the package.nix PATHnix-shell/shell.nix support means supporting the non-flake path too. Worthnix develop -f escape hatch?Ease L · Impact medium overall, high for this repository's own users —
mcpx is packaged and developed in Nix, and "the environment a script runs in" is
currently a fixed list chosen at build time.
Depends on / related: #187 (owns the cache mechanism, #181 collision 12),
#7 (launcher placeholders — the existing declaration-to-command-line machinery
this must not duplicate), #79 (startup cost, which naive nix run would
wreck), #78 (daemon cache correctness — the resolved-store-path cache is new
daemon state), #49 (CI), and siblings #106 (shebang/interpreter dispatch, where
exec.env composes), #103 (dependency configuration; "baked into binary"
overlaps with a Nix-vendored dependency set) and #101 (the comparison doc).
Security/auth deferred; see tracker.
History carried over from dezren39/darwin-nix#107 (verbatim, oldest first):
@dezren39 · 2026-09-30T07:21:45Z
Integration pass. Placed in the DAG rooted at #181.
d956689 to 9afedba #100 Bump build/buck/preludes/buck2-prelude from d956689 to 8740ce0 #101 Bump build/buck/preludes/buck2-prelude from d956689 to 062245a #103 Bump tracing from 0.1.38 to 0.1.40 in /sources/pavex/examples/skeleton #104 Bump h2 from 0.3.18 to 0.3.24 in /sources/pavex/examples/skeleton #105 Bump h2 from 0.3.19 to 0.3.24 in /sources/pavex/examples/realworld #106@dezren39 · 2026-09-30T07:28:25Z
Integration pass -- cross-theme collision. Surfaced only when the themes were put side by side; the authors of these issues could not see each other's work. Recorded at the root in #181.
#103, #104 and #107 each introduce a content-addressed cache, sized for node_modules trees and Nix closures -- orders of magnitude larger than what pruneWorkDirs/defaults.ExecWorkDirs was sized for. Without one design across the three, #78 gets a fourth instance of the same problem.
Also on: #103 #104 #78. Nobody currently owns this.
@dezren39 · 2026-09-30T11:06:01Z
Collision ownership (issues pass, 2026-09-30, at 05c78b2). #181 listed these cross-theme collisions with no owner. Each now has one:
| #181 row | Collision | Owner | What the owner decides |
|---|---|---|---|
| 12 | three new content-addressed caches (#103, #104, #107) | #187 (new) | One cache mechanism (layout, keys, byte/age eviction, leases, nix GC roots) under #175; the three issues own only what they put in it. |
Where this issue is the owner, the decision is made here; where it is not, it adopts the owner's decision rather than making its own.
@dezren39 · 2026-09-30T12:04:36Z
Issues pass (2026-09-30, at 05c78b2).
Parent: #175 and "Cache: deferred to Phase 4: joiner with missing pre-join control messages stalls silently #187" (Phase 3: sync, blob gate, and relays #181 collision 12). Part 1's resolved store paths and part 2's captured devshells become entries in Phase 4: joiner with missing pre-join control messages stalls silently #187's mechanism, and the caching text stays as input. Added the one fact Phase 4: joiner with missing pre-join control messages stalls silently #187 must own: a cached store path is immutable but can be garbage-collected, so each entry needs a nix GC root for as long as it lives.exec.env is too close to the shipped script.env (environment variables, --env KEY=VALUE, internal/settings/registry.go:254). Suggested script.devshell or exec.environment.internal/registry/registry.go:248-255) and the wrapper (package.nix:96-103). Added the container as a second fixed runtime set (Containerfile:66-80, bun + git; the git half may change with GIT's in-flight PR). Siblings are now listed by number.@dezren39 · 2026-10-28T21:49:56Z
Triage verdict (task 2140, repo-health-nix-pilot): RELOCATED — confirmed unimplemented feature; program-acceptance code moved to developing-today/code, cache facet stays with #187. No fix packet in this repo.
Verified against current main at 224c7b738e88c7a8e5d406987a7d88257e229db2:
enhancement, design — no hard-stop labels. Parent tracker fix(id): make Nix E2E check reproducible #175 is OPEN; the cache mechanism (including the nix GC roots that keep a resolved store path alive) is deferred to Phase 4: joiner with missing pre-join control messages stalls silently #187, also OPEN.mcpx accepting a flake ref as a program and as an execution environment — is implemented, if anywhere, in mcpx's CLI/runner program-resolution code. That code no longer lives in dezren39/nix: no pkgs/mcpx at HEAD (404); this repo's mcpx-nixbuild.yml states the source "lives only in developing-today/code now" (migration commit a03494f3090b there).pkgs/mcpx for flakeRef and for flake support in its environment docs return nothing.Route: no small_fix packet in dezren39/nix — this repo's only stake is the flake pin it builds, not program acceptance. The feature routes with the source in developing-today/code, referencing #107 and #187 (which owns what the resolution cache stores and its GC roots); per the cross-repo rule, do not re-file it there. #107 stays open on the nix side until implemented there or transferred.
🤖 Agent note · picked up
🤖 Agent note · triaged
Verdict: scope CONFIRMED against current pkgs/mcpx main; not a duplicate; Part 1 follow-up enqueued, Part 2 remainder stays tracked here.
Dedupe (searched all code issues: "mcpx flake ref", "mcpx devshell", "mcpx flake program environment", "nix resolver store path mcpx"): only #1921 itself plus distinct-scope items — #1908 (one content-addressed cache; owns the mechanism and the nix GC roots this feature must use, not the feature), #1983 (testing: environments as CI matrix entries — test infrastructure, not program acceptance), #1895 (the nix derivation's own man page/completions), and trackers #1889 / #1900. Nothing else accepts a flake ref as a program or an execution environment. No duplicate closure.
Scope confirmation at main c58507a3630e1a5a4935b3279a61c7fb59e3c65b (2026-10-29):
pkgs/mcpx returns 0 hits for flakeRef, print-out-paths, nix develop, and devshell — no flake acceptance and no environment concept exists, exactly as the issue states; runner.Run still spawns with the inherited environment.internal/registry/registry.go contains the package-type launcher map (uvx / dnx present) — the table a nix package type joins.internal/settings/registry.go:333 defines script.env as environment variables — the naming collision the issue warns about is live: the Part 2 setting must be script.devshell or exec.environment, never exec.env.Enqueued follow-up: task 3199 (small_fix, dedupe repo-health:v1:fix:developing-today/code:issue:1921) — Part 1 only: one program-spec resolver (plain spec = today's LookPath; nix:<ref>#<attr> resolves once via nix build --no-link --print-out-paths to a store path executed directly), wired into MCP server command and the registry launcher table, with explicit degradation (no nix / bad ref / timeout → error naming the spec, never a silent PATH fallback). Verification: go test ./... in pkgs/mcpx via CI, resolver tested against a stubbed nix binary.
Remainder (stays on this issue): Part 2 execution environments (flake: / shell: / auto / isolated, captured-env replay), the persistent resolution cache + GC roots (mechanism is #1908's), and adapter / script.interpreter wiring. The open questions (nix as dependency vs option, eval timeout/offline bounds, impure flakes, remote-exec resolution site) gate Part 2 and the cache, not the Part 1 resolver.
Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15188 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.
agent-note:v1
state: triaged
lane: code-d
task: 15188
issue: #1921
Triage verdict (2026-11-14, lane code-d, task 15188): REAL-AND-CURRENT, both parts now have merged-or-open PRs; the remainder is shepherding one open PR to merge. This replaces the defective prior packet (task 9168, blocked as packet_defect) with a coherent one.
Fresh state:
Triage decisions:
Disposition: labels synced (task/pr-shepherd, priority/normal, effort/m added; status:in-review kept — accurate while PR #8381 is open). A pr_shepherd follow-on packet is enqueued from task 15188; this triage completes as triaged naming it.
Merge pull request #8381 from developing-today/queue/14245-1921-devshell