oficina / equipo Public

Plan 2 Runner draft (Astra), with the subscription-calls ruling

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 875f7af8644bf6fa82e7847698b84a4d6db50a7f parent 5954de4
1 file changed, +425 −0
  • docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md +425 −0

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
new file mode 100644
index 00000000..53d3a9d4
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
@@ -0,0 +1,425 @@
+# Equipo Runner Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. This is the future execution method. This planning session authorizes no implementation or agent dispatch.
+
+**Goal:** Paul submits a bug through a task form, watches Engineering and Review work, and receives an Amadan review branch with evidence, with cancellation that confirms the work has stopped.
+
+**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.
+
+**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.
+- “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.
+- “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.
+- Preserve `EQUIPO_ORIGIN`, `EQUIPO_INSTANCE_KEY`, SMTP requirements and first-boot-only owners. App tables belong in `Models`/`Schema`; framework tables remain in `BootSchema` only. Migrations are additive.
+- Builds use `CGO_ENABLED=0`; leave Go caches at their defaults. Use on-disk `$TMPDIR`, bind test servers to `127.0.0.1`, stop processes and remove owned scratch. No sudo.
+- `make ci` remains the shared gate and `.amadan/ci*` delegates to Make. No automatic merge, default-branch push or deployment. Commits below are future implementation steps, with subjects under 80 characters.
+
+## Review Focus
+
+1. A reply lost after agent creation, push or task submission must not duplicate effects. Tasks 7, 12 and 14 test crash boundaries and replay conflicts.
+2. A runner token, old cookie or delayed answer from the wrong person/machine must not authorize work after removal or reassignment. Tasks 5, 8 and 13 test these with successful controls.
+3. Clock rollback, machine sleep and process-ID reuse must not keep a lease alive or produce a false stop acknowledgement. Tasks 2 and 15 test each condition.
+4. A reconnect that replaces history, repeats cumulative usage or omits completion must not undercharge or declare success. Task 12 tests all three, including unknown usage.
+5. A candidate that edits check scripts, deletes tests, or changes after review must not pass the trusted evidence gate. Tasks 4, 10 and 11 test these independently.
+
+---
+
+## 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.
+
+| Existing code | Plan decision |
+|---|---|
+| `cmd/equipo/main.go`, `app.go`, `db.DB.Writer()` in pinned Rastrillo | Preserve one activation database. Add a borrowed-pool core constructor, not an unreplicated second SQLite file. |
+| `team.Open`, `Status`, `Resume`, `.incarnation` and `.lock` | Preserve witness/lock behavior. Implement audited quarantine release before production attaches the core. A missing witness pauses admission, including after hibernation that loses local files. |
+| `JobSpec.Project`, `GrantRef`, `RosterAuthority.Introspect` | Derive project, requester and grant together. Extend `AdmissionRequest` with `Project` so the core can verify the binding at every admission. |
+| `Claim`, `Renew`, `Complete`, `Release`, `Contain` | Keep these APIs. Add an explicit supervisor stop transition for clock rollback; do not weaken `Contain` to accept an active lease. |
+| `Intend`, `Admit`, `Record`, `Lost`, `Reconcile` | Instance records/admit actions; runner executes them. Instance adapters reconcile from durable runner observations and never connect inbound to a machine. |
+| `Artifact.Hash`, `CheckResult.SubjectHash`, publication `head` | Artifact hash is SHA-256 of bytes, not a Git object ID. Add a typed Git candidate payload and retain both identities through evidence and publication. |
+| `evaluateSoftwareFix`, `RequireDistinctReviewProvider` | Add separate repository-check evidence and explicit model-family independence without weakening legacy fixture policies. |
+| `periodSum`, `Admit` | Index open/current-month rows; preserve checked arithmetic. Lower limits block even previously reserved, undispatched actions. Already dispatched actions remain charged and are contained when limits are exceeded. |
+| 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.
+
+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.
+
+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.
+
+## 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`. |
+| 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`. |
+| 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.
+
+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.
+
+For every task: record red command/result, green command/result and guard-mutation result in the controller's report. A missing-symbol failure starts the test cycle but does not prove a guard: after green, temporarily bypass each security/evidence guard, observe its named assertion fail, and restore it. Stage only the task's named files before its commit. No tests in ordinary CI invoke live providers, push to Amadan or start Paseo agents.
+
+### Task 1: Put execution state in the activation database
+
+**Files:** Create `internal/equipo/team/shared.go`, `internal/equipo/execution_models.go`, `internal/equipo/migrations/0007_execution.sql`, `internal/equipotest/execution_schema_test.go`, `internal/equipo/team/shared_test.go`; modify `team/store.go`, app `store.go`, `models.go`, `migrations/schema.sql`; create the transaction wrapper in `internal/equipo/execution.go` (expanded in Task 8).
+
+**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.
+ ```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 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.
+
+**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.
+
+- [ ] **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.
+
+ ```go
+ if !errors.Is(err, team.ErrGrantRevoked) { t.Fatal("project and grant diverged") }
+ if after.Reserved != before.Reserved { t.Fatal("release refunded uncertainty") }
+ if oldHandleAccepted { t.Fatal("stopped attempt retained authority") }
+ ```
+
+- [ ] **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 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"`.
+
+### Task 3: Define subscription accounting and bound period queries
+
+**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.
+
+- [ ] **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.
+ ```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 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"`.
+
+### Task 4: Make Git identity and repository checks part of evidence
+
+**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.
+
+- [ ] **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.
+
+ ```go
+ if report.Satisfied { t.Fatal("missing repository checks accepted") }
+ if publish.Head != candidate.Commit { t.Fatal("artifact digest used as Git object") }
+ if !errors.Is(err, team.ErrEvidence) { t.Fatal("same-family review accepted") }
+ ```
+
+- [ ] **Step 2: Run red.** `go test ./internal/equipo/team -run 'TestGitCandidate|TestBugNeeds|TestReviewDifferent|TestChangedCandidate' -count=1`.
+- [ ] **Step 3: Implement typed candidate validation and predicate extensions.** Preserve legacy fixture byte-subject semantics for version-1 jobs. Version-2 bug jobs require Git candidate media type and both checks. `checkPublication` validates repository, ref, commit and candidate hash at Intend and again at Admit, closing a candidate-change race. `ReadyToPublish` never terminates a job; reserve `Conclude` for the final contained workflow because it fails the job when evidence is incomplete. Family comes from the observed session, not model-authored review JSON. Reject unsupported Git object formats explicitly; support SHA-1 and SHA-256 with exact lengths and lowercase hex.
+- [ ] **Step 4: Run green.** Repeat Step 2 and `go test ./internal/equipo/team -run 'TestFixture|TestReview|TestEvidence|TestConclude' -count=1`. Mutate commit/hash matching, the repository-check requirement and family comparison independently.
+- [ ] **Step 5: Commit.** `git commit -m "feat: require Git-bound checks and independent model families"`.
+
+### Task 5: Enrol and revoke machines with scoped credentials
+
+**Files:** Create app `enrolment.go`, `runners.go`, `internal/runnerproto/types.go`, `validate.go`, `internal/equipotest/enrolment_test.go`; add `0010_runners.sql`, models/schema entries; modify app routing and copy keys.
+
+**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.
+ ```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 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.
+
+**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`.
+
+- [ ] **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.
+ ```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 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`.
+
+**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.
+
+- [ ] **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.
+ ```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 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.
+
+**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.
+
+- [ ] **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.
+ ```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 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.
+
+- [ ] **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.
+ ```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 5: Commit.** `git commit -m "feat: drive Paseo through a pinned structured client"`.
+
+### Task 10: Create credential-free workspaces from exact revisions
+
+**Files:** Create `internal/runner/workspace/{workspace,workspace_test}.go`, `internal/runner/workspace/testdata/` small repositories generated by tests; extend `runnerproto/types.go` and `paseo/types.go`.
+
+**Interfaces:** `workspace.Manager` uses `paseo.Client` and runner-local forge read access. Methods `Prepare(ctx context.Context, target team.TargetBinding) (runnerproto.PreparedBug, error)`, `Create(ctx context.Context, assignment runnerproto.Assignment, brief runnerproto.Brief) (paseo.Workspace, error)`, `CaptureCandidate(ctx context.Context, ws paseo.Workspace, target team.TargetBinding) (team.GitCandidate, error)`, `ExportCandidate(ctx context.Context, candidate team.GitCandidate, destination string) error`. Create a private clone per project. `WorkspaceRequest` carries explicit base commit, review branch, unique attempt workspace key and isolation `worktree`.
+
+- [ ] **Step 1: Add `TestWorkspacePinsBase`, `TestWorkspaceHasNoCredentials`, `TestCandidateCaptureCleanAndImmutable`, `TestWorkspaceRetryIdentity`.** Default branch moving after preparation does not change the base. Dirty tracked/untracked files, symlink escape or wrong repository refuses capture. Builder commits cannot switch repository/ref. Poisoned hooks, `.gitconfig`, URL rewrite rules and credential helper never run. Process environment/log/agent-visible clone config contains no Amadan bearer. An old workspace is not reused by a new attempt; a repeated creation request resolves the same workspace or remains uncertain. Capture Git commit/tree and verify the commit descends from base.
+ ```go
+ if actualBase != prepared.BaseCommit { t.Fatal("workspace followed a moving branch") }
+ 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 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`.
+
+**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`.
+
+- [ ] **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.
+ ```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.
+
+ 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.
+- [ ] **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"`.
+
+### Task 12: Persist events and usage across reconnects
+
+**Files:** Create runner `journal.go`, `events.go`, `usage.go`, their `_test.go` files; app `runner_events.go`, `internal/equipotest/runner_events_test.go`; add `0015_runner_events.sql`, models/schema entries.
+
+**Interfaces:** `runner.OpenJournal(path string) (*Journal, error)`, `(*Journal).Append(ctx context.Context, event runnerproto.Event) error`, `Pending(ctx context.Context, limit int) ([]runnerproto.Event, error)`, `Ack(ctx context.Context, eventID string) error`, `Close() error`. `runnerproto.Event{ID, TaskID, ServerID, AgentID, SessionID, Epoch, Kind, TurnID string; Seq int64; Scope team.Scope; Handle team.Handle; Payload json.RawMessage; SourceAt time.Time}`. `(*Store).IngestRunnerEvent(ctx context.Context, principal RunnerPrincipal, event runnerproto.Event) error`. `runner.UsageAccumulator.Observe(event paseo.Event) (*team.Usage, error)` emits a settled total only after a complete verified turn; field completeness is tracked separately from numeric zero.
+
+- [ ] **Step 1: Add `TestRunnerEventReplay`, `TestTimelineEpochReplacement`, `TestUsageCumulativeAndMissing`, `TestRunnerJournalCrashBoundaries`, `TestBufferFullStopsWork`.** Crash before local append, after append/before upload, and after server commit/before ACK. No duplicate event or charge; conflicting duplicate ID rejects. Refetch missed timeline before following live events, deduplicate by server/agent/session/epoch/sequence; control events without sequence use stable event/turn/request identity. Epoch replacement invalidates the old projection but never deletes accounting. Cumulative cost 0.0673131 then 0.0758928 is not summed as two independent costs. Missing final usage leaves `Receipt.Usage == nil`, not zero. A later zero LastUsage cannot erase completed-turn events. Full disk/outbox stops admission and initiates containment.
+ ```go
+ if receipt.Usage != nil { t.Fatal("missing usage became known zero") }
+ if chargedTwice { t.Fatal("event replay charged twice") }
+ ```
+
+- [ ] **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.
+
+ 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.
+- [ ] **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.
+
+**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.
+
+- [ ] **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.
+ ```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 5: Commit.** `git commit -m "feat: relay fenced questions and permission responses"`.
+
+### Task 14: Publish only the verified review commit
+
+**Files:** Create `internal/runner/forge/{forge,forge_test}.go`, app `runner_adapters.go`, `internal/equipotest/publish_test.go`; extend protocol with publication/dispatch tickets and receipt lookup.
+
+**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.
+
+ ```go
+ if gotRefspec != commit+":refs/heads/"+reviewRef { t.Fatal("unqualified push") }
+ if remoteHead != candidate.Commit { t.Fatal("published unchecked commit") }
+ if secondPushCount != 0 { t.Fatal("replayed an uncertain publication") }
+ ```
+
+- [ ] **Step 2: Run red.** `go test ./internal/runner/forge ./internal/equipotest -run 'TestPublish' -count=1`.
+- [ ] **Step 3: Implement publication and reconciliation.** Call `ReadyToPublish` before Intend and revalidate at Admit. Runner verifies ticket deadline/incarnation, target and local immutable object immediately before pushing. Use a credential-isolated Git subprocess, hooks/helpers disabled, canonical HTTPS Amadan remote, and refspec `<commit>:refs/heads/<Ref>`; never `HEAD` or a short destination. First publication uses `--force-with-lease=refs/heads/<Ref>:` with an empty expected old object, so a concurrently created ref refuses instead of overwriting it. This is absence-checked creation only; never supply an existing old head to authorize replacement or use an unguarded force push. Review ref creation expects absence; retry accepts only the identical existing commit. Remote ref observation supplies receipt fields for repository/ref/commit/candidate hash and disclosed agent identity. Keep a local durable dispatch record before Git. Exact-target readback reconciles unknown outcomes; lack of visibility is not definitive absence. A target-branch change or manual merge never grants default-branch push rights. Use supported Amadan agent credential/config surfaces; do not copy a person's forge credential or invent an Amadan API. Tests use a local bare repository and credential sentinels.
+- [ ] **Step 4: Run green.** Repeat Step 2; mutate ref qualification, candidate matching and retry handling separately. Preserve core action replay/receipt-conflict tests.
+- [ ] **Step 5: Commit.** `git commit -m "feat: publish verified commits to qualified review refs"`.
+
+### 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.
+
+**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)`.
+
+- [ ] **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.
+ ```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.
+
+ 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.
+- [ ] **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.
+
+**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.
+
+- [ ] **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.
+ ```go
+ if response.Code != http.StatusServiceUnavailable { t.Fatal("count error rendered as zero") }
+ if horizontalOverflow || coloredLeftAccent { t.Fatal("task layout violates shell rules") }
+ ```
+
+- [ ] **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.
+
+ 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.
+- [ ] **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`.
+
+**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.
+
+- [ ] **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.
+ ```go
+ if listeners != 0 { t.Fatal("runner opened an inbound port") }
+ 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.
+
+ 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.
+- [ ] **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"`.
+
+### Task 18: Verify the complete slice and prepare human acceptance
+
+**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.
+
+- [ ] **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.
+ ```go
+ if remoteHead != checkedCommit || remoteHead != reviewedCommit { t.Fatal("evidence and publication diverged") }
+ if providerDispatchesWithOneFamily != 0 { t.Fatal("task ran without independent review capacity") }
+ ```
+
+- [ ] **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 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.
+
+ **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.
+
+## 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.
+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.