oficina / equipo Public
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 12 implementation tasks (1–10, 11a and 11b), reusing the already-built core.
- Baseline: branch
plan-2b, round 1 brief97efa98, original plan/nesting reportd9dc6e5, atop runnerce02b38. This revision changes only this plan, with no provider runs, product implementation, commits, pushes, deployment, helper agents or copy-review server.CODEX-BRIEF-plan-2b-fixes-R1.mdcontrols this revision. - Execution is off unless
EQUIPO_EXECUTION_ENABLED=1. KeepEQUIPO_ORIGIN,EQUIPO_INSTANCE_KEY, SMTP/logged-mail rules and one activation database.NewStoregrants no authority. - Derive
Actorfrom 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.Ownedorscope.OwnedByfor 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
ModelsandSchema; framework sessions, auth and proof tables belong only inBootSchema. 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; host development commands leave Go caches at their defaults. Isolated check execution uses the explicit Task 9 cache policy. 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
- 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).
- A home, symlink, managed config or resumed thread changes after preflight: no prompt uses stale identity or weaker policy (Tasks 4–6).
- The runner dies between intent, stdin write, stdout read and durable completion: no redispatch, fabricated completion or accounting reset (Task 7).
- A delayed permission answer arrives after revocation, or grants a broader sandbox: no renewed authority or hidden turn (Task 8).
- 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 11a performs offline cutover and removal; Task 11b certifies and packages the release 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:
TestDirectContractRejectsUnknownVersionrejects unsupported versions/provider names;TestDirectIdentitySeparatesSessionAndAttemptdistinguishes provider session from local attempt/turn;TestHistoricalIsolationRemainsReadableround-trips oldPaseoVersion, 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,PolicyVersiontoteam.IsolationTuple, retainingPaseoVersionfor 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 addonly 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; modify Makefile (runner-prerequisites), .amadan/ci.d/35-runner-adapter-test and, if needed, add .amadan/ci.d/36-runner-namespaces.
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:
TestNamespaceKillsDetachedChildrenspawnssetsid, double-fork and cgroup-migration-attempt children, opens exact PID descriptors and requires all exited after the Go helper PID 1 dies; an unrelated control survives.TestNamespaceCgroupMoveKeepsMembershipasserts that namespace membership is unchanged by a cgroup move: an authorized host-side test fixture moves an owned child between delegated test cgroups, compares its PID namespace identity before/after and requires exit with PID 1. A denied write to an absent cgroup mount is a separate control, not proof of a successful move. Run the move test in the named capable CI job if local delegation is unavailable.TestNamespaceHidesHostControldenies host proc-root, cgroup, user bus/systemd, other homes and inherited sockets.TestNamespaceParentDeathkills the launcher and observes descendant death.TestNamespaceRecoveryIdentitycovers PID reuse, changed boot, missing handshake and unavailable proof.TestNamespaceMountEscaperejects 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, private mount/IPC/UTS/cgroup/network namespaces, fresh/procand/dev, dropped capabilities and an empty environment with an allowlist. The Go namespace helper remains PID 1, reaps children and owns the relay; it starts the pinned harness as a child and never execs it over itself. Drop the probe's--as-pid-1harness launch. Bubblewrap 0.11.0 needs--as-pid-1only when its command is the Go helper, to suppress bubblewrap's default reaper and give that helper PID 1; assert this topology in the startup handshake. 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,/sysor/tmpbind. Mount/etcread-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 Go helper's host PID identity via bubblewrap's status FD and handshake; hold its pidfd and use it for kill/wait. The helper's pidfd exit is the containment proof, never the harness child's exit. Go Pdeathsig fires when the forking OS thread exits, not just when the runner process exits. Call runtime.LockOSThread before fork/start and keep that lifecycle goroutine and thread alive until the owned child has exited and been reaped; test thread-exit and runner-exit cases. 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.
- [ ] CI prerequisite and worker proof: Add the exact
bwrap --versioncheck forbubblewrap 0.11.0torunner-prerequisites, alongside the pinned provider checks. During implementation, push the Task 2 branch (never the default branch) and confirm the Amadan CI workers permit unprivileged user namespaces and pidfd open/signal/wait. Record the job, runner, commands and successful test output in the controller report. If ordinary workers lack these capabilities, require the namedrunner-namespacesCI job on docs-t1, through.amadan/ci.d/36-runner-namespacesdelegating tomake runner-namespace-test; arrange its capable runner assignment and delegated test cgroups before completing Task 2. Runmake runner-namespace-testas the explicit capability suite and the fullmake cigate on that capable runner, so broader tests that also create namespaces run there too. Keep.amadan/ciand.amadan/ci.d/delegating to these Make targets. Worker labels alone are insufficient. Missing capability fails the required job, never skips namespace tests. This future implementation push is not authorized in this planning revision. - [ ] 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 addtask 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. The Go helper at PID 1 owns it and reaps any relay children.
- [ ] Write failing tests:
TestEgressRejectsHostServicesuses 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.TestEgressAllowsOnlyProviderTLStunnels a configured fixture and denies other methods, request smuggling and wildcard matches.TestEgressDiesWithAttemptleaves no relay/listener after stop;TestEgressLimitsbounds 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.comand OpenAIchatgpt.com; add an explicit provider auth-host allowlist entry for token refresh of dedicated Equipo credential homes only. Pin each auth hostname through the installed provider contract and Task 11b refresh certification, with no wildcard or general login-web access. Shared interactive homes never qualify for refresh. 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 binds127.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 addtask 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,ThreadPolicy,TurnPolicy json.RawMessage; Tools []string}. 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:
TestAccountHomeBindingselects only a dedicated Equipo credential home, refuses a second matching binding and all shared interactive homes (ZeroSub homes,~/.claude,~/.codex, including aliases), and checks expected identity before first prompt. State explicitly that Claude identity is trust-on-first-use: Paul confirms its CLI-observed account metadata at enrolment, and later checks compare with that binding; it is not independent remote attestation.TestAccountUnavailableDoesNotFailoversends zero prompts on quota/auth/identity failures.TestAccountHomeMutationrejects symlink replacement and serializes attempts sharing a home. Between turns, a new credential generation with the same identity requires fresh preflight and bind before the next prompt, without containment or marking the connection dead; a different identity stops the step. Cover successful refresh, failed refresh and identity change separately.TestEffectivePolicyHashchanges for any binary, settings, routing, exact specialist tool list, MCP, managed-file, env, mount policy or Codex per-thread/per-turn RPC policy change.TestUnexpectedConfigLayerrejects user/project/managed config or remote control appearing in readback.TestPrivateHomeDoesNotTouchInteractiveConfigverifies 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: Configure dedicated Equipo credential homes independently of Paseo discovery. Paul creates one dedicated home and signs in once per account during enrolment; record the expected identity there. Refuse shared interactive homes, including ZeroSub homes,
~/.claudeand~/.codex, even as credential-only sources or symlink aliases. Stage a private runtime home with that dedicated login binding and required identity metadata; Equipo owns runtime session storage. Credential material never enters workspaces or the journal. Use dirs 0700 and files 0600, pin source identity against symlink replacement, and serialize attempts and token refresh with the account lease. Permit the harness to update only its dedicated credential storage, including atomic replacement, through the provider auth-host egress entry. Recheck identity/generation before every turn and resume. A new generation with the same identity between turns requires fresh preflight, validation and bind, then continues without containment or a dead connection. A different identity stops the step; refresh failure leaves it waiting for account maintenance, with no fallback home. An unexplained change during an active turn remains a containment condition.
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, exact specialist tool list, inner policy, outer binds, proxy policy, disabled hooks/plugins and MCP executable/config. Hash the canonical Codex thread/start, thread/resume and turn/start RPC policy parameters into the attempt manifest as well as the policy hash. Pin the omission of per-turn policy overrides explicitly; reject any supplied override rather than letting it change later turns. 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 addtask 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 sanitized testdata/ fixtures from the authorized stream-input recording below.
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.
- [ ] Record stream-input contract first: Begin Task 5 with an explicitly authorized recording on a dedicated Equipo home with allowance, at most two tiny provider runs. In one long-lived process, capture the exact stdin user envelope, fresh
--session-idbehavior under--input-format stream-json, and separate per-turnresult.usageacross at least two admitted tiny turns. Record commands, version/digest and sanitized frames, including turn boundaries; pin these fixtures before implementing the adapter. The earlier argv-prompt probes do not establish this input or usage contract. If authorization or allowance is absent, this task waits; no speculative fixtures. No recording is run in this plan-revision session. - [ ] Write failing tests:
TestClaudeLaunchPolicychecks exact argv/env, sandbox enabled,failIfUnavailable:true, no unsandboxed retries, no excluded commands, native Read denies and strict MCP. Assert Engineering has exactly--tools Bash,Read,Write,Edit,Glob,Grep; Review and Product have exactly--tools Read,Glob,Grep,Bash. Only the explicitly registered Equipo MCP tools are added through strict MCP configuration. Never expose WebFetch, WebSearch, Task/subagents or Skill. Assert the exact tool list is in the policy hash and any added tool changes it.TestClaudeNoPromptBeforeAdmissionstarts a fake CLI and observes zero user input before admission.TestClaudeStreamEventsconsumes the recorded stdin/output fixtures, checks session identity and distinct per-turn usage in one long-lived process, retains session/tool/request IDs and handles rate-limitis_error:truewith misleadingsubtype:success, non-JSON stderr, partial and oversized stdout.TestClaudeResumeUsesSameBindingretains session/account/policy and refuses an uncertain prior turn.TestClaudeSandboxUnavailableruns 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 manualand--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,/egress, the fixed tool socket/tool/equipo.sockand aliases. Deny those paths in both native tools and the inner shell sandbox while retaining only trusted helper access. Use the exact per-specialist--toolslists above, plus only Equipo MCP tools. Validate stdin user envelopes against Task 5's recorded stream-input fixtures before live certification; do not put the initial prompt in argv. SetCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1andDISABLE_AUTOUPDATER=1; do not use the probe's unsupportedCLAUDE_CODE_DISABLE_AUTO_UPDATEspelling. Retain--resumeonly 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, tool inventory/hash, protected-path denies, required environment, readiness, recorded stream usage, error interpretation and resumed identity independently. Beyond this task's bounded recording, real network prompting belongs only to Task 11b's opt-in gate.
- [ ] Commit:
git addtask 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:
TestCodexAppServerPolicyrequires 0.165.0, matching code-mode host,--strict-config, account/config checks,approvalPolicy:"on-request",approvalsReviewer:"user"andactivePermissionProfile.idon both start and resume. Assert canonical thread and turn RPC policies are in the attempt manifest and policy hash; a caller-supplied per-turn override is refused before stdin.TestCodexNoLegacyPolicyOverriderejects legacysandbox/sandboxPolicy, missing deny entries (including/egressand/tool/equipo.sock), per-turn policy overrides and--ignore-user-configon app-server.TestCodexToolVisibilityobserves command execution output inside a code-mode invocation, not just assistant text.TestCodexRPCInterleavinghandles notifications between replies, numeric/string server IDs and EOF without losing frames.TestCodexUnexpectedPolicyChangecontains before another turn when config/profile changes or an unauthorized active-turn account change occurs; a changed identity stops the step. The same-identity between-turn credential refresh follows Task 4's fresh preflight and bind.TestCodexUsageBeforeCompletionretains 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 --strict-config --listen stdio://in the constructed home. Mount and hash bothcodexand adjacentcodex-code-mode-host. Initialize withexperimentalApi:true, theninitialized,account/read,config/read,thread/startorthread/resume, then admittedturn/start. Use a namedpermissions:"equipo"profile with workspace write, explicit deny paths including the selected home,/egressand/tool/equipo.sock(and aliases), and tool network disabled; do not combine it with a legacy sandbox field. Compare the full constructed filesystem profile/readback, not just the lossy legacysandboxsummary returned by the server. Disable apps, multi-agent delegation, remote control and inherited MCP. SetapprovalPolicy:"on-request"andapprovalsReviewer:"user"explicitly on thread start/resume. Pinturn/startto inherit those values and the named profile with no policy override fields; reject per-turn overrides before transmission. Record these RPC policy parameters in the attempt manifest and policy hash. Task 8 answers only validated approvals for Equipo's own MCP tools in the runner and relays every other approval request to a person. No automatic reviewer agents. Task 11b certifies on-request and the deny profile together.turn/interruptis 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/strict config, change approval routing, permit a turn override, omit RPC policy from the hash, allow unknown config origin or confuse request/reply IDs; require failures.
- [ ] Commit:
git addtask 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:
TestDirectCrashBoundariescrashes 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.TestDirectCompletionReplayreplays durable completed events exactly once with preserved accounting.TestDirectInterruptedWaitsForPersonretains unknown charge and invalidates pending answers.TestDirectJournalFailureContainscovers ENOSPC, torn trailing frame, malformed/oversized JSON, blocked stdout and full 128 MiB pending outbox.TestDirectUsageDeltaschecks 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 addtask 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 /tool/equipo.sock; both providers' inner deny lists include this path and /egress, with only the trusted stdio helper able to use its endpoint. 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:
TestDirectToolScoperuns 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.TestClaudePermissionResponsepreserves original tool request and merges only allowed question answers.TestCodexApprovalResponsecorrelates exact command/file/MCP IDs: only Equipo MCP approvals pass to the runner's automatic response after broker validation of the current fence, attempt, tool name and arguments. Wrong fence/attempt/tool/arguments are denied. Every other approval is relayed to a person, with sandbox/policy/rule amendments refused even if an answer tries to grant them; no automatic fallback reviewer.TestCodexAsyncQuestionAnsweranswers pinned asyncagentMessage.questionsusingturn/steerwith exactexpectedTurnId, and separately supports schemaitem/tool/requestUserInput.TestDirectStaleAnswerrejects cancel/restart/replaced-turn/revoked-member/replayed-changed-payload answers.TestToolProxyCannotExposeSecretsproves 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. Route user questions through Equipo's scoped ask MCP tool; do not add the built-in AskUserQuestion to the exact specialist tool lists. For Codex, the runner answers approvals for Equipo's own MCP tools only after broker validation of fence, attempt, tool and arguments. Relay every other approval request to a person through the durable question path. Person answers can authorize only actions within the certified outer/inner policy; decline escalation and permanent amendments. Revalidate the broker binding again when executing an approved tool. 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 addtask 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,runner_events}.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:
TestDirectBugWorkflowexecutes the fixed five-step graph with fake CLIs and real local Git/checks.TestDirectWorkspaceIdentitypins base/ref, rejects credential/config/hooks, preserves fresh attempt workspaces and immutable export.TestDirectCancelWaitsForNamespacescovers model, code-mode host, relay, MCP helper and detached check children, keeping capacity occupied until all proofs exist.TestDirectRestartAndLeaseLosscontains on runner death, wall-clock rollback/suspend, revoked membership and changed connection.TestDirectContainmentReportBindingrequires an authenticated launch event inrunner_eventsbefore dispatch and rejects old inventory-only proof, missing namespace/launch record, wrong attempt/fence/manifest and forged Empty flags; cover operation on the pre-0018 schema.TestCheckNamespaceContainmentretains existing command-sandbox deny tests while stopping detached children reliably.TestCheckCacheIsolationproves module-cache writes fail, the host build cache is absent, and each check gets its own writable build cache under attempt scratch, removed after containment. - [ ] Red:
CGO_ENABLED=0 go test ./internal/runner/... ./internal/equipotest -run 'TestDirectBug|TestDirectWorkspace|TestDirectCancel|TestDirectRestart|TestDirectContainment|TestCheckNamespace|TestCheckCache' -count=1; expect failure. - [ ] Implement: Replace Paseo project/workspace creation with runner-owned
git worktreeoperations 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 module cache read-only. Each check gets a private writable build cache under its on-disk attempt scratch, withGOCACHEset only inside the check process; never mount the host build cache. Keep temporary build files in that check's scratch too, remove them after proven containment, and preserve no-credential and denied-path tests. Host development and CI commands keep their default Go caches.
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 stored as typed events in the existing runner_events table (migration 0015), available before 0018, never trusts a tool-provided proof or Empty:true. Send and acknowledge the launch event, bound to assignment/fence/attempt/manifest, before allowing its first prompt or check command. 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, launch-event admission, fake proof binding, module-cache write protection, host build-cache exclusion, per-check cache separation and local Git hooks/metadata escape.
- [ ] Commit:
git addtask 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 withTestAmadanDescriptionLengthHash: hash the four verbatim UTF-8 channels in order, each prefixed by its unsigned 8-byte big-endian byte length. Pin literal expected hashes rather than computing expectations with the implementation under test: four empty channels yieldsha256:66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925, as pinned by Amadan's handler test atbcc0e66. The non-empty channels["Equipo café\n", "Paul", "Fixed\nchecked", "✓"]yieldsha256:ac030712c32422e57053ff69f80ec87d1efdff87a000e9a08dd3e711d0995a88, independently computed with Pythonhashlib.sha256(b"".join(struct.pack(">Q", len(v.encode("utf-8"))) + v.encode("utf-8") for v in channels)).hexdigest(). Here\ndenotes an actual newline. Also distinguishab|cfroma|bc.TestAmadanDescriptionReadbackchecks slash branch escaping, by/at/agent metadata, content tampering, malformed/oversized JSON, empty:true with 200, redirect, auth failure and timeout.TestPublishDescriptionRecoveryverifies lost Set reply uses GET, no second push, and head-without-confirmed-description stays incomplete.TestPublishTransportIsProductionrejects 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. Verifybymatches the disclosed agent credential, retainatand optional structuredagentmetadata, and compare verbatim expected description text plus validated channel hash.empty:truemeans no description, not success. Keep 15-second timeout, 1 MiB response cap and no redirects/credential forwarding.
Keep BeforePush() == false: describe after the exact review ref exists. 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 addtask files;git commit -m 'fix: verify Amadan descriptions through production readback'.
Task 11a: Complete offline cutover and removal
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; Makefile, .amadan/ci, .amadan/ci.d/, packaging/equipo-runner.service, scripts/live-gate.sh. Create migration internal/equipo/migrations/0018_direct_launch.sql, update schema snapshot/models and add internal/equipotest/direct_cutover_test.go, internal/runner/journal_state.go, scripts/runner-dead-references.py and its explicit legacy/reference allowlist.
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. Move saveState/readStates into internal/runner/journal_state.go before removing internal/runner/process_linux.go. 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. 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.
The removal sweep must also cover:
internal/equipotest/testdata/runner-flow.mjsandinternal/equipotest/runner_flow_test.go: remove the Node flow and port its useful assertions toTestRunnerDirectEndToEndand Go HTTP/scriptless tests.internal/equipotest/runner_release_test.go:50-99: replace bridge/package fixtures, Node/npm scenarios and install assertions with direct binary/helper/version checks; preserve dirty/untracked/copy release refusals.Makefile:135-145andrelease-runner: remove Node/npm/bridge dependencies, retain the pinned Codex and bubblewrap prerequisites and package only direct runtime artifacts.scripts/live-gate.sh:6-22: remove theequipo-runnerOS-user check, Paseo home/endpoint, trial/acknowledgement prerequisites and obsolete test invocation; retain bounded-input confirmation for Task 11b.internal/runner/containment_r1_test.go,containment_r2_test.go,containment_r3_test.go,ci_proc_test.go,process_linux_test.goandinternal/equipotest/residual_process_test.go: port authority, cancellation and recovery assertions to namespace tests and delete obsolete process-inventory coverage gates. No skipped replacement tests.
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 the dedicated-user requirement. release.Manifest version 2 carries exact provider/helper/bwrap digests, launcher/policy versions and certified tuples. Offline fixtures cannot populate production certificates.
- [ ] Write failing tests:
TestDirectEligibilityRequiresCertifiedTupledenies forged true/unlisted/stale reports for both providers with no acknowledgement bypass.TestDirectCutoverPreservesHistoryupgrades through 0017→0018, setsrevoked_aton every opensupervised_trialsandisolation_acknowledgementsrow, preserves already-revoked timestamps and all historical evidence/charges, and verifies the audit event and idempotent reopen.TestDirectLegacyWorkCannotResumefences old protocol/active attempts into person-wait pending containment.TestDirectReleaseContractproves no Node/Paseo/dedicated-user requirement and real direct constructors.TestRunnerDirectEndToEndexercises 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.TestDirectDeadReferencesrejects a seeded obsolete reference in each active file class and checks the scan cannot silently omit tracked files or allow an entire active file. - [ ] Red:
CGO_ENABLED=0 go test ./internal/equipotest ./internal/runner/... ./internal/release ./cmd/equipo-runner -run 'TestDirectEligibility|TestDirectCutover|TestDirectLegacy|TestDirectRelease|TestRunnerDirectEndToEnd|TestDirectDeadReferences' -count=1; expect failure. - [ ] Implement: In the migration transaction, 0018 updates
revoked_atonly where it is NULL insupervised_trialsandisolation_acknowledgements, and appends a credential-freeaudit_eventsrecord identifying the direct-launch cutover as a system migration. Drop nothing. Invalidate active old reports/consents and pending selections; no 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.
Revalidate before claim, open and every turn; changed effective policy/version invalidates eligibility and contains active work. Apply Task 4's separate rules for same-identity credential refresh and changed identity. make runner-adapter-test becomes Go direct-adapter/containment/command-sandbox tests, with no npm. Keep it under make ci and delegating .amadan/ci*, including Task 2's required capable-runner job if needed. Package the Go namespace helper in the runner binary; provider binaries stay explicitly installed and version/digest checked. Keep the outbound user unit without requiring a different OS user, sudo or a daemon. 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.
- [ ] Zero-dead-references gate: Add
make runner-dead-referencestomake ciand its delegating CI step. Scan all tracked non-legacy text files with the case-insensitive expressionnode|npm|\.mjs|paseo|equipo-runner|trial. Require zero dead references after explicit classification. Keep a reviewed, path-specific inventory of legacy readers/fixtures, historical migrations and archived plans/reports; never blanket-exempt an active source/test/build/docs file. Exact live references such as theequipo-runnerbinary/service name, direct command paths, legitimate tree-node terminology and tested historical decoding need narrow match-level allowances with reasons. The oldequipo-runnerOS-user requirement is dead. Fail on every unclassified match and stale allowance; this is a zero-dead-reference gate, not a ban on the retained executable name. Record the raw scan and dispositions in the controller report. - [ ] Offline green and mutations: Repeat targeted tests, then
CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner,make migration-check,make runner-dead-references,make cionce andgo 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 scriptless flows with Go HTTP tests after removing the Node flow. Break revocation, audit atomicity, eligibility and dead-reference classification independently; record failures and restore. Do not rerun full gates without a new reason. No live certification or release packaging in this task. - [ ] Commit:
git addtask files only;git commit -m 'refactor: retire legacy execution through offline direct cutover'.
Task 11b: Certify and package the direct release
Files: Create internal/runner/provider/live_test.go; update internal/release/manifest.json, internal/equipotest/runner_release_test.go, scripts/live-gate.sh, docs/live-gate.md and individually reviewed entries in internal/equipo/copy.go.
Interfaces: DirectLiveConfig explicitly names disposable repository, dedicated Equipo account bindings, funding and sentinel paths; no discovery of arbitrary signed-in accounts. The manifest accepts only tuples backed by completed certification of the exact release policy.
- [ ] Write failing tests:
TestDirectLiveGateRequiresExplicitInputsrefuses missing dedicated homes, budget, disposable target or sentinel configuration before prompting.TestDirectReleaseRequiresCertificationrejects missing/changed provider-policy tuples and pending copy; fake CLI evidence cannot certify a production tuple. Pin the release prerequisite check for bubblewrap 0.11.0. - [ ] Red:
CGO_ENABLED=0 go test ./internal/runner/provider ./internal/equipotest -run 'TestDirectLiveGate|TestDirectReleaseRequiresCertification|TestRunnerReleaseContractPackaging' -count=1; expect failure before wiring the gate. - [ ] Implement enrolment and release gate: In the live-gate draft, document Paul's step: create dedicated Equipo credential homes, sign in once per provider account there, confirm Claude's trust-on-first-use identity and bind those homes during enrolment. Shared ZeroSub/interactive homes are refused. Keep refresh limited to these homes and the certified provider auth host. Wire the explicit-input gate and versioned packaging; keep production tuple eligibility off until the certification below passes. Review all pending runtime/live-gate copy before release; no copy-review server is part of this planning revision.
- [ ] Offline green and mutations: Repeat the targeted tests and
TestRunnerReleaseContractPackaging; mutate missing certification, wrong bubblewrap version and shared-home acceptance independently, observe failure and restore. Task 11a's full gate remains the baseline; rerun affected gates for subsequent code changes. - [ ] Opt-in certification: Run
EQUIPO_LIVE_DIRECT=1 go test -tags direct_live ./internal/runner/provider -run '^TestDirectLive(Contract|Isolation|Recovery|Calibration)$' -count=1only after explicit live-test authorization and bounded inputs. Certify Codex's deny profile together withapprovalPolicy:"on-request",approvalsReviewer:"user"and--strict-config; the earlier probe is insufficient. Exercise a broker-validated Equipo MCP approval answered by the runner, non-Equipo approvals relayed to a person, stale/invalid broker requests and denied policy escalation. Require both providers' actual native/shell/search/image tools when exposed, selected-home and other-home sentinels,/egress,/tool/equipo.sock, aliases including/proc/*/rootand/proc/*/fd, workspace positive control, immutable settings, MCP authority, real questions/permissions and account/version readback. Claude's tool inventory must equal the per-specialist lists in Task 5 plus Equipo MCP tools; forbidden tools are never enabled for certification. Missing tools are explicitly recorded; no untested read surface is certified.
Exercise successful token refresh through each pinned auth host, failed refresh, same-identity credential-generation change between turns with fresh preflight/bind and continued availability, and changed identity stopping the step. Exercise clean-session resume, intentional mid-turn runner kill, durable replay and no redispatch. Recheck Go helper PID 1 ownership, its pidfd exit, absence of detached descendants and host services. Missing/failed assertions block the tuple; the nesting probe and Task 5 recording are not substitutes for release certification.
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. Update the instance and runner manifest together only with passing tuples and their evidence.
- [ ] Commit and human gate:
git addreviewed task files only;git commit -m 'feat: certify and package direct provider releases'. After reviewed copy and a clean reviewed branch, run existingmake releaseandmake release-runnerto create versioned artifacts. Paul installs/enables the user service, enrols docs-t1, approves the machine, selects his dedicated 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, 11a–11b; §9 containment and live gate → 2–3, 11b. 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, 11b; durable events/usage/restart → 7; Amadan readback → 10; containment → 2–3, 9; Codex read isolation → 6, 11b. 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: Twelve reviewable tasks reuse the core, journal, check executor, tool broker and publisher. No new coordination service or general remote-control layer. The original planning session ran the companion report's nesting probes. This round 1 revision checked repository code, installed CLI help/schema, Go parent-death semantics and Amadan's hash handler, with no provider runs or product CI. Task 5 recording, Task 2 CI-worker proof and Task 11b release certification remain future implementation gates.
Questions for Paul
None for this plan. The chosen architecture and scope are already decided. Signing in once per account to dedicated Equipo homes, authorizing the bounded recording/certification, installing the reviewed release, enrolment and the first bug fix are Paul's live acceptance steps.
Round 1 dispositions
All controller decisions in CODEX-BRIEF-plan-2b-fixes-R1.md are applied without reopening them.
| Finding | Disposition | | --- | --- | | P2.1 Claude tools | Task 5 pins Engineering and Review/Product built-ins plus only Equipo MCP tools; TestClaudeLaunchPolicy and Task 4 hash the exact inventory. | | P2.2 Codex approvals | Tasks 6/8 pin on-request, user review and strict config; only broker-validated Equipo MCP approvals are answered by the runner. Task 11b certifies this with the deny profile. | | P2.3 Stream input | Task 5 starts with an authorized, at-most-two-run recording of stdin envelopes, session ID and per-turn usage in a long-lived process; fixtures come from that recording. | | P2.4 Credentials | Tasks 4/11b require dedicated homes and Paul's sign-in; shared homes are refused. Task 3 permits scoped auth-host refresh. Same-identity generations re-preflight/rebind between turns; changed identity stops the step. | | P2.5 Check caches | Task 9 mounts the module cache read-only, uses a private per-check build cache under attempt scratch, and never mounts the host build cache. | | P2.6 CI | Task 2 pins bubblewrap 0.11.0 and requires a future branch push with worker capability evidence; fallback is the required runner-namespaces job on docs-t1, never skipped. | | P2.7 Removal | Task 11a lists every requested flow, release, Makefile, live-gate and process-test location; the non-legacy reference gate requires zero dead references. | | P2.8 Cutover | Task 11a is offline; 11b handles release/live certification. Migration 0018 revokes open trial/acknowledgement rows with an audit event and drops nothing. | | P3 PID 1 and cgroups | Task 2 keeps the Go helper as reaper/relay owner; its pidfd exit proves containment. Harness-as-init is removed. A cgroup move must leave PID namespace membership unchanged. | | P3 RPC and identity | Tasks 4/6 hash thread/turn policy parameters and reject per-turn overrides. TestAccountHomeBinding labels Claude identity trust-on-first-use. | | P3 Protected paths and launch records | Tasks 5/6/8 deny /egress and /tool/equipo.sock to model tools. Task 9 stores authenticated launch records in existing runner events before 0018. | | P3 Hash, environment and parent death | Task 10 pins empty/non-empty literal hashes; Task 5 sets both required environment variables; Task 2 locks the forking OS thread for the child lifetime. |
Revision verification (2026-11-03): claude --version returned 2.1.312; claude --help confirmed the tool/input/session flags. Inspection of the pinned Claude binary found both required environment keys and no CLAUDE_CODE_DISABLE_AUTO_UPDATE key. codex --version returned 0.165.0; codex app-server --help confirmed --strict-config. codex app-server generate-json-schema --experimental --out <scratch>/schema confirmed thread start/resume and turn policy fields, including the ability to override them that this plan refuses. bwrap --version returned 0.11.0; its help confirmed default reaper behavior. /usr/local/go/src/syscall/exec_linux.go documents thread-scoped Pdeathsig. Amadan git show bcc0e66:internal/hub/branch_description.go and its test confirm the length-prefixed hash and empty literal; Python hashlib/struct independently produced Task 10's non-empty literal. Checked the named removal locations and migrations 0011/0015/0017 against this checkout. Generated schema scratch was under on-disk $TMPDIR and removed. No provider runs, product edits, agents, servers, commits or pushes were made in this revision.