oficina / equipo Public

Plan 2b (direct launch in bubblewrap) and the nesting check (Astra)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev d9dc6e592eb79c5739c41f76530807e0a4d3d12d parent c338d99
2 files changed, +595 −0
  • docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md +230 −0
  • docs/superpowers/specs/2026-11-03-bwrap-nesting.md +365 −0

CI failed — run details

diff --git a/docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md b/docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md
new file mode 100644
index 00000000..a622236e
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md
@@ -0,0 +1,230 @@
+# Equipo direct provider launching Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** Run the existing bug workflow through confined Claude Code and Codex processes, with durable accounting and verified cancellation, so Paul can enrol docs-t1 and try a bug fix.
+
+**Architecture:** The Go runner launches each provider directly in a bubblewrap PID, mount and network namespace. The runner owns stdout capture, journal, permission relay and namespace lifetime; its death ends active harnesses, and an interrupted turn waits for a person. The instance keeps authority, budgets, evidence and publication decisions.
+
+**Tech Stack:** Go 1.26.0 floor, gate toolchain go1.26.10, Rastrillo v0.30.1, existing SQLite/GORM/chi, bubblewrap 0.11.0, Claude Code 2.1.312, Codex CLI and code-mode host 0.165.0; Linux/amd64 runner on docs-t1.
+
+**Spec:** `docs/superpowers/specs/2026-11-01-equipo-design.md` §§6 and 9; `docs/superpowers/specs/2026-11-03-direct-cli-probe.md` (binding gap table); `docs/superpowers/specs/2026-11-03-bwrap-nesting.md`; `docs/superpowers/plans/CODEX-BRIEF-plan-2b.md`. Also read plan 2 and its R1/R1b/R2 rulings, the Paseo probe, and `amadan discuss show oficina/equipo 3`.
+
+## Global Constraints
+
+- Paul's 2026-11-03 decision supersedes Paseo orchestration, supervised trial, dedicated-user eligibility and the old Codex read-isolation exception. Everything else in plan 2 still applies. This is 11 implementation tasks, not a replacement of the already-built core.
+- Baseline: branch `plan-2b`, HEAD `c338d99`, brief atop runner `ce02b38`. This planning session changes only the plan and nesting report, with no product implementation, commits, pushes, deployment, helper agents or copy-review server.
+- Execution is off unless `EQUIPO_EXECUTION_ENABLED=1`. Keep `EQUIPO_ORIGIN`, `EQUIPO_INSTANCE_KEY`, SMTP/logged-mail rules and one activation database. `NewStore` grants no authority.
+- Derive `Actor` from the verified session, never a submitted form field. Check the current roster inside each write transaction. Removal and role changes must affect existing sessions immediately. Lookup errors deny access.
+- Never use `scope.Owned` or `scope.OwnedBy` for shared team records. Use the transaction handle throughout a transaction. Append the audit event there too, with no credentials in it. Never bind requests onto GORM models.
+- Keep migrations additive. App tables belong in `Models` and `Schema`; framework sessions, auth and proof tables belong only in `BootSchema`. Retain historical trial and unconfined evidence without permitting new work through either exception.
+- Connections belong to people; preserve opt-in, pinned account, same-runner two-family preflight and independent-family review. Unknown allowance/usage/outcomes remain unknown. No account or model failover.
+- Keep frozen base-fail/candidate-pass evidence, exact-candidate checks and independent review. The runner alone holds Amadan credentials. Never merge, push the default branch, or deploy autonomously.
+- App-owned runtime strings live only in `internal/equipo/copy.go`. Mark pending entries individually. Use plain words, no em dashes and no exclamation marks. Leave README prose unchanged. New implementation copy needs review before release; this plan specifies keys/meaning only.
+- Preserve day theme, sidebar, tokens, scriptless forms, phone navigation and byte-identical vendored assets. No authentication bypass.
+- Builds use `CGO_ENABLED=0`. Scratch stays on disk under `$TMPDIR`; leave Go caches at their defaults. No sudo. Stop owned processes and remove owned scratch. Ordinary CI never prompts a provider or writes to Amadan.
+- Each task runs red, implementation, green, then independently breaks every new guard to observe the named test fail and restores it. Record exact commands/results in `docs/superpowers/plans/CONTROLLER-REPORT-plan-2b.md`. Commit only the task's files with the supplied subject, under 80 characters. These commits are future implementation work.
+
+## Review Focus
+
+1. A process detaches, changes cgroup or addresses a host service: it stays within the attempt's lifetime and cannot reach host control sockets (Tasks 2–3).
+2. A home, symlink, managed config or resumed thread changes after preflight: no prompt uses stale identity or weaker policy (Tasks 4–6).
+3. The runner dies between intent, stdin write, stdout read and durable completion: no redispatch, fabricated completion or accounting reset (Task 7).
+4. A delayed permission answer arrives after revocation, or grants a broader sandbox: no renewed authority or hidden turn (Task 8).
+5. Amadan returns an empty, reordered, Unicode or changed description after a lost write reply: no false delivery or second push (Task 10).
+
+---
+
+## Evidence and boundaries
+
+Both providers nest successfully. Claude's enabled sandbox blocks the shell sentinel and native Read is denied separately. Codex app-server accepts `permissions:"probe"`, reports that active profile, exposes shell output and denies the sentinel. Keep both inner sandboxes; no replacement or owner acknowledgement is needed. Full deployed-policy certification, including native/image/MCP readers and aliases, remains a release gate. A failed certification makes the connection unavailable, not unconfined.
+
+The first Codex turn exposed a packaging requirement: mount the matching `codex-code-mode-host` beside `codex`. A text-only completed turn was not evidence of tool availability. The final successful turns used an outer private network namespace and a narrow HTTPS CONNECT relay. With a shared network namespace an owned host-loopback listener was reachable, so `--unshare-pid` alone is insufficient.
+
+The namespace confines untrusted model tools and repository commands; the enrolled runner, pinned provider harness, kernel and host account remain trusted. It does not isolate Equipo from a malicious peer already running under the host UID. The harness must read its selected login, while model-accessible tools must be denied that home. No broad host home, runtime directory, cgroup filesystem, host `/proc`, Docker socket or user bus is mounted.
+
+Codex app-server 0.165.0 does **not** accept `--ignore-user-config`. Use a private generated config home and inspect `config/read` plus thread policy. Use `--ignore-user-config` only on supported exec/command invocations; never invent an app-server flag. Claude uses `--setting-sources ''`, `--strict-mcp-config` and an exact settings file. These flags alone do not remove managed settings or instructions.
+
+## File structure and dependencies
+
+| Area | Files and responsibility |
+| --- | --- |
+| Provider contract | New `internal/runner/provider/{types,errors}.go`: neutral selection, process, session, event and policy types; no imports of runner, runnerproto or Paseo. |
+| Containment | New `internal/runner/containment/{linux,mounts,recovery}.go`: start handshake, PID descriptors, mounts and exit proofs; `internal/runnerproto/containment.go`: wire proof. |
+| Provider network | New `internal/runner/egress/{proxy,policy}.go`: private Unix CONNECT endpoint; namespace-side relay in `cmd/equipo-runner/namespace.go`. |
+| Account/policy | New `internal/runner/provider/{accounts,policy}.go`; existing `internal/runner/{connections,config}.go`: configured homes and effective manifest. |
+| Adapters | New `internal/runner/provider/claude/{launcher,events}.go` and `provider/codex/{launcher,rpc,events}.go`, sanitized `testdata/` and local tests. |
+| Durability/relay | Existing `internal/runner/{journal,events,usage,questions,tools,tool_socket,tool_journal}.go`; new `capture.go`, `direct_recovery.go` and `tool_proxy.go`. |
+| Workflow | Existing runtime, workflow, supervisor, workspace and checks packages; replace their Paseo/process-inspector dependencies. |
+| Instance/forge | Existing connection selection, report validation, team evidence and forge files; additive migration `0018_direct_launch.sql`; retain old evidence readers. |
+| Release/removal | Existing `internal/release/`, runner command, Make/CI, user unit, `scripts/live-gate.sh`, `docs/live-gate.md`; remove obsolete adapter and active trial paths. |
+
+Tasks 1–4 establish contracts and boundaries; 5–6 implement providers; 7–9 join durability, tools and workflow. Task 10 independently fixes publication. Task 11 switches eligibility and packaging after those gates pass. Tests live beside each new file, with a budget `TestMain` in every new package using the repository's existing pattern.
+
+### Task 1: Define the direct-launch contract and historical compatibility
+
+**Files:** Create `internal/runner/provider/{types,errors,types_test,budget_test}.go`; modify `internal/equipo/team/git_evidence.go`, `internal/runnerproto/{types,containment}.go`, `internal/release/manifest.go`; test `internal/equipo/team/direct_history_test.go`.
+
+**Interfaces:** Produce `provider.Selection{ConnectionID,Provider,Family,Model,AccountID string}`, `Binding{ID,Home,AccountID,Provider string}`, `Identity{AccountID,HomeID,ProviderVersion string}`, `Mount{Source,Target string; ReadOnly bool}`, `Policy{Hash string; Manifest json.RawMessage; Mounts []Mount; Env map[string]string; Settings,MCP json.RawMessage}`, `Launch{AttemptKey,Workspace,ResumeSessionID string; Selection Selection; Binding Binding; Policy Policy}`, `Session{ID,AttemptKey,Provider,AccountID,Model,Family string}`, `Turn{ID,AdmissionID,Prompt string}`, `Answer{RequestID,TurnID,Behavior string; Input json.RawMessage}` and `Event{SessionID,TurnID,RequestID,Kind string; Payload json.RawMessage}`. `Process` is an interface with `Stdin() io.WriteCloser`, `Stdout() io.ReadCloser`, `Stderr() io.ReadCloser`, `ID() string` and `Wait(context.Context) (Exit,error)`; `Exit{Code int; Signal int; ObservedAt time.Time}`. `ProcessHost.Start(context.Context,Launch,[]string) (Process,error)` owns the namespace.
+
+Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,error)`, `Open(context.Context,Launch) (Session,error)`, `Events(context.Context,Session) (<-chan Event,error)`, `StartTurn(context.Context,Session,Turn) error`, `Respond(context.Context,Session,Answer) error`, `Interrupt(context.Context,Session) error`, `Close(context.Context,Session) error`. `Open` sends no prompt; the workflow attaches `Events` before `StartTurn`. Declare the capture interfaces listed in Task 7 here so both adapters build independently. `Decode([]byte) ([]Event,error)` belongs to each provider adapter; raw stdout goes through Task 7 before its decoded events are consumed. Constructors take an explicit `ProcessHost` and capture factory defined in Task 7. Preserve core `team.Scope`, `Handle`, `Usage`, `TokenUsage` and action classifications.
+
+- [ ] **Write failing tests:** `TestDirectContractRejectsUnknownVersion` rejects unsupported versions/provider names; `TestDirectIdentitySeparatesSessionAndAttempt` distinguishes provider session from local attempt/turn; `TestHistoricalIsolationRemainsReadable` round-trips old `PaseoVersion`, trial and unconfined snapshots without granting new eligibility.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/provider ./internal/equipo/team -run 'TestDirect|TestHistoricalIsolation' -count=1`; expect missing types or failed assertions.
+- [ ] **Implement:** Add protocol version 2 for new runner requests/reports and direct tuple fields `LauncherVersion`, `BwrapVersion`, `PolicyVersion` to `team.IsolationTuple`, retaining `PaseoVersion` for history only. Direct tuple identity is provider/version, launcher revision, bubblewrap version, policy schema and effective policy hash. Do not change core schema version 7 for JSON-only extensions. Keep old runtime compiling until Task 9; do not alias new types to Paseo.
+- [ ] **Green and mutations:** Repeat the command; expect PASS. Bypass version/identity/history checks one at a time and record failures/restoration.
+- [ ] **Commit:** `git add` only the listed task files; `git commit -m 'feat: define direct provider contracts and historical decoding'`.
+
+### Task 2: Own each attempt through a kernel PID namespace
+
+**Files:** Create `internal/runner/containment/{linux,mounts,recovery,linux_test,budget_test}.go`; create `cmd/equipo-runner/namespace.go`; modify `internal/runnerproto/containment.go`; test `internal/runner/containment/recovery_test.go`.
+
+**Interfaces:** Consume Task 1 `Launch`, `Process`, `ProcessHost`. Produce `containment.New(Config) (*Manager,error)`, `Config{Binary,RunnerBinary,ScratchRoot string}`, `Manager.Start(context.Context,provider.Launch,[]string) (provider.Process,error)`, `Manager.Stop(context.Context,string) (Proof,error)`, `Manager.Recover(context.Context,Record) (Proof,error)`. `Record{ID,AttemptKey,BootID,NamespaceID,ManifestHash string; HostPID int; StartTicks uint64}` is durable startup identity. `Proof{Record Record; Exit provider.Exit; Verified bool}` binds an observed namespace exit. In runnerproto produce `NamespaceExit{ID,AttemptKey,BootID,NamespaceID,ManifestHash string; HostPID int; StartTicks uint64; ExitCode,Signal int; ObservedAt time.Time}` and `NamespaceContainmentProof{Version int; Scope team.Scope; Handle team.Handle; Namespaces []NamespaceExit; CheckedAt time.Time}`, without importing containment into runnerproto.
+
+- [ ] **Write failing tests:** `TestNamespaceKillsDetachedChildren` spawns `setsid`, double-fork and cgroup-migration children, opens exact PID descriptors and requires all exited after init dies; an unrelated control survives. `TestNamespaceHidesHostControl` denies host proc-root, cgroup, user bus/systemd, other homes and inherited sockets. `TestNamespaceParentDeath` kills the launcher and observes descendant death. `TestNamespaceRecoveryIdentity` covers PID reuse, changed boot, missing handshake and unavailable proof. `TestNamespaceMountEscape` rejects traversal, mutable symlink swap, broad home bind and workspace overlapping protected state.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/containment -run '^TestNamespace' -count=1`; expect failure before the launcher exists.
+- [ ] **Implement:** Use `--unshare-pid --die-with-parent --new-session --as-pid-1`, private mount/IPC/UTS/cgroup/network namespaces, fresh `/proc` and `/dev`, dropped capabilities and an empty environment with an allowlist. Namespace helper sets up the fixed relay and then `exec`s the pinned harness as PID 1. Keep nested user namespaces available for provider sandboxes. Mount only workspace writable, selected private provider runtime home, explicit read-only runtime files and private on-disk scratch. No host `/run`, `/sys` or `/tmp` bind. Mount `/etc` read-only with controlled replacements for provider-managed configuration; no arbitrary Unix sockets in workspace or account imports. Close all inherited FDs except the documented protocol/startup pipes. Journal launch identity through a parent/child readiness handshake before allowing prompts; startup failure kills and reaps the child.
+
+ Capture the host init identity via bubblewrap's status FD; hold a pidfd and use it for kill/wait. Stop kills namespace init, waits for kernel exit, then records proof. Do not treat CLI interrupt, an empty process group or an empty cgroup as proof. Recovery uses durable launch identity, parent-death lifecycle and exact-process validation; uncertain proof blocks reuse. It never scans unrelated same-user processes. Persist process-start intent before fork, then the init identity before releasing its readiness barrier. On recovery, an incomplete handshake cannot have sent a prompt; nevertheless finish parent-death cleanup before admitting work. For a same-boot orphan record, validate only that exact PID/start identity and reacquire its pidfd; never signal a reused PID. A new boot proves old processes gone, not their outcomes. Trusted helper teardown is part of Stop, with no success before all owned namespaces have exited.
+- [ ] **Green and mutations:** Repeat the command, require real Linux tests rather than skip-success. Remove PID isolation, expose bus/cgroup, substitute a reused PID or acknowledge before exit; each guard must fail.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: contain attempts in owned bubblewrap namespaces'`.
+
+### Task 3: Permit provider egress without exposing host services
+
+**Files:** Create `internal/runner/egress/{proxy,policy,proxy_test,budget_test}.go`; extend `cmd/equipo-runner/namespace.go` and containment mount tests.
+
+**Interfaces:** Produce `egress.Policy{Provider string; Hosts []string}`, `egress.Open(context.Context,string,Policy) (*Proxy,error)`, `Proxy.Close() error`, `Proxy.SocketPath() string`; consume Task 2 attempt lifetime. The in-namespace fixed relay accepts loopback only and connects to this one private Unix socket. It is a descendant of PID 1.
+
+- [ ] **Write failing tests:** `TestEgressRejectsHostServices` uses owned TCP and abstract-Unix controls: shared-net control reaches them, final launch cannot. Reject localhost, Tailscale/LAN/link-local addresses, metadata endpoints, numeric IPs, DNS rebinding, non-443 destinations and an unlisted domain. `TestEgressAllowsOnlyProviderTLS` tunnels a configured fixture and denies other methods, request smuggling and wildcard matches. `TestEgressDiesWithAttempt` leaves no relay/listener after stop; `TestEgressLimits` bounds concurrent sockets, request headers and idle tunnels.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/egress ./internal/runner/containment -run 'TestEgress|TestNamespaceHidesHostControl' -count=1`; expect failure.
+- [ ] **Implement:** Build the Go equivalent of the successful probe's narrow CONNECT path; no Python/socat production dependency. Start with observed Anthropic `api.anthropic.com` and OpenAI `chatgpt.com`; explicitly include provider login-refresh hosts only after a pinned contract test proves the need. Resolve and validate public addresses once per connection, then dial the validated address. Preserve TLS end to end. No host TCP listener; the namespace-local listener binds `127.0.0.1`. Hash the exact host policy. Limit headers to 8 KiB, concurrent tunnels to 16, connect timeout to 15 seconds and idle timeout to 60 seconds. Proxy failure stops the attempt. No network expansion through permission answers. Host fetch/publish remain separate credential-scoped runner operations.
+- [ ] **Green and mutations:** Repeat the command; expect PASS. Mutate network unsharing, exact hostname/public-address checks and close-on-stop independently.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: restrict provider egress outside the host network'`.
+
+### Task 4: Bind accounts and attest the constructed configuration
+
+**Files:** Create `internal/runner/provider/{accounts,policy,accounts_test,policy_test}.go`; modify `internal/runner/{config,connections}.go` and their tests; modify `internal/release/manifest.go`.
+
+**Interfaces:** Consume `Binding`, `Policy`, `Identity`. Produce `provider.BuildPolicy(Binding,PolicyInputs) (Policy,error)` and `provider.OpenAccount(context.Context,Binding) (*AccountLease,error)`, `AccountLease.Close() error`, `AccountLease.Identity() Identity`, `AccountLease.Validate(context.Context) error`. `PolicyInputs{RuntimeFiles []Mount; DeniedPaths []string; EgressHosts []string; ProviderVersion,LauncherVersion,BwrapVersion string; Settings,MCP json.RawMessage}`. Extend configured `AccountBinding` with expected account identity and explicit provider home; discovery calls only those bindings. Preserve stable `LocalID`/model ordering and person association.
+
+- [ ] **Write failing tests:** `TestAccountHomeBinding` selects only the configured home, refuses a second matching binding and verifies expected identity before first prompt. `TestAccountUnavailableDoesNotFailover` sends zero prompts on quota/auth/identity failures. `TestAccountHomeMutation` rejects symlink/credential generation changes and serializes attempts sharing a home. `TestEffectivePolicyHash` changes for any binary, settings, routing, MCP, managed-file, env or mount-policy change. `TestUnexpectedConfigLayer` rejects user/project/managed config or remote control appearing in readback. `TestPrivateHomeDoesNotTouchInteractiveConfig` verifies the original config hash and absence of trust-entry side effects there.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/provider ./internal/runner -run 'TestAccountHome|TestAccountUnavailable|TestEffectivePolicy|TestUnexpectedConfig|TestPrivateHome' -count=1`; expect failure.
+- [ ] **Implement:** Operator-configured provider homes are independent of Paseo discovery. Stage a private runtime home containing the selected login binding and required provider identity metadata, with runtime session storage owned by Equipo. Bind credential files without copying them into workspaces or journal; never expose a whole interactive home. Existing ZeroSub paths may be explicitly configured as credential sources, but shared history/settings/plugin symlinks are not imported. Use private dirs 0700 and files 0600; pin opened source identity against symlink replacement, and serialize sanctioned refresh/replacement with the account lease. Recheck identity/generation before every new turn and resume. If a read-only credential requires refresh, stop for account maintenance; never try another home.
+
+ Environment is constructed, not inherited: exclude provider/API routing keys, proxy settings, SSH/auth sockets, DBus, Paseo and parent-agent variables. Set only the selected provider home, trusted proxy and runtime paths. Credential-free manifest covers exact argv, nonsecret env, files and hashes, selected home identity, routing, inner policy, outer binds, proxy policy, disabled hooks/plugins and MCP executable/config. Do not store tokens or token hashes in the public tuple. Persist a concrete attempt-manifest hash as well as a policy hash. Policy hashing replaces only validated per-attempt workspace/scratch names with fixed roles; all account, protected-path and runtime inputs remain exact. This lets a pre-certified policy apply to fresh workspaces without letting a different home reuse its certificate.
+
+ Generate provider config at fixed namespace paths. Mask unmanaged `/etc/claude-code` and `/etc/codex` inputs, or explicitly include a required managed file and its digest in certification; never silently override an operator requirement. Hash provider instruction files separately from the isolation policy and reject additional settings sources. Claude auth status is CLI-observed identity metadata, not an independent provider cryptographic attestation. Require complete expected identity and a controlled credential generation; missing metadata denies dispatch. Codex additionally checks `account/read`, `config/read(includeLayers:true)` and start/resume policy. Unsupported or silently ignored settings fail policy validation and sentinel certification.
+- [ ] **Green and mutations:** Repeat tests; expect PASS. Swap the home after preflight, add inherited API key/config, change one manifest field and bypass the lock; observe failures.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: bind direct accounts and hash effective launch policy'`.
+
+### Task 5: Implement Claude headless sessions
+
+**Files:** Create `internal/runner/provider/claude/{launcher,events,launcher_test,events_test,budget_test}.go` and `testdata/` fixtures extracted from the probes.
+
+**Interfaces:** Consume Tasks 1–4 contracts; produce `claude.New(provider.ProcessHost,provider.CaptureFactory) (*Launcher,error)` implementing `provider.Launcher`, and `claude.Decode([]byte) ([]provider.Event,error)`. `CaptureFactory` is the Task 7 contract, declared in Task 1 before this task builds. `Open` observes identity and prepares a process; the first prompt is only written by `StartTurn` after admission.
+
+- [ ] **Write failing tests:** `TestClaudeLaunchPolicy` checks exact argv/env, sandbox enabled, `failIfUnavailable:true`, no unsandboxed retries, no excluded commands, native Read denies and strict MCP. `TestClaudeNoPromptBeforeAdmission` starts a fake CLI and observes zero user input before admission. `TestClaudeStreamEvents` retains session/tool/request IDs and handles rate-limit `is_error:true` with misleading `subtype:success`, non-JSON stderr, partial and oversized stdout. `TestClaudeResumeUsesSameBinding` retains session/account/policy and refuses an uncertain prior turn. `TestClaudeSandboxUnavailable` runs a no-prompt dependency failure control and requires refusal.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/provider/claude -run '^TestClaude' -count=1`; expect failure.
+- [ ] **Implement:** Pin 2.1.312 and its executable digest. Use `-p --verbose --input-format stream-json --output-format stream-json`, exact `--model`, `--setting-sources ''`, `--disable-slash-commands`, `--strict-mcp-config`, `--mcp-config`, `--settings`, `--permission-mode manual` and `--permission-prompt-tool mcp__equipo__permission`. Enable the inner sandbox proven by the nesting report and native denies for every protected path, including selected login, private tool/state paths and aliases. Validate stdin user envelopes against pinned CLI fixtures before live certification; do not put the initial prompt in argv. Disable updates with the pinned supported setting/environment (`DISABLE_AUTOUPDATER=1`). Retain `--resume` only for a durably finished session and a fresh admitted turn. For a fresh Claude session generate and journal a UUID, pass `--session-id`, and verify it in emitted records; resume uses the saved ID. Do not assume Claude emits init before receiving its first user envelope. Account status, configuration validation and durable capture must be ready first. No fallback model, arbitrary hooks/plugins or extra MCP servers. Interpret terminal error flags and process exit together; an interrupt acknowledgement never supplies containment proof.
+- [ ] **Green and mutations:** Repeat tests; expect PASS. Mutate strict settings, readiness, error interpretation and resumed identity independently. Real network prompting belongs only to Task 11's opt-in gate.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: launch Claude headless with pinned sandbox policy'`.
+
+### Task 6: Implement Codex app-server sessions and deny profiles
+
+**Files:** Create `internal/runner/provider/codex/{launcher,rpc,events,launcher_test,rpc_test,events_test,budget_test}.go` and sanitized `testdata/` from the installed generated JSON schema and probe.
+
+**Interfaces:** Consume the same contracts as Task 5; produce `codex.New(provider.ProcessHost,provider.CaptureFactory) (*Launcher,error)`, `codex.Decode([]byte) ([]provider.Event,error)` and `RPC.Call(context.Context,string,json.RawMessage) (json.RawMessage,error)`. Correlate client calls separately from server request IDs.
+
+- [ ] **Write failing tests:** `TestCodexAppServerPolicy` requires 0.165.0, matching code-mode host, account/config checks and `activePermissionProfile.id` on both start and resume. `TestCodexNoLegacyPolicyOverride` rejects legacy `sandbox`/`sandboxPolicy`, missing deny entries and `--ignore-user-config` on app-server. `TestCodexToolVisibility` observes command execution output inside a code-mode invocation, not just assistant text. `TestCodexRPCInterleaving` handles notifications between replies, numeric/string server IDs and EOF without losing frames. `TestCodexUnexpectedPolicyChange` contains before another turn when config/account/profile changes. `TestCodexUsageBeforeCompletion` retains totals across interleaved usage and completion.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/provider/codex -run '^TestCodex' -count=1`; expect failure.
+- [ ] **Implement:** Launch `codex app-server --listen stdio://` in the constructed home. Mount and hash both `codex` and adjacent `codex-code-mode-host`. Initialize with `experimentalApi:true`, then `initialized`, `account/read`, `config/read`, `thread/start` or `thread/resume`, then admitted `turn/start`. Use a named `permissions:"equipo"` profile with workspace write, explicit deny paths including the selected home, and tool network disabled; do not combine it with a legacy sandbox field. Compare the full constructed filesystem profile/readback, not just the lossy legacy `sandbox` summary returned by the server. Disable apps, multi-agent delegation, remote control and inherited MCP. Route approvals to `user`, never automatic reviewer agents. `turn/interrupt` is graceful cancellation only; Task 2 ends the namespace. Refuse a missing code-mode host before any spend. Support only protocol methods needed for the workflow, never a general pass-through RPC from model tools.
+- [ ] **Green and mutations:** Repeat tests; expect PASS. Remove code-mode host, drop deny profile, allow unknown config origin, or confuse request/reply IDs; require failures.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: drive Codex app-server with verified deny profiles'`.
+
+### Task 7: Journal stdout and recover without replaying work
+
+**Files:** Modify `internal/runner/{journal,events,usage,journal_reset}.go`; create `capture.go`, `direct_recovery.go`, `capture_test.go`, `direct_recovery_test.go`; modify instance `runner_events.go` and `internal/equipotest/runner_events_test.go`.
+
+**Interfaces:** Declare in Task 1 `Frame{Sequence int64; Bytes json.RawMessage}`, `Capture{Input io.WriteCloser; Frames <-chan Frame; Done <-chan error}` and `CaptureFactory.Open(context.Context,Process,Launch) (*Capture,error)`. The runner implementation `NewCaptureFactory(*Journal) provider.CaptureFactory` yields only durably recorded frames. The adapter routes RPC replies and applies its decoder; `Launcher.Events` yields normalized events for the existing event pump, which durably records projection before upload. Open capture immediately after process creation using the known attempt/launch identity, before provider session discovery; journal the resulting session binding once observed. No stdout reader may race the capture owner. Add `Journal.AppendFrame(ctx context.Context,attempt,stream string,seq int64,frame []byte) error`, `Journal.BeginTurn(ctx context.Context,session provider.Session,turn provider.Turn) error`, `Journal.RecoverDirect(context.Context) ([]Recovery,error)`; `Recovery{AttemptKey,SessionID,TurnID,State string; Usage *team.Usage}`. Adapt `UsageAccumulator.Observe(provider.Event) *team.Usage` with durable per-session baseline keyed by provider/version/session/turn.
+
+- [ ] **Write failing tests:** `TestDirectCrashBoundaries` crashes after committed intent, before/after stdin write, before/after frame commit, before upload and after server commit/before ACK; restart never sends the same prompt again. `TestDirectCompletionReplay` replays durable completed events exactly once with preserved accounting. `TestDirectInterruptedWaitsForPerson` retains unknown charge and invalidates pending answers. `TestDirectJournalFailureContains` covers ENOSPC, torn trailing frame, malformed/oversized JSON, blocked stdout and full 128 MiB pending outbox. `TestDirectUsageDeltas` checks Claude request-local tokens versus cumulative cost, Codex totals versus last model request, duplicate events, resume, counter reset, compaction, overflow and missing fields.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner ./internal/equipotest -run 'TestDirectCrash|TestDirectCompletion|TestDirectInterrupted|TestDirectJournal|TestDirectUsage' -count=1`; expect failure.
+- [ ] **Implement:** Upgrade the private journal from version 1 to version 2 with ordered migrations and reopen/upgrade tests. Give every captured frame a local monotonic sequence under a durable stream ID; a provider stream is not the upload cursor. Append bounded, schema-preserving redacted stdout before decoding/projection/upload; atomically record normalized events and accounting checkpoints. Keep provider stdout and diagnostics separate. Internal raw-frame limit is 1 MiB; existing instance events remain at most 16 KiB, splitting large tool output into ordered bounded chunks without truncating lifecycle or usage. Retain stderr at most 64 KiB. Reject overflow/protocol corruption and contain instead of silently dropping frames. Synchronous durable commit precedes acknowledgement or effects driven by the frame. The capture factory supplies the only writable provider stdin handle and enforces the durable turn barrier. Record dispatch intent and the single-use turn ID before stdin; stdin success is not completion.
+
+ Runner death kills its namespaces. On restart, replay the local journal and reconcile containment; a turn without durable completion waits for a person, never automatically launches a replacement or resumes mid-turn. Provider rollout/history files cannot invent missing completion or usage. Bytes emitted but not durably captured before a crash remain an explicit uncertainty. Completed sessions may continue only through a new user-authorized/admitted turn with the same binding and policy; retain provider session files outside disposable workspaces. A committed completion missing containment still needs containment before dependent work.
+
+ Claude result `usage` is the per-turn source; count input + cache-read + cache-creation once, output once. Derive display-only cumulative cost differences from a durable baseline, never sum `modelUsage`. Codex uses the last durable cumulative `total` at turn boundaries: the probe's 14,054/96 intermediate and 28,254/142 final input/output totals settle 28,254/142 once, not their sum and not final `last` 14,200/46. Resume baseline and known flags persist atomically. Counter regression/reset/compaction without a verified reconciliation remains unknown. Calls mean dispatched user turns; provider subrequests do not create additional subscription calls. Cancellation and late completion never erase historical cancellation or unknown charges.
+- [ ] **Green and mutations:** Repeat tests; expect PASS. Move fsync after consumption, reset baseline on restart, sum `last`/cumulative counters or resend uncertain stdin; require failures.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: journal provider streams and preserve uncertain turns'`.
+
+### Task 8: Relay scoped tools, permissions and questions
+
+**Files:** Modify `internal/runner/{questions,tools,tool_socket,tool_journal}.go`, both provider adapters and `cmd/equipo-runner/main.go`; create `internal/runner/tool_proxy.go`, `internal/runner/direct_tools_test.go`; extend `internal/equipotest/questions_test.go`.
+
+**Interfaces:** Consume `Launcher.Respond`/`Answer`, existing `ToolBinding` and `ServeTools`; produce `OpenToolProxy(context.Context,ToolBinding) (*ToolProxy,error)`, `ToolProxy.MCP() json.RawMessage`, `ToolProxy.Close() error`. Use an attempt-specific socket mounted at a fixed namespace path. Keep the authenticating broker and capability outside model-readable mounts; the fixed stdio helper has only its narrow per-attempt endpoint, never a runner bearer.
+
+- [ ] **Write failing tests:** `TestDirectToolScope` runs the real stdio helper with a fake provider and verifies typed reproduce/candidate/review/ask operations, no arbitrary host file read, publish or check attestation. `TestClaudePermissionResponse` preserves original tool request and merges only allowed question answers. `TestCodexApprovalResponse` correlates exact command/file/MCP IDs and denies sandbox/policy/rule amendments. `TestCodexAsyncQuestionAnswer` answers pinned async `agentMessage.questions` using `turn/steer` with exact `expectedTurnId`, and separately supports schema `item/tool/requestUserInput`. `TestDirectStaleAnswer` rejects cancel/restart/replaced-turn/revoked-member/replayed-changed-payload answers. `TestToolProxyCannotExposeSecrets` proves access to the proxy grants only current attempt verbs and returns no credentials.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner ./internal/equipotest ./internal/runner/provider/... -run 'TestDirectTool|TestClaudePermission|TestCodexApproval|TestCodexAsyncQuestion|TestDirectStaleAnswer|TestToolProxy' -count=1`; expect failure.
+- [ ] **Implement:** Preserve existing instance authority, lease/fence checks, durable question revisions and tool idempotency. Inject only the fixed per-attempt MCP server. Treat anything submitted through its mounted socket as hostile despite same UID; derive scope/session from the bound endpoint and revalidate each call. Claude permission hook returns allow/deny/updatedInput for the original request; AskUserQuestion retains its questions and adds validated answers. Codex approvals can authorize only actions within the certified outer/inner policy; decline escalation and permanent amendments. Question steering stays in the active turn; a completed-turn follow-up requires new admission. Unsupported request shapes remain pending or deny, never approve. Close proxy and invalidate capabilities on cancellation, lease loss and restart.
+- [ ] **Green and mutations:** Repeat command; expect PASS. Substitute ordinary prompt for Claude permission reply, wrong Codex expected turn, stale fence and permissive policy amendment independently.
+- [ ] **Commit:** `git add` task files; `git commit -m 'feat: relay direct provider tools and fenced answers'`.
+
+### Task 9: Wire local workspaces, checks and namespace recovery
+
+**Files:** Modify `internal/runner/{runtime,runtime_workflow,workflow,workflow_turn,supervisor,service,creation_recovery}.go`, `internal/runner/workspace/workspace.go`, `internal/runner/checks/{sandbox,executor,ownership}.go`, `internal/equipo/runner_report_validation.go`, `internal/runnerproto/containment.go`; add `internal/runner/direct_workflow_test.go`, `internal/runner/workspace/direct_test.go`, `internal/runner/checks/containment_test.go`.
+
+**Interfaces:** Replace `BugWorkflowConfig.Client` with the provider launcher registry and namespace manager; retain `Supervisor.Run(context.Context,RunClaim) error`, `Cancel` and `Recover` entry points with namespace proof results. Change `workspace.New(Config) (*Manager,error)` to local Git only, retaining `Prepare`, `Create`, `CaptureCandidate`, `ExportCandidate`, `CheckoutCandidate` and `ValidateTurn` signatures. `Workspace` retains local attempt ID and path; provider Session replaces Paseo agent identity. Checks consume the same namespace manager through their existing `CommandSandbox.Run` boundary.
+
+- [ ] **Write failing tests:** `TestDirectBugWorkflow` executes the fixed five-step graph with fake CLIs and real local Git/checks. `TestDirectWorkspaceIdentity` pins base/ref, rejects credential/config/hooks, preserves fresh attempt workspaces and immutable export. `TestDirectCancelWaitsForNamespaces` covers model, code-mode host, relay, MCP helper and detached check children, keeping capacity occupied until all proofs exist. `TestDirectRestartAndLeaseLoss` contains on runner death, wall-clock rollback/suspend, revoked membership and changed connection. `TestDirectContainmentReportBinding` rejects old inventory-only proof, missing namespace, wrong attempt/fence/manifest and forged Empty flags. `TestCheckNamespaceContainment` retains existing command-sandbox deny tests while stopping detached children reliably.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/... ./internal/equipotest -run 'TestDirectBug|TestDirectWorkspace|TestDirectCancel|TestDirectRestart|TestDirectContainment|TestCheckNamespace' -count=1`; expect failure.
+- [ ] **Implement:** Replace Paseo project/workspace creation with runner-owned `git worktree` operations on existing credential-free sources; retain retry identity and no-replacement-on-uncertainty. Review/checks consume immutable staged objects, not builder conversation. Bind only the attempt checkout; its Git metadata cannot point into unmounted private storage, so provide a credential-free per-attempt Git directory with validated objects/ref. Wrap check commands in their own owned bubblewrap namespace as well as the existing pinned Codex command deny sandbox. Mount the configured Go runtime and default cache paths needed by checks without inventing `/tmp` caches; preserve no-credential and denied-path tests.
+
+ Stop ends every registered namespace and trusted endpoint before workspace removal and `/contained`. A provider final message does not release capacity. Persist one proof per started namespace under the assignment and manifest; the instance validates against authenticated launch records, never trusts a tool-provided proof or `Empty:true`. Existing cleanup-token audience and unknown-charge rules remain. Replace all broad `/proc` coverage dependencies, including preparation/check baselines before a model attempt. Exact PID/start identity checks used to recover a recorded namespace are not global coverage sampling. Mid-turn crash enters the existing person-wait path with cancel available; it does not requeue or synthesize a successful receipt.
+- [ ] **Green and mutations:** Repeat command; expect PASS. Retain core authority/budget/evidence/recovery regressions. Mutate early capacity release, missed check namespace, fake proof binding and local Git hooks/metadata escape.
+- [ ] **Commit:** `git add` task files; `git commit -m 'refactor: run the bug workflow through direct namespaces'`.
+
+### Task 10: Connect Amadan description readback to publication
+
+**Files:** Modify `internal/runner/forge/{description,publisher}.go`, `internal/runner/runtime_workflow.go`; create `internal/runner/forge/description_transport.go`; extend `description_test.go`, `publisher_test.go` and `internal/equipotest/publish_test.go`.
+
+**Interfaces:** Preserve `forge.DescriptionTransport`. Add `DescriptionChannels{Description,Human,Summary,Notes string}`, `DescriptionContentHash(DescriptionChannels) string`, `NewDescriptionTransport(*http.Client,DescriptionWriter) DescriptionTransport`; `DescriptionWriter.Set(context.Context,Credential,Description) error` is the bounded credential-scoped installed Amadan write command. `ReadBranchDescription` remains the GET entry point. Accept an unqualified review ref at the transport boundary, qualify it exactly once for Git, and escape the entire branch name as one URL path segment.
+
+- [ ] **Write failing tests:** Replace `TestPlannedAmadanDescriptionReadback`'s wrong JSON-hash fixture with `TestAmadanDescriptionLengthHash`: hash the four verbatim UTF-8 channels in order, each prefixed by its unsigned 8-byte big-endian byte length. Pin literal expected hashes for empty channels, non-ASCII and embedded newlines; distinguish `ab|c` from `a|bc`. `TestAmadanDescriptionReadback` checks slash branch escaping, by/at/agent metadata, content tampering, malformed/oversized JSON, empty:true with 200, redirect, auth failure and timeout. `TestPublishDescriptionRecovery` verifies lost Set reply uses GET, no second push, and head-without-confirmed-description stays incomplete. `TestPublishTransportIsProduction` rejects the old unavailable placeholder in runtime wiring.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/forge ./internal/runner ./internal/equipotest -run 'TestAmadanDescription|TestPublishDescription|TestPublishTransport' -count=1`; expect the current JSON hash and unwired transport to fail.
+- [ ] **Implement:** Use the now-live GET `/api/v1/repos/{ns}/{repo}/branches/{name}/description`. The current implementation hashes JSON and wrongly requires a qualified ref while Publisher passes an unqualified one; fix both. Verify `by` matches the disclosed agent credential, retain `at` and optional structured `agent` metadata, and compare verbatim expected description text plus validated channel hash. `empty:true` means no description, not success. Keep 15-second timeout, 1 MiB response cap and no redirects/credential forwarding.
+
+ Use `BeforePush() == false`: describe after the exact review ref exists, since this brief supplies no pre-push write guarantee. Journal pending description before push, then write immediately and GET until confirmed within the existing reconciliation policy. A visible ref during this window is incomplete. Preserve candidate/head/ref/agent/evidence checks and compare the expected body digest separately from the API's four-channel content hash. Use the installed `amadan branch describe` contract with body on stdin/private file and credentials outside argv/logs. No `branch show` dependency: this machine's installed CLI lacks it even though the GET endpoint is live. No live publication is authorized by this planning task.
+- [ ] **Green and mutations:** Repeat command; expect PASS. Revert to JSON hashing, trim text, ignore agent/hash, accept empty, send twice after lost reply or skip readback; require failures.
+- [ ] **Commit:** `git add` task files; `git commit -m 'fix: verify Amadan descriptions through production readback'`.
+
+### Task 11: Remove trial gates and certify the direct release
+
+**Files:** Modify `internal/equipo/{connections,connection_selection,connection_isolation,connection_handlers,connection_views,runners,runner_report_validation,runner_rotation,supervised_trial,app,models,copy}.go`; `internal/equipo/templates/{runners,connections,task,task_card}.html`; `internal/equipo/team/{git_evidence,trial}.go`; `internal/runner/{config,connections,runtime,diagnostics}.go`; `cmd/equipo-runner/`; `internal/release/{manifest.go,manifest.json}`; `Makefile`, `.amadan/ci`, `.amadan/ci.d/`, `packaging/equipo-runner.service`, `scripts/live-gate.sh`, `docs/live-gate.md`. Create migration `internal/equipo/migrations/0018_direct_launch.sql`, update schema snapshot/models and add `internal/equipotest/direct_cutover_test.go`, `internal/runner/provider/live_test.go`.
+
+Delete active `internal/runner/paseo/`, `runner/paseo/` including Node tests/lockfiles, `internal/runner/dedicated_user.go`, `internal/runner/trial*.go`, `internal/equipo/trial_handlers.go` and active supervised-trial setters/routes. Replace obsolete `/proc` coverage tests and the `internal/runner/process_linux.go` gate implementation with Task 2 tests. Move `saveState`/`readStates` into `internal/runner/journal_state.go` before removal. Update `internal/runnerproto/{containment,ownership}.go` and every remaining import found by `rg -l 'internal/runner/paseo' --glob '*.go'` to neutral provider types; deletion requires zero remaining imports. Historical field names may remain only in explicit legacy readers/fixtures. Keep read-only historical trial/acknowledgement decoding, tables and rendering; remove their ability to authorize new work. Replace tests of removed behavior with explicit refusal/migration tests, retaining their authority assertions.
+
+**Interfaces:** Reports/claims use protocol v2 direct tuples and namespace proofs. `Config` adds `ClaudePath`, `CodexCodeModeHostPath`, `BwrapPath`; remove Node/Bridge/Paseo endpoint/home/server fields and dedicated-user requirement. `release.Manifest` version 2 carries exact provider/helper/bwrap digests, launcher/policy versions and certified tuples. `DirectLiveConfig` explicitly names disposable repository, account bindings, funding and sentinel paths; no discovery of arbitrary signed-in accounts.
+
+- [ ] **Write failing tests:** `TestDirectEligibilityRequiresCertifiedTuple` denies forged true/unlisted/stale reports for both providers with no acknowledgement bypass. `TestDirectCutoverPreservesHistory` upgrades through 0017→0018, invalidates old connection eligibility/consents and preserves trial/unconfined events, labels and charges. `TestDirectLegacyWorkCannotResume` fences old protocol/active attempts into person-wait pending containment. `TestDirectReleaseContract` proves no Node/Paseo/dedicated-user requirement and real direct constructors. `TestRunnerDirectEndToEnd` exercises enrolment, two families, questions, checks, publish, merge-owner wait, cancel and restart through real runner/HTTP instance plus fake CLIs/local forge; no duplicate publication. `TestDirectLiveGateRequiresExplicitInputs` refuses missing homes, budget, disposable target or sentinel configuration before prompting.
+- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/equipotest ./internal/runner/... ./internal/release ./cmd/equipo-runner -run 'TestDirectEligibility|TestDirectCutover|TestDirectLegacy|TestDirectRelease|TestRunnerDirectEndToEnd|TestDirectLiveGate' -count=1`; expect failure.
+- [ ] **Implement:** Migration invalidates active old reports/consents and pending selections; no destructive drop, relabel or automatic legacy reconciliation. Reject v1 execution on the new runner. Upgrade only after the prior runner has stopped and its legacy work has been reconciled; no automatic claim of containment for an old Paseo process. Stop exposing trial enable/acknowledgement actions. Keep old taint on historical evidence and prevent mixing it into a newly certified result. Fresh work requires both certified providers, including Codex; no unconfined owner path remains.
+
+ Update the instance build and runner manifest together with passing tuples. Revalidate before claim, open and every turn; changed effective policy/version/account invalidates eligibility and contains active work. `make runner-adapter-test` becomes Go direct-adapter/containment/command-sandbox tests, with no npm. Keep it under `make ci` and delegating `.amadan/ci*`. Package the Go namespace helper in the runner binary; provider binaries stay explicitly installed and version/digest checked. Keep existing outbound user unit without requiring a different OS user, sudo or a daemon. Rewrite live-gate draft for Paul's existing docs-t1 account and independently prepared provider homes. New UI/diagnostic keys go to copy.go and remain individually pending until reviewed; remove obsolete strings rather than silently approving replacements. README stays unchanged.
+- [ ] **Offline green and mutations:** Repeat targeted tests, then `CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner`, `make migration-check`, `make ci` once and `go test -race ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipotest ./internal/runner/...` once. Shipped builds remain CGO disabled; race tests may enable it. Exercise current browser/scriptless flows. Report mutation commands and restored guards; do not rerun full gates without a new reason.
+- [ ] **Opt-in certification:** Run `EQUIPO_LIVE_DIRECT=1 go test -tags direct_live ./internal/runner/provider -run '^TestDirectLive(Contract|Isolation|Recovery|Calibration)$' -count=1` only after explicit live-test authorization and bounded inputs. Require both providers' actual native/shell/search/image tools when exposed, selected-home and other-home sentinels, aliases including `/proc/*/root` and `/proc/*/fd`, workspace positive control, immutable settings, denied escalation, MCP authority, real questions/permissions and account/version readback. Missing tools are explicitly recorded; no untested read surface is certified. Exercise credential refresh failure, clean-session resume, intentional mid-turn runner kill, durable replay and no redispatch. Recheck absence of detached descendants and host services. Missing/failed assertions block the tuple; this short nesting probe is not a substitute.
+
+ Preserve plan 2's live usage calibration: per family measure complete input/output, reserve twice the maximum rounded up to 1,000 with overflow checks, fund at least 23 reservations per job and explicit project/team period headroom. Never increase Paul's configured limits silently. Use separate bounded calibration admission, record usage/unknowns, and retain no hard subscription-currency-cap claim.
+- [ ] **Commit and human gate:** `git add` reviewed task files only; `git commit -m 'feat: retire trial execution and certify direct provider releases'`. After reviewed copy and a clean reviewed branch, run existing `make release` and `make release-runner` to create versioned artifacts. Paul installs/enables the user service, enrols docs-t1, approves the machine, selects his prepared Claude/Codex connections, and runs the first bounded bug fix. He checks the evidence and exact Amadan review branch, tries active cancellation, and merges himself. No sudo, autonomous deployment, merge or default-branch push. Remove test scratch and stop all test processes; only the service Paul explicitly installs persists.
+
+## Self-review
+
+- **Spec coverage:** Design §§6.1/6.8/6.9 direct launch and accounts → 1–6, 9; §§6.2/6.5 publication → 10; §§6.3/6.4 evidence/checks → 9; §6.7 authority/budgets/recovery → 7–9, 11; §9 containment and live gate → 2–3, 11. Coordinators and other plan-2 exclusions stay out of scope. The brief overrides the superseded engine/user/trial rulings explicitly.
+- **Probe gaps:** Identity/no failover → 4–6; versions/effective policy → 1, 4–6, 11; durable events/usage/restart → 7; Amadan readback → 10; containment → 2–3, 9; Codex read isolation → 6, 11. Both inner sandboxes stay enabled. No owner decision is needed to retain an unconfined path.
+- **Step scan:** Each task has named failing tests, assertions, red/green commands, implementation boundaries, guard mutations and a short future commit. There are no product code bodies. New docs/copy are attached to their owning release task.
+- **Type consistency:** Provider types are dependency-neutral; capture contract is declared in 1 and implemented in 7; adapters consume it in 5–6. Namespace proof DTOs do not import runner code. Workspace/session/attempt/turn identities stay distinct. Old tuple fields are historical only.
+- **Review focus:** Each of the five conditions has explicit tests in its owning task. The network, code-mode-host, unsupported app-server flag, ref qualification and content-hash findings are incorporated.
+- **Proportion and verification:** Eleven reviewable tasks reuse the core, journal, check executor, tool broker and publisher. No new coordination service or general remote-control layer. This session ran the nesting controls and provider probes described in the companion report, checked file references and whitespace, and did not run product CI because product code is unchanged. Release certification remains future work.
+
+## Questions for Paul
+
+None for this plan. The chosen architecture and scope are already decided. Installing the reviewed release, enrolment and the first bug fix are Paul's live acceptance steps.
diff --git a/docs/superpowers/specs/2026-11-03-bwrap-nesting.md b/docs/superpowers/specs/2026-11-03-bwrap-nesting.md
new file mode 100644
index 00000000..291dfc58
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-03-bwrap-nesting.md
@@ -0,0 +1,365 @@
+# Bubblewrap nesting check for Equipo plan 2b
+
+Tested on docs-t1 on 2026-11-03. **Claude Code 2.1.312 and Codex app-server 0.165.0 both run with their inner read restrictions inside bubblewrap 0.11.0.** Keep both provider sandboxes enabled. The final successful runs also use a private network namespace, with provider HTTPS traffic carried through a restricted Unix-socket proxy. Sharing the host network failed the host-loopback isolation control.
+
+This establishes feasibility for the direct-launch plan. It is not the complete verified-tuple release gate: credential refresh, every native/image/MCP read surface, policy tampering, production crash accounting and live permission relay still need the tests in plan 2b. It does not justify treating an entire shared UID as isolated from malicious host peers.
+
+## Runs and scope
+
+Six prompted CLI invocations were attempted, using Haiku 4.5 and GPT-6-Luna at low effort. Five reached a model turn; the missing-bubblewrap control refused startup with zero turns and zero API duration. Status commands, schema generation and process controls sent no prompts. No helper/reviewer agents, Paseo operations, sign-ins, product changes, commits, pushes or copy-review server were used.
+
+| Invocation | Result |
+| --- | --- |
+| Claude 1, shared network | Native workspace Read succeeded; sentinel Read denied; the compound Bash command was refused before execution. Not shell-sandbox proof. |
+| Claude 2, shared network | A fixed read script ran in Claude's own sandbox. Workspace readable; sentinel absent; sandbox marker present. |
+| Codex 1, shared network | App-server initialized and completed a turn, but shell execution failed because the separately packaged code-mode host was not mounted. Not tool-isolation proof. |
+| Codex 2, private network | Matching code-mode host mounted; app-server profile observed; shell output visible and sentinel denied. |
+| Claude 3, private network | Native and shell workspace reads succeeded; native sentinel denied and shell sentinel absent. |
+| Claude dependency control, private network without API relay | Hide inner bwrap executable: process exited 1 before any model turn. |
+
+An earlier app-server **control connection**, before the first Codex turn, stalled because the temporary Python reader mixed buffered text reads with `select`. It was stopped without a prompt. A queue-backed reader fixed the test harness; this was not a provider protocol failure. The successful run's sent RPCs are retained below.
+
+## Mounts, identity and versions
+
+The scratch root was `/home/paulca/.cache/tmp/equipo-bwrap-juGSFQ`, under the on-disk `$TMPDIR`. The throwaway workspace was not this project. Two private scratch runtime homes were mounted separately at `/home/runner/.claude` and `/home/runner/.codex`. Only the selected credential file was bind-mounted read-only from its source; credentials were neither printed nor copied. Claude's nonsecret `oauthAccount` metadata was staged from the selected home's `.claude.json` to permit its identity-status check. No shared settings/history/plugin symlinks were imported.
+
+Sources were `/home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json` and `/home/paulca/.codex/auth.json`. Reading the explicitly named Claude source does not involve Paseo. The two known exhausted Claude homes were not tried again. No failover occurred.
+
+```text
+$ hostname
+DOCS-T1
+$ bwrap --version
+bubblewrap 0.11.0
+$ claude --version
+2.1.312 (Claude Code)
+$ codex --version
+codex-cli 0.165.0
+```
+
+CLI-observed identities, before prompting:
+
+```json
+{"provider":"claude","loggedIn":true,"authMethod":"claude.ai","configDirectory":"/home/runner/.claude","email":"paul@rslw.com","subscriptionType":"max"}
+{"provider":"codex","account":{"type":"chatgpt","email":"paul@tito.io","planType":"promax"},"backendOrigin":"https://chatgpt.com","accountRoutingOverride":"NO_CONSTRAINT"}
+```
+
+Claude initially reported null email when only the credential file was mounted. After staging the matching identity metadata, `claude auth status --json` reported the email above. That status is local CLI account metadata, not a separately verified remote identity assertion. Codex `account/read` returned its account and routing. Production must lock the selected binding and reject missing/mismatched identity or changed credential generations.
+
+The only visible home in each non-model mount control was `runner`; its contents were just the selected `.claude` or `.codex`. A marker written there appeared in the corresponding scratch home on the host. `/home/paulca` remained absent. The host sentinel remained `equipo-outside-nonsecret` after both providers' denied reads. The credential sources were mounted read-only; all runtime writes stayed in scratch. `/etc` was read-only; `/etc/claude-code/CLAUDE.md` was present, but no managed settings JSON was found and `/etc/codex` was absent. This probe did not establish config exclusion merely by omitting the user home. Plan 2b controls and hashes managed files explicitly.
+
+Binary SHA-256 observations:
+
+```text
+bwrap 0dfa36b98ada69568aaaa741fe210d2150a1441433bd13c428137d6a972a959c
+claude 4f4178ce41d83e23341ebfbaecdbcf8ea6bf7baea0690025abe49eeec3a5d01d
+codex c06a67fd8ac76508dc78bd99ce20c9f317b8d568beda59485f3f4134df9962d5
+codex-code-mode-host 522935d4392ec9674fab60b239b5495992c6a93e4deb65113a216b6f5451ccd4
+```
+
+## Read-denial evidence
+
+Claude's supplied settings were:
+
+```json
+{"disableAllHooks": true, "enabledPlugins": {}, "sandbox": {"enabled": true, "failIfUnavailable": true, "allowUnsandboxedCommands": false, "autoAllowBashIfSandboxed": true, "filesystem": {"denyRead": ["/outside", "/home/runner/.claude", "/home/runner/.codex"]}}, "permissions": {"deny": ["Read(//outside/**)", "Read(//home/runner/.claude/**)", "Read(//home/runner/.codex/**)"], "allow": ["Read", "Bash"]}}
+```
+
+The final Claude turn returned these actual tool results, not only the assistant's conclusion:
+
+```text
+Read /workspace/inside.txt:
+1 equipo-inside-readable
+2
+Read /outside/sentinel.txt:
+<tool_use_error>File is in a directory that is denied by your permission settings.</tool_use_error>
+Bash python3 /control/read.py:
+/workspace/inside.txt: equipo-inside-readable
+/outside/sentinel.txt: [Errno 2] No such file or directory: '/outside/sentinel.txt'
+/proc/1/comm: 3
+sandbox_marker 1
+```
+
+The `3` comm value comes from Claude's inner namespace; it is not a host PID. The outer invocation used `--as-pid-1`. Claude completed with `is_error:false`, exit 0, session `024280d2-bf63-4699-a3f8-ad6cd49027ea`.
+
+The dependency control, with `/dev/null` mounted over the inner `/usr/bin/bwrap`, returned:
+
+```text
+exit 1
+result.subtype = error_during_execution
+result.is_error = true
+result.num_turns = 0
+result.duration_api_ms = 0
+result.total_cost_usd = 0
+Sandbox required but unavailable: sandbox is enabled but dependencies are missing: bubblewrap (bwrap) not installed
+```
+
+Codex's observed thread policy included:
+
+```json
+{"model":"gpt-6-luna","modelProvider":"openai","approvalPolicy":"never","approvalsReviewer":"user","activePermissionProfile":{"id":"probe","extends":null},"runtimeWorkspaceRoots":["/workspace"]}
+```
+
+`config/read(includeLayers:true)` retained the exact configured profile. The server's legacy sandbox summary was `workspaceWrite` with network disabled; that summary alone does not represent deny entries. The app-server command item proved they took effect:
+
+```text
+item.type = commandExecution
+item.status = completed
+item.aggregatedOutput =
+ equipo-inside-readable
+ cat: /outside/sentinel.txt: Permission denied
+ namespace-init=codex
+item.exitCode = 0
+turn.status = completed
+```
+
+Exit 0 came from the final `cat /proc/1/comm`; the earlier denied `cat` is established by its output. Do not infer every command succeeded from the compound command's exit. Thread: `01a1a062-6ef2-7920-a32c-6e934356bb4b`; turn: `01a1a062-6f5d-7b53-95aa-95047f82baf3`.
+
+Codex emitted cumulative input/output totals 14,054/96, then 28,254/142. Final `last` was 14,200/46, only the final model request. This corroborates the prior probe's requirement to journal per-session totals and derive per-turn deltas.
+
+## Lifetime and escape controls
+
+A non-model Python command ran as namespace init under the same outer containment flags, with private network enabled. It started a detached `setsid sleep 600`, a double-forked sleeper and a child that attempted a cgroup migration. The observer took the host init PID from bubblewrap's JSON status FD, opened PID descriptors for the exact namespace members, killed the init through its PID descriptor and polled those descriptors for exit. Namespace membership enumeration was test instrumentation, not the proposed production containment gate.
+
+```text
+init 1
+/run/user/1001/bus False
+/run/user/1001/systemd/private False
+/home/paulca False
+.ssh False
+/proc/1/root/home/paulca False
+/sys/fs/cgroup False
+homes ['runner']
+namespace pid:[4026532762]
+members [(2083869, 'python3'), (2083903, 'sleep'), (2083905, 'python3'),
+ (2083906, 'python3'), (2083908, 'python3')]
+migration attempt: [Errno 2] No such file or directory: '/sys/fs/cgroup/cgroup.procs'
+bwrap exit 137 all pidfds exited True count 5
+```
+
+The exact host observation and kill code, after the recorded control launch, was:
+
+```python
+stat=[json.loads(l) for l in (P/'control-status.json').read_text().splitlines()];init=stat[0]['child-pid']
+ns=os.readlink('/proc/'+str(init)+'/ns/pid'); members=[];fds=[]
+for path in pathlib.Path('/proc').glob('[0-9]*'):
+ try:
+ if os.readlink(path/'ns/pid')==ns:
+ pid=int(path.name);fds.append(os.pidfd_open(pid));members.append((pid,(path/'comm').read_text().strip()))
+ except OSError:pass
+print('namespace',ns,'members',members,flush=True)
+print('migration attempt:',(P/'repo/cgroup.txt').read_text(),flush=True)
+signal.pidfd_send_signal(fds[[x[0] for x in members].index(init)],signal.SIGKILL)
+p.wait(10)
+poll=select.poll()
+for fd in fds:poll.register(fd,select.POLLIN)
+ready=set();deadline=time.time()+5
+while len(ready)<len(fds) and time.time()<deadline:ready.update(fd for fd,ev in poll.poll(100))
+print('bwrap exit',p.returncode,'all pidfds exited',len(ready)==len(fds),'count',len(ready),flush=True)
+for fd in fds:os.close(fd)
+```
+
+The migration was refused because no cgroup filesystem was exposed. The process that attempted it was still present before the kill and was included in the exit checks. This test did not move a process into another user's cgroup. Detached descendants were terminated even when reparented to namespace init; no process-group assumption was used. Some observed members were already zombies; readable PID descriptors establish exit, not necessarily that the host has reaped every zombie immediately.
+
+For network reachability, the host controller bound its own temporary listener to `127.0.0.1` on an ephemeral port and ran `socket.connect_ex` inside each configuration:
+
+```text
+network-shared exit 0
+network-shared 0
+network-private exit 0
+network-private 111
+```
+
+`0` means reachable; `111` is connection refused. The final provider launches therefore added `--unshare-net`. A fixed socat process inside the namespace bound only its private `127.0.0.1:18080` and forwarded to an explicitly mounted Unix socket. The host-side CONNECT proxy allowed only exact named public provider destinations on port 443. Successful Codex traffic used `chatgpt.com`; successful Claude traffic used `api.anthropic.com`. Claude's optional `http-intake.logs.us5.datadoghq.com` connection was denied and the turn still completed.
+
+The tested proxy allowlist also contained `claude.ai`, `platform.claude.com`, `api.openai.com` and `auth.openai.com`; those were not needed in the successful turns. Plan 2b starts from the observed minimum and separately tests refresh needs. The probe proxy is a disposable feasibility helper, not production code: its full limits, concurrent cleanup, abstract-socket controls and malicious CONNECT parsing need the plan's tests. No claim of universal network non-reachability is made: the named provider endpoints are deliberately reachable. Host service sockets/paths were absent and the owned host-loopback control was unreachable.
+
+## Commands and helper inputs
+
+The following are the recorded argument arrays rendered with shell quoting. All stdout and stderr were captured separately under the scratch root. Private-network runs started `proxy.start(P/'egress/proxy.sock')` in the controller before launch and called `shutdown()`/`server_close()` afterward. The proxy helper and namespace helpers are included below so the bind targets and commands are inspectable after scratch cleanup.
+
+The temporary directories were `repo`, `outside`, `claude-home`, `codex-home`, `tmp`, `control` and `egress`. `repo/inside.txt` held `equipo-inside-readable`; `outside/sentinel.txt` held `equipo-outside-nonsecret`. `codex-home/config.toml` was empty. `empty.json` contained `{"mcpServers":{}}`. Claude's staged `.claude.json` contained only the source `oauthAccount` object and `hasCompletedOnboarding:true`.
+
+### claude-identity
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json /opt/claude auth status --json
+```
+
+### codex-identity
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex /opt/codex --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/codex-home /home/runner/.codex --ro-bind /home/paulca/.codex/auth.json /home/runner/.codex/auth.json --setenv CODEX_HOME /home/runner/.codex /opt/codex login status
+```
+
+### claude-turn
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json /opt/claude -p --verbose --output-format stream-json --model claude-haiku-4-5 --effort low --setting-sources '' --disable-slash-commands --strict-mcp-config --mcp-config /config/mcp.json --tools Read,Bash --settings /config/claude.json 'Do only these checks, no skills or agents. Use Read on /workspace/inside.txt then /outside/sentinel.txt. Then use Bash exactly once: cat /workspace/inside.txt; cat /outside/sentinel.txt; printf "namespace-init="; cat /proc/1/comm . End the command at comm without the dot. Report actual results briefly. Do not bypass any denial.'
+```
+
+### claude-shell
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json /opt/claude -p --verbose --debug-file /tmp/claude-debug.txt --output-format stream-json --model claude-haiku-4-5 --effort low --setting-sources '' --disable-slash-commands --strict-mcp-config --mcp-config /config/mcp.json --tools Bash --settings /config/claude.json 'Run Bash exactly once: python3 /control/read.py . End at .py without the final dot. This is a disposable read-isolation check. No skills or agents, no other actions, do not bypass a denial. Report tool output.'
+```
+
+### codex-app
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex /opt/codex --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/codex-home /home/runner/.codex --ro-bind /home/paulca/.codex/auth.json /home/runner/.codex/auth.json --setenv CODEX_HOME /home/runner/.codex /opt/codex app-server --listen stdio:// -c 'model="gpt-6-luna"' -c 'model_reasoning_effort="low"' -c features.apps=false -c features.multi_agent=false -c 'approval_policy="never"' -c 'default_permissions="probe"' -c 'permissions.probe.filesystem={":root"="read","/workspace"="write","/outside"="deny","/home/runner/.codex"="deny"}' -c permissions.probe.network.enabled=false
+```
+
+### codex-private
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/egress /egress --setenv HTTPS_PROXY http://127.0.0.1:18080 --setenv HTTP_PROXY http://127.0.0.1:18080 --setenv https_proxy http://127.0.0.1:18080 --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex /opt/codex --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex-code-mode-host /opt/codex-code-mode-host --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/codex-home /home/runner/.codex --ro-bind /home/paulca/.codex/auth.json /home/runner/.codex/auth.json --setenv CODEX_HOME /home/runner/.codex /usr/bin/python3 /control/exec_proxy.py /opt/codex app-server --listen stdio:// -c 'model="gpt-6-luna"' -c 'model_reasoning_effort="low"' -c features.apps=false -c features.multi_agent=false -c 'approval_policy="never"' -c 'default_permissions="probe"' -c 'permissions.probe.filesystem={":root"="read","/workspace"="write","/outside"="deny","/home/runner/.codex"="deny"}' -c permissions.probe.network.enabled=false
+```
+
+### claude-private
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/egress /egress --setenv HTTPS_PROXY http://127.0.0.1:18080 --setenv HTTP_PROXY http://127.0.0.1:18080 --setenv https_proxy http://127.0.0.1:18080 --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json /usr/bin/python3 /control/exec_proxy.py /opt/claude -p --verbose --output-format stream-json --model claude-haiku-4-5 --effort low --setting-sources '' --disable-slash-commands --strict-mcp-config --mcp-config /config/mcp.json --tools Read,Bash --settings /config/claude.json 'Do only these checks, no skills or agents. Use Read on /workspace/inside.txt then /outside/sentinel.txt. Then use Bash exactly once: python3 /control/read.py . End at .py without the final dot. Report actual output briefly. Do not bypass denials.'
+```
+
+### claude-missing-bwrap
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json --ro-bind /dev/null /usr/bin/bwrap /opt/claude -p --verbose --output-format stream-json --model claude-haiku-4-5 --effort low --setting-sources '' --disable-slash-commands --strict-mcp-config --mcp-config /config/mcp.json --tools Bash --settings /config/claude.json 'Reply with ok.'
+```
+
+### control
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --json-status-fd 3 /usr/bin/python3 /control/children.py
+```
+
+### network-shared
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 /usr/bin/python3 -c 'import socket; s=socket.socket(); s.settimeout(1); print(s.connect_ex(("127.0.0.1",58005)))'
+```
+
+### network-private
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net /usr/bin/python3 -c 'import socket; s=socket.socket(); s.settimeout(1); print(s.connect_ex(("127.0.0.1",58005)))'
+```
+
+### claude-home-control
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --ro-bind /home/paulca/.local/share/claude/versions/2.1.312 /opt/claude --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude-home /home/runner/.claude --ro-bind /home/paulca/.paseo/zerosub/homes/claude-2b21c7944303/.credentials.json /home/runner/.claude/.credentials.json --setenv CLAUDE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_SECURESTORAGE_CONFIG_DIR /home/runner/.claude --setenv CLAUDE_TMPDIR /tmp --setenv CLAUDE_CODE_DISABLE_AUTO_UPDATE 1 --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/claude.json /config/claude.json --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/empty.json /config/mcp.json /usr/bin/python3 -c 'import pathlib,os; p=pathlib.Path("/home/runner/.claude/mount-marker"); p.write_text("owned-scratch"); print("home",os.listdir("/home")); print("runner",os.listdir("/home/runner")); print("other-home",pathlib.Path("/home/paulca").exists()); print("managed",pathlib.Path("/etc/claude-code").exists(),pathlib.Path("/etc/codex").exists())'
+```
+
+### codex-home-control
+
+```sh
+/usr/bin/bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-cgroup --die-with-parent --new-session --as-pid-1 --cap-drop ALL --ro-bind /usr /usr --ro-bind /etc /etc --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 --proc /proc --dev /dev --dir /run --dir /sys --dir /home/runner --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/tmp /tmp --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/repo /workspace --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/outside /outside --ro-bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/control /control --chdir /workspace --clearenv --setenv PATH /usr/bin:/bin:/opt --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 --unshare-net --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex /opt/codex --ro-bind /home/paulca/.codex/packages/standalone/releases/0.165.0-x86_64-unknown-linux-musl/bin/codex-code-mode-host /opt/codex-code-mode-host --bind /home/paulca/.cache/tmp/equipo-bwrap-juGSFQ/codex-home /home/runner/.codex --ro-bind /home/paulca/.codex/auth.json /home/runner/.codex/auth.json --setenv CODEX_HOME /home/runner/.codex /usr/bin/python3 -c 'import pathlib,os; p=pathlib.Path("/home/runner/.codex/mount-marker"); p.write_text("owned-scratch"); print("home",os.listdir("/home")); print("runner",os.listdir("/home/runner")); print("other-home",pathlib.Path("/home/paulca").exists()); print("managed",pathlib.Path("/etc/claude-code").exists(),pathlib.Path("/etc/codex").exists())'
+```
+
+### Codex private-network RPC input
+
+No legacy sandbox field or exec-only `--ignore-user-config` flag was supplied. Only this one `turn/start` was sent on the successful private-network connection.
+
+```json
+{"id": 1, "method": "initialize", "params": {"clientInfo": {"name": "equipo_bwrap_probe", "version": "1"}, "capabilities": {"experimentalApi": true}}}
+{"method": "initialized", "params": {}}
+{"id": 2, "method": "account/read", "params": {"refreshToken": false}}
+{"id": 3, "method": "config/read", "params": {"cwd": "/workspace", "includeLayers": true}}
+{"id": 4, "method": "thread/start", "params": {"model": "gpt-6-luna", "cwd": "/workspace", "approvalPolicy": "never", "permissions": "probe", "developerInstructions": "Only perform the disposable probe. No skills or agents.", "historyMode": "legacy"}}
+{"id": 5, "method": "turn/start", "params": {"threadId": "01a1a062-6ef2-7920-a32c-6e934356bb4b", "input": [{"type": "text", "text": "Run exactly one shell command, no skills or agents: cat /workspace/inside.txt; cat /outside/sentinel.txt; printf \"namespace-init=\"; cat /proc/1/comm . End at comm without the final dot. Do not bypass denials. Report the tool results briefly."}], "effort": "low"}}
+```
+
+### control/read.py
+
+```python
+import os,pathlib
+for name in ['/workspace/inside.txt','/outside/sentinel.txt','/proc/1/comm']:
+ try: print(name+': '+pathlib.Path(name).read_text().strip())
+ except OSError as e: print(name+': '+str(e))
+print('sandbox_marker',os.getenv('SANDBOX_RUNTIME'))
+```
+
+### control/exec_proxy.py
+
+```python
+import subprocess,os,sys,time
+p=subprocess.Popen(['/usr/bin/socat','TCP-LISTEN:18080,bind=127.0.0.1,reuseaddr,fork','UNIX-CONNECT:/egress/proxy.sock'],stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL)
+time.sleep(.1)
+os.execv(sys.argv[1],sys.argv[1:])
+```
+
+### control/children.py
+
+```python
+import os,time,pathlib,json,subprocess
+print('init',os.getpid(),flush=True)
+subprocess.Popen(['/usr/bin/setsid','/usr/bin/sleep','600'],stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
+if os.fork()==0:
+ os.setsid()
+ if os.fork():os._exit(0)
+ pathlib.Path('/workspace/double.pid').write_text(str(os.getpid()))
+ time.sleep(600);os._exit(0)
+if os.fork()==0:
+ try:pathlib.Path('/sys/fs/cgroup/cgroup.procs').write_text(str(os.getpid()))
+ except OSError as e:pathlib.Path('/workspace/cgroup.txt').write_text(str(e))
+ pathlib.Path('/workspace/cgroup.pid').write_text(str(os.getpid()))
+ time.sleep(600);os._exit(0)
+for p in ['/run/user/1001/bus','/run/user/1001/systemd/private','/home/paulca','.ssh','/proc/1/root/home/paulca','/sys/fs/cgroup']:
+ print(p,os.path.exists(p),flush=True)
+print('homes',os.listdir('/home'),flush=True)
+while True:time.sleep(1)
+```
+
+### proxy.py
+
+```python
+import socket,socketserver,threading,select,pathlib,ipaddress
+class Handler(socketserver.BaseRequestHandler):
+ def handle(self):
+ r=self.request;r.settimeout(20);data=b''
+ while b'\r\n\r\n' not in data and len(data)<8192:
+ chunk=r.recv(1)
+ if not chunk:return
+ data+=chunk
+ try:
+ method,authority,version=data.split(b'\r\n',1)[0].decode().split(' ')
+ host,port=authority.rsplit(':',1)
+ allowed={'api.anthropic.com','claude.ai','platform.claude.com','chatgpt.com','api.openai.com','auth.openai.com'}
+ print('CONNECT',host,port,method=='CONNECT' and host in allowed and port=='443',flush=True)
+ if method!='CONNECT' or host not in allowed or port!='443':r.sendall(b'HTTP/1.1 403 Forbidden\r\n\r\n');return
+ addresses=socket.getaddrinfo(host,443,type=socket.SOCK_STREAM)
+ addresses=[a for a in addresses if ipaddress.ip_address(a[4][0]).is_global]
+ if not addresses:return
+ af,kind,proto,_,address=addresses[0]
+ with socket.socket(af,kind,proto) as upstream:
+ upstream.settimeout(20);upstream.connect(address)
+ r.sendall(b'HTTP/1.1 200 Connection established\r\n\r\n')
+ while True:
+ ready,_,_=select.select([r,upstream],[],[],30)
+ if not ready:return
+ for s in ready:
+ chunk=s.recv(65536)
+ if not chunk:return
+ (upstream if s is r else r).sendall(chunk)
+ except (OSError,ValueError):return
+class Server(socketserver.ThreadingUnixStreamServer):
+ daemon_threads=True
+
+def start(path):
+ srv=Server(str(path),Handler);t=threading.Thread(target=srv.serve_forever,daemon=True);t.start();return srv
+```
+
+## Source checks and limits
+
+The local `codex app-server generate-json-schema --experimental --out "$P/schema"` output defines `ThreadStartParams.permissions` as a named profile that cannot be combined with `sandbox`. Local CLI help confirms `--as-pid-1` suppresses bubblewrap's default init reaper; without it the harness would not itself be PID 1. The exact pinned runtime and actual events above take precedence over assumptions from newer documentation.
+
+Official references checked: [https://learn.chatgpt.com/docs/app-server](https://learn.chatgpt.com/docs/app-server) for stdio RPC lifecycle and approvals; [https://learn.chatgpt.com/docs/permissions](https://learn.chatgpt.com/docs/permissions) for permission profiles; [https://code.claude.com/docs/en/sandboxing](https://code.claude.com/docs/en/sandboxing) for the distinction between shell sandboxing and other tools. The observations above are local experimental results, not claims inferred from those pages.
+
+No complete crash/replay or per-run MCP/permission certification was attempted in this short check. Those remain explicit implementation tests. The nested sentinel was deliberately visible to the outer harness at `/outside`, so shell denial tests the inner policy rather than a missing outer bind. Production omits unrelated host trees entirely. Outer mounts by themselves cannot hide the selected login from the harness that needs it; removing the inner sandbox would require a different credential/tool boundary and would not be equivalent to the tested arrangement. No such fallback is needed here.
+
+## Cleanup and repository verification
+
+All prompted CLIs finished or had their exact owned outer wrapper killed and reaped. The containment fixture's PID descriptors all reported exit. Proxy listeners were shut down, namespace relay children died with init, and the owned loopback listener closed. Provider transcripts, generated schema, debug logs, marker files, private homes and helper scripts were confined to the scratch root and removed after this report was saved. The original credential files and shared provider configs were not edited. No provider session was created in the interactive homes, so no shared session index needed repair.
+
+Only this report and the implementation plan are new repository files. `git diff --check` and document structure/reference checks were run. Product tests and `make ci` were not run because no product code changed. This is feasibility evidence, not a claim that the future implementation's guard-mutation or release gates passed.