oficina / equipo Public

Plan 2: resolve round 1 findings (Astra); Codex read isolation blocked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 6216253ec1b0269572e64b630bea37fdd61fd5d8 parent a66c96e
1 file changed, +156 −89
  • docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md +156 −89

CI passed — run details

diff --git a/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md b/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
index 53d3a9d4..56726722 100644
--- a/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
+++ b/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
@@ -6,20 +6,20 @@
**Architecture:** Keep the instance authoritative for tasks, connections, leases, budgets and evidence. Attach the execution core to the instance's existing activation database, and run a separate Go service on docs-t1 that makes outbound requests and controls local Paseo through a version-pinned Node client adapter. The runner owns repository credentials and the check executor; agents receive neither runner credentials nor permission to publish.
-**Tech Stack:** Go module `amadan.net/oficina/equipo`, Go floor `1.25.0`, gate toolchain `go1.26.10`, Rastrillo `v0.28.0`, chi, GORM and `modernc.org/sqlite`; Go runner plus `@getpaseo/client` and `@getpaseo/protocol` exactly `0.14.0`; Linux user systemd service on docs-t1.
+**Tech Stack:** Go module `amadan.net/oficina/equipo`, Go floor `1.25.0`, gate toolchain `go1.26.10`, Rastrillo `v0.28.0`, chi, GORM and `modernc.org/sqlite`; Go runner plus `@getpaseo/client`, `@getpaseo/protocol` and `@getpaseo/server` exactly `0.14.0`; Linux user systemd service on docs-t1.
**Spec:** `docs/superpowers/specs/2026-11-01-equipo-design.md`, especially §§3.2, 3.4, 6–7 and 9–10; Runner row of `docs/superpowers/plans/2026-11-01-equipo-roadmap.md`; binding corrections in `docs/superpowers/specs/2026-11-01-paseo-probe.md`; `CODEX-BRIEF-plan-2-runner.md`; carries read with `amadan discuss show oficina/equipo 2`.
## Global Constraints
-- “Paseo runs the agents.” `equipo-runner` is a “small Go binary, a user service under systemd or launchd, no root, no inbound ports”. This plan implements Linux/systemd on docs-t1; tito-studio and launchd are outside the acceptance gate.
+- “Paseo runs the agents.” `equipo-runner` is a “small Go binary, a user service under systemd or launchd, no root, no inbound ports”. This means no TCP or inet listener; Task 13 uses a private per-attempt Unix socket. This plan implements Linux/systemd on docs-t1; tito-studio and launchd are outside the acceptance gate.
- “Connections belong to people, not the team.” Every task uses its requester's explicitly enabled connections on their enrolled machines. No subscription credentials reach the instance.
- “Review always a different family from the builder.” Distinct sessions and producer identities are also required. Unknown family cannot establish independence.
- “Equipo never merges and never pushes the default branch.” Push only the bound review branch, using a disclosed Amadan agent account held by the runner.
- “A changed candidate invalidates checks and review.” Bugs require frozen reproduction failing on base, passing on candidate, repository checks, independent review and publication of that candidate.
- “Uncertain external actions stay unknown and charged.” Cancel, restart, a missing event and quarantine release cannot manufacture receipts or refunds.
- “Three steps cannot be removed”: independent review, checks and the person at the end. This plan has a fixed bug plan and no plan editor.
-- “Subscriptions are first-class connections.” Record measured usage and enforce admission, turn, attempt and time limits; do not present subscription tokens or currency as a provider-enforced cap. See Question 1 before live use.
+- “Subscriptions are first-class connections.” Record measured usage and enforce admission, turn, attempt and time limits; do not present subscription tokens or currency as a provider-enforced cap. The controller has approved counting subscription calls as dispatched Paseo turns; the technical live gates still apply.
- “No split screen”; phone navigation uses index screens and parent links. Keep the existing day/sidebar shell, token colors, byte-identical vendored assets and scriptless forms. No coloured left-border accents.
- “Copy for every user-facing string goes through copy review before it ships.” App-owned runtime strings, including runner diagnostics, live only in `internal/equipo/copy.go`. Mark each pending entry `COPY REVIEW REQUIRED`; review before release. This plan specifies copy keys and meaning, not final wording. Leave README prose unchanged.
- Current roster checks and audit writes belong inside each app write transaction. Derive browser `Actor` from the verified session; runner actor identity comes from its credential. Never bind requests onto GORM models or use `scope.Owned` for team records.
@@ -39,7 +39,7 @@
## Grounding, decisions and boundaries
-Grounded at repository HEAD `5954de4`, branch `plan-2`, with a clean worktree before this file. The brief's `e5c58ab` is ancestry, not a reason to reset HEAD. Plan 1, its controller brief and discussion 2 are historical inputs; their push/reviewer instructions do not override this planning brief.
+Round 1 revision grounded at repository HEAD `a66c96e`, branch `plan-2`, with a clean worktree before this revision. The earlier plan was grounded at `5954de4`; the findings reviewed `6d88d2b`. The brief's `e5c58ab` is ancestry, not a reason to reset HEAD. Plan 1, its controller brief and discussion 2 are historical inputs; their push/reviewer instructions do not override this planning brief.
| Existing code | Plan decision |
|---|---|
@@ -54,25 +54,46 @@ Grounded at repository HEAD `5954de4`, branch `plan-2`, with a clean worktree be
| Probe and installed client package metadata | Pin the public client packages to `0.14.0`; do not import the probe's absolute CLI-internal path. SDK behavior still needs contract tests, especially Codex, recovery, account routing and cleanup. |
| `handlers.go`, templates and mockups | Replace empty Journey/Connections and specialist activity with real reads. Borrow task cards from Conversation without building a coordinator or chat. |
-Plan 2 includes the minimum owner provider/family allowlist and personal connection selection needed to enforce §7. Selection is pinned, otherwise first eligible connection ordered by connection ID; fixed specialist model settings further filter eligibility. It does not build best-fit reasoning, ask-each-time policy, coordinators, preferences, plan editing, owner-routing conversations, product ranking, CARLOS signals, features or copy/design tasks.
+Plan 2 includes personal connection selection. The controller moves the owner provider/family allowlist to plan 4; the different-family review rule stays mandatory. Selection is pinned, otherwise first eligible connection ordered by connection ID; fixed specialist model settings further filter eligibility. Both model families must be eligible on the same docs-t1 runner; otherwise the task waits before any provider turn. Cross-machine Git bundles, chunked blobs, lost-enrolment-response recovery, EventSource refresh and Journey pagination are cut from this plan. It does not build best-fit reasoning, ask-each-time policy, coordinators, preferences, plan editing, owner-routing conversations, product ranking, CARLOS signals, features or copy/design tasks.
-Keep project/account deletion absent. Revoking a machine or disabling a connection is necessary and included; deleting projects/accounts is not. Preserve existing ASCII label uniqueness and IDs; labels are never identity or authority.
+Keep project/account deletion absent. Task 6 pins this carry with `TestProjectAccountNoDeleteAndASCIILabels`: DELETE routes do not succeed, records/audit remain unchanged, ASCII case duplicates conflict, and existing non-ASCII lower-case behavior stays unchanged. Revoking a machine or disabling a connection is necessary and included; deleting projects/accounts is not. Preserve existing ASCII label uniqueness and IDs; labels are never identity or authority.
Execution success means verified branch delivered. The app task then waits for the named merge owner with an Amadan link. It never claims the branch was merged or the app deployed. The human step stays visible and incomplete until a person records completion; that record is attributed as a person's acknowledgement, not forge verification.
+## Read isolation and installed-provider findings
+
+Inspected on docs-t1 at `a66c96e`: Paseo client/protocol/server 0.14.0, Claude Code 2.1.312, Codex CLI 0.165.0 and Node v24.19.0. Package evidence is under `/home/paulca/.local/lib/node_modules/@getpaseo/cli/node_modules/`: `@getpaseo/client/dist/{daemon-client,index}.d.ts`, `@getpaseo/server/dist/server/server/agent/providers/claude/{options,agent}.js`, and `providers/{codex/options,codex-app-server-agent}.js`. These paths are inspection references, never runtime imports.
+
+`ReadIsolation` is mandatory for each provider, permission mode, credential home and effective configuration hash. Tasks 9/10 build the denied-path set from canonical runner state, the configured Amadan credential, the actual Paseo daemon/account credential locations (including managed provider homes), and `~/.ssh`. Protect configuration, journals, bearer/cleanup files and resolved symlink targets too. A worktree located under the Paseo home does not justify reopening credential directories. Reject a workspace inside any denied subtree. Revalidate before creation and every turn; changing mode, home, plugin routing or policy invalidates the preflight result. Permission answers cannot override these denials.
+
+| Provider | Finding and eligibility |
+|---|---|
+| Claude Code 2.1.312 through Paseo 0.14.0 | Supported configuration surface, not yet live-proven. `ClaudeProviderOptionsSchema` accepts `settings.sandbox.filesystem.denyRead`, `failIfUnavailable` and strict sandbox settings, and `settings.permissions.deny`. `buildOptions` forwards those settings. Choose `modeId: "default"`; set `settings.sandbox` to enabled, fail-if-unavailable, filesystem enabled, no excluded commands and `allowUnsandboxedCommands: false`. Set `denyRead` to all protected paths and matching absolute `Read(...)` deny rules for built-in file access. No bypass mode, unsandboxed retry, unreviewed hooks/plugins/MCP servers or policy-changing permission responses. Keep `ReadIsolation=false` until Task 18 passes every sentinel and policy-tampering test for this exact configuration. |
+| Codex CLI 0.165.0 through Paseo 0.14.0 | **Ineligible on the installed adapter.** `-s` offers `read-only`, `workspace-write`, `danger-full-access`; none is a deny-read path declaration. The installed `codex sandbox -P :read-only` and `-P :workspace` both read a task-owned sentinel outside the workspace, both with `sandbox_permissions` omitted and with `-c 'sandbox_permissions=[]'`. Omitting `disk-full-read-access` therefore does not establish read confinement. A named profile with an explicit filesystem `deny` did block that sentinel while a workspace control remained readable. However, Paseo's strict `CodexProviderOptionsSchema` rejects both `sandbox_permissions` and `default_permissions`/`permissions`; its turn policy maps the legacy modes. Plan 2 does not invent a passthrough, edit shared provider homes, or bypass Paseo. Require a supported per-agent profile interface, effective-policy observation and the sentinel gate before making Codex eligible. |
+
+Claude's sandbox covers shell commands; built-in file tools use permission rules, and hooks/MCP/helper processes can run outside it. The trusted Equipo MCP executable is deliberately outside the agent command sandbox so it can read its scoped capability file. Only that fixed executable/configuration is accepted. See [https://code.claude.com/docs/en/sandboxing](https://code.claude.com/docs/en/sandboxing) and [https://code.claude.com/docs/en/settings-reference](https://code.claude.com/docs/en/settings-reference). Codex documents explicit filesystem `deny` entries in named profiles at [https://learn.chatgpt.com/docs/permissions](https://learn.chatgpt.com/docs/permissions); that CLI capability alone does not supply Paseo's missing per-agent contract.
+
+Local verification ran no agents or provider calls. `codex --version`, `codex --help`, `codex sandbox --help`, `claude --version` and `claude --help` established versions/options. Node `safeParse` accepted the Claude settings and legacy Codex mode, but rejected the Codex read-profile fields. For the command-only Codex probes, `codex sandbox -P <profile> -C <scratch/workspace> [-c 'sandbox_permissions=[]'] -- /bin/cat <scratch/outside/sentinel>` exited 0 under both built-ins. A custom profile extending `:workspace` with `<scratch/outside> = "deny"` exited 1 with permission denied; reading `<scratch/workspace/control>` exited 0. The profile was passed as one TOML `permissions={...}` override to avoid dotted path parsing. Preliminary probes without `-P`, or with `--strict-config` (unsupported by `sandbox`), failed at argument validation and are not isolation evidence. All probe files were under `$TMPDIR` and removed.
+
+This means the current Claude/Codex pair cannot pass live acceptance now. Keep the different-family requirement and zero-dispatch wait. The subscription-turn ruling is settled; upstream Codex support and live proof are technical blockers, not new questions for Paul.
+
## File map and shared conventions
| Area | Files and responsibility |
|---|---|
| Shared database and recovery | `internal/equipo/team/shared.go`, `recovery_release.go`, `stop.go`; app `execution.go`, `execution_models.go`, `recovery.go`; existing core store/recovery/scheduler files. |
-| Policy/evidence | Core `policy.go`, `budget.go`, `periodbudget.go`, `model.go`, `evidence.go`, `actions.go`, new `git_evidence.go`. |
+| Policy/evidence | Core `policy.go`, `budget.go`, `periodbudget.go`, `model.go`, `evidence.go`, `actions.go`, new `git_evidence.go`; ordered core migrations advance to version 7. |
| Instance records and endpoints | App `runners.go`, `enrolment.go`, `connections.go`, `tasks.go`, `task_prepare.go`, `runner_api.go`, `runner_events.go`, `questions.go`, `task_views.go`, `task_handlers.go`. |
| Wire contract | `internal/runnerproto/{types,validate}.go`: versioned request/response types shared by instance and runner, no database or provider access. |
-| Runner | `cmd/equipo-runner/main.go`; `internal/runner/{config,client,journal,service,supervisor,events,usage,questions,connections}.go`. |
+| Runner | `cmd/equipo-runner/main.go`; `internal/runner/{config,client,journal,service,supervisor,process_linux,events,usage,questions,connections,tools,tool_socket}.go`. |
| Local boundaries | `internal/runner/paseo/{client,types}.go`; `runner/paseo/{package.json,package-lock.json,bridge.mjs,bridge.test.mjs}`; `internal/runner/workspace/workspace.go`, `internal/runner/checks/{executor,definition,goresults}.go`, `internal/runner/forge/forge.go`. |
| UI/package | App templates `tasks.html`, `task.html`, `task_form.html`, `connections.html`, `enrol.html`, `recovery.html`, shared `task_card.html`; existing specialist/chrome/index/project templates, `copy.go`, `equipo.css`; `packaging/equipo-runner.service`, Makefile and matching CI wrappers. |
-Each task lists its tests and migrations. App migration numbers start after `0006_account_label.sql`; update `migrations/schema.sql` with every addition. New app tables use the existing model inventory. Shared core tables also get exact GORM schema mirrors, not business logic in GORM. Keep the standalone core migrator for its existing fixture/tests and compare its result to the app migration in Task 1.
+Each task lists its tests and migrations. Every new test named in an implementation step must be added to that task's red/green selection before implementation, not merely left for the full CI run. App migration numbers start after `0006_account_label.sql`; update `migrations/schema.sql` with every addition. New app tables use the existing model inventory. Shared core tables also get exact GORM schema mirrors, not business logic in GORM. Keep the standalone core migrator for its existing fixture/tests and compare its result to the app migration in Task 1 and at every later core version bump.
+
+Core migration ownership is explicit: Task 1 mirrors version 3; Task 2 adds recovery generation, clock high-water state, per-job authority staleness and recovery charges, advancing 3 → 4 in `0008_recovery.sql`; Task 3 adds indexed reservation period/project fields, advancing 4 → 5 in `0009_runner_policy.sql`; Task 7 adds job request-key/hash fields, advancing 5 → 6 in `0012_tasks.sql`; Task 8 adds durable admission request identity/tickets, advancing 6 → 7 in `0013_runner_assignments.sql`. Each owner updates `team.SchemaVersion`, the ordered standalone migrator, app SQL and schema mirrors together. JSON-only evidence/policy additions in Tasks 4/7 need no separate columns. Never stamp a legacy database straight to the newest version: apply each missing step in order. At each bump run `TestExecutionSchemaParity` against the current constant, fresh creation and every supported upgrade path, then reopen twice and assert no repeated changes; preserve data and refuse newer versions.
+
+Dependency split: execute Tasks 1–18 in numbered order. Task 6 implements instance selection/report validation only; its runner discovery and account-home wiring move to Task 17 after Tasks 9/15 exist. Task 7 owns durable tasks, preparation DTOs and a pure fixed-graph builder tested with a fake preparation source; it does not call HTTP or Task 10. Task 8 tests route authority with seeded assignments, real core admissions and fake result validators; it does not import Tasks 11–13. Task 15 wires the preparation outbox to Tasks 8/10 and replaces those validators with Tasks 11–13, including the deferred crash and integration tests. Task 17 wires discovery and startup. Test fakes must be explicitly injected; production constructors reject missing real dependencies.
New JSON uses protocol version `1`, snake_case fields and strict decoding. IDs are opaque strings except existing typed core IDs. Times are UTC; durations cross the wire as integer seconds. New UI codes are enums mapped through `copy.go`, never raw internal errors. Every test step below gives names and assertions; snippets are assertions inside those named tests, not implementation bodies.
@@ -84,24 +105,24 @@ For every task: record red command/result, green command/result and guard-mutati
**Interfaces:** Add `team.OpenShared(ctx context.Context, writer *sql.DB, path string, o team.Options) (*team.Store, error)`. It borrows `db.DB.Writer()`, owns neither pool nor app migrations, and verifies core schema version before `start`. `Close` records the witness but closes SQL only for stores opened by existing `team.Open`. Produce app-private schema mirrors for the existing `service`, `jobs`, `steps`, `attempts`, `reservations`, `actions`, `events`, `artifacts`, `period_budgets`, `time_reservations` tables and indexes. Keep existing names: none collide with Foundation tables. Add `(*team.Store).WithTransaction(ctx context.Context, fn func(*sql.Tx) error) error` using the existing witnessed transaction path. App `(*Execution).Write(ctx context.Context, fn func(*gorm.DB) error) error` binds a fresh GORM session to that SQL transaction, preserving the writer resolver and disabling nested transaction creation. When execution is attached, `Store.write` delegates to this wrapper. Never modify core rows in an ordinary app transaction outside its lock/witness protocol.
-- [ ] **Step 1: Add `TestExecutionSharedPool`, `TestExecutionSchemaParity` and `TestExecutionBackupIncludesArtifacts`.** Apply `BootSchema` twice, attach the core, write through both stores, close core and prove the app pool remains usable. Compare columns, defaults, indexes and foreign keys with standalone schema version 3. A combined app/core write and its audit roll back together; a crash after SQL commit but before witness publication has the existing recoverable-gap behavior. Assert no nested pool acquisition while the shared writer is held. A SQLite backup of the activation database includes jobs, reproduction bytes and app records. Assert `len(second.Applied) == 0` and `writer.Ping() == nil` after core close.
+- [ ] **Step 1: Add `TestExecutionSharedPool`, `TestExecutionSchemaParity` and `TestExecutionBackupIncludesArtifacts`.** Apply `BootSchema` twice, attach the core, write through both stores, close core and prove the app pool remains usable. Compare columns, defaults, indexes and foreign keys with standalone `team.SchemaVersion` (3 in this task, advanced by the owning tasks below). A combined app/core write and its audit roll back together; a crash after SQL commit but before witness publication has the existing recoverable-gap behavior. Assert no nested pool acquisition while the shared writer is held. A SQLite backup of the activation database includes jobs, reproduction bytes and app records. Assert `len(second.Applied) == 0` and `writer.Ping() == nil` after core close.
```go
if err := writer.Ping(); err != nil { t.Fatal("core closed the borrowed pool") }
if len(second.Applied) != 0 { t.Fatal("execution migration repeated") }
```
- [ ] **Step 2: Run red.** `go test ./internal/equipo/team ./internal/equipotest -run 'TestExecution' -count=1`; expect missing `OpenShared`/execution tables.
-- [ ] **Step 3: Implement borrowed ownership and additive schema mirrors.** Do not call the core's standalone migrations on the production pool. Preserve lock ordering, external witness writes and commit-failure poisoning. All core transactions close rows before nested queries because the borrowed writer has one connection. No production startup wiring yet.
+- [ ] **Step 3: Implement borrowed ownership and additive schema mirrors.** Do not call the core's standalone migrations on the production pool. Preserve lock ordering, external witness writes and commit-failure poisoning. The Rastrillo writer DSN lacks `_txlock=immediate`; this design is safe only with its existing `SetMaxOpenConns(1)` and serialized witnessed writes. Assert `writer.Stats().MaxOpenConnections == 1` and refuse attachment otherwise; never expand the pool without revisiting locking. All core transactions close rows before nested queries. No production startup wiring yet.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; expect PASS and no drift. Re-run `TestCommit`/`TestRecovery` tests selected from the existing core suite after changing pool ownership.
- [ ] **Step 5: Commit.** `git commit -m "feat: attach execution storage to the activation database"`.
### Task 2: Release quarantine and handle stale authority safely
-**Files:** Create core `recovery_release.go`, `stop.go`, their `_test.go` files; app `recovery.go`, `internal/equipotest/recovery_test.go`; modify core `authority.go`, `jobs.go`, `scheduler.go`, `actions.go`, `recovery.go`, `periodbudget.go`, app `authority.go`, `projects.go`, `roster.go`, `budgets.go`; add `0008_recovery.sql` and model/schema mirrors.
+**Files:** Create core `recovery_release.go`, `stop.go`, their `_test.go` files; app `recovery.go`, `internal/equipotest/recovery_test.go`; modify core `authority.go`, `jobs.go`, `scheduler.go`, `actions.go`, `recovery.go`, `periodbudget.go`, `store.go`, app `authority.go`, `projects.go`, `roster.go`, `budgets.go`; add `0008_recovery.sql` and model/schema mirrors.
-**Interfaces:** Extend `team.AdmissionRequest` with `Project team.ProjectID` (inside package: `Project ProjectID`). Add `(*team.Store).Pause(ctx context.Context, reason string) error`, `PauseTx(ctx context.Context, tx *sql.Tx, reason string) error`, `(*team.Store).StopAttempt(ctx context.Context, scope team.Scope, h team.Handle, reason string) error`, `RecoverySnapshot(ctx context.Context) (RecoverySnapshot, error)` and `ReleaseQuarantine(ctx context.Context, expectedRevision int64, actor, reason, reconciliationHash string) error`. `RecoverySnapshot` contains `Revision int64`, `Incarnation int64`, `Hash string`, `Unresolved []ActionID`, `Uncontained []AttemptID`. Also expose `ReleaseQuarantineTx(ctx context.Context, tx *sql.Tx, expectedRevision int64, actor, reason, reconciliationHash string) error` for the witnessed app transaction. `RecoverySnapshot.Revision` is a dedicated recovery generation changed by reconciliation, stop, receipt and release mutations, not `service.revision` (even reads advance that witness counter). App `(*Store).ReleaseExecution(ctx context.Context, actor Actor, expectedRevision int64, reason, snapshotHash string) error` is the owner-only entry point.
+**Interfaces:** Extend `team.AdmissionRequest` with `Project team.ProjectID` (inside package: `Project ProjectID`). Add global `(*team.Store).Pause(ctx context.Context, reason string) error` for startup/quarantine only, plus `FenceGrantsTx(ctx context.Context, tx *sql.Tx, changes []GrantChange) error`, where `GrantChange{Ref GrantRef; Version, Epoch int64}` names the current authority observation; `(*team.Store).StopAttempt(ctx context.Context, scope team.Scope, h team.Handle, reason string) error`, `RecoverySnapshot(ctx context.Context) (RecoverySnapshot, error)` and `ReleaseQuarantine(ctx context.Context, expectedRevision int64, actor, reason, reconciliationHash string) error`. `RecoverySnapshot` contains `Revision int64`, `Incarnation int64`, `Hash string`, `Unresolved []ActionID`, `Uncontained []AttemptID`. Also expose `ReleaseQuarantineTx(ctx context.Context, tx *sql.Tx, expectedRevision int64, actor, reason, reconciliationHash string) error` for the witnessed app transaction. `RecoverySnapshot.Revision` is a dedicated recovery generation changed by reconciliation, stop, receipt and release mutations, not `service.revision` (even reads advance that witness counter). App `(*Store).ReleaseExecution(ctx context.Context, actor Actor, expectedRevision int64, reason, snapshotHash string) error` is the owner-only entry point.
-- [ ] **Step 1: Add `TestRecoveryReleaseOwnerAndRevision`, `TestRecoveryReleaseKeepsUnknownCharged`, `TestProjectGrantChargeAgreement`, `TestRuntimeAuthorityEditPauses`, `TestContainAfterClockRollback`.** A member, stale snapshot or missing reconciliation evidence cannot release. A known unresolved action remains uncertain/charged after release and cannot be replayed. All known attempts must be contained first. Wrong `Project` with a valid grant fails at create, renew and admit. Project/roster edits pause admission in the same app transaction; no next effect until Resume. Move fake time backwards during an active lease: `StopAttempt`, physical cleanup, then `Contain` succeeds without waiting for the old deadline; old handle fails. Unknown elapsed time retains the full reserved seconds rather than settling to zero. Persist a clock high-water mark for mutating operations; a backward observation marks affected attempt time uncertain even when the new time remains after CreatedAt. No read or clock step can refund that uncertainty.
+- [ ] **Step 1: Add `TestRecoveryReleaseOwnerAndRevision`, `TestRecoveryReleaseKeepsUnknownCharged`, `TestProjectGrantChargeAgreement`, `TestRuntimeAuthorityEditFencesOnlyChangedGrants`, `TestContainAfterClockRollback`.** A member, stale snapshot or missing reconciliation evidence cannot release. A known unresolved action remains uncertain/charged after release and cannot be replayed. All known attempts must be contained first. Wrong `Project` with a valid grant fails at create, renew and admit. Project edits atomically mark and fence only jobs whose saved grant version/epoch differs. Run two projects: editing A stops A until Resume while B can renew and admit. A roster edit advances the current global `RosterEpoch`, so all grants using that epoch become stale; this is an actual epoch change, not an unconditional pause for any app edit. An account label or unrelated settings edit must not stop either job. Removed authority cancels its jobs; lookup errors deny the affected operation. Move fake time backwards during an active lease: `StopAttempt`, physical cleanup, then `Contain` succeeds without waiting for the old deadline; old handle fails. Unknown elapsed time retains the full reserved seconds rather than settling to zero. Persist a clock high-water mark for mutating operations; a backward observation marks affected attempt time uncertain even when the new time remains after CreatedAt. No read or clock step can refund that uncertainty.
```go
if !errors.Is(err, team.ErrGrantRevoked) { t.Fatal("project and grant diverged") }
@@ -110,7 +131,7 @@ For every task: record red command/result, green command/result and guard-mutati
```
- [ ] **Step 2: Run red.** `go test ./internal/equipo/team ./internal/equipotest -run 'TestRecoveryRelease|TestProjectGrantCharge|TestRuntimeAuthority|TestContainAfter' -count=1`.
-- [ ] **Step 3: Implement the recovery contract.** Resolve `Project` against the grant in every Authority call; set production `AdmissionSeconds = 5`. Use the witnessed transaction wrapper from Task 1 and its current `*sql.Tx` for `PauseTx`, never a root-pool call inside GORM's transaction. Pausing fences active attempts, requests stop and revokes undispatched intents. `Resume` revalidates changed grants only while paused; revoked or target-changed jobs cancel. Roster/project/budget edits persist a reconciliation-needed record with their audit. A serialized execution service synchronizes budgets, contains interrupted attempts and calls Resume. Owner release records both core and app audit in the shared transaction, clears restore quarantine only for the exact reconciled revision, then leaves Resume to reopen admission. Missing post-restore history requires an owner attestation plus conservative recovery charges for identified lost work; add `RecoveryCharge{Key string; Account AccountID; Project ProjectID; Reserved PeriodLimits}` and `(*team.Store).RecordRecoveryCharge(ctx context.Context, charge RecoveryCharge, actor, reason string) error`, idempotent by key/content and owner-gated by the app, included in period totals without inventing receipts; do not infer that missing work was free. No public runner release endpoint.
+- [ ] **Step 3: Implement the recovery contract.** Resolve `Project` against the grant in every Authority call; set production `AdmissionSeconds = 5`. Use the witnessed transaction wrapper from Task 1 and its current `*sql.Tx` for `FenceGrantsTx`, never a root-pool call inside GORM's transaction. Mark only changed grants stale, fence their active attempts, request stop and revoke their undispatched intents. Extend `Resume` to reconcile those stale jobs while admission for unrelated jobs remains open; revalidate and clear only contained, still-authorized jobs. Revoked or target-changed jobs cancel. Startup/quarantine retains the existing global pause. Roster/project edits persist scoped reconciliation work with their audit; budget edits synchronize only their team/project scope and block admissions under the new limit without staling unrelated grants. A serialized execution service synchronizes budgets, contains affected attempts and calls Resume. Owner release records both core and app audit in the shared transaction, clears restore quarantine only for the exact reconciled revision, then leaves Resume to reopen admission. Missing post-restore history requires an owner attestation plus conservative recovery charges for identified lost work; add `RecoveryCharge{Key string; Account AccountID; Project ProjectID; Reserved PeriodLimits}` and `(*team.Store).RecordRecoveryCharge(ctx context.Context, charge RecoveryCharge, actor, reason string) error`, idempotent by key/content and owner-gated by the app, included in period totals without inventing receipts; do not infer that missing work was free. No public runner release endpoint.
- [ ] **Step 4: Run green and mutate guards.** Repeat Step 2 and `make migration-check`. Remove owner/revision checks, project matching and the stop fence one at a time; their tests must fail. Restore each. Preserve existing restore/witness/crash tests.
- [ ] **Step 5: Commit.** `git commit -m "feat: reconcile and release execution quarantine"`.
@@ -118,16 +139,16 @@ For every task: record red command/result, green command/result and guard-mutati
**Files:** Modify core `policy.go`, `model.go`, `budget.go`, `periodbudget.go`, `store.go`; create `subscription_test.go`, `periodquery_test.go`; add `0009_runner_policy.sql` and update schema mirrors; modify app `budgets.go`, create `internal/equipotest/budget_sync_test.go`.
-**Interfaces:** Policy version 2 adds `UsageMode string` with `metered` and `subscription` plus `RequireDistinctReviewFamily bool`. Preserve version-1 decoding and behavior. Add `team.RunnerPolicy(mode string, limits team.Limits, rates team.Rates) (team.Policy, error)` and `(*team.Store).ConfiguredBudgets(ctx context.Context, account team.AccountID) (team.BudgetSet, error)`. Subscription currency is unavailable, not a fictitious positive price; its ledger currency component is zero and displayed through a separate availability flag. Policy still requires positive calls/tokens/time bounds. Metered mode retains positive cost caps and explicit rates. Under configured team/project budgets, select pricing and per-call limits from the job policy, not the first account job; subscription and metered jobs must coexist regardless of creation order. Keep legacy unconfigured account policy behavior.
+**Interfaces:** Policy version 2 adds `UsageMode string` with `metered` and `subscription` plus `RequireDistinctReviewFamily bool`. Preserve version-1 decoding and behavior. Add `team.RunnerPolicy(mode string, limits, perTurn team.Limits, rates team.Rates) (team.Policy, error)` and `(*team.Store).ConfiguredBudgets(ctx context.Context, account team.AccountID) (team.BudgetSet, error)`. Subscription currency is unavailable, not a fictitious positive price; its ledger currency component is zero and displayed through a separate availability flag. Policy still requires positive calls/tokens/time bounds. Metered mode retains positive cost caps and explicit rates. Under configured team/project budgets, select pricing and per-call limits from the job policy, not the first account job; subscription and metered jobs must coexist regardless of creation order. Keep legacy unconfigured account policy behavior.
-- [ ] **Step 1: Add `TestSubscriptionPolicy`, `TestMixedConnectionPolicies`, `TestLoweredBudgetBlocksReservedAdmission`, `TestBudgetSyncCrash`, `TestPeriodQueriesBoundedHistory`, `TestUnknownUsageStillCharged`.** Pin 5-second admissions, 60-second leases, 1,200-second attempts, 2,700-second jobs, two attempts per step, concurrency two, depth zero for runner jobs, 24 external actions/job (provider turns plus publication, with one slot held for publication), 200,000 input and 40,000 output tokens/job. A subscription turn reserves remaining allowed job tokens rather than pretending to impose the fixture's 4,000-token provider output limit. Lower a limit after Intend: Admit returns `ErrBudget`. Duplicate budget sync does not advance twice. Seed 100,000 settled old rows plus open rows from earlier months; query plans use indexes and return the same checked totals. Zero remaining headroom prevents new work; unknown receipts keep reservations open.
+- [ ] **Step 1: Add `TestSubscriptionPolicy`, `TestMixedConnectionPolicies`, `TestLoweredBudgetBlocksReservedAdmission`, `TestBudgetSyncCrash`, `TestPeriodQueriesBoundedHistory`, `TestUnknownUsageStillCharged`.** Pin 5-second admissions, 60-second leases, 1,200-second attempts, 2,700-second jobs, two attempts per step, concurrency two, depth zero for runner jobs, 24 external actions/job (at most 23 provider turns, with one slot held for publication). Token limits and per-turn token reservations are explicit configuration, not Foundation fixture defaults. Task 18 measures real turns before setting project/team token limits. Each turn reserves one call and the configured bounded `PerCall` input/output allowance, clipped to positive remaining job and period headroom; never reserve the whole remaining job allowance by default. These are accounting reservations, not provider output caps. Seed an offline example with headroom for two such reservations: after one turn has unknown usage, its reservation stays open and a second may proceed if the turn is otherwise known complete and the remaining ledger permits it. An unknown external outcome still stops replay/progression. Exhausted headroom blocks. Lower a limit after Intend: Admit returns `ErrBudget`. Duplicate budget sync does not advance twice. Seed 100,000 settled old rows plus open rows from earlier months; query plans use indexes and return the same checked totals. Zero remaining headroom prevents new work; unknown receipts keep reservations open.
```go
if policy.AdmissionSeconds != 5 || policy.LeaseSeconds != 60 { t.Fatal("wrong admission or lease") }
if !errors.Is(err, team.ErrBudget) { t.Fatal("lowered limit admitted reserved action") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/equipo/team ./internal/equipotest -run 'TestSubscription|TestMixedConnection|TestLoweredBudget|TestBudgetSync|TestPeriodQueries|TestUnknownUsage' -count=1`.
-- [ ] **Step 3: Implement policy and indexed accounting.** Make currency validation mode-aware rather than fabricating a positive subscription cap; retain checked token/call arithmetic and actual overrun settlement. Add validated reservation period/project columns, backfilled from parsed timestamps and job rows, with indexes for open rows and settled rows by account/project/month. Use separate indexed queries instead of `(?=0 OR ...)`; checked Go accumulation preserves overflow errors. Include every open row regardless of month. Synchronize app budget revisions in order while paused; a crash after core configuration is recognized by revision and content hash on retry. Calls count dispatched Paseo turns, including reviewer turns and follow-ups; underlying provider requests are unavailable unless the adapter proves them. Display that distinction. Persist overruns and stop before the next turn. Question 1 gates live acceptance of this call meaning; no fabricated hard subscription cap.
+- [ ] **Step 2: Run red.** `go test ./internal/equipo/team ./internal/equipotest -run 'TestSubscription|TestMixedConnection|TestLoweredBudget|TestBudgetSync|TestPeriodQueries|TestUnknownUsage|TestBoundedTurnReservation|TestCachedUsageSeparate' -count=1`.
+- [ ] **Step 3: Implement policy and indexed accounting.** Make currency validation mode-aware rather than fabricating a positive subscription cap; retain checked token/call arithmetic and actual overrun settlement. Add validated reservation period/project columns, backfilled from parsed timestamps and job rows, with indexes for open rows and settled rows by account/project/month. Use separate indexed queries instead of `(?=0 OR ...)`; checked Go accumulation preserves overflow errors. Include every open row regardless of month. Synchronize app budget revisions in order within their affected scope; a crash after core configuration is recognized by revision and content hash on retry. Calls count dispatched Paseo turns, including reviewer turns and follow-ups; underlying provider requests are unavailable unless the adapter proves them. Display that distinction. Persist overruns and stop before the next turn. The controller approved this call meaning; no fabricated hard subscription cap. Add `TestBoundedTurnReservation` and `TestCachedUsageSeparate` to the red/green command. Task 18 records measured uncached input, cached input and output separately, then sets explicit per-turn/job/project/team limits; missing calibration keeps production dispatch unavailable, not on fixture defaults.
- [ ] **Step 4: Run green.** Repeat Step 2, `make migration-check`, and existing `TestReservationLimitsAndOverflow`, `TestSettlementRules`, `TestLateUsageAfterCancelAndAuditedSettlement`, `TestTimeReservationsDoNotChangeCallLedger`. Verify the history query test fails when the month/state predicates are removed.
- [ ] **Step 5: Commit.** `git commit -m "feat: account for subscription turns and index period usage"`.
@@ -135,7 +156,7 @@ For every task: record red command/result, green command/result and guard-mutati
**Files:** Create core `git_evidence.go`, `git_evidence_test.go`; modify core `model.go`, `evidence.go`, `actions.go`, `policy.go`; update schema mirrors only if persistence fields change.
-**Interfaces:** Add `team.GitCandidate{Repository, BaseCommit, Commit, Tree string}` with media type `application/vnd.equipo.git-candidate+json`; `team.RepositoryCheckResult{CandidateHash, Commit, CheckDefinitionHash string; Outcome CheckOutcome; ExitCode, TestsRun, TestsFailed int; LogHash string}`; `RoleRepositoryChecks` allowed only for `CapVerify`. Add `ModelFamily string` to `Provenance`; require it under version-2 family policy. Extend publication JSON with `candidate_hash`; `head` is the Git commit. Add read-only `(*Store).Evidence(ctx context.Context, scope Scope) (EvidenceReport, error)` and `(*Store).ReadyToPublish(ctx context.Context, scope Scope) (EvidenceReport, error)`; the latter checks all evidence except the publication receipt.
+**Interfaces:** Add `team.GitCandidate{Repository, BaseCommit, Commit, Tree string}` with media type `application/vnd.equipo.git-candidate+json`; `team.RepositoryCheckResult{CandidateHash, Commit, CheckDefinitionHash, BaselineTestSetHash, ObservedTestSetHash string; Outcome CheckOutcome; ExitCode, TestsRun, TestsFailed int; LogHash string}`; `RoleRepositoryChecks` allowed only for `CapVerify`. Add `ModelFamily string` to `Provenance`; require it under version-2 family policy. Extend publication JSON with `candidate_hash`; `head` is the Git commit. Add read-only `(*Store).Evidence(ctx context.Context, scope Scope) (EvidenceReport, error)` and `(*Store).ReadyToPublish(ctx context.Context, scope Scope) (EvidenceReport, error)`; the latter checks all evidence except the publication receipt.
- [ ] **Step 1: Add `TestGitCandidateIdentity`, `TestBugNeedsRepositoryChecks`, `TestReviewDifferentFamily`, `TestChangedCandidateInvalidatesEvidence`.** Compute candidate artifact hash from canonical payload bytes; prove it differs from the commit ID. Candidate reproduction/review references that artifact hash; base reproduction references base commit as today. Publish must match both identities. Passing reproduction plus review without repository checks fails. Same family across different profiles/providers fails; different family with separate producer/session passes. Missing family fails. A second candidate invalidates both check results and review. Compilation failure, skipped/no tests, zero-exit without measured tests, wrong definition and malformed SHA values fail.
@@ -156,83 +177,96 @@ For every task: record red command/result, green command/result and guard-mutati
**Interfaces:** Define `Runner{ID, Person, MachineKeyHash, Label string; Revision int64; RevokedAt *time.Time}` and `RunnerPrincipal{RunnerID, Person string; CredentialID string}`. `(*Store).BeginEnrolment(ctx context.Context, machinePublicKey, label string) (runnerproto.DeviceCode, error)`, `ApproveEnrolment(ctx context.Context, actor Actor, userCode string) error`, `ExchangeEnrolment(ctx context.Context, deviceSecret, proof string) (runnerproto.RunnerCredential, error)`, `AuthenticateRunner(ctx context.Context, token string) (RunnerPrincipal, error)`, `RevokeRunner(ctx context.Context, actor Actor, runnerID string, revision int64) error`. Wire DTOs include expiry and polling interval, never provider secrets.
-- [ ] **Step 1: Add `TestEnrolmentAudience`, `TestEnrolmentSingleUse`, `TestRunnerRemovalRevokes`, `TestEnrolmentCSRFAndRate`.** A device grant can only poll/exchange, never claim; runner bearer cannot approve in the browser or access private UI; session cookie cannot authenticate runner endpoints. Approver identity is stored, submitted person ignored/rejected. Device code expires after 10 minutes, polls no faster than 5 seconds, approval is one use, machine proof is required. Ed25519 proof signs the enrolment ID, server challenge and exchange nonce; never trust a submitted person field. Lost exchange response can be recovered only with the same machine proof before expiry. Removal and revoke deny the next request, including an existing long-poll delivery. DB errors return unavailable, never authorize. No credential appears in audit/log/HTML.
+- [ ] **Step 1: Add `TestEnrolmentAudience`, `TestEnrolmentSingleUse`, `TestRunnerRemovalRevokes`, `TestEnrolmentCSRFAndRate`.** A device grant can only poll/exchange, never claim; runner bearer cannot approve in the browser or access private UI; session cookie cannot authenticate runner endpoints. Approver identity is stored, submitted person ignored/rejected. Device code expires after 10 minutes, polls no faster than 5 seconds, approval is one use, machine proof is required. Ed25519 proof signs the enrolment ID, server challenge and exchange nonce; never trust a submitted person field. A lost successful exchange response requires fresh enrolment and browser approval. The consumed code cannot recover or mint a second bearer; the owner can revoke the unused runner record. Removal and revoke deny the next request, including an existing long-poll delivery. DB errors return unavailable, never authorize. No credential appears in audit/log/HTML.
```go
if response.Code != http.StatusUnauthorized { t.Fatal("wrong credential audience accepted") }
if grantedPerson != approver.Address { t.Fatal("enrolment trusted submitted person") }
```
- [ ] **Step 2: Run red.** `go test ./internal/equipotest -run 'TestEnrolment|TestRunnerRemoval' -count=1`.
-- [ ] **Step 3: Implement routes and credential storage.** POST `/api/enrolments`, POST `/api/enrolments/token`; GET/POST `/runners/enrol` under session and CSRF; POST `/runners/{id}/revoke`. Generate 256-bit device/bearer secrets, store hashes and explicit audience/instance/person/machine bindings. User code has 10 unambiguous base32 characters; rate-limit creation and approval attempts. Runner credentials expire after 30 days; rotation overlaps for at most 5 minutes and cannot revive revocation. Keep an encrypted, instance-key-bound exchange response for at most the 10-minute enrolment window so the same machine can recover a lost response; retain only credential hashes afterward. Keep browser CSRF on browser routes and reject cookie-only runner requests. Approval must disclose the machine label/key fingerprint and real instance origin. Export runner display strings from `copy.go` through a small copy accessor; do not duplicate literals in the runner package.
+- [ ] **Step 3: Implement routes and credential storage.** POST `/api/enrolments`, POST `/api/enrolments/token`; GET/POST `/runners/enrol` under session and CSRF; POST `/runners/{id}/revoke`. Generate 256-bit device/bearer secrets, store hashes and explicit audience/instance/person/machine bindings. User code has 10 unambiguous base32 characters; rate-limit creation and approval attempts. Runner credentials expire after 30 days; rotation overlaps for at most 5 minutes and cannot revive revocation. Persist credential hashes only; do not retain an encrypted exchange response or add an enrolment replay endpoint. Keep browser CSRF on browser routes and reject cookie-only runner requests. Approval must disclose the machine label/key fingerprint and real instance origin. Export runner display strings from `copy.go` through a small copy accessor; do not duplicate literals in the runner package.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`. Mutate audience and live membership checks separately; successful approval/claim controls must still work.
- [ ] **Step 5: Commit.** `git commit -m "feat: enrol person-bound runners with separate credentials"`.
### Task 6: Discover and select personal connections
-**Files:** Create app `connections.go`, runner `connections.go`, `internal/equipotest/connections_test.go`, `internal/runner/connections_test.go`; add `0011_connections.sql`, models/schema entries; modify specialist/project handlers later consumed by Task 16.
+**Files:** Create app `connections.go`, `internal/equipotest/connections_test.go`; runner `connections.go` and its tests belong to Task 17; add `0011_connections.sql`, models/schema entries; modify specialist/project handlers later consumed by Task 16.
-**Interfaces:** `runnerproto.ConnectionReport{LocalID, Provider, Family, Model, AccountLabel, Kind string; Available bool; AllowanceKnown bool; AllowanceRemaining int64}`; one stable connection/profile identity may expose multiple model rows. App `Connection{ID, RunnerID, Person, LocalID string; Revision int64; LastSeen time.Time}` plus reports, owner `ProjectModelPolicy{ProjectID, Revision int64; Providers, Families []string}` and personal `ConnectionChoice{ProjectID, Revision int64; ConnectionIDs []string; PinnedID string}`. Store methods `ReportConnections(ctx context.Context, principal RunnerPrincipal, reports []runnerproto.ConnectionReport) error`, `SaveModelPolicy(ctx context.Context, actor Actor, policy ProjectModelPolicy) error`, `SaveConnectionChoice(ctx context.Context, actor Actor, choice ConnectionChoice) error`, `SelectConnection(ctx context.Context, taskID, specialist, excludedFamily string) (runnerproto.Selection, error)`. `Selection` includes connection, runner, provider, family, model, account label, revision and reason code (`pinned` or `first_allowed`). All signatures use `context.Context` for `ctx`.
+**Interfaces:** `runnerproto.ConnectionReport{LocalID, Provider, Family, Model, AccountLabel, Kind, UnavailableReason, IsolationConfigHash string; Available, ReadIsolation bool; AllowanceKnown bool; AllowanceRemaining int64}`; one stable connection/profile identity may expose multiple model rows. App `Connection{ID, RunnerID, Person, LocalID string; Revision int64; LastSeen time.Time}` plus reports and personal `ConnectionChoice{ProjectID, Revision int64; ConnectionIDs []string; PinnedID string}`. Store methods `ReportConnections(ctx context.Context, principal RunnerPrincipal, reports []runnerproto.ConnectionReport) error`, `SaveConnectionChoice(ctx context.Context, actor Actor, choice ConnectionChoice) error`, `SelectConnection(ctx context.Context, person string, projectID int64, specialist, excludedFamily string) (runnerproto.Selection, error)`. This internal selector receives person/project from the authenticated task service in Task 7, never submitted form fields; Task 6 tests it with current roster/project fixtures without a task table. `Selection` includes connection, runner, provider, family, model, account label, revision and reason code (`pinned` or `first_allowed`). All signatures use `context.Context` for `ctx`.
-- [ ] **Step 1: Add `TestConnectionsBelongToPersonAndMachine`, `TestConnectionSelection`, `TestReviewWaitsForOtherFamily`, `TestAccountFailoverStops`.** Two people with the same account label never share credentials/selection. Explicit tick is required; project allowlist restricts it. A missing pin waits, never silently falls back. First allowed is stable by connection ID then model ID. A selected model must satisfy fixed specialist settings. One-family tasks wait before spending on the build. Unexpected actual account/family at session-open stops before the first prompt; mid-step failover contains and requires a disclosed new assignment.
+- [ ] **Step 1: Add `TestConnectionsBelongToPersonAndMachine`, `TestConnectionSelection`, `TestReviewWaitsForOtherFamily`, `TestAccountFailoverStops`, `TestProjectAccountNoDeleteAndASCIILabels`.** Two people with the same account label never share credentials/selection. Explicit personal opt-in is required; there is no owner provider/family allowlist in plan 2. Builder and reviewer must be available to that person on the same docs-t1 runner, both passing preflight including read isolation. A missing pin waits, never silently falls back. First allowed is stable by connection ID then model ID. A selected model must satisfy fixed specialist settings. One-family tasks wait before spending on the build. Unexpected actual account/family at session-open stops before the first prompt; mid-step failover contains and requires a disclosed new assignment.
```go
if selection.RunnerID != connection.RunnerID { t.Fatal("wrong machine selected") }
if selection.Family == builderFamily { t.Fatal("review used the builder family") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/equipotest ./internal/runner -run 'TestConnections|TestConnectionSelection|TestReviewWaits|TestAccountFailover' -count=1`.
-- [ ] **Step 3: Implement identity and selection.** Reports describe signed-in profiles on this local machine only, tied to the authenticated runner person. An operator-maintained runner-local account binding file lists the existing profile IDs this enrolment may report; it contains no credential bytes. Enrolment does not automatically claim every profile visible in a shared daemon. Never infer ownership by email label or import all of another user's daemon accounts. Supported account routing must pin a credential home and report actual account identity with failover disabled; absent capability makes that connection unavailable. Mark reports stale after 90 seconds without heartbeat. Show provider allowance only when a supported read returns it; otherwise show counted Equipo usage with unknown allowance. Revocation disables new work and requests containment. Preserve max-concurrency specialist settings in assignment, without inventing model names.
+- [ ] **Step 2: Run red.** `go test ./internal/equipotest -run 'TestConnections|TestConnectionSelection|TestReviewWaits|TestAccountFailover|TestProjectAccountNoDeleteAndASCIILabels' -count=1`. Seed sanitized reports and observed-identity fixtures here; runner discovery is tested in Task 17.
+- [ ] **Step 3: Implement identity and selection.** Reports describe signed-in profiles on this local machine only, tied to the authenticated runner person. An operator-maintained runner-local account binding file lists the existing profile IDs this enrolment may report; it contains no credential bytes. Enrolment does not automatically claim every profile visible in a shared daemon. Never infer ownership by email label or import all of another user's daemon accounts. Supported account routing must pin a credential home and report actual account identity with failover disabled before the first prompt; absent capability makes that connection unavailable. Task 9 records the installed routing limitation and Task 17 enforces it. Detecting a changed account after a prompt is not prevention. Never change shared daemon account defaults to make this test pass. Mark reports stale after 90 seconds without heartbeat. Show provider allowance only when a supported read returns it; otherwise show counted Equipo usage with unknown allowance. Revocation disables new work and requests containment. Preserve max-concurrency specialist settings in assignment, without inventing model names.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; mutate person, pin and excluded-family filters independently.
- [ ] **Step 5: Commit.** `git commit -m "feat: select allowed connections for each person's tasks"`.
### Task 7: Create bug tasks and prepare their fixed plan
-**Files:** Create app `tasks.go`, `task_prepare.go`, `internal/equipotest/tasks_test.go`; add `0012_tasks.sql`, models/schema entries; extend core `jobs.go` and new `job_retry_test.go`.
+**Files:** Create app `tasks.go`, `task_prepare.go`, `internal/equipotest/tasks_test.go`; add `0012_tasks.sql`, models/schema entries; extend core `jobs.go`, `store.go` and new `job_retry_test.go`.
-**Interfaces:** `Task{ID, Requester, Description, RequestID string; ProjectID, Revision int64; JobID team.JobID; State, WaitCode string; BaseCommit, ReviewRef, CheckDefinitionHash string}`. `(*Store).CreateBug(ctx context.Context, actor Actor, projectID int64, description, requestID string) (Task, error)`, `PrepareBug(ctx context.Context, principal RunnerPrincipal, taskID string, expectedRevision int64, prep runnerproto.PreparedBug) (Task, error)`. `PreparedBug` contains repository, saved-default observation, base commit and check-definition bytes/hash. Add `team.JobSpec.RequestKey string`; unique `(account, requester, request_key)` with canonical input hash returns the original job or `ErrConflict`. `BugJobSpec(task Task, project Project, policy team.Policy, expectedSymptom string) (team.JobSpec, error)` derives Project and GrantRef from that same task/project.
+**Interfaces:** `Task{ID, Requester, Description, RequestID string; ProjectID, Revision int64; JobID team.JobID; State, WaitCode string; BaseCommit, ReviewRef, CheckDefinitionHash string}`. `(*Store).CreateBug(ctx context.Context, actor Actor, projectID int64, description, requestID string) (Task, error)`, `PrepareBug(ctx context.Context, principal RunnerPrincipal, taskID string, expectedRevision int64, prep runnerproto.PreparedBug) (Task, error)`. `PreparedBug`, defined in `runnerproto` by this task, contains repository, saved-default observation, base commit and check-definition bytes/hash. App `BugPreparer` exposes `Prepare(context.Context, team.TargetBinding) (runnerproto.PreparedBug, error)` as the preparation boundary; Task 7 uses a fake and Task 15 connects the runner implementation from Task 10 through Task 8. Add `team.JobSpec.RequestKey string`; unique `(account, requester, request_key)` with canonical input hash returns the original job or `ErrConflict`. `BugJobSpec(task Task, project Project, policy team.Policy, expectedSymptom string) (team.JobSpec, error)` derives Project and GrantRef from that same task/project.
-- [ ] **Step 1: Add `TestBugFormCannotChooseAuthority`, `TestBugSubmissionRetry`, `TestBugPreparationCrash`, `TestFixedBugPlan`, `TestJobRequestKey`.** Form accepts only project ID, description and request ID. Forged repository, requester, grant, budget, ref or kind fails. Only a current team owner or that project's work owner can start under today's Authority; other members can read shared tasks. Same request creates one task/job, changed payload conflicts. Crash between core job creation and app linking recovers the same job. Changed project/connection revision invalidates preparation. Assert five execution steps and one app human step, with the exact capabilities below.
+- [ ] **Step 1: Add `TestBugFormCannotChooseAuthority`, `TestBugSubmissionRetry`, `TestBugPreparationCrash`, `TestFixedBugPlan`, `TestJobRequestKey`.** Form accepts only project ID, description and request ID. Forged repository, requester, grant, budget, ref or kind fails. Only a current team owner or that project's work owner can start under today's Authority; other members can read shared tasks. Same request creates one task/job, changed payload conflicts. Crash between core job creation and app linking recovers the same job using the fake preparer. Task 15 repeats `TestBugPreparationCrash` with the real protocol and local Git source. Changed project/connection revision invalidates preparation. Assert five execution steps and one app human step, with the exact capabilities below.
```go
if retried.ID != original.ID || retried.JobID != original.JobID { t.Fatal("submission duplicated work") }
if len(steps) != 5 || steps[4].Capability != team.CapPublish { t.Fatal("fixed graph changed") }
```
- [ ] **Step 2: Run red.** `go test ./internal/equipotest ./internal/equipo/team -run 'TestBug|TestFixedBug|TestJobRequestKey' -count=1`.
-- [ ] **Step 3: Implement durable preparation and graph.** Validate description length 1–16,384 UTF-8 bytes. App transaction writes task plus outbox and audit before any network work. A preparation assignment to the selected runner fetches the saved repository/default head and base-pinned check definition using Task 10; it starts no agent. Persist a server-generated review ref `equipo/<task-id>` and immutable base. After online authority and budget checks, create `reproduce: CapReproduce`, `implement: CapImplement` depends on reproduce, `review: CapReview` depends on implement, `verify: CapVerify` depends on review, `publish: CapPublish` depends on verify. Display Engineering reproduce/fix, Review review/checks, and person merge; publishing is a runner operation. Person merge is not an executable core step. Every attempt has a fresh workspace identity. Reproduce freezes the symptom string and reproduction before implementation; add a revision-guarded `FreezeBugEvidence(ctx context.Context, scope team.Scope, h team.Handle, expectedSymptom, definitionHash, reproductionHash string) error` that only permits CapReproduce before any candidate. Initial evidence uses the validated bug description until that freeze; hashes/definitions cannot change. Add `FrozenReproductionHash` to `EvidenceRequirement`; the freeze checks a registered reproduction for this attempt, and subsequent registrations must match it. The executor alone produces base/candidate/check result artifacts. Before completing reproduce, require the frozen hash, symptom and base result to agree. No free-form plan editing.
+- [ ] **Step 3: Implement durable preparation and graph.** Validate description length 1–16,384 UTF-8 bytes. App transaction writes task plus outbox and audit before any network work. Persist a preparation outbox item; test consuming it with `BugPreparer` and authenticated prepared data locally. The real assignment/fetch path is deferred to Task 15 after Tasks 8/10, and starts no agent. Persist a server-generated review ref `equipo/<task-id>` and immutable base. After online authority and budget checks, create `reproduce: CapReproduce`, `implement: CapImplement` depends on reproduce, `review: CapReview` depends on implement, `verify: CapVerify` depends on review, `publish: CapPublish` depends on verify. Display Engineering reproduce/fix, Review review/checks, and person merge; publishing is a runner operation. Person merge is not an executable core step. Every attempt has a fresh workspace identity. Reproduce freezes the symptom string and reproduction before implementation; add a revision-guarded `FreezeBugEvidence(ctx context.Context, scope team.Scope, h team.Handle, expectedSymptom, definitionHash, reproductionHash string) error` that only permits CapReproduce before any candidate. Initial evidence uses the validated bug description until that freeze; hashes/definitions cannot change. Add `FrozenReproductionHash` to `EvidenceRequirement`; the freeze checks a registered reproduction for this attempt, and subsequent registrations must match it. The executor alone produces base/candidate/check result artifacts. Before completing reproduce, require the frozen hash, symptom and base result to agree. No free-form plan editing.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; inject crashes before/after each outbox acknowledgement. Force mismatched grant/project and verify denial.
- [ ] **Step 5: Commit.** `git commit -m "feat: create idempotent bug tasks with a fixed review plan"`.
### Task 8: Expose fenced outbound runner work
-**Files:** Create app `runner_api.go`; extend `execution.go`; create `internal/equipotest/runner_api_test.go`; extend `runnerproto/types.go`, `validate.go`; add `0013_runner_assignments.sql`, models/schema entries. Production attachment remains disabled until Task 17.
+**Files:** Create app `runner_api.go`; extend `execution.go`, core `actions.go` and `store.go`; create core `admit_retry_test.go`; create `internal/equipotest/runner_api_test.go`; extend `runnerproto/types.go`, `validate.go`; add `0013_runner_assignments.sql`, models/schema entries. Production attachment remains disabled until Task 17.
-**Interfaces:** `runnerproto.Assignment{ID, TaskID, StepKey, WorkspaceKey string; Scope team.Scope; Selection Selection; Revision int64; Kind string}` where kind is `prepare` or `step`; `Brief` contains saved target, instructions, standing instructions, selection, policy and artifact hashes, with `ConfirmedPreferences []string` empty in plan 2. `ClaimRequest{AssignmentID string; Revision int64}`; `ClaimResponse{Scope team.Scope; Handle team.Handle; Brief Brief; LeaseDeadline time.Time; CleanupToken string}`. App `Execution` owns core, app store and reconciliation adapters. Methods `Poll(ctx context.Context, p RunnerPrincipal, after int64) ([]runnerproto.Assignment, error)`, `Claim(ctx context.Context, p RunnerPrincipal, req runnerproto.ClaimRequest) (runnerproto.ClaimResponse, error)`, `Sync(ctx context.Context) error`. All post-claim requests carry scope, handle, request ID and protocol version.
+**Interfaces:** Core adds `AdmitOnce(ctx context.Context, scope Scope, h Handle, id ActionID, requestID string) (AdmissionTicket, error)` and `AdmissionTicket{Dispatch Dispatch; ExpiresAt time.Time; Incarnation int64}`; legacy `Admit` remains for existing callers. `runnerproto.Assignment{ID, TaskID, StepKey, WorkspaceKey string; Scope team.Scope; Selection Selection; Revision int64; Kind string}` where kind is `prepare` or `step`; `Brief` contains saved target, instructions, standing instructions, selection, policy and artifact hashes, with `ConfirmedPreferences []string` empty in plan 2. `ClaimRequest{AssignmentID string; Revision int64}`; `ClaimResponse{Scope team.Scope; Handle team.Handle; Brief Brief; LeaseDeadline time.Time; CleanupToken string}`. App `Execution` owns core, app store and reconciliation adapters. Methods `Poll(ctx context.Context, p RunnerPrincipal, after int64) ([]runnerproto.Assignment, error)`, `Claim(ctx context.Context, p RunnerPrincipal, req runnerproto.ClaimRequest) (runnerproto.ClaimResponse, error)`, `Sync(ctx context.Context) error`. All post-claim requests carry scope, handle, request ID and protocol version.
-- [ ] **Step 1: Add `TestRunnerCannotClaimOthersWork`, `TestRunnerFenceEveryMutation`, `TestRunnerLongPollRechecksRoster`, `TestSpecialistConcurrency`, `TestDispatchAdmissionExpires`.** Two runners race one assignment: one handle wins. Wrong person/machine/connection/fence fails across renew, event, artifact, intent/admit, completion and answers. Revoke during poll: no work returned. Specialist concurrency one permits one matching active attempt across jobs even though core job/team policy permits two. Admission received after five seconds cannot execute. DB/Authority failure produces no assignment or zero-looking status.
+- [ ] **Step 1: Add `TestRunnerCannotClaimOthersWork`, `TestRunnerFenceEveryMutation`, `TestRunnerLongPollRechecksRoster`, `TestSpecialistConcurrency`, `TestDispatchAdmissionExpires`, `TestAdmitLostReplyRetry`.** The same request ID/action/attempt/fence/runner within the original admission window returns the identical stored ticket after a lost response, with no new charge, event or deadline. Changed payload/binding conflicts; expiry, cancellation, revocation, changed grant, budget reduction or incarnation change denies replay. Crash immediately after the core admission commit still recovers that ticket. Two runners race one assignment: one handle wins. Wrong person/machine/connection/fence fails across renew, event, artifact, intent/admit, completion and answers. Revoke during poll: no work returned. Specialist concurrency one permits one matching active attempt across jobs even though core job/team policy permits two. Admission received after five seconds cannot execute. DB/Authority failure produces no assignment or zero-looking status.
```go
if successfulClaims != 1 { t.Fatal("assignment claimed twice") }
if dispatchesAfterRevoke != 0 { t.Fatal("revoked runner received work") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/equipotest -run 'TestRunnerCannot|TestRunnerFence|TestRunnerLong|TestSpecialistConcurrency|TestDispatchAdmission' -count=1`.
-- [ ] **Step 3: Implement protocol routes.** POST `/api/runner/v1/poll` holds at most 25 seconds, outside transactions. POST routes `/claim`, `/renew`, `/prepare`, `/events`, `/artifacts`, `/intend`, `/admit`, `/receipts`, `/lost`, `/complete`, `/release`, `/stop`, `/contained`, `/connections`, `/heartbeat`; GET scoped artifact download. Derive runner/person/account from authentication and stored assignment; handles alone grant nothing. Reserve assignment plus specialist slot atomically, then call Claim with persisted workspace key, reconciling crashes before enabling side effects. Lease renewals every 15 seconds; delivery includes instance incarnation and a 5-second dispatch deadline. Receipt/containment recovery after cancellation accepts only exact historical attempt/action bindings, never new effects. Each claim issues a separate audience `cleanup` capability for its known owned attempt, retained locally for up to 30 days and accepted after membership/runner revocation only on receipts/lost/contained endpoints; it cannot claim, renew, admit, answer permissions or register successful evidence. Version mismatch fails closed. Limits: JSON action 64 KiB, event 16 KiB, artifact 1 MiB; no unbounded request buffering.
-- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`. Mutate every endpoint's binding check with table-driven subtests. Expire/revoke while the poll sleeps and before it returns.
+- [ ] **Step 2: Run red.** `go test ./internal/equipotest ./internal/equipo/team -run 'TestRunnerCannot|TestRunnerFence|TestRunnerLong|TestSpecialistConcurrency|TestDispatchAdmission|TestAdmitLostReplyRetry|TestRevokedCleanupCannotRefund' -count=1`.
+- [ ] **Step 3: Implement protocol routes.** Store the admission request identity, dispatch and original deadline/incarnation in the same core transaction that changes intent to dispatching; do not call `Admit` and then write an app ticket in a second transaction. An exact `AdmitOnce` retry revalidates current authority, handle, budget and original expiry before returning the stored ticket. Runner journals request ID and consumes each action ticket once even if HTTP replies duplicate. POST `/api/runner/v1/poll` holds at most 25 seconds, outside transactions. POST routes `/claim`, `/renew`, `/prepare`, `/events`, `/artifacts`, `/intend`, `/admit`, `/receipts`, `/lost`, `/complete`, `/release`, `/stop`, `/contained`, `/connections`, `/heartbeat`; GET scoped artifact download. Derive runner/person/account from authentication and stored assignment; handles alone grant nothing. Reserve assignment plus specialist slot atomically, then call Claim with persisted workspace key, reconciling crashes before enabling side effects. Lease renewals every 15 seconds; delivery includes instance incarnation and a 5-second dispatch deadline. Receipt/containment recovery after cancellation accepts only exact historical attempt/action bindings, never new effects. Each claim issues a separate audience `cleanup` capability for its known owned attempt, retained locally for up to 30 days and accepted after membership/runner revocation only on receipts/lost/contained endpoints; it cannot claim, renew, admit, answer permissions or register successful evidence. After roster/runner revocation, cleanup-only reports are untrusted recovery observations: they cannot lower any reserved or already observed usage/time charge, settle an unknown action for less, or grant success. Keep the reservation open and measured high-water totals; an owner may settle with an audited reason through the existing settlement boundary after corroboration. A forged zero-usage cleanup receipt must leave the full charge in `TestRevokedCleanupCannotRefund`. Containment may release a concurrency slot only after the separately validated process proof; it cannot refund tokens/time. Version mismatch fails closed. Limits: JSON action 64 KiB, event 16 KiB, artifact 1 MiB; no unbounded request buffering.
+- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`. Route tests use explicitly injected fake artifact/question validators here; Task 15 tests their real replacements. Mutate every endpoint's binding check with table-driven subtests. Expire/revoke while the poll sleeps and before it returns.
- [ ] **Step 5: Commit.** `git commit -m "feat: serve scoped runner assignments and fenced reports"`.
### Task 9: Build the version-pinned structured Paseo adapter
**Files:** Create `internal/runner/paseo/{client,types,client_test}.go`, `runner/paseo/{package.json,package-lock.json,bridge.mjs,bridge.test.mjs}`, `internal/runner/paseo/testdata/` sanitized protocol fixtures. Modify Makefile with `runner-adapter-test` and a matching CI step.
-**Interfaces:** Package `paseo` exports `Client` interface: `Preflight(context.Context) (Capabilities, error)`, `CreateWorkspace(context.Context, WorkspaceRequest) (Workspace, error)`, `CreateAgent(context.Context, AgentRequest) (Agent, error)`, `Subscribe(context.Context, Agent, Cursor) (Subscription, error)`, `Send(context.Context, Agent, string, string) error`, `Respond(context.Context, Agent, PermissionResponse) error`, `Stop(context.Context, Agent) error`, `Archive(context.Context, Agent) error`, `ArchiveWorkspace(context.Context, Workspace) error`. `Subscription` exposes `Ready <-chan error`, `Events <-chan Event`, `Close() error`. `Agent` retains `ServerID, AgentID, ProviderSessionID, WorkspaceID, AccountID, Provider, Model, Family string`; `Workspace` retains server/project/workspace IDs and absolute path. `Cursor{Epoch string; Seq int64}`. `AgentRequest` contains workspace, selection, idempotency key and per-agent `MCPServers map[string]MCPServer`, with no initial prompt. `MCPServer{Command string; Args []string; Env map[string]string}`. Other wire records are defined in `types.go` from the pinned SDK, with no guessed provider-specific fields. `Capabilities{Version string; AccountPinning, ObservedAccount, RecoverableTimeline, ProcessOwnership, MCPAtCreate bool}` records verified support. `Event{Kind, ServerID, AgentID, SessionID, TurnID, PermissionID, Epoch string; Seq int64; Payload json.RawMessage}` preserves provider-specific data for strict normalization. `AgentRequest{Workspace Workspace; Selection runnerproto.Selection; IdempotencyKey string; MCPServers map[string]MCPServer}` is the complete create input.
+**Interfaces:** Package `paseo` exports `Client` interface: `Preflight(context.Context, runnerproto.Selection, ReadPolicy) (Capabilities, error)`, `CreateWorkspace(context.Context, WorkspaceRequest) (Workspace, error)`, `CreateAgent(context.Context, AgentRequest) (Agent, error)`, `Subscribe(context.Context, Agent, Cursor) (Subscription, error)`, `Send(context.Context, Agent, string, string) error`, `Respond(context.Context, Agent, PermissionResponse) error`, `Stop(context.Context, Agent) error`, `Archive(context.Context, Agent) error`, `ArchiveWorkspace(context.Context, Workspace) error`. `Subscription` exposes `Ready <-chan error`, `Events <-chan Event`, `Close() error`. `Agent` retains `ServerID, AgentID, ProviderSessionID, WorkspaceID, AccountID, Provider, Model, Family string`; `Workspace` retains server/project/workspace IDs and absolute path. `Cursor{Epoch string; Seq int64}`. `AgentRequest` contains workspace, selection, idempotency key and per-agent `MCPServers map[string]MCPServer`, with no initial prompt. `MCPServer{Type string; Command string; Args []string; Env map[string]string}` serializes `type: "stdio"` explicitly and rejects other types for Equipo tools. Other wire records are defined in `types.go` from the pinned SDK, with no guessed provider-specific fields. `Capabilities{Version string; AccountPinning, ObservedAccount, RecoverableTimeline, ProcessOwnership, MCPAtCreate, ReadIsolation bool; ReadIsolationReason, IsolationConfigHash string}` records verified support. `Event{Kind, ServerID, AgentID, SessionID, TurnID, PermissionID, Epoch string; Seq int64; Payload json.RawMessage}` preserves provider-specific data for strict normalization. `AgentRequest{Workspace Workspace; Selection runnerproto.Selection; IdempotencyKey, ModeID string; ReadPolicy ReadPolicy; Env map[string]string; ProviderOptions json.RawMessage; MCPServers map[string]MCPServer}` is the complete create input. `Env` carries a nonsecret attempt marker; `ProviderOptions` is constructed by the trusted adapter from the verified isolation policy, never from agent input. `ReadPolicy{DeniedPaths []string; ConfigHash string}` contains the trusted canonical policy. `Preflight` takes the selection and policy explicitly and returns per-selection capabilities; one global success must not authorize other providers/modes. `ProcessOwnership` is supplied by Task 15's inspector coverage and combined with adapter capabilities by the supervisor, not asserted from Paseo status alone.
-- [ ] **Step 1: Add `TestPaseoAdapterContract`, `TestSubscriptionReadyBeforePrompt`, `TestPaseoUnsupportedCapabilities`; Node tests `structured events`, `permission IDs`, `MCP at creation`, `workspace identity`, `unknown version`.** Replay the probe's structured events, full question inputs and completion usage; CLI human logs must be rejected as event JSON. Send before subscription readiness fails. Creation persists both workspace and provider-session identity. No absolute CLI-internal import, plugin installation or remote host routing. Missing account observation, timeline recovery or cleanup capability makes preflight unavailable for live dispatch, with a reason code.
+- [ ] **Step 1: Add `TestPaseoAdapterContract`, `TestSubscriptionReadyBeforePrompt`, `TestPaseoUnsupportedCapabilities`; Node tests `structured events`, `permission IDs`, `MCP at creation`, `workspace identity`, `unknown version`, `read isolation required`, `provider option schema`, `cancelAgent export`, `daemon credentials`.** Replay the probe's structured events, full question inputs and completion usage; CLI human logs must be rejected as event JSON. Send before subscription readiness fails. Creation persists both workspace and provider-session identity. No absolute CLI-internal import, plugin installation or remote host routing. Missing account observation, timeline recovery, read isolation or cleanup capability makes preflight unavailable for live dispatch, with a reason code.
```go
if sendsBeforeReady != 0 { t.Fatal("prompt sent before observation was ready") }
if response.PermissionID != request.PermissionID { t.Fatal("permission identity lost") }
```
- [ ] **Step 2: Run red.** `go test ./internal/runner/paseo -run 'TestPaseo|TestSubscriptionReady' -count=1` and `node --test runner/paseo/bridge.test.mjs`.
-- [ ] **Step 3: Implement the Go/Node boundary.** Use public exports of exact `@getpaseo/client@0.14.0` and `@getpaseo/protocol@0.14.0`, lock dependencies, and communicate over child-process stdin/stdout with request IDs and bounded frames. Keep diagnostics on stderr, redact authentication. Connect only to the configured local daemon; the Go runner supervises bridge exits. Use public SDK creation, timeline fetch/subscribe, permission response and agent control. Persist creation intent before sending, and recover creation by SDK idempotency key/observed identity; if unsupported, classify uncertainty and never create a replacement blindly. CLI JSON is allowed only for bounded discovery/workspace commands with captured separate stdout/stderr fixtures and strict decoding. Unknown versions or undocumented contracts require a Paseo capability request, not screen scraping or invented RPCs. The later live compatibility gate verifies Codex as well as Claude and actual account pinning; the probe did not establish those.
-- [ ] **Step 4: Run green.** Repeat Step 2 through `make runner-adapter-test`. Break readiness ordering and permission-ID forwarding separately. This task uses fake transports only; live agents wait for Task 18.
+- [ ] **Step 3: Implement the Go/Node boundary.** Pin `@getpaseo/client@0.14.0`, `@getpaseo/protocol@0.14.0` and `@getpaseo/server@0.14.0` exactly, including the server dependency used solely for exported daemon credential discovery. Lock transitive dependencies, and communicate over child-process stdin/stdout with request IDs and bounded frames. Keep diagnostics on stderr, redact authentication. Connect only to the configured local daemon; the Go runner supervises bridge exits. Use the exported package paths below, never the installed CLI's helper. The deliberately used client `internal/daemon-client` export is version-pinned and covered by a load/contract test; it is not an invented top-level stop API.
+
+ | Go boundary | Installed export/method |
+ |---|---|
+ | Connect/preflight | `createHostClient` from `@getpaseo/client/node`; `readDaemonInstance`, `readLocalCredentialForTarget`, `resolvePaseoHome` from `@getpaseo/server/daemon-control`; endpoint helpers from `@getpaseo/protocol/daemon-endpoints`; client `connect` (await its promise). Discover only the selected local daemon, never start/stop it. |
+ | `CreateWorkspace`, `CreateAgent` | `DaemonClient.createWorkspace`, `createAgent` from `@getpaseo/client/internal/daemon-client`; keep `idempotencyKey`, `workspaceId`, `env`, `modeId`, `providerOptions` and MCP type. |
+ | `Subscribe` | `DaemonClient.fetchAgentTimeline`, `subscribeAgentTimeline`, plus `subscribe` for control events; unsubscribe on close. |
+ | `Send`, `Respond` | `DaemonClient.sendMessage` with client message identity; `respondToPermission` with the original request ID. |
+ | `Stop`, `Archive`, `ArchiveWorkspace` | `DaemonClient.cancelAgent`, `archiveAgent`, `archiveWorkspace`, respectively. `Stop` is cancellation, not proof of containment. |
+ | Process inventory support | `DaemonClient.listTerminals` filtered by workspace and `killTerminal` for exact owned IDs; Linux process coverage comes from Task 15. |
+
+ Credentials go only to the trusted bridge connection. Never pass a daemon password to `createAgent.env` or MCP env, print it, or import daemon-control from an unpinned package. Persist creation intent before sending, and recover creation by SDK idempotency key/observed identity; if unsupported, classify uncertainty and never create a replacement blindly. CLI JSON is allowed only for bounded discovery/workspace commands with captured separate stdout/stderr fixtures and strict decoding. Unknown versions or undocumented contracts require a Paseo capability request, not screen scraping or invented RPCs. Implement and test the provider eligibility decisions above now; do not defer identifying the unsupported Codex configuration to a live run. Missing `ReadIsolation` refuses agent creation and dispatch. The later live gate verifies the full effective policy, credentials and cleanup; it does not override unsupported settings.
+
+ Account-routing finding: installed `@kapybara/zerosub@1.3.0` (`shared/rpc.ts`, `server/{routing,service,state}.ts`) exposes `zerosub.state` and `zerosub.agents.account` through plugin RPC, with bindings and observed sessions, but automatically reassigns exhausted/disabled portable accounts. That is not a no-failover contract. Keep such routes unavailable unless a supported per-agent binding/no-failover guarantee is supplied and tested before prompting. Do not call the account-changing RPC during this planning session or silently use its fallback. The implementation must name and pin the selected routing interface in its capability report before enabling a connection; no guessed `AccountID` field on `createAgent`.
+- [ ] **Step 4: Run green.** Repeat Step 2 through `make runner-adapter-test`. Provision Node v24.19.0 (or an explicitly retested version recorded in the manifest) in both local and Amadan CI; the Make target checks Node/npm and runs `npm ci` against the lock before Node tests. Add the shared Make target to `ci` and a delegating `.amadan/ci.d/` step. No test silently skips for missing Node. Break readiness ordering and permission-ID forwarding separately. This task uses fake transports only; live agents wait for Task 18.
- [ ] **Step 5: Commit.** `git commit -m "feat: drive Paseo through a pinned structured client"`.
### Task 10: Create credential-free workspaces from exact revisions
@@ -247,27 +281,27 @@ For every task: record red command/result, green command/result and guard-mutati
if hookRan || credentialVisible { t.Fatal("workspace crossed runner trust boundary") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/runner/workspace -run 'TestWorkspace|TestCandidateCapture' -count=1`.
-- [ ] **Step 3: Implement trust separation.** Fetch the saved canonical Amadan repository using a runner subprocess with scoped credential access; no secrets in URLs, argv, shared clone configuration or inherited agent environment. Create a credential-free source clone for Paseo and verify its remote. Disable system/global Git config, hooks and credential helpers in all agent/check workspaces; validate command arguments and paths without shell interpolation. Keep publication credentials outside all worktrees and enforce their exclusion through harness read restrictions. Local same-user harness sandboxes are the milestone's trust boundary, not a claim of OS-user isolation. Reproduction/implementation use fresh Paseo workspaces on the bound review branch from the explicit base; import frozen reproduction into the implementation brief. Review uses a fresh candidate checkout and no builder conversation. Export candidate into runner-owned immutable staging before builder cleanup, including a Git bundle when different enrolled machines hold builder/reviewer connections. Instance stores bounded bundle chunks by hash in its artifact store; no pre-review forge push is needed. Task 11 validates all imported paths and hashes.
+- [ ] **Step 2: Run red.** `go test ./internal/runner/workspace -run 'TestWorkspace|TestCandidateCapture|TestReadIsolationRequired' -count=1`.
+- [ ] **Step 3: Implement trust separation.** Fetch the saved canonical Amadan repository using a runner subprocess with scoped credential access; no secrets in URLs, argv, shared clone configuration or inherited agent environment. Create a credential-free source clone for Paseo and verify its remote. Disable system/global Git config, hooks and credential helpers in all agent/check workspaces; validate command arguments and paths without shell interpolation. Keep publication credentials outside all worktrees. Pass the canonical denied-path set to Task 9 at agent creation; require `ReadIsolation` before any model turn. Add `TestReadIsolationRequired` to this task's test command: missing capability, denied path nested in a workspace, symlink alias or a changed policy refuses creation before prompting. Local same-user harness sandboxes are the milestone's trust boundary, not a claim of OS-user isolation. Reproduction/implementation use fresh Paseo workspaces on the bound review branch from the explicit base; import frozen reproduction into the implementation brief. Review uses a fresh candidate checkout and no builder conversation. Export candidate into runner-owned immutable staging before builder cleanup, as local verified Git objects on this same docs-t1 runner. Review/check workspaces consume that immutable local staging, not the builder worktree. No cross-machine transfer, Git bundles, chunk manifests or pre-review forge push. Task 11 validates all reproduction paths and evidence hashes.
- [ ] **Step 4: Run green.** Repeat Step 2 with local disposable Git remotes only. Assert hook sentinel absent and no credential marker in agent environment/config/logs. Delete test-owned repositories.
- [ ] **Step 5: Commit.** `git commit -m "feat: isolate task workspaces and capture exact Git candidates"`.
### Task 11: Freeze reproductions and run trusted checks
-**Files:** Create `internal/runner/checks/{executor,definition,goresults,executor_test}.go`, app `artifacts.go`, `internal/equipotest/artifacts_test.go`; add `0014_artifact_blobs.sql`, models/schema entries; extend `runnerproto/types.go`.
+**Files:** Create `internal/runner/checks/{executor,definition,goresults,sandbox,executor_test,sandbox_test}.go`, app `artifacts.go`, `internal/equipotest/artifacts_test.go`; add `0014_artifact_blobs.sql`, models/schema entries; extend `runnerproto/types.go`.
-**Interfaces:** `checks.Definition{Version int; Repository, BaseCommit string; Commands []Command; Reproduction Command}`; `Command{Argv []string; Dir, Parser string; TimeoutSeconds int}`; `checks.Reproduction{ExpectedSymptom string; Files []File; TestNames []string}`; `File{Path string; Bytes []byte}`. `ParseDefinition(raw []byte, repository, baseCommit string) (Definition, error)`, `(*Executor).Reproduce(ctx context.Context, def Definition, repro Reproduction, subjectCommit string) (team.CheckResult, error)`, `(*Executor).RepositoryChecks(ctx context.Context, def Definition, candidate team.GitCandidate, candidateHash string) (team.RepositoryCheckResult, error)`. Instance `(*Store).PutBlob(ctx context.Context, principal RunnerPrincipal, scope team.Scope, h team.Handle, digest string, body []byte) error`, `Blob(ctx context.Context, principal RunnerPrincipal, scope team.Scope, digest string) ([]byte, error)` use scoped content-addressed immutable rows. Artifact registration continues through `team.Store.Register`.
+**Interfaces:** `checks.Definition{Version int; Repository, BaseCommit string; Commands []Command; Reproduction Command; Baseline TestBaseline}`; `TestIdentity{Package, Name string}`, `TestBaseline{Names []TestIdentity; Hash string}`; `CaptureBaseline(ctx context.Context, def Definition) (TestBaseline, error)` runs the base and records the required identities; `Command{Argv []string; Dir, Parser string; TimeoutSeconds int}`; `checks.Reproduction{ExpectedSymptom string; Files []File; TestNames []string}`; `File{Path string; Bytes []byte}`. `CommandSandbox.Run(ctx context.Context, command Command, workspace string, policy paseo.ReadPolicy, stdout, stderr io.Writer) (int, error)` returns the exit code and streams output to executor-owned parsers before bounded log retention. Its production implementation uses the verified local Codex command sandbox with a runner-built profile, while ordinary unit tests inject a fake. `ParseDefinition(raw []byte, repository, baseCommit string) (Definition, error)`, `(*Executor).Reproduce(ctx context.Context, def Definition, repro Reproduction, subjectCommit, candidateHash string) (team.CheckResult, error)`, `(*Executor).RepositoryChecks(ctx context.Context, def Definition, candidate team.GitCandidate, candidateHash string) (team.RepositoryCheckResult, error)`. Instance `(*Store).PutBlob(ctx context.Context, principal RunnerPrincipal, scope team.Scope, h team.Handle, digest string, body []byte) error`, `Blob(ctx context.Context, principal RunnerPrincipal, scope team.Scope, digest string) ([]byte, error)` use scoped content-addressed immutable rows. Artifact registration continues through `team.Store.Register`.
-- [ ] **Step 1: Add `TestFrozenReproduction`, `TestTrustedBaseCheckDefinitions`, `TestExecutorEvidenceOutcomes`, `TestArtifactScopeAndLimits`, `TestBundleValidation`.** Freeze valid bytes outside every worktree; changed bytes under the digest conflict. Later candidate edits cannot change frozen files or check commands. Base test failure must match the symptom with `TestsRun > 0`, `TestsFailed > 0`; candidate must pass the same frozen tests. Parse real `go test -json` test events; compile errors, skips, no tests, incomplete JSON, timeout, log truncation affecting parsing and exit zero without tests are not passes. Repository checks are a separate result. Traversal, absolute paths, symlinks, duplicate archive entries, corrupt bundle/chunk hash, wrong base and oversized uploads fail before execution. Agents cannot submit executor-attested results through their tool capability.
+- [ ] **Step 1: Add `TestFrozenReproduction`, `TestTrustedBaseCheckDefinitions`, `TestExecutorEvidenceOutcomes`, `TestArtifactScopeAndLimits`, `TestReproductionOverlayCollision`, `TestRepositoryTestSetSuperset`, `TestRepositoryDeletedTestFile`, `TestRepositoryTSkipRejected`.** Freeze valid bytes outside every worktree; changed bytes under the digest conflict. Later candidate edits cannot change frozen files or check commands. Base test failure must match the symptom with `TestsRun > 0`, `TestsFailed > 0`; candidate must pass the same frozen tests. Parse real `go test -json` test events; compile errors, skips, no tests, incomplete JSON, timeout, log truncation affecting parsing and exit zero without tests are not passes. Repository checks are a separate result. Traversal, absolute paths, symlinks, duplicate file paths, corrupt blob hashes, wrong base and oversized uploads fail before execution. Record the base test-name set by package, test and subtest under the same build tags/platform; candidate successful execution must contain that set and the frozen reproduction names, with every required member passing. A deleted `_test.go` file, renamed-away baseline test, `t.Skip`, skipped package or subtest, or zero tests fails even if the process exits zero. Additional passing tests are allowed. Persist the baseline set/hash in the check definition and the observed set/hash in the result. Agents cannot submit executor-attested results through their tool capability.
```go
if base.Outcome != team.CheckFail || base.TestsFailed == 0 { t.Fatal("base did not reproduce") }
if candidate.Outcome != team.CheckPass || candidate.TestsRun == 0 { t.Fatal("candidate lacks passing tests") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/runner/checks ./internal/equipotest -run 'TestFrozen|TestTrusted|TestExecutor|TestArtifact|TestBundle' -count=1`.
-- [ ] **Step 3: Implement pinned execution and artifact persistence.** Read `.equipo/checks.json` from the immutable base; require version 1 and supported parser `go-test-json` for reproduction/test counts, `exit` only for non-test gates. If absent, support the repository's base `.amadan/ci.d/` or `.amadan/ci` only through a reviewed, explicit Go adapter that captures structured test results; unsupported repositories wait with a setup reason, never guess success. Pin the manifest plus transitively invoked repository scripts/Makefiles in a base-derived check-definition bundle. Execute them from trusted material against an exact detached candidate export, without overwriting candidate source. Refuse an adapter whose scripts cannot preserve that separation. At least one measured test command and every required repository gate must succeed. Candidate modifications to the check harness cannot weaken the baseline gate; candidate new tests may add coverage.
+- [ ] **Step 2: Run red.** `go test ./internal/runner/checks ./internal/equipotest -run 'TestFrozen|TestTrusted|TestExecutor|TestArtifact|TestReproductionOverlay|TestRepositoryTest|TestRepositoryDeleted|TestRepositoryTSkip|TestCheckSandboxDeniedPaths' -count=1`.
+- [ ] **Step 3: Implement pinned execution and artifact persistence.** Read `.equipo/checks.json` from the immutable base; require version 1 and supported parser `go-test-json` for reproduction/test counts, `exit` only for non-test gates. If absent, support the repository's base `.amadan/ci.d/` or `.amadan/ci` only through a reviewed, explicit Go adapter that captures structured test results; unsupported repositories wait with a setup reason, never guess success. Pin the manifest plus transitively invoked repository scripts/Makefiles in a base-derived check-definition bundle. Keep the immutable candidate export untouched. Execute repository gates from trusted material against a fresh scratch copy of that export. For reproduction only, overlay the frozen test files into a separate scratch copy of the base or candidate. An absent path may be added; an existing file may be replaced only if its bytes exactly match the recorded base version (or already equal the frozen bytes). Reject a candidate-edited collision, non-test path, symlink or traversal; never silently overwrite a candidate fix. Record the subject commit, overlay hash and collision checks. Destroy the scratch copies after each run. `Reproduce` receives empty `candidateHash` for base and writes `SubjectHash = def.BaseCommit`; for candidate it verifies commit against the typed candidate artifact and writes `SubjectHash = candidateHash`, as the core evidence predicate requires. Reject an empty candidate hash on a candidate run; test commit/hash confusion explicitly. Refuse an adapter whose scripts cannot preserve that separation. At least one measured test command and every required repository gate must succeed. During Task 15 preparation integration, combine Task 10's immutable base fetch with `checks.CaptureBaseline(ctx context.Context, def Definition) (TestBaseline, error)` from this task before finalizing `PreparedBug.CheckDefinitionHash`. Task 10 unit tests inject a prepared-definition fixture and do not import this later executor. A known failing bug test may be present in the baseline, but incomplete discovery/build failure requires setup. Candidate modifications to the check harness cannot weaken the baseline gate; candidate new tests may add coverage.
- Executor processes are supervised process groups, with no model/forge credentials and a minimal environment; checks may need dependencies but cannot receive publication authority. Each command timeout is at most 1,200 seconds and never exceeds remaining attempt time. Retain exit code, parsed counts, timestamps and bounded logs (64 KiB per stream); parse incrementally before truncating stored logs. Freeze reproduction through `RoleReproduction` before base execution completes and before implementation starts. Cache only hash-verified instance blobs. Blob chunks are at most 1 MiB, a bundle at most 64 MiB and an attempt's uploaded blobs at most 128 MiB; reject larger work visibly. Persist bundle manifests/chunks in the activation DB, so backup includes evidence; no external filesystem-only evidence store. Do not garbage-collect referenced task evidence in this plan.
+ Executor processes are supervised process groups, with no model/forge credentials and a minimal environment. Repository tests are untrusted code too: `Executor` requires a `CommandSandbox` which runs the pinned local `codex sandbox -P equipo-checks` command with an explicit trusted filesystem profile, denied paths from Task 9, required runtime/workspace reads and no credential access. This is command execution, not a Codex agent or provider call; the locally verified named-profile support is separate from the ineligible Paseo Codex integration. Add `TestCheckSandboxDeniedPaths` with per-path sentinels and a passing workspace control; no unsandboxed fallback. Runner config records the verified Codex binary path/version; checks may need dependencies but cannot receive publication authority. Each command timeout is at most 1,200 seconds and never exceeds remaining attempt time. Retain exit code, parsed counts, timestamps and bounded logs (64 KiB per stream); parse incrementally before truncating stored logs. Freeze reproduction through `RoleReproduction` before base execution completes and before implementation starts. Cache only hash-verified instance blobs. Each complete reproduction/evidence blob is at most 1 MiB and an attempt's uploaded blobs at most 128 MiB; reject larger work visibly instead of chunking. Persist complete blobs in the activation DB, so backup includes evidence; no external filesystem-only evidence store. Do not garbage-collect referenced task evidence in this plan.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`. Mutate baseline command selection, symptom match, positive test counts and hash verification independently. Use actual small Go fixtures, no external repositories/providers.
- [ ] **Step 5: Commit.** `git commit -m "feat: execute frozen reproductions and base-pinned checks"`.
@@ -284,27 +318,27 @@ For every task: record red command/result, green command/result and guard-mutati
```
- [ ] **Step 2: Run red.** `go test ./internal/runner ./internal/equipotest -run 'TestRunnerEvent|TestTimelineEpoch|TestUsageCumulative|TestRunnerJournal|TestBufferFull' -count=1`.
-- [ ] **Step 3: Implement durable intake.** Journal SQLite lives in the runner's persistent private state directory, not scratch. Fsync creation/dispatch identities before effects, then append each event before acknowledging it to local workflow logic. Instance inbox and app projection/audit update transactionally; replay into core receipts/artifacts is idempotent and acknowledged only after core acceptance. Add a unique registration request key to the artifact transport inbox so repeated `Register` cannot append duplicate semantic artifacts. Use live subscriptions plus explicit cursor refetch on reconnect. Detect unrecoverable gaps and stop new dispatch until reconciled. Never infer a completed turn from queued/idle status or prose.
+- [ ] **Step 3: Implement durable intake.** Journal SQLite lives in the runner's persistent private state directory, not scratch. Fsync creation/dispatch identities before effects, then append each event before acknowledging it to local workflow logic. Instance inbox and app projection/audit update transactionally; replay into core receipts/artifacts is idempotent and acknowledged only after core acceptance. Add a unique registration request key to the artifact transport inbox so repeated `Register` cannot append duplicate semantic artifacts. Use live subscriptions plus explicit cursor refetch on reconnect. Detect unrecoverable outcome gaps and stop new dispatch until reconciled. An explicit completed-turn event with missing usage is different: keep its bounded reservation open and allow later work only under Task 3's remaining-headroom rule. Never infer a completed turn from queued/idle status or prose.
- Normalize each provider's measured token fields through versioned fixture tests, including cached input once. If cumulative usage semantics are not documented/tested, keep that field unknown. Subscription estimated cost may be displayed separately but is not charged as actual spend. Completed observations may arrive after cancel and settle the known action without changing cancellation state. Buffer at most 128 MiB of unacknowledged events; exponential reconnect backoff 1–30 seconds with jitter while the monotonic lease deadline remains binding. Redact secrets; artifact logs are downloads as escaped text, never active HTML.
+ Normalize each provider's measured token fields through versioned fixture tests. Add `runnerproto.TokenUsage{UncachedInput, CachedInput, Output int64; UncachedKnown, CachedKnown, OutputKnown bool}` to the projection/events, separately from core `team.Usage`. Core `InputTokens` is the checked sum of uncached plus cached input, once. If provider input includes cache, subtract it before reporting uncached input; if it excludes cache, add it only for the core total. Cache-write categories must be normalized once too. Display cached input separately and preserve each unknown flag. If cumulative usage semantics are not documented/tested, keep that field unknown. Subscription estimated cost may be displayed separately but is not charged as actual spend. Completed observations may arrive after cancel and settle the known action without changing cancellation state. Buffer at most 128 MiB of unacknowledged events; exponential reconnect backoff 1–30 seconds with jitter while the monotonic lease deadline remains binding. Redact secrets; artifact logs are downloads as escaped text, never active HTML.
- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; mutate deduplication, epoch replacement and nil-usage handling separately. Reopen both journal and instance DB during tests.
- [ ] **Step 5: Commit.** `git commit -m "feat: persist runner events and reconcile measured usage"`.
### Task 13: Relay questions and permissions with scoped tools
-**Files:** Create runner `questions.go`, `tools.go`, app `questions.go`, `internal/equipotest/questions_test.go`, `internal/runner/questions_test.go`; add `0016_questions.sql`, models/schema entries; extend protocol and copy keys.
+**Files:** Create runner `questions.go`, `tools.go`, `tool_socket.go`, `internal/runner/tool_socket_test.go`, minimal `cmd/equipo-runner/{main,main_test}.go`, app `questions.go`, `internal/equipotest/questions_test.go`, `internal/runner/questions_test.go`; add `0016_questions.sql`, models/schema entries; extend protocol and copy keys.
-**Interfaces:** `Question{ID, TaskID, AgentID, SessionID, PermissionID, Kind string; Attempt team.AttemptID; Fence, Revision int64; Request json.RawMessage; AnsweredBy string}`. `(*Store).AnswerQuestion(ctx context.Context, actor Actor, questionID string, revision int64, answer json.RawMessage) error`. `runner.DeliverAnswer(ctx context.Context, client paseo.Client, agent paseo.Agent, question runnerproto.Question, answer json.RawMessage) error`. `paseo.PermissionResponse{PermissionID string; Behavior string; UpdatedInput json.RawMessage}`. `runner.ServeTools(ctx context.Context, input io.Reader, output io.Writer, capability string) error` serves per-agent stdio Model Context Protocol (MCP); capability binds instance/task/attempt/fence/allowed tool names and expires with the lease.
+**Interfaces:** `Question{ID, TaskID, AgentID, SessionID, PermissionID, Kind string; Attempt team.AttemptID; Fence, Revision int64; Request json.RawMessage; AnsweredBy string}`. `(*Store).AnswerQuestion(ctx context.Context, actor Actor, questionID string, revision int64, answer json.RawMessage) error`. `runner.DeliverAnswer(ctx context.Context, client paseo.Client, agent paseo.Agent, question runnerproto.Question, answer json.RawMessage) error`. `paseo.PermissionResponse{PermissionID string; Behavior string; UpdatedInput json.RawMessage}`. `runner.ServeTools(ctx context.Context, input io.Reader, output io.Writer, socketPath, capabilityPath string) error` serves per-agent stdio Model Context Protocol (MCP) to the harness and forwards typed requests over a per-attempt Unix socket to the runner. `runner.ServeAttemptSocket(ctx context.Context, socketPath string, binding ToolBinding) error` owns that socket; `ToolBinding` binds instance/task/attempt/fence/allowed tool names, current lease and journal request IDs. The capability expires with the lease; runner validates the binding for every call.
-- [ ] **Step 1: Add `TestQuestionPermissionID`, `TestQuestionStaleAnswer`, `TestQuestionBrowserAuthority`, `TestAgentToolScope`.** Structured `AskUserQuestion` sends the original permission ID and updated answers through Respond, never Send. Conversational follow-up uses Send only when explicitly classified as such. Cancel/restart/permission replacement invalidates answers. Same answer replay is one effect; changed replay conflicts. Only current requester or current owner may answer execution questions in plan 2; no teammate's coordinator acts for them. Tool capability cannot read another task, publish, attest checks, change budgets or issue runner calls. Copy/sample prompt injection in a tool result cannot widen permissions.
+- [ ] **Step 1: Add `TestQuestionPermissionID`, `TestQuestionStaleAnswer`, `TestQuestionBrowserAuthority`, `TestAgentToolScope`, `TestToolVerbUnderFakeHarness`, `TestToolSocketIsolation`.** Structured `AskUserQuestion` sends the original permission ID and updated answers through Respond, never Send. Conversational follow-up uses Send only when explicitly classified as such. Cancel/restart/permission replacement invalidates answers. Same answer replay is one effect; changed replay conflicts. Only current requester or current owner may answer execution questions in plan 2; no teammate's coordinator acts for them. Tool capability cannot read another task, publish, attest checks, change budgets or issue runner calls. Copy/sample prompt injection in a tool result cannot widen permissions. A fake harness spawns the real `equipo-runner tool` subprocess from the same `type: "stdio"` MCP config used at creation; initialize and submit a real typed request over its stdin/stdout and assert the runner receives it over the socket exactly once. Its stdio belongs to the harness, not the runner. Test another attempt's capability, expired fence/lease, changed request-ID payload, malformed/oversized frame, missing capability file and disconnected socket. None can create evidence. Inspect the child argv and logs for a capability sentinel: it must be absent.
```go
if sendCalls != 0 || respondCalls != 1 { t.Fatal("structured answer bypassed permission response") }
if staleAnswerApplied { t.Fatal("old permission answer affected a new attempt") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/runner ./internal/equipotest -run 'TestQuestion|TestAgentTool' -count=1`.
-- [ ] **Step 3: Implement direct human relay and tool result submission.** Persist full bounded permission input for display, without secrets; use SDK permission responses keyed by ID. POST `/tasks/{id}/questions/{question}/answer` uses verified actor, current roster, revision and CSRF. Poll answers through the runner's authenticated outbound stream. Treat permission errors/unknown provider formats as pending, not implicit approval. Tools at agent creation are only `submit_reproduction`, `submit_candidate`, `submit_review`, `ask_person`, narrowed by capability. They accept typed data, never raw evidence/provenance fields; runner validates files/commit and derives provenance from the observed session. No plan/coordinator/settlement tools yet. Tool subprocess communicates over inherited pipes, using an attempt capability rather than the runner's bearer or Amadan credential. Each new follow-up turn needs a fresh budgeted admission; answering an existing permission does not secretly launch another turn. On long waits release/contain the attempt if its time limit expires and invalidate its permission ID.
-- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; deliberately route a structured answer through Send and require the test to fail. Test both Claude and Codex sanitized request fixtures; unsupported shapes stay blocked until the live compatibility test establishes them.
+- [ ] **Step 2: Run red.** `go test ./internal/runner ./internal/equipotest -run 'TestQuestion|TestAgentTool|TestToolVerb|TestToolSocket' -count=1`.
+- [ ] **Step 3: Implement direct human relay and tool result submission.** Persist full bounded permission input for display, without secrets; use SDK permission responses keyed by ID. POST `/tasks/{id}/questions/{question}/answer` uses verified actor, current roster, revision and CSRF. Poll answers through the runner's authenticated outbound stream. Treat permission errors/unknown provider formats as pending, not implicit approval. Tools at agent creation are only `submit_reproduction`, `submit_candidate`, `submit_review`, `ask_person`, narrowed by capability. They accept typed data, never raw evidence/provenance fields; runner validates files/commit and derives provenance from the observed session. No plan/coordinator/settlement tools yet. Runner creates `<StateDir>/attempts/<opaque-id>/` with mode 0700, a socket there and an atomically created 0600 capability file. MCP config contains the fixed runner executable, `args: ["tool"]`, `type: "stdio"`, and `EQUIPO_TOOL_SOCKET` / `EQUIPO_TOOL_CAPABILITY_FILE` paths plus the nonsecret attempt marker in its environment. No other runner environment is forwarded. No capability bytes in argv, agent environment, prompt, config JSON or logs. The trusted tool opens the file without following symlinks, verifies owner/mode, and authenticates each bounded socket request with the attempt capability. Runner verifies peer UID as an additional check; UID alone is not authority. Use a bounded versioned request/response protocol and durable request-ID deduplication before acknowledging submission. Replays with changed bytes conflict. Socket path length is checked before agent creation. Remove the attempt socket and capability after verified containment, invalidate them immediately on lease/fence change, and recreate only after fresh authority. Model shell/file tools must be unable to read the entire state directory under Task 9's isolation policy. This local Unix socket is the only tool-to-runner channel; it adds no TCP or inet listener. Each new follow-up turn needs a fresh budgeted admission; answering an existing permission does not secretly launch another turn. On long waits release/contain the attempt if its time limit expires and invalidate its permission ID.
+- [ ] **Step 4: Run green.** Repeat Step 2 and `make migration-check`; build a test-owned runner binary under `$TMPDIR` using the minimal `tool` command dispatcher added here in `cmd/equipo-runner/{main,main_test}.go` (Task 17 expands it). Run the fake-harness test with that real verb, then remove the binary. Deliberately route a structured answer through Send and require the test to fail. Test both Claude and Codex sanitized request fixtures; unsupported shapes stay blocked until the live compatibility test establishes them.
- [ ] **Step 5: Commit.** `git commit -m "feat: relay fenced questions and permission responses"`.
### Task 14: Publish only the verified review commit
@@ -313,7 +347,7 @@ For every task: record red command/result, green command/result and guard-mutati
**Interfaces:** `forge.Publisher` implements `team.Adapter`: `Classify(team.Operation) (team.ReplayClass, error)`, `Execute(context.Context, team.Dispatch) (team.Receipt, error)`, `Reconcile(context.Context, team.Dispatch) (team.ReconcileResult, error)`. Publication payload is `{repository, ref, head, candidate_hash}` from Task 4. `runnerproto.DispatchTicket{Dispatch team.Dispatch; Scope team.Scope; Handle team.Handle; Incarnation int64; ExpiresAt time.Time}` is issued only by instance Admit. `Execution` installs non-network adapters backed by durable runner observations: provider calls are unsafe to replay without proof, forge pushes are reconcilable. Instance adapters' Execute refuses local execution; the authorized runner receives the ticket.
-- [ ] **Step 1: Add `TestPublishQualifiedRef`, `TestPublishExactEvidence`, `TestPublishLostReceipt`, `TestPublishCredentialIsolation`, `TestPublishCancelRace`.** Target `heads/main` yields destination `refs/heads/heads/main`, never `refs/heads/main`. Equal saved default, forged repository/ref, tag, changed candidate, stale ticket, wrong runner or missing evidence refuses before Git. Local receive hook records the exact commit. Lost push reply followed by remote-ref query matching the expected commit recovers a receipt, without another push. Different remote head conflicts; query failure stays uncertain/charged. Cancellation before dispatch causes no push; cancellation after dispatch reports an in-flight effect and reconciles it without undoing the branch.
+- [ ] **Step 1: Add `TestPublishQualifiedRef`, `TestPublishExactEvidence`, `TestPublishLostReceipt`, `TestPublishCredentialIsolation`, `TestPublishCancelRace`.** Target `heads/main` yields destination `refs/heads/heads/main`, never `refs/heads/main`. Equal saved default, forged repository/ref, tag, changed candidate, stale ticket, wrong runner or missing evidence refuses before Git. Local receive hook records the exact commit. Lost Admit response first recovers the exact unexpired ticket via Task 8's request ID; duplicate delivery cannot dispatch twice, and expiry or changed authority prevents Git. Lost push reply followed by remote-ref query matching the expected commit recovers a receipt, without another push. Different remote head conflicts; query failure stays uncertain/charged. Cancellation before dispatch causes no push; cancellation after dispatch reports an in-flight effect and reconciles it without undoing the branch.
```go
if gotRefspec != commit+":refs/heads/"+reviewRef { t.Fatal("unqualified push") }
@@ -328,30 +362,30 @@ For every task: record red command/result, green command/result and guard-mutati
### Task 15: Drive the workflow and prove containment
-**Files:** Create runner `supervisor.go`, `service.go`, `supervisor_test.go`, `service_test.go`, app `cancel.go`, `internal/equipotest/cancel_test.go`; extend protocol and journal persistence.
+**Files:** Create runner `supervisor.go`, `service.go`, `process_linux.go`, `process_linux_test.go`, `supervisor_test.go`, `service_test.go`, app `cancel.go`, `internal/equipotest/cancel_test.go`; extend protocol and journal persistence.
-**Interfaces:** `runner.Supervisor.Run(ctx context.Context, claim runnerproto.ClaimResponse) error`, `Cancel(ctx context.Context, scope team.Scope, h team.Handle) (runnerproto.ContainmentProof, error)`, `Recover(ctx context.Context) error`. `ContainmentProof{Attempt team.AttemptID; Fence int64; ServerID, AgentID, WorkspaceID, BootID string; ProcessIdentities []ProcessIdentity; CheckedAt time.Time; Empty bool}`; `ProcessIdentity{HostPID int; StartTicks uint64; BootID string}`. `ProcessInspector.Remaining(ctx context.Context, agent paseo.Agent, workspace paseo.Workspace) ([]ProcessIdentity, error)` is injected; unknown coverage/errors cannot produce `Empty=true`. App `(*Store).CancelTask(ctx context.Context, actor Actor, taskID string, revision int64) (team.CancelReport, error)`.
+**Interfaces:** `runner.Supervisor.Run(ctx context.Context, claim runnerproto.ClaimResponse) error`, `Cancel(ctx context.Context, scope team.Scope, h team.Handle) (runnerproto.ContainmentProof, error)`, `Recover(ctx context.Context) error`. `ContainmentProof{Attempt team.AttemptID; Fence int64; ServerID, AgentID, WorkspaceID, BootID string; ProcessIdentities []ProcessIdentity; CheckedAt time.Time; Empty bool}`; `ProcessIdentity{HostPID int; StartTicks uint64; BootID string}`. `ProcessInspector` has `Track(ctx context.Context, owner ProcessOwner) error`, `Remaining(ctx context.Context, owner ProcessOwner) (ProcessInventory, error)` and `Stop(ctx context.Context, identity ProcessIdentity) error`. `ProcessOwner{Attempt team.AttemptID; Marker string; Agent paseo.Agent; Workspace paseo.Workspace; ExecutorGroups []ProcessIdentity}` and `ProcessInventory{Processes []ProcessIdentity; TerminalIDs []string; CoverageKnown bool}` retain both OS and Paseo ownership. Build production `NewLinuxProcessInspector(procRoot string, client paseo.Client, journal *Journal) (ProcessInspector, error)` in this task, not just a fake. It uses `/proc` in production; unreadable coverage/errors cannot produce `Empty=true`. Extend `paseo.Client` with `ListTerminals(ctx context.Context, workspace paseo.Workspace) ([]Terminal, error)` and `KillTerminal(ctx context.Context, id string) error`, mapped to the exports in Task 9; `Terminal` retains exact ID/workspace ownership, not a guessed PID. App `(*Store).CancelTask(ctx context.Context, actor Actor, taskID string, revision int64) (team.CancelReport, error)`.
-- [ ] **Step 1: Add `TestRunnerBugWorkflow`, `TestCancelStopsArchivesThenVerifies`, `TestCancelSurvivingBackgroundChild`, `TestRunnerLeaseLoss`, `TestRunnerRestartDoesNotDuplicate`, `TestProcessIdentityReuse`.** Observe ordered calls stop → archive agent → stop owned check processes → archive workspace → verify all owned processes absent → contain report. A surviving detached/background child or unknown process inventory prevents acknowledgement and reclaim. Namespace PID is never signalled as a host PID; reused host PID with different start/boot identity is never killed. Wall-clock rollback and suspend exhaust a monotonic deadline; failed renewals stop work before lease expires. Instance outage buffers reports but cannot extend authority. Crash after successful completion but before containment still triggers cleanup on restart, not another agent.
+- [ ] **Step 1: Add `TestRunnerBugWorkflow`, `TestCancelStopsArchivesThenVerifies`, `TestCancelSurvivingBackgroundChild`, `TestRunnerLeaseLoss`, `TestRunnerRestartDoesNotDuplicate`, `TestProcessIdentityReuse`, `TestLinuxInspectorEnvironmentStrippedChild`, `TestLinuxInspectorUnknownCoverage`, `TestBugPreparationIntegration`.** Observe ordered calls stop → archive agent → stop owned check processes → archive workspace → verify all owned processes absent → contain report. A surviving detached/background child or unknown process inventory prevents acknowledgement and reclaim. Namespace PID is never signalled as a host PID; reused host PID with different start/boot identity is never killed. Wall-clock rollback and suspend exhaust a monotonic deadline; failed renewals stop work before lease expires. Instance outage buffers reports but cannot extend authority. Crash after successful completion but before containment still triggers cleanup on restart, not another agent. The Linux test launches a real test-owned parent with the attempt env marker and a child that clears its environment, detaches and keeps the attempt worktree cwd; after the parent exits, `Remaining` must still find the child and refuse Contain. Then stop that exact PID/start/boot identity and require empty coverage plus a successful dependent-step claim. A second fixture changes cwd after being tracked and remains owned by its recorded identity. Inject unreadable same-user `/proc` entries, PID reuse and inventory interruption: coverage stays unknown, no stopped acknowledgement, and unrelated test-owned control processes survive. These tests must use the production inspector, not a mock returning empty.
```go
if remainingProcesses > 0 && contained { t.Fatal("acknowledged a surviving process") }
if newAgentAfterUncertainCreate { t.Fatal("restart duplicated an agent") }
```
-- [ ] **Step 2: Run red.** `go test ./internal/runner ./internal/equipotest -run 'TestRunnerBugWorkflow|TestCancel|TestRunnerLease|TestRunnerRestart|TestProcessIdentity' -count=1`.
-- [ ] **Step 3: Implement the state machine.** Persist each transition and all IDs before the next effect. Reproduce: create agent with scoped tools, subscribe/await readiness, admit/send, freeze result, executor runs base and rejects anything except the expected test failure. Implement: fresh agent consumes frozen reproduction and returns a clean captured commit. Review: fresh different-family agent sees exact candidate and submits structured verdict. Verify: runner executor only, no provider call. Publish: runner only, after the complete evidence gate. For model steps, reserve/admit every turn and persist the exact session identity before accepting artifacts. Register artifact results while the handle is valid; Complete then archive/verify/Contain; only then start a dependent step. Rejected review or failed checks ends this fixed run with evidence and no publication; revisions/replanning are not silently invented.
+- [ ] **Step 2: Run red.** `go test ./internal/runner ./internal/equipotest -run 'TestRunnerBugWorkflow|TestCancel|TestRunnerLease|TestRunnerRestart|TestProcessIdentity|TestLinuxInspector|TestBugPreparationIntegration|TestBugPreparationCrash' -count=1`.
+- [ ] **Step 3: Implement preparation and the state machine.** Wire Task 7's preparation outbox to Task 8's runner assignment, Task 10's local Git preparation and Task 11's baseline capture; now run real protocol/fetch crash cases and replace artifact/question fakes with Tasks 11–13 validators. Persist each transition and all IDs before the next effect. Reproduce: create agent with scoped tools, subscribe/await readiness, admit/send, freeze result, executor runs base and rejects anything except the expected test failure. Implement: fresh agent consumes frozen reproduction and returns a clean captured commit. Review: fresh different-family agent sees exact candidate and submits structured verdict. Verify: runner executor only, no provider call. Publish: runner only, after the complete evidence gate. For model steps, reserve/admit every turn and persist the exact session identity before accepting artifacts. Register artifact results while the handle is valid; Complete then archive/verify/Contain; only then start a dependent step. Rejected review or failed checks ends this fixed run with evidence and no publication; revisions/replanning are not silently invented.
- Supervisor renews every 15 seconds and starts shutdown with a 10-second safety margin before its 60-second lease, using elapsed/boot time that includes suspension on Linux. Restart treats prior authority as expired until the instance validates it; never reuse a cached dispatch ticket. Cancel transaction first fences work and revokes intents; response is stop requested while containment is pending. Afterwards acknowledge stopped only on process verification, preserving in-flight action uncertainty separately. No PID guessing, broad `pkill` or daemon-wide shutdown on the shared machine. The adapter must enumerate agent tool jobs and workspace-owned terminals plus executor process groups; if Paseo cannot supply complete ownership, the live gate is blocked and requests that capability. A timer or an `idle` status is not proof. Graceful runner shutdown drains reports or leaves durable pending cleanup; the service restarts to finish it. After all successful attempts are contained, `Conclude` verifies publication and the app marks the human merge step waiting.
+ Supervisor renews every 15 seconds and starts shutdown with a 10-second safety margin before its 60-second lease, using elapsed/boot time that includes suspension on Linux. Restart treats prior authority as expired until the instance validates it; never reuse a cached dispatch ticket. Cancel transaction first fences work and revokes intents; response is stop requested while containment is pending. Afterwards acknowledge stopped only on process verification, preserving in-flight action uncertainty separately. No PID guessing, broad `pkill` or daemon-wide shutdown on the shared machine. Build the Linux inspector before wiring the supervisor. Set nonsecret `EQUIPO_ATTEMPT_MARKER=<random-attempt-id>` in `createAgent.env` and in executor/tool process environments. Start tracking before the first prompt. Read `/proc/sys/kernel/random/boot_id`; scan same-user `/proc/<pid>/{stat,environ,cwd}` for the exact marker or canonical attempt-worktree cwd (including descendants), and retain descendants/process groups seen while their ancestry is known. Persist PID, `/proc/<pid>/stat` start ticks and boot ID in the journal before signalling. Rescan after stop/archive, include the recorded executor groups and Paseo terminals for the exact workspace, stop those terminal IDs, and require none remain. Never signal on a namespace PID or a stale identity; recheck identity immediately before each signal. A child stripping its environment is still found by cwd or tracked ancestry. A process that loses all attribution before observation, inaccessible same-user entries, a failed terminal list or interrupted monitoring means unknown coverage, never empty. Do not kill another user's processes; inaccessible entries are excluded only when their UID is known to be unrelated. If host permissions or provider behavior prevent complete coverage, dispatch stays unavailable until the ownership gap is fixed. This implements local ownership; it does not assume Paseo owns process trees. A timer or an `idle` status is not proof. Graceful runner shutdown drains reports or leaves durable pending cleanup; the service restarts to finish it. After all successful attempts are contained, `Conclude` verifies publication and the app marks the human merge step waiting.
- [ ] **Step 4: Run green.** Repeat Step 2 with fake client plus real test-owned subprocesses. Mutate stop/archive ordering and process verification separately. Preserve `TestTimeChargeWaitsForContainment` and cancellation/late-receipt regressions.
- [ ] **Step 5: Commit.** `git commit -m "feat: supervise bug steps and verify cancellation containment"`.
### Task 16: Show live tasks, connections and recovery in the existing shell
-**Files:** Create app `task_views.go`, `task_handlers.go`, templates `tasks.html`, `task.html`, `task_form.html`, `task_card.html`, `connections.html`, `enrol.html`, `recovery.html`, optional `static/tasks.js`; modify `handlers.go`, `app.go`, `navigation.go`, `render.go`, `copy.go`, `copy_test.go`, `static/equipo.css`, templates `specialist.html`, `chrome.html`, `index.html`, `project.html`; create `internal/equipotest/task_pages_test.go`; modify browser/performance tests.
+**Files:** Create app `task_views.go`, `task_handlers.go`, templates `tasks.html`, `task.html`, `task_form.html`, `task_card.html`, `connections.html`, `enrol.html`, `recovery.html`; modify `handlers.go`, `app.go`, `navigation.go`, `render.go`, `copy.go`, `copy_test.go`, `static/equipo.css`, templates `specialist.html`, `chrome.html`, `index.html`, `project.html`; create `internal/equipotest/task_pages_test.go`; modify browser/performance tests.
-**Interfaces:** `(*Store).TaskView(ctx context.Context, actor Actor, taskID string) (TaskView, error)`, `Journey(ctx context.Context, actor Actor, after string, limit int) (TaskPage, error)`, `SpecialistWork(ctx context.Context, actor Actor, key string) (SpecialistView, error)`. `TaskView` combines Task, ordered step cards, questions, selection/actual identity, usage availability, evidence links, cancellation state and merge owner. `TaskPage` carries rows and next cursor; `SpecialistView` carries working/queued/finished-week counts, measured tokens with known/unknown flag, tasks and existing settings. Use `team.Events(ctx, scope, after)` and the durable app projection as change sources.
+**Interfaces:** `(*Store).TaskView(ctx context.Context, actor Actor, taskID string) (TaskView, error)`, `Journey(ctx context.Context, actor Actor) (TaskPage, error)`, `SpecialistWork(ctx context.Context, actor Actor, key string) (SpecialistView, error)`. `TaskView` combines Task, ordered step cards, questions, selection/actual identity, usage availability, evidence links, cancellation state and merge owner. `TaskPage` carries all active/waiting rows and this week's finished rows, with no cursor or pagination; `SpecialistView` carries working/queued/finished-week counts, measured tokens with known/unknown flag, tasks and existing settings. Use `team.Events(ctx, scope, after)` and the durable app projection as change sources.
-- [ ] **Step 1: Add `TestTaskPages`, `TestTaskPagesUnknownCounts`, `TestTaskFormsCSRFAndRevision`, `TestTaskLiveRefresh`, `TestTaskLayoutRules`.** Form-to-detail works without JavaScript. Shared members see the same tasks; writes use current authorized actor. Journey uses ordered chips beside cards, not a task table, with category/action and model/account when assigned. Only one family produces a visible wait. Cancel requested and stopped differ. Unknown counters are unavailable/503, never zero. Counts match records across all five specialist pages and rail. HTML injection in descriptions, question text, branch names and logs is escaped. Chips use labels/icons as well as color; no percentages, initials or coloured left borders. Unauthenticated event feed is denied; membership removal closes it.
+- [ ] **Step 1: Add `TestTaskPages`, `TestTaskPagesUnknownCounts`, `TestTaskFormsCSRFAndRevision`, `TestTaskLiveRefresh`, `TestTaskLayoutRules`.** Form-to-detail works without JavaScript. Shared members see the same tasks; writes use current authorized actor. Journey uses ordered chips beside cards, not a task table, with category/action and model/account when assigned. Only one family produces a visible wait. Cancel requested and stopped differ. Unknown counters are unavailable/503, never zero. Counts match records across all five specialist pages and rail. HTML injection in descriptions, question text, branch names and logs is escaped. Chips use labels/icons as well as color; no percentages, initials or coloured left borders. Live read-only views refresh the whole page every 15 seconds through a plain HTML refresh; every request rechecks membership. Use a separate explicit edit/answer form page without auto-refresh so drafts/focus are not discarded. No EventSource endpoint, fragment replacement or pagination. Tests check refresh presence on live views and absence on editable forms, and deny the next refresh after membership removal.
```go
if response.Code != http.StatusServiceUnavailable { t.Fatal("count error rendered as zero") }
if horizontalOverflow || coloredLeftAccent { t.Fatal("task layout violates shell rules") }
@@ -359,28 +393,28 @@ For every task: record red command/result, green command/result and guard-mutati
- [ ] **Step 2: Run red.** `go test ./internal/equipotest -run 'TestTaskPages|TestTaskForms|TestTaskLive|TestTaskLayout' -count=1`.
- [ ] **Step 3: Inventory copy before inserting runtime strings.** Apply the copy-review workflow to task/enrolment/connection/recovery forms, wait and error states, permission actions, evidence labels, usage qualifiers, accessible names and runner CLI/service diagnostics. Mark pending keys individually in `copy.go`, including `task.wait.family`, `task.wait.setup`, `task.cancel.requested`, `task.cancel.stopped`, `usage.counted_turns`, `usage.allowance_unknown`, `recovery.unknown_charged`, and `runner.preflight.unavailable`. The task brief permits flagged draft entries; remove markers only after review and apply edits verbatim. Add `TestReleaseCopyReviewed` and Make target `copy-release-check`, required by both release targets, which refuse any pending entries. Export `RunnerText(key string) string` from this copy file for runner display strings. No README changes or unapproved mockup wording.
-- [ ] **Step 4: Implement screens and forms.** GET `/tasks/new`, POST `/tasks`, GET `/tasks/{id}`, POST `/tasks/{id}/cancel`, POST `/tasks/{id}/acknowledge-merge`; replace `/journey`, `/needs-you`, `/connections` and specialist activity. Add owner recovery GET `/settings/recovery`, POST `/settings/recovery/release`, provider/family policy POST `/projects/{id}/models` and personal choice POST `/projects/{id}/connections`. Merge acknowledgement requires the current saved merge owner, revision and a person-supplied Amadan reference; label it as reported by that person. Team owners cannot impersonate them. Forms return 303, invalid input 422, stale revision 409, forbidden 403 and unavailable 503 through copy keys. Keep Conversation an honest form entry/card destination, with no coordinator claims.
+- [ ] **Step 4: Implement screens and forms.** GET `/tasks/new`, POST `/tasks`, GET `/tasks/{id}`, POST `/tasks/{id}/cancel`, POST `/tasks/{id}/acknowledge-merge`; replace `/journey`, `/needs-you`, `/connections` and specialist activity. Add owner recovery GET `/settings/recovery`, POST `/settings/recovery/release`, personal choice POST `/projects/{id}/connections`. Merge acknowledgement requires the current saved merge owner, revision and a person-supplied Amadan reference; label it as reported by that person. Team owners cannot impersonate them. Forms return 303, invalid input 422, stale revision 409, forbidden 403 and unavailable 503 through copy keys. Keep Conversation an honest form entry/card destination, with no coordinator claims.
- Group Journey as needs-person, in-progress, queued and finished this week; show failure/cancellation labels within recent finished records. Needs you contains the current person's actionable questions and merge steps. Specialist pages retain settings and include working/queued/finished-week rows and counted usage. Update account/project totals from real task/usage data with checked arithmetic. Use cursor pagination, 50 rows/page. Optional app-owned EventSource receives change IDs at `/tasks/events` and refreshes relevant rendered fragments without losing focus or entered form text; 15-second heartbeats and reconnect cursor. With scripts disabled, ordinary links/refresh and all forms still work. Do not modify vendored JavaScript/CSS. Preserve the phone index/back links and one `aria-current` destination.
-- [ ] **Step 5: Run green and browser checks.** Repeat Step 2. `go test -tags browser ./internal/equipotest -run TestRunnerTaskBrowserWalk -count=1` at widths 1280/390, scripts on/off; require no overflow with long names, keyboard access and readable chips. Add private-page sign-in/setup to `TestPerfScreens` for every new GET screen, explicit exclusions for long-poll/event/download endpoints, then run `make perf`. Inspect at normal motion too; record the existing framework transition issue if reproducible, never silently mask it.
+ Group Journey as needs-person, in-progress, queued and finished this week; show failure/cancellation labels within recent finished records. Needs you contains the current person's actionable questions and merge steps. Specialist pages retain settings and include working/queued/finished-week rows and counted usage. Update account/project totals from real task/usage data with checked arithmetic. Use plain 15-second page refresh on live read-only views. Render active/waiting tasks and recent finished tasks without cursor pagination; keep the defined weekly window and check `make perf`. Editable forms live on non-refreshing pages. Ordinary links and all forms work with scripts disabled. Do not modify vendored JavaScript/CSS. Preserve the phone index/back links and one `aria-current` destination.
+- [ ] **Step 5: Run green and browser checks.** Repeat Step 2. `go test -tags browser ./internal/equipotest -run TestRunnerTaskBrowserWalk -count=1` at widths 1280/390, scripts on/off; require no overflow with long names, keyboard access and readable chips. Add private-page sign-in/setup to `TestPerfScreens` for every new GET screen, explicit exclusions for long-poll/download endpoints, then run `make perf`. Inspect at normal motion too; record the existing framework transition issue if reproducible, never silently mask it.
- [ ] **Step 6: Commit.** `git commit -m "feat: show live bug tasks and runner status in the app"`.
### Task 17: Package and wire the runner user service
-**Files:** Create `cmd/equipo-runner/{main,main_test}.go`, runner `config.go`, `client.go`, `config_test.go`, `client_test.go`, `packaging/equipo-runner.service`; modify app `config.go`, `app.go`, `execution.go`, `cmd/equipo/main.go`, Makefile and CI wrappers; create `internal/equipotest/runner_startup_test.go`, `runner_release_test.go`.
+**Files:** Expand `cmd/equipo-runner/{main,main_test}.go` from Task 13; create runner `connections.go`, `connections_test.go`, `config.go`, `client.go`, `config_test.go`, `client_test.go`, `packaging/equipo-runner.service`; modify app `config.go`, `app.go`, `execution.go`, `cmd/equipo/main.go`, Makefile and CI wrappers; create `internal/equipotest/runner_startup_test.go`, `runner_release_test.go`.
-**Interfaces:** `runner.Config{Origin, StateDir, PaseoHome, NodePath, BridgePath, AmadanCredentialPath, AccountBindingsPath string}`; `runner.LoadConfig(getenv func(string) string) (Config, error)`, `runner.Enrol(ctx context.Context, cfg Config, output io.Writer) error`, `runner.Run(ctx context.Context, cfg Config) error`. Command verbs: `enrol`, `run`, `preflight`, `tool`, `version`; `tool` is stdio-only from Task 13. App Config adds `ExecutionEnabled bool` and `ExecutionMarkerPath string`; `OpenExecution(ctx context.Context, d *db.DB, path string, cfg Config, store *Store) (*Execution, error)`, `(*Execution).Close() error`. Preserve `App`/`Router` callers by adding explicit `AppWithExecution`/`RouterWithExecution` constructors with `execution *Execution` as the final argument; old constructors build the disabled app.
+**Interfaces:** `runner.Config{Origin, StateDir, PaseoHome, NodePath, BridgePath, AmadanCredentialPath, AccountBindingsPath, CodexPath string}`; `runner.LoadConfig(getenv func(string) string) (Config, error)`, `runner.Enrol(ctx context.Context, cfg Config, output io.Writer) error`, `runner.Run(ctx context.Context, cfg Config) error`. Command verbs: `enrol`, `run`, `preflight`, `tool`, `version`; `tool` uses stdio toward the harness and the private Unix socket toward the runner, from Task 13. App Config adds `ExecutionEnabled bool` and `ExecutionMarkerPath string`; `OpenExecution(ctx context.Context, d *db.DB, path string, cfg Config, store *Store) (*Execution, error)`, `(*Execution).Close() error`. Preserve `App`/`Router` callers by adding explicit `AppWithExecution`/`RouterWithExecution` constructors with `execution *Execution` as the final argument; old constructors build the disabled app.
-- [ ] **Step 1: Add `TestRunnerConfig`, `TestRunnerHTTPClient`, `TestRunnerServiceLifecycle`, `TestExecutionStartupClosed`, `TestRunnerReleaseContract`.** Enrol/run opens no listener, no root requirement, state directory 0700/credential file 0600, atomic token writes and process lock prevent two services on one state directory. Reject cross-origin redirects and TLS failures before bearer reuse. Missing/expired credential requires enrolment; rotation cannot bypass revocation. Disabled app opens no core or adapter. Enabled app uses the existing writer, applies schema before attach, synchronizes configured budgets and Resume before dispatch; fresh witness mismatch opens UI/recovery but no work. Construction failure and SIGTERM close core before app DB. Release stamps commit, includes exact adapter lock/package, and refuses dirty tracked source or pending copy.
+- [ ] **Step 1: Add `TestRunnerConfig`, `TestRunnerHTTPClient`, `TestRunnerServiceLifecycle`, `TestExecutionStartupClosed`, `TestRunnerReleaseContract`, `TestExecutionHibernateWitness`.** Enrol/run opens no TCP or inet listener; only the per-attempt Unix socket from Task 13 is allowed, no root requirement, state directory 0700/credential file 0600, atomic token writes and process lock prevent two services on one state directory. Reject cross-origin redirects and TLS failures before bearer reuse. Missing/expired credential requires enrolment; rotation cannot bypass revocation. Disabled app opens no core or adapter. Enabled app uses the existing writer, applies schema before attach, synchronizes configured budgets and Resume before dispatch; fresh witness mismatch opens UI/recovery but no work. Construction failure and SIGTERM close core before app DB. Release stamps commit, includes exact adapter lock/package, and refuses dirty tracked source or pending copy. `TestRunnerServiceUsesLinuxInspector` constructs the real service with the Linux inspector and repeats the surviving-child case; fake-only process wiring fails. Discovery accepts only operator-bound, observed accounts with no-failover/read-isolation capability, and never marks the currently unsupported Codex route eligible.
```go
- if listeners != 0 { t.Fatal("runner opened an inbound port") }
+ if tcpOrInetListeners != 0 { t.Fatal("runner opened a TCP or inet listener") }
if attachedDatabasePath != resolvedDatabasePath { t.Fatal("execution uses another database") }
```
-- [ ] **Step 2: Run red.** `go test ./cmd/equipo-runner ./internal/runner ./internal/equipotest -run 'TestRunnerConfig|TestRunnerHTTP|TestRunnerService|TestExecutionStartup|TestRunnerRelease' -count=1`.
-- [ ] **Step 3: Implement service wiring.** `EQUIPO_EXECUTION_ENABLED=1` opts in; otherwise preserve Foundation's unopened store. Production main resolves activation, opens one DB, builds app schema, attaches execution and clears `opts.DBPath`; shutdown stops background reconciliation before closing core then DB. Keep the witness outside the SQLite file at a stable configured local path; never store it in a row beside the history it witnesses. Missing/lost witness forces quarantine. Hibernation reports/renewals are ordinary requests; instance downtime never extends a runner lease.
+- [ ] **Step 2: Run red.** `go test ./cmd/equipo-runner ./internal/runner ./internal/equipotest -run 'TestRunnerConfig|TestRunnerHTTP|TestRunnerService|TestExecutionStartup|TestRunnerRelease|TestRunnerServiceUsesLinuxInspector|TestExecutionHibernateWitness|TestConnections|TestAccountFailover' -count=1`.
+- [ ] **Step 3: Implement service wiring.** `EQUIPO_EXECUTION_ENABLED=1` opts in; otherwise preserve Foundation's unopened store. Production main resolves activation, opens one DB, builds app schema, attaches execution and clears `opts.DBPath`; shutdown stops background reconciliation before closing core then DB. Keep the witness outside the SQLite file at a stable configured local path; never store it in a row beside the history it witnesses. Missing/lost witness forces quarantine. The `oficina` deployment must preserve the witness and lock on stable storage across hibernation; SQLite backup alone is insufficient and its witness must not be rolled back alongside restored history. Test normal hibernate/wake with the witness preserved and loss of local witness with the same DB: the latter opens recovery only. Hibernation reports/renewals are ordinary wake-up requests; instance downtime never extends a runner lease. Record actual witness survival in the human deployment checklist; if the platform cannot preserve it, wake-up must quarantine rather than auto-release.
- Runner reads origin/state/Paseo home from explicit configuration, keeps provider homes unchanged, and stores only machine key, runner credential and journal in its private state directory. The Amadan agent credential is an operator-provisioned local secret opened only by the forge/fetch boundary, never passed to bridge or agents. Device enrolment prints the browser verification address and code via reviewed copy; it does not start a browser server. User unit uses `Type=simple`, explicit executable/config paths, `Restart=on-failure`, bounded shutdown and no root install. Make `runner-release` produce a docs-t1 Linux/amd64 bundle with Go binary, bridge and locked production Node dependencies; keep instance release Linux/arm64 default. Node version compatibility comes from the pinned package/tested runtime, recorded in the release manifest. Unit installation/enabling is a human action after Task 18. No automatic deployment or modification of the shared Paseo daemon.
+ Runner reads origin/state/Paseo home from explicit configuration, keeps provider homes unchanged, and stores machine key, runner credential, journal, attempt capabilities and private sockets in its state directory. The Amadan agent credential is an operator-provisioned local secret opened only by the forge/fetch boundary, never passed to bridge or agents. Device enrolment prints the browser verification address and code via reviewed copy; it does not start a browser server. Wire `NewLinuxProcessInspector("/proc", client, journal)` into the production supervisor, with failed/unknown coverage blocking dispatch. Implement Task 6's deferred discovery/account-binding runner side through Task 9, with sanitized fake SDK tests. Keep the read-isolation decisions enforced in config/preflight; verify the configured command-sandbox Codex binary version before checks. User unit uses `Type=simple`, explicit executable/config paths, `Restart=on-failure`, bounded shutdown and no root install. Make `runner-release` produce a docs-t1 Linux/amd64 bundle with Go binary, bridge and locked production Node dependencies (including server 0.14.0 for daemon-control); keep instance release Linux/arm64 default. Record tested Node v24.19.0 and the installed Codex 0.165.0 command-sandbox prerequisite in the release manifest; the runner must refuse an unverified version. CI provisions Node for `runner-adapter-test` and Codex 0.165.0 for command-only `TestCheckSandboxDeniedPaths`; both prerequisites are checked, with no skipped success. Installing Codex for this check does not authorize a provider session or require login. Unit installation/enabling is a human action after Task 18. No automatic deployment or modification of the shared Paseo daemon.
- [ ] **Step 4: Run green.** Repeat Step 2; `CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner`, `make runner-adapter-test`, `make migration-check`. Use fake executables to inspect release/service commands; do not install the service during tests.
- [ ] **Step 5: Commit.** `git commit -m "build: package the outbound runner and wire guarded startup"`.
@@ -388,9 +422,9 @@ For every task: record red command/result, green command/result and guard-mutati
**Files:** Create `internal/equipotest/runner_flow_test.go`, `internal/runner/paseo/live_test.go`; modify `internal/equipotest/browser_test.go`, `perf_test.go`, Makefile and CI wrappers as needed for the same gates. Store the controller's test/mutation/capability report with the implementation review, not in README.
-**Interfaces:** `TestRunnerEndToEnd` starts the real HTTP instance and Go runner with fake Paseo transport and local bare forge; no external provider. `TestPaseoLiveContract` uses explicit environment `EQUIPO_LIVE_PASEO=1` and an operator-supplied disposable repository plus their enrolled connections. Ordinary CI does not run or count this live gate.
+**Interfaces:** `TestPaseoLiveReadIsolation` and `TestPaseoLiveTurnCalibration` use the same explicit live opt-in as `TestPaseoLiveContract`. `TestRunnerEndToEnd` starts the real HTTP instance and Go runner with fake Paseo transport and local bare forge; no external provider. `TestPaseoLiveContract` uses explicit environment `EQUIPO_LIVE_PASEO=1` and an operator-supplied disposable repository plus their enrolled connections. Ordinary CI does not run or count this live gate.
-- [ ] **Step 1: Add failing end-to-end acceptance assertions.** Enrol Paul and a second member, report distinct personal connections, configure project/team budgets and model allowlists, submit bug, observe reproduce → fix → review → checks → publication → merge-owner wait. Verify exact remote commit, frozen reproduction, base fail/candidate pass, repository-check counts, different-family review and provenance. Second member can read but cannot use Paul's connection. One-family setup waits with zero provider dispatches. Repeat task submission, crash runner after dispatch, lose one event/receipt, restart instance, restore older DB with a newer/missing witness, lower budget, change roster/project mid-step, cancel during a permission wait and during a background process. Assert one publication at most and no false stopped/succeeded state.
+- [ ] **Step 1: Add failing end-to-end acceptance assertions.** Enrol Paul and a second member, report distinct personal connections, configure project/team budgets and personal connection choices, submit bug, observe reproduce → fix → review → checks → publication → merge-owner wait. Verify exact remote commit, frozen reproduction, base fail/candidate pass, repository-check counts, different-family review and provenance. Second member can read but cannot use Paul's connection. One-family setup waits with zero provider dispatches. Repeat task submission, crash runner after dispatch, lose one event/receipt, restart instance, restore older DB with a newer/missing witness, lower budget, change roster/project mid-step, cancel during a permission wait and during a background process. Assert one publication at most and no false stopped/succeeded state.
```go
if remoteHead != checkedCommit || remoteHead != reviewedCommit { t.Fatal("evidence and publication diverged") }
if providerDispatchesWithOneFamily != 0 { t.Fatal("task ran without independent review capacity") }
@@ -399,27 +433,60 @@ For every task: record red command/result, green command/result and guard-mutati
- [ ] **Step 2: Run red.** `go test ./internal/equipotest -run TestRunnerEndToEnd -count=1`; observe the first missing integration behavior rather than marking skipped fixtures as success.
- [ ] **Step 3: Complete wiring only where acceptance fails.** Reuse Tasks 1–17 contracts; no new coordinator, product view, model guessing or special test-only authentication. Add the live contract assertions for structured events/recovery, Codex/Claude permission responses, per-agent MCP, observed credential-home identity, failover refusal, subscription usage completeness and stop/archive/process cleanup. A missing upstream guarantee is a named blocking capability with its failing assertion, not a substitute implementation.
- [ ] **Step 4: Run green and the offline release gates once after targeted checks pass.** `make ci`; `make runner-adapter-test` is already part of that target and must also have a matching `.amadan/ci.d/` wrapper. Run `go test -tags browser ./internal/equipotest -run TestRunnerTaskBrowserWalk -count=1`, and once `go test -race ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipotest ./internal/runner/...`. Race tests are verification only and may use the toolchain's required CGO; shipped builds remain `CGO_ENABLED=0`. Verify build/vet/format/staticcheck/govulncheck/gitleaks/budgets/tests/migration/performance all ran, new packages use the repository's budget TestMain pattern, and source/test size limits have not been silently raised. Report mutation commands and restored guards. No full-suite loops without a new failure/change.
-- [ ] **Step 5: Run the authorized live compatibility gate on docs-t1.** Only after Question 1 and operator-selected connections/repository are settled, run `EQUIPO_LIVE_PASEO=1 go test -tags paseo_live ./internal/runner/paseo -run TestPaseoLiveContract -count=1`. Use a task-owned disposable workspace and the person's actual allowed accounts; preserve another user's daemon/projects/agents. Require both model families, complete account routing evidence, reconnect recovery, and proven absence of agent/background/terminal processes after cancellation. If any prerequisite is absent, report the precise blocked gate and product capability needed. Do not call offline fixtures proof of live reliability. This planning session runs none of it.
+- [ ] **Step 5: Run the authorized live compatibility gate on docs-t1.** Question 1 is ruled. After supported isolation/account-routing interfaces and operator-selected connections/repository exist, run `EQUIPO_LIVE_PASEO=1 go test -tags paseo_live ./internal/runner/paseo -run 'TestPaseoLiveContract|TestPaseoLiveReadIsolation|TestPaseoLiveTurnCalibration' -count=1`. Use a task-owned disposable workspace and the person's actual allowed accounts; preserve another user's daemon/projects/agents. Require both eligible model families, complete account routing evidence, reconnect recovery, and proven absence of agent/background/terminal processes after cancellation. Add `TestPaseoLiveReadIsolation` (include it in the same tagged command): one sentinel test each for runner state, the Amadan credential location, Paseo home credentials/each routed provider credential home, and `~/.ssh`, plus a readable workspace control. Create uniquely named nonsecret sentinels in each actual protected directory, including each routed credential home and `~/.ssh`; for the configured Amadan file use a disposable test credential protected by the identical file rule. Never overwrite credentials, substitute a different home to claim coverage, or ask an agent to print real secrets. Remove only the sentinel files after the test. Exercise shell `cat`, native Read/search tools, symlink aliases and requests to escape sandbox/alter policy for each path. The trusted tool verb must still authenticate using its capability file. Unknown, skipped or readable protected sentinels fail `ReadIsolation`; an unsupported provider is explicitly blocked and the two-family gate is not passed. Repeat for every enabled provider/mode and after restart. This planning revision found Codex blocked on Paseo 0.14.0, so this gate cannot currently pass. Do not weaken it.
+
+ Add `TestPaseoLiveTurnCalibration` to the same command. Measure at least one real representative turn per eligible family, recording provider/model/config hash, uncached input, cached input and output with completeness flags. The earlier Claude probe reported 18 input + 29,591 cached + 404 output; it is a warning against tiny fixture budgets, not a production calibration. Set each per-turn token reservation to twice the largest measured total input/output, rounded up to 1,000 tokens with checked arithmetic. Set the job allowance to at least 23 of those reservations and explicit project/team period headroom for the accepted run; never overwrite existing lower operator limits silently. If those limits cannot fund the test, leave the gate blocked with the required amount. Use explicit bounded calibration reservations recorded in the report, not the uncalibrated production dispatcher. Test an unknown-usage reservation followed by a known completed turn within remaining headroom, and test exhaustion. Display cached input separately. Record resulting values and measured overruns; subsequent turns may exceed an estimate and remain charged before further work is stopped. If any prerequisite is absent, report the precise blocked gate and product capability needed. Do not call offline fixtures proof of live reliability. This planning session runs none of it.
- [ ] **Step 6: Commit and hand over release artifacts.** `git commit -m "test: verify the runner workflow and live compatibility gate"`. From the clean reviewed commit run `make release` and `make runner-release`; verify both stamps and package manifests. Human deploys the instance through the existing versioned `oficina` CARLOS release procedure and installs/enables the user service on docs-t1. Human enrols, checks the origin/machine confirmation, submits a real bounded bug, follows Journey/specialists, opens evidence and the Amadan review branch, and merges through Amadan themselves. Repeat cancel on an active task and inspect acknowledged containment. No agent deploys, merges or pushes the default branch. Stop all test processes and remove only task-owned scratch; the human-installed service is the intended persistent process.
## Questions for Paul
-1. **May subscription limits count dispatched Paseo turns, with provider-internal calls/tokens recorded when observable?** An unmodified subscription CLI can make multiple model requests in a turn and cannot promise a hard token/currency cap. This plan reserves before each turn, records measured usage/overruns, enforces time/attempt limits and stops before further work. If “calls” must mean every provider request under a hard ceiling, subscription execution is blocked until Paseo/provider support supplies that boundary. Tasks 3/12 can be implemented and tested offline; Task 18 live use waits for the ruling.
+No open product questions. The existing question and its binding ruling are retained below.
+
+1. **May subscription limits count dispatched Paseo turns, with provider-internal calls/tokens recorded when observable?** An unmodified subscription CLI can make multiple model requests in a turn and cannot promise a hard token/currency cap. This plan reserves before each turn, records measured usage/overruns, enforces time/attempt limits and stops before further work. If “calls” must mean every provider request under a hard ceiling, subscription execution is blocked until Paseo/provider support supplies that boundary. The ruling below settles this question; Task 18 still requires the technical live gates.
**Ruled by the controller, 2026-11-02:** yes. A subscription "call" is a
dispatched Paseo turn; provider-internal calls and tokens are recorded
when observable and shown, never enforced as a hard cap. This is spec
section 6.8 as Paul approved it ("usage is recorded and shown, and
- Equipo's own limits (calls, time, attempts) still apply"). Task 18 is not
- blocked.
-
-Technical prerequisites are not decisions for Paul: unsupported account pinning/identity, recoverable completion usage, process ownership/cleanup or base-check adapters must be established by contract tests or requested from the owning product. No permission is sought to invent those interfaces. There is no project/account deletion question: it is not needed for this slice. No tito-studio enrolment is planned.
+ Equipo's own limits (calls, time, attempts) still apply"). The subscription call definition does not block Task 18. The technical
+ read-isolation/account-routing gates still block live acceptance where
+ unsupported.
+
+Technical prerequisites are not decisions for Paul: Codex read isolation is currently ineligible through Paseo 0.14.0; Claude has a configuration path but no live sentinel proof yet. Likewise, unsupported account pinning/identity, recoverable completion usage, process ownership/cleanup or base-check adapters must be established by contract tests or requested from the owning product. No permission is sought to invent those interfaces. There is no project/account deletion question: it is not needed for this slice. No tito-studio enrolment is planned.
+
+## Round 1 dispositions
+
+- **P1-1:** Tasks 13/17 use a per-attempt Unix socket under 0700 state, a 0600 capability file named only by environment path, and the real `tool` verb under a fake harness; no TCP or inet listener.
+- **P1-2:** Task 15 builds the Linux inspector with env marker, `/proc` cwd/ancestry scans, terminal/executor ownership, PID/start/boot identity and unknown-coverage refusal; Task 17 wires it, with a real environment-stripped-child test.
+- **P1-3:** Tasks 9/10/13/17 require `ReadIsolation`; Claude has supported settings pending live proof, Codex is ineligible on Paseo 0.14.0, and Task 18 tests every protected path without weakening the family gate.
+- **P2-1:** Task 2 fences only grants whose version/epoch changes; two-project tests keep unrelated work running, while the existing global roster epoch legitimately affects all bound grants.
+- **P2-2:** Task 9 pins server/client/protocol 0.14.0 and names each export, including daemon-control credentials and `DaemonClient.cancelAgent`.
+- **P2-3:** Task 8 stores admission identity/ticket atomically and replays it only for the same unexpired, currently authorized attempt/fence/request; Task 14 tests lost Admit replies and single execution.
+- **P2-4:** Task 11 freezes the baseline test-name set, requires a passing superset and rejects deleted test files, `t.Skip`, skipped packages/subtests and zero-test success.
+- **P2-5:** Task 11 uses separate scratch copies for reproduction overlays and rejects candidate-edited collisions; the immutable candidate export remains unchanged.
+- **P2-6:** Task 6's runner discovery moves to 17, Task 7's network/fetch preparation to 15, and Task 8 uses explicit fake validators until 15; numbered execution has no hidden forward implementation dependency.
+- **P2-7:** Tasks 2/3/7/8 own ordered core bumps 4/5/6/7, app migration mirrors and upgrade/parity tests against `team.SchemaVersion`.
+- **P2-8:** Tasks 3/12 bound per-turn reservations, retain unknown charges and report cached input separately; Task 18 measures real turns and configures job/project/team limits from the measurements.
+- **P3 carry 7:** Task 6 adds `TestProjectAccountNoDeleteAndASCIILabels` to pin the absent deletion paths and existing label behavior.
+- **P3 reproduction identity:** Task 11 adds `candidateHash` to `Reproduce`, with base-commit versus candidate-artifact subject assertions.
+- **P3 writer DSN:** Task 1 explicitly requires and asserts one writer connection for Rastrillo's DSN; larger pools are refused.
+- **P3 hibernation:** Task 17 tests preserved/lost witnesses across `oficina` wake-up and requires stable external witness storage or quarantine.
+- **P3 CI Node:** Tasks 9/17 provision and check Node v24.19.0 for the same `runner-adapter-test` Make/CI gate and release manifest.
+- **P3 MCP type:** Tasks 9/13 serialize `type: "stdio"` and exercise the actual spawn contract.
+- **P3 cleanup accounting:** Task 8's `TestRevokedCleanupCannotRefund` prevents cleanup-only reports from reducing charges; lower settlement requires corroboration and owner audit.
+- **P3 account routing:** Tasks 9/17 identify ZeroSub 1.3.0's automatic failover and refuse eligibility without a proven per-agent no-failover/account observation interface; full live proof remains a named technical prerequisite, not assumed support.
+- **Cut cross-machine transfer:** Tasks 6/10/11 bind the whole run to one docs-t1 runner with local candidate staging and complete bounded blobs; remove Git bundles and chunked transfer.
+- **Cut enrolment-response recovery:** Task 5 requires fresh browser-approved enrolment after a lost exchange; retain only credential hashes.
+- **Cut EventSource and pagination:** Task 16 uses plain 15-second page refresh on read-only live views and separate forms, with no Journey cursor or event feed.
+- **Cut owner allowlist:** Tasks 6/16 defer provider/family policy editing to plan 4; personal selection and different-family review remain.
+
+No P3 sentence/test is left unapplied. Read isolation, process coverage and account routing remain release gates whose live success is not claimed by this planning revision.
## Self-review
1. **Spec coverage:** §3.2 independent Review → Tasks 4/6/15; §3.4 fixed immutable bug path/person at end → 7/16; §§4.1–4.4 live rail/Journey/specialists/task cards → 16; §§6.1/6.8/6.9 runner/enrolment/claim/workspaces/client/questions/finish/cancel → 5–15/17; §§6.2/6.5 exact review-branch publication → 4/10/14; §§6.3–6.4 frozen bug evidence/trusted checks → 4/11; §6.7 authority/budgets/recovery/hibernation → 1–3/8/12/15/17; §7 personal connections and deterministic selection → 6/16; §§9–10 gates and Paul's bug/cancel try-out → 18. Coordinators, plan editing, preferences, settlement, recommendations and product ranking remain roadmap rows 3–4. Copy/design and feature predicates are deliberately absent.
-2. **Carries covered:** qualified `refs/heads/<Ref>` → 14; Project/grant agreement → 2/7; five-second admissions → 2/3/8/14; stale project/roster edits until Resume → 2/8/15; lowering limits blocks reserved undispatched work → 3; clock-back containment/time uncertainty → 2/15; no project/account deletion and unchanged ASCII label semantics → boundary decision; period full scan → 3. None is left as an unassigned reminder.
-3. **Contradictions resolved:** (a) spec CLI event-following versus probe's structured client: probe wins, Task 9; (b) spec ordinary send for questions versus permission-ID responses: probe wins, Task 13; (c) stop/archive receipt versus real containment: verify processes, Task 15; (d) core provider independence versus required family independence: version-2 family rule, Task 4; (e) fixture candidate-content digest versus Git commit identity: retain both, Task 4; (f) core reproduction-only check result versus separate repository checks: add a required role, Tasks 4/11; (g) core standalone SQLite open versus activation database ownership: borrowed writer and migration mirrors, Task 1; (h) spec hard calls/tokens language versus unmodified subscriptions: explicit accounting contract and Question 1; (i) older first-team sandbox/egress reservations versus this approved runner scope: implement the scoped subscription/harness milestone, with explicit personal connection consent; the suite amendment remains separate roadmap work, not a second approval request. Older mockup initials/navigation/colored accents are already superseded by the brief and mockup README, not new product choices.
-4. **Type and dependency check:** Existing core APIs retain their signatures unless an extension is named. The shared app transaction wrapper preserves the core witness; recovery snapshots use a semantic generation rather than the read-advancing witness revision. New wire DTOs are shared through `runnerproto`; local SDK types stay in `runner/paseo`. Core scope uses persisted Team.ID, never CARLOS account labels. Production construction waits until recovery, policy, adapters and supervisor exist; UI reads can be tested with projections earlier. Definition hash and immutable base exist before job creation; reproduction and symptom freeze precede candidate creation. Candidate artifact hash never substitutes for Git commit at push. A preparation assignment is not a provider action or an executable plan step. Artifact uploads and late recovery reports have distinct authorization paths.
+2. **Carries covered:** qualified `refs/heads/<Ref>` → 14; Project/grant agreement → 2/7; five-second admissions → 2/3/8/14; stale project/roster edits until Resume → 2/8/15; lowering limits blocks reserved undispatched work → 3; clock-back containment/time uncertainty → 2/15; no project/account deletion and unchanged ASCII label semantics → boundary decision and Task 6 pinning test; period full scan → 3. None is left as an unassigned reminder.
+3. **Contradictions resolved:** (a) spec CLI event-following versus probe's structured client: probe wins, Task 9; (b) spec ordinary send for questions versus permission-ID responses: probe wins, Task 13; (c) stop/archive receipt versus real containment: verify processes, Task 15; (d) core provider independence versus required family independence: version-2 family rule, Task 4; (e) fixture candidate-content digest versus Git commit identity: retain both, Task 4; (f) core reproduction-only check result versus separate repository checks: add a required role, Tasks 4/11; (g) core standalone SQLite open versus activation database ownership: borrowed writer and migration mirrors, Task 1; (h) spec hard calls/tokens language versus unmodified subscriptions: explicit accounting contract and the controller's settled turn-count ruling; (i) older first-team sandbox/egress reservations versus this approved runner scope: implement the scoped subscription/harness milestone, with explicit personal connection consent and required deny-read isolation; the suite amendment remains separate roadmap work, not a second approval request. Older mockup initials/navigation/colored accents are already superseded by the brief and mockup README, not new product choices.
+4. **Type and dependency check:** Existing core APIs retain their signatures unless an extension is named. The shared app transaction wrapper preserves the core witness; recovery snapshots use a semantic generation rather than the read-advancing witness revision. Core schema changes have ordered version owners, and the dependency split above separates local unit work from Tasks 15/17 integration. New wire DTOs are shared through `runnerproto`; local SDK types stay in `runner/paseo`. Core scope uses persisted Team.ID, never CARLOS account labels. Production construction waits until recovery, policy, adapters and supervisor exist; UI reads can be tested with projections earlier. Definition hash and immutable base exist before job creation; reproduction and symptom freeze precede candidate creation. Candidate artifact hash never substitutes for Git commit at push. A preparation assignment is not a provider action or an executable plan step. Artifact uploads and late recovery reports have distinct authorization paths.
5. **Review Focus and step scan:** Each of the five failure classes has named tests and owning tasks. Every task has an explicit red command, implementation interface, green check and future commit; task 16 adds its copy/browser gates. Guard mutations are required and recorded. No product function bodies, fabricated model IDs, invented forge endpoints, anonymous “handle errors” steps or unbounded live test instructions are supplied.
-6. **Proportion and verification honesty:** Eighteen independently reviewable tasks cover this one runner slice, rather than four roadmap plans. Assertions and interface declarations supply decisions; implementers write function bodies. This planning session inspected HEAD, the spec/roadmap/probe/Foundation plan/controller, discussion 2, app/core source, mockups, pinned Rastrillo DB APIs and installed Paseo package exports. It did not run implementation tests, provider sessions, pushes, deployment, or a live cancellation experiment. All future verification commands above remain unchecked until execution. The only requested artifact is this plan; no README, handoff file or product code changes are part of this session.
+6. **Proportion and verification honesty:** Eighteen independently reviewable tasks cover this one runner slice, rather than four roadmap plans. Assertions and interface declarations supply decisions; implementers write function bodies. The original plan inspected the spec/roadmap/probe/Foundation plan/controller and mockups. This revision rechecked HEAD `a66c96e`, the revision brief/findings, relevant spec/roadmap/probe, discussion 2, app/core source, pinned Rastrillo DB APIs, installed Paseo/ZeroSub exports, local CLI help and official sandbox documentation. Local schema-validation and command-only sentinel probes ran as recorded above; `git diff --check` and the task/disposition checks passed. It did not run implementation tests, provider sessions, pushes, deployment, or a live cancellation experiment. All implementation and live verification commands above remain unchecked until execution. The four cuts are reflected throughout the tasks; the current live blocker is stated explicitly instead of weakening acceptance. The only requested artifact is this plan; no README, handoff file or product code changes are part of this session.