Commit Graph
4 Commits
Author SHA1 Message Date
Joseph Magly 2faab4b6bc feat(mcp): mount the runtime closure of non-FHS interpreters in the sandbox
Let the MCP worker sandbox run Nix/Guix interpreters by mounting exactly
the interpreter's resolved runtime closure, read-only (#521).

- obliteratus/mcp_runtime_layout.py resolves the closure only when the
  interpreter's loader isn't already mounted: the interpreter, its
  loader, stdlib lib-dynload modules and every shared object listed in
  installed distributions' RECORD files, following DT_NEEDED with
  glibc's search order (DT_RPATH chain, LD_LIBRARY_PATH, DT_RUNPATH,
  loader directory; $ORIGIN only).
- Each required /nix/store or /gnu/store path is mounted read-only at
  its original location; other libraries are mounted as single files.
  Never /, a store root, home, tmp, runtime dirs or the checkout;
  store names are validated and every mount stays fd-pinned.
- The sandbox and the supervisor receive only the LD_LIBRARY_PATH
  entries the closure actually used, never the ambient value; FHS hosts
  get none and their mount set is unchanged.
- Bounded parsing and resolution with precise fail-closed refusals; the
  #522 loader refusal still applies to anything unresolved.
- The bubblewrap boundary test now runs and passes under the Nix flake,
  and the worker-boundary and crash-window tests pass there again.
2026-11-17 12:59:21 -05:00
Joseph MaglyandClaude Opus 5.5 5e451b7a92 fix(mcp): fail closed on interpreters whose loader the sandbox can't mount
The MCP worker sandbox mounts interpreter libraries from standard (FHS)
locations only. A Nix-built interpreter's dynamic loader lives under
/nix/store, so bubblewrap failed with an opaque execvp error.

- New obliteratus/mcp_runtime_layout.py reads the interpreter's ELF
  PT_INTERP loader with a bounded program-header parse; malformed or
  non-ELF binaries fail closed.
- _runtime_paths refuses with "unsupported interpreter layout" when the
  loader isn't among the mounted paths; FHS and static interpreters are
  unchanged. runtime_layout_supported() reports the reason.
- The real bubblewrap boundary test skips with that reason on
  unsupported layouts, as it already does without bubblewrap; on FHS
  interpreters it still runs. Mount-construction and supervisor tests
  no longer depend on the host loader layout.
- Unit tests cover real and synthetic ELF loaders, static binaries,
  non-ELF and truncated input, refusal and acceptance.

Full non-FHS support (mounting the runtime closure) is tracked in #521.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:16:36 -05:00
Joseph Magly 7ac4830b01 fix(mcp): gate execution on working pidfds 2026-10-29 00:36:34 -04:00
Joseph Magly 002e6e56e1 feat: complete local readiness across UI, MCP and memory admission
Integrate bounded admission, UI ownership and controls, opt-in durable MCP execution, rank-local TP2 groundwork, regression hardening and operator guides. Physical larger-memory and two-host qualification remain separate.
2026-10-20 17:58:20 -04:00