Plan 2b: round 1 fixes applied (Astra); ready to build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+94
−48
docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md+94 −48
CI passed — run details
Intent
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| index a622236e..3843cd50 100644 |
| --- a/docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md |
| +++ b/docs/superpowers/plans/2026-11-03-equipo-plan-2b-direct.md |
| @@ -12,8 +12,8 @@ |
| ## 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. |
| +- 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 brief `97efa98`, original plan/nesting report `d9dc6e5`, atop runner `ce02b38`. 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.md` controls this revision. |
| - 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. |
| @@ -22,7 +22,7 @@ |
| - 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. |
| +- 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 |
| @@ -59,7 +59,7 @@ Codex app-server 0.165.0 does **not** accept `--ignore-user-config`. Use a priva |
| | 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. |
| +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 |
| @@ -77,15 +77,16 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| ### 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`. |
| +**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:** `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. |
| +- [ ] **Write failing tests:** `TestNamespaceKillsDetachedChildren` spawns `setsid`, 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. `TestNamespaceCgroupMoveKeepsMembership` asserts 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. `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. |
| +- [ ] **Implement:** Use `--unshare-pid --die-with-parent --new-session`, private mount/IPC/UTS/cgroup/network namespaces, fresh `/proc` and `/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-1` harness launch. Bubblewrap 0.11.0 needs `--as-pid-1` only 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`, `/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. |
| + 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 --version` check for `bubblewrap 0.11.0` to `runner-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 named `runner-namespaces` CI job on docs-t1, through `.amadan/ci.d/36-runner-namespaces` delegating to `make runner-namespace-test`; arrange its capable runner assignment and delegated test cgroups before completing Task 2. Run `make runner-namespace-test` as the explicit capability suite and the full `make ci` gate on that capable runner, so broader tests that also create namespaces run there too. Keep `.amadan/ci` and `.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 add` task files; `git commit -m 'feat: contain attempts in owned bubblewrap namespaces'`. |
| @@ -93,11 +94,11 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| **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. |
| +**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:** `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. |
| +- [ ] **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`; 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 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'`. |
| @@ -105,13 +106,13 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| **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. |
| +**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:** `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. |
| +- [ ] **Write failing tests:** `TestAccountHomeBinding` selects 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. `TestAccountUnavailableDoesNotFailover` sends zero prompts on quota/auth/identity failures. `TestAccountHomeMutation` rejects 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. `TestEffectivePolicyHash` changes for any binary, settings, routing, exact specialist tool list, MCP, managed-file, env, mount policy or Codex per-thread/per-turn RPC 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. |
| +- [ ] **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, `~/.claude` and `~/.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, 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. |
| + 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. |
| @@ -119,14 +120,15 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| ### 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. |
| +**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. |
| -- [ ] **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. |
| +- [ ] **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-id` behavior under `--input-format stream-json`, and separate per-turn `result.usage` across 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:** `TestClaudeLaunchPolicy` checks 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. `TestClaudeNoPromptBeforeAdmission` starts a fake CLI and observes zero user input before admission. `TestClaudeStreamEvents` consumes 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-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. |
| +- [ ] **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, `/egress`, the fixed tool socket `/tool/equipo.sock` and aliases. Deny those paths in both native tools and the inner shell sandbox while retaining only trusted helper access. Use the exact per-specialist `--tools` lists 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. Set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` and `DISABLE_AUTOUPDATER=1`; do not use the probe's unsupported `CLAUDE_CODE_DISABLE_AUTO_UPDATE` spelling. 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, 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 add` task files; `git commit -m 'feat: launch Claude headless with pinned sandbox policy'`. |
| ### Task 6: Implement Codex app-server sessions and deny profiles |
| @@ -135,10 +137,10 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| **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. |
| +- [ ] **Write failing tests:** `TestCodexAppServerPolicy` requires 0.165.0, matching code-mode host, `--strict-config`, account/config checks, `approvalPolicy:"on-request"`, `approvalsReviewer:"user"` and `activePermissionProfile.id` on 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. `TestCodexNoLegacyPolicyOverride` rejects legacy `sandbox`/`sandboxPolicy`, missing deny entries (including `/egress` and `/tool/equipo.sock`), per-turn policy overrides 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/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. `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. |
| +- [ ] **Implement:** Launch `codex app-server --strict-config --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, `/egress` and `/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 legacy `sandbox` summary returned by the server. Disable apps, multi-agent delegation, remote control and inherited MCP. Set `approvalPolicy:"on-request"` and `approvalsReviewer:"user"` explicitly on thread start/resume. Pin `turn/start` to 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/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/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 add` task files; `git commit -m 'feat: drive Codex app-server with verified deny profiles'`. |
| ### Task 7: Journal stdout and recover without replaying work |
| @@ -161,26 +163,26 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| **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. |
| +**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:** `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. |
| +- [ ] **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: 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. `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. |
| +- [ ] **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 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`. |
| +**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:** `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. |
| +- [ ] **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` requires an authenticated launch event in `runner_events` before 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. `TestCheckNamespaceContainment` retains existing command-sandbox deny tests while stopping detached children reliably. `TestCheckCacheIsolation` proves 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 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 module cache read-only. Each check gets a private writable build cache under its on-disk attempt scratch, with `GOCACHE` set 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, 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. |
| + 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 add` task files; `git commit -m 'refactor: run the bug workflow through direct namespaces'`. |
| ### Task 10: Connect Amadan description readback to publication |
| @@ -189,42 +191,86 @@ Produce `Launcher` with `Preflight(context.Context,Binding,Policy) (Identity,err |
| **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. |
| +- [ ] **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 rather than computing expectations with the implementation under test: four empty channels yield `sha256:66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925`, as pinned by Amadan's handler test at `bcc0e66`. The non-empty channels `["Equipo café\n", "Paul", "Fixed\nchecked", "✓"]` yield `sha256:ac030712c32422e57053ff69f80ec87d1efdff87a000e9a08dd3e711d0995a88`, independently computed with Python `hashlib.sha256(b"".join(struct.pack(">Q", len(v.encode("utf-8"))) + v.encode("utf-8") for v in channels)).hexdigest()`. Here `\n` denotes an actual newline. Also 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. |
| + 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 add` task files; `git commit -m 'fix: verify Amadan descriptions through production readback'`. |
| -### Task 11: Remove trial gates and certify the direct release |
| +### 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,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`. |
| +**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. 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. |
| +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. |
| -**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. |
| +The removal sweep must also cover: |
| -- [ ] **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. |
| +- `internal/equipotest/testdata/runner-flow.mjs` and `internal/equipotest/runner_flow_test.go`: remove the Node flow and port its useful assertions to `TestRunnerDirectEndToEnd` and 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-145` and `release-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 the `equipo-runner` OS-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.go` and `internal/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. |
| - 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. |
| +**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. |
| - 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. |
| +- [ ] **Write failing tests:** `TestDirectEligibilityRequiresCertifiedTuple` denies forged true/unlisted/stale reports for both providers with no acknowledgement bypass. `TestDirectCutoverPreservesHistory` upgrades through 0017→0018, sets `revoked_at` on every open `supervised_trials` and `isolation_acknowledgements` row, preserves already-revoked timestamps and all historical evidence/charges, and verifies the audit event and idempotent reopen. `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. `TestDirectDeadReferences` rejects 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_at` only where it is NULL in `supervised_trials` and `isolation_acknowledgements`, and appends a credential-free `audit_events` record 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-references` to `make ci` and its delegating CI step. Scan all tracked non-legacy text files with the case-insensitive expression `node|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 the `equipo-runner` binary/service name, direct command paths, legitimate tree-node terminology and tested historical decoding need narrow match-level allowances with reasons. The old `equipo-runner` OS-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 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 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 add` task 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:** `TestDirectLiveGateRequiresExplicitInputs` refuses missing dedicated homes, budget, disposable target or sentinel configuration before prompting. `TestDirectReleaseRequiresCertification` rejects 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=1` only after explicit live-test authorization and bounded inputs. Certify Codex's deny profile together with `approvalPolicy:"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/*/root` and `/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 add` reviewed task files only; `git commit -m 'feat: certify and package 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 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, 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. |
| +- **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:** 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. |
| +- **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. Installing the reviewed release, enrolment and the first bug fix are Paul's live acceptance steps. |
| +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. |