# Equipo coordinator and conversation Implementation Plan

> **For implementation:** Use superpowers:executing-plans task-by-task, subject to the dispatch brief. This planning session authorizes only plan edits.

**Goal:** Give each person a coordinator for editable bug/feature plans, sourced recommendations, and account/specialist/playbook setup.

**Architecture:** The instance owns conversations, plans, authority and delivery. Each coordinator turn uses a fresh provider session with bounded instance context and scoped Equipo tools. Specialists, checks and publication use the fenced execution store, durable runner journal and Amadan publisher. HTML and the person API share application operations.

**Tech Stack:** Go 1.26.0 floor, gate toolchain go1.26.10, Rastrillo v0.30.1 from the pinned module cache, SQLite/GORM/chi, existing direct-launch provider adapters and bubblewrap 0.11.0. The current release targets Linux/amd64 runners and Linux/arm64 instances; provider pins are Claude Code 2.1.312 and Codex 0.165.0, subject to the completed Plan 2b review.

**Spec:** `docs/superpowers/specs/2026-11-01-equipo-design.md`, revision 3, especially §§3–7 and 13; `docs/superpowers/plans/CODEX-BRIEF-plan-3.md`, as revised by `CODEX-BRIEF-plan-3-fixes-R1.md` and `CODEX-BRIEF-plan-3-fixes-R2.md`; `docs/superpowers/plans/2026-11-01-equipo-roadmap.md`; `docs/mockups/README.md` and the seven mockups named in the brief.

## Global Constraints

- The brief and revision 3 supersede the roadmap's Paseo wording and old mockup project pickers. Use direct launch, dedicated Equipo credential homes, Teams above each team, one conversation per person and automatic task threads.
- Execution is off unless `EQUIPO_EXECUTION_ENABLED=1`. `NewStore` grants no authority. Keep `EQUIPO_ORIGIN`, `EQUIPO_INSTANCE_KEY`, SMTP requirements and loopback-only logged mail. Open one activation database; preserve shutdown and failed-construction cleanup.
- Derive `Actor` from the verified session, never a submitted form field. Check the current roster inside each write transaction. Removal and role changes must affect existing sessions immediately. Lookup errors deny access.
- Never use `scope.Owned` or `scope.OwnedBy` for shared team records. Use the transaction handle throughout a transaction. Append the audit event there too, with no credentials in it. Never bind requests onto GORM models; decode explicit input types and use `.Select` for updates.
- Keep migrations additive. App tables belong in `Models` and `Schema`; framework sessions, auth and proof tables belong only in `BootSchema`. Preserve old tasks, evidence, approvals, charges and historical execution records.
- Connections belong to people. A coordinator and its tasks use only its person's connections. A step never changes account mid-step. Review uses a different family from every builder whose contribution remains in the candidate. Checks use no model.
- Inferred preferences never decide anything. Confirmed preferences influence instructions, not authority, budgets, approvals, account consent or project ownership. Team rules take precedence.
- Publication plans always retain independent review, checks and a person at the end. Recommendations publish nothing and have the explicit §6.3 exception. Never merge, push the default branch, or deploy autonomously.
- App-owned runtime strings live only in `internal/equipo/copy.go`. Mark pending entries individually. Use plain words, no em dashes and no exclamation marks. Mockup copy is unapproved. This plan specifies keys and meaning, not approved wording. Leave README prose unchanged. Do not start a copy-review server.
- Use the day theme and sidebar shell. Link tokens.css and theme.css. Keep vendored static files byte-identical and put app styling in equipo.css. Use attribute grammar, token colors, scriptless forms and phone index navigation. No split screen, initials, coloured left-border accents or authentication bypass. Values and badges never wrap; secondary text truncates.
- An unknown count must remain unknown. Never turn a query error into zero. Unknown allowance, usage, delivery and containment remain unknown too.
- Builds use `CGO_ENABLED=0`. Keep host Go caches at their defaults, scratch under on-disk `$TMPDIR`, servers on `127.0.0.1`, and stop processes/remove scratch created by the task. No sudo. Provider calls and external publication are absent from ordinary tests.
- Every implementation task runs its named tests red, implements, repeats the same command to PASS, then breaks each new guard separately, observes failure and restores it. Record commands, exit status, failed assertions and restoration in `docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md`. Commit only when the later implementation dispatch authorizes it; use the task's subject, fewer than 80 characters. No such commits occur while writing this plan.

## Review Focus

1. Plan edits, answers and claims race: current revisions govern changes; started work retains its identity (Tasks 2, 9, 10).
2. Runner crashes replay recorded effects once; uncertain prompts are never resent automatically (Tasks 5–7).
3. Private conversations, credentials and subscriptions remain private, while task threads stay shared (Tasks 1, 8–10, 17, 19).
4. Model suggestions and templates cannot weaken tools, review, account consent or authority (Tasks 3, 6, 12–14).
5. Interrupted setup, unsupported login and unreachable teams retain truthful pending/unavailable/unknown states (Tasks 16–18).

---

## Order, usable stops and dependencies

Build **Plan 3a, Tasks 1–11**, then **Plan 3b, Tasks 12–18, 20, 19, 21**. Each part has an acceptance gate. Task 20 supplies credentials before Task 19’s device-bound subscriptions; Task 21 requires the complete v1 contract.

- **3a:** With an enrolled, certified runner and manual connections, Paul can request bugs/features/recommendations, edit/approve plans, answer questions, follow threads and inspect preferences through web and browser-session API. Default specialists suffice.
- **3b:** Add invites, runner/account setup, templates, editable specialists/playbooks, remembered teams, complete API and notifications. The client remains web; native apps and Apple/Google push delivery are excluded.

Later work remains coordinator settlement/deadlock and cross-person routing, product-view Now/Next/Later, CARLOS signals (platform #514), hosted runners and provider cloud agents. Plan 3 includes sourced recommendations from project material/requests, model picks with reasons, templates and onboarding.

### Baseline and Plan 2b review dependencies

Reuse these existing interfaces:

| Existing seam | Reuse and change in Plan 3 |
| --- | --- |
| `provider.Launcher` in `internal/runner/provider/types.go` | Retain `Preflight`, `Open`, `Events`, `StartTurn`, `Respond`, `Interrupt`, `Close`; attach events before prompting. A session ID is distinct from attempt, turn and admission IDs. |
| `Journal.BeginTurn`, `BindSession`, `RecoverDirect`, `ReconcileDirect`; `CaptureFactory` | Retain durable input barriers, captured frames, usage baselines and uncertainty. Extend purpose and conversation correlation without making provider history authoritative. |
| `ToolBinding`, `OpenToolProxy`, `ServeTools`, `ToolSubmission` | Existing relay permits reproduction, candidate, review and question tools. Add separate coordinator tool schemas and capabilities, not a universal socket with every verb. |
| `Execution.atomic`, `team.Store.Atomic`, `AdmitOnce` | Plan, core graph, audit, card and outbox changes share one SQLite commit. Extend graph mutation explicitly; do not update core tables from UI handlers. |
| `CreateBug`, `PrepareBug`, `StartBug`, `BugJobSpec`, `BugPlan` | Current path hard-codes a bug and reproduce/implement/review/verify/publish. Keep compatibility wrappers while replacing scheduling and rendering with persisted plans. |
| `PredicateSoftwareFix`, `FreezeBugEvidence`, trusted executor attestation | Add feature and rendered-change predicates. A recommendation needs delivery with sources, not a software-fix predicate or pretend branch. |
| `forge.DescriptionTransport` and `NewDescriptionTransport` | Preserve production description write/readback and four-channel length-prefixed content hash; publication stays incomplete until exact head and description are confirmed. |
| `live.New`, `live.Hub`, `JobNotifier`, `observeWrite` | Extend post-commit invalidation to private conversation/preferences and recipient notifications. Preserve job topics and current membership checks. |

Before Task 1, compare completed Plan 2b interfaces and record changes to permissions, provenance, sessions, account refresh, attestation and release policy identity in the controller report. Adapt consumers without restoring retired trial or unconfined paths.

Plan 2b has upstream live-use blockers: empty release certificates, an incomplete live exercise driver and an embedded-manifest/binary policy-digest cycle. Offline work may use fixtures. Both live stops require the completed 2b release gate and new coordinator/tool-policy certification; old certificates cannot cover changed policies.

**Supported setup ruling:** The executable runner lane is Linux/amd64; Mac runner is shown as "coming later" without a launch action. A Mac client may use a Linux runner. Mac containment needs separate design and certification. Codex uses supported device auth; Claude uses official browser sign-in into a dedicated Equipo home. On a headless runner the person opens the official link on another device and pastes the returned code only at the runner terminal, never through the instance. Missing official login capability fails closed. Tasks 16, 17 and 21 implement and test this ruling.

## File structure and shared contracts

Use the packages below; `internal/equipo` remains the database/HTTP composition root with thin facade methods. Features cannot import `equipo`; inject transaction-bound roster, authority, audit, copy-key and execution callbacks. Every write, including replay, rechecks authority and shares one transaction with the core. No second database, scheduler or budget ledger.

| Responsibility | Files introduced or extended |
| --- | --- |
| Shared application types and mutation contract | `internal/equipo/kernel/{types,mutation,budget_test}.go`; root aliases preserve existing facade signatures |
| Conversation, cards, threads, preferences, coordinator records | `internal/equipo/conversation/{models,store,threads,views,handlers,preferences,live,coordinator,tools,context}.go`; app-owned templates `conversation.html`, `thread.html`, `conversation_card.html`, `preferences.html` |
| Plans, selections and evidence | `internal/taskplan/{types,validate,evidence}.go` for pure rules; `internal/equipo/planning/{plans,dispatch,handlers,approval_settings,rendered_approval,execution,selection}.go` for application operations; minimal transaction/graph/evidence hooks in existing `team` files |
| Coordinator and runner workflow | `internal/coordinator/{types,runtime,tools,recovery}.go`; `internal/runner/planflow/{types,workflow,prompt}.go` with injected runner services and no import of `runner`; `internal/runnerproto/coordinator.go`; thin wiring in runner runtime/service and existing journal, proxy and provider policy files |
| Person API | `internal/equipo/personapi/{types,validate,handler,auth,conversation,devices,roster,budgets}.go`; `docs/api/equipo-v1.openapi.json` and later reviewed `docs/api/equipo-v1.md` |
| Specialist and playbook library | `internal/equipo/library/{specialists,templates,playbooks,handlers,views}.go`; app-owned templates |
| Invitations, onboarding, remembered teams | `internal/equipo/setup/{invites,onboarding,accounts,team_links,handlers}.go`; runner-local `internal/runner/setup/{install,account_login}.go`; `cmd/equipo-runner/main.go` wiring |
| Notification preparation | `internal/equipo/notifications/{models,outbox,api}.go`; recipient feed, expiring subscription records and acknowledgements; no external push adapter |
| New integration, browser and acceptance tests | `internal/plan3test/*_test.go`, with its own fixture harness, budget `TestMain` and time budget; existing `internal/equipotest` remains the regression suite |

Every new Go package gets `budget_test.go` with `budget.Main`. Rastrillo rejects records that restate defaults: new packages inherit 5,000 source lines, 8,000 test lines and 10s without entries. Add only this integration exception, measuring it at Tasks 11 and 21:

```text
time internal/plan3test 300s Initial cap for combined browser and runner acceptance; measure at both usable stops.
```

Task 1 establishes the integration harness. Tasks 2–5 run `make budget` after core hooks. Keep pure validation/workflow in the named packages and count whole directories. Allow measured raises for `internal/runner` and `internal/equipo/team`: expected new source totals are about 8,500 and 9,500 lines respectively, planning estimates rather than measurements. Update existing exception records in their current style with actual source/test totals, measured test time where relevant, the new ceiling and reasons for retained journal/proxy or transaction/schema hooks. Do not add default-valued records. Keep `internal/equipo` within its existing ceiling through extraction. Browser tests in Tasks 9/18, acceptance in Tasks 11/21 and real-launcher fixture continuity belong in `internal/plan3test`.

Migrations follow implementation order: 0019 conversation (Task 1), 0020 plans (2), 0021 coordinator (5), 0022 preferences (8), 0023 person API request metadata (10), 0024 specialist library (12), 0025 playbooks (13), 0026 connection modes (14), 0027 invitations (15), 0028 onboarding (16), 0029 team links (18), 0030 person device credentials (20), 0031 notifications (19). Register feature-owned model lists in the root `Models` and update `migrations/schema.sql` and upgrade tests. Framework session/auth/proof tables stay in `BootSchema`; person-device rows here are application-owned. Re-number only if the final 2b review adds migrations.

For 0021, app-owned `coordinator_bindings`, `coordinator_turns` and `coordinator_questions` belong to `conversation`, `Models` and the app migration. Versioned `coordinator_limits` belong to the execution core: declare them in `team/store.go`'s schema and ordered upgrade chain (baseline `SchemaVersion = 7`; assign the next version after Task 2/3 core changes), mirror them in `execution_models.go`, and include identical DDL in 0021 and the schema snapshot. Test both standalone core upgrade and app upgrade followed by core open/reopen. The core period queries read these limits in the existing reservation transaction. No duplicate app limit table or second counter. Apply the same schema ownership rule to any new core graph/evidence columns; JSON-only fields do not change the core schema version.

Shared contracts by implementing task:

- Task 1: `Mutation{RequestID string; Revision int64}`. Revisions start at 1. IDs are opaque strings; timestamps are UTC. A repeated request ID with identical canonical input returns its saved result; changed input conflicts. Key scope includes authenticated principal, operation and resource. Authorization is rechecked even on replay.
- Task 1: `Message{ID, ConversationID, ThreadID, AuthorKind, AuthorID, Body string; Sequence, Revision int64; CreatedAt time.Time}`, `Card{ID, Kind, ResourceID string; Revision int64}`, and `ConversationPage{Messages []Message; Cards []Card; NextCursor string; Revision int64}`. Cards reference authoritative resources; they never contain permission authority.
- Task 2: `taskplan.Kind` values `bug`, `feature`, `rendered_change`, `recommendation`, `investigation`; `Step{Key, Specialist, Action, Instructions string; ConnectionID, Model, SelectionReason string; Required bool}`; `Plan{TaskID string; Revision int64; Kind Kind; ProjectID int64; Steps []Step; PlaybookID string; PlaybookRevision int64}`. Server-owned state records actual starts, completions, selections and evidence separately. A client cannot submit `Required` to remove an invariant.
- Task 10: `personapi.Page[T]{Items []T; NextCursor string; Revision int64}` and `Error{Code, CopyKey, RequestID string; CurrentRevision *int64}`. Person API types are explicit projections, never GORM rows or runner credentials. Missing/unknown quantities are nullable, not zero.

## Plan 3a: Conversation that runs work

### Task 1: Persist the private conversation and shared task threads

**Files:** Create `internal/equipo/kernel/{types,mutation,budget_test}.go`, `internal/equipo/conversation/{models,store,threads,budget_test}.go`, `internal/plan3test/{harness,budget}_test.go`, `internal/plan3test/conversation_test.go`, migration `0019_conversation.sql`; modify models, schema snapshot and migration tests.

**Shared kernel:** Task 1 defines `Actor` and `Mutation` in `internal/equipo/kernel`, with root aliases for compatibility. Feature packages import this package for shared types and receive transaction-bound authority/audit callbacks; the kernel imports no feature or root `equipo` package and owns no database.

**Interfaces:** `Store.Conversation(ctx context.Context, actor Actor, cursor string, limit int) (ConversationPage,error)`; `Store.SendMessage(ctx context.Context, actor Actor, threadID, body string, m Mutation) (Message,error)`; `Store.TaskThread(ctx context.Context, actor Actor, taskID string, cursor string, limit int) (ConversationPage,error)`. Main conversation is unique by team/person; task thread is unique by task. Messages use monotonic per-conversation/thread sequences and explicit `person`, `coordinator`, `system` attribution. `RouteMessage(ctx context.Context, actor Actor, messageID, taskID string, m Mutation) (Message,error)` atomically places the reply in its task thread and leaves a reference notice in the main conversation.

- [ ] **Tests first:** `TestConversationPrivateAndThreadShared` denies another member's main conversation, source messages and IDs, while allowing active members to read a team's task thread. `TestConversationMessageReplay` asserts one message/outbox entry for duplicate sends, conflict for changed body and rollback on audit failure. `TestConversationRouteOnce` asserts one automatic thread, one routed reply and one main notice after retry; an unrelated task/team or already-routed different target conflicts. `TestConversationPageBounds` checks 1–100 items, stable cursor order during concurrent inserts, escaped HTML, valid UTF-8 and 16 KiB body limit.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestConversation' -count=1`; expect missing operations or failed assertions.
- [ ] **Implement:** Main conversation and preferences are person-private even from other team owners. Task threads are shared team records; routing deliberately copies only the selected message into shared work, never the person's history. Keep source provenance private. Create the thread with each task, including a lazy idempotent backfill for old tasks. Messages about existing tasks require current task visibility and the sender's own coordinator; another person's active task cannot receive new execution instructions in Plan 3. Distinguish ordinary thread discussion from commands that change a task.
- [ ] **Green and guard mutations:** Bypass person scope, replay hash, audit transaction or route uniqueness independently; observe failures and restore. Run `make migration-check`.
- [ ] **Implementation commit:** `feat: persist conversations and automatic task threads`.

### Task 2: Add revisioned plans, approval settings and atomic graph edits

**Files:** Create `internal/taskplan/{types,validate,validate_test,budget_test}.go`, `internal/equipo/planning/{plans,dispatch,approval_settings,budget_test}.go`; add the atomic edit primitive to `team/jobs.go`, corresponding tests, `0020_plans.sql`; modify `tasks.go`, `task_prepare.go`, `team/{jobs,scheduler,model}.go`, schema/model mirrors.

**Interfaces:** `taskplan.Validate(p Plan) error` and `taskplan.ValidateEdit(before, after Plan, started map[string]bool) error`; `Store.ProposePlan(ctx context.Context, actor Actor, p taskplan.Plan, m Mutation) (taskplan.Plan,error)` for the verified person path; `Store.EditPlan(ctx context.Context, actor Actor, p taskplan.Plan, m Mutation) (taskplan.Plan,error)`; `Store.ApprovePlan(ctx context.Context, actor Actor, taskID string, m Mutation) (Task,error)`; `Store.CorrectTaskProject(ctx context.Context, actor Actor, taskID string, projectID int64, m Mutation) (Task,error)`. Task 6's coordinator path calls an internal transaction operation with coordinator attribution and delegated authority, never constructs a person `Actor`.

Core adds `PlanChange{Append, Replace []StepSpec; Cancel []string; Order []string}` and `team.Store.EditUnstarted(ctx context.Context, scope Scope, expectedRevision int64, change PlanChange) (Job,error)`. `ApprovalMode` is `immediate` or `required`; `Store.SetProjectApproval(ctx context.Context, actor Actor, projectID int64, mode ApprovalMode, m Mutation) error` is owner-only, and `Store.SetApprovalOverride(ctx context.Context, actor Actor, projectID int64, mode *ApprovalMode, m Mutation) error` changes only the person's override. Nil inherits. Default is immediate; precedence is person override, project, immediate.

- [ ] **Tests first:** `TestPlanRequiredSteps` rejects deletion/renaming/substitution of review, checks or final person, duplicate keys, cycles and publication before evidence. `TestPlanEditClaimRace` makes an edit and claim race; exactly one revision wins, with no partial core/card/audit change. `TestPlanStartedImmutable` rejects reorder, instruction/model/account changes to started or finished steps and changes to their dependencies. `TestPlanApprovalPrecedence` covers defaults, inheritance, two tabs and switching to required before dispatch. `TestPlanProjectCorrection` rebinds an unstarted task and clears picks/preparation/approval; after any execution starts, keeps the old target, cancels safely and offers an explicitly linked replacement rather than retargeting a workspace.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/taskplan ./internal/equipo/team ./internal/plan3test -run '^TestPlan' -count=1`.
- [ ] **Implement:** For a new proposal, accept an empty task ID and revision 0, allocate the task/thread/card IDs on the server and return revision 1; every edit requires the current positive revision. Create the task, plan, thread, card and dispatch-outbox entry atomically. Store an append-only revision history with actor and changed step keys. Validate and mutate app/core rows through `Execution.atomic`; `EditUnstarted` uses the bound core transaction and current grant. Cancellation marks unstarted steps cancelled, never erases evidence. Recompute pending dependencies and guard review/checks after every candidate-producing step. Keep final person outside runner execution; publication produces a review branch and a human wait. Require current work authority, model constraints and budgets when approving and dispatching. An automatic start is the person's configured policy acting on a validated proposal, not a coordinator approval. Investigation starts with bounded read-only scope and a person checkpoint; any later publication is a new validated revision with all three mandatory steps. Plans retain the existing `team.MaxSteps = 16` limit, including hidden execution steps. Add/replace/reorder may affect only unstarted steps; instruction-only edits still increment the app and core revision in the same transaction. Persist task kind, current plan revision and approval revision, rather than deriving them from displayed text.
- [ ] **Green and guard mutations:** Remove each invariant, revision fence and approval recheck separately; require a failing named test. Test upgrade from existing bug tasks using `BugPlan` as the history-preserving seed; run `make migration-check`.
- [ ] **Implementation commit:** `feat: add guarded plan revisions and approval settings`.

### Task 3: Define feature, rendered-change and read-only completion contracts

**Files:** Create `internal/taskplan/evidence.go`, `internal/equipo/planning/{evidence,rendered_approval}.go` and tests; modify `internal/equipo/team/{model,evidence,git_evidence,policy,publication}.go` only for core primitives, `internal/equipo/{authority,runner_provenance,execution_models}.go`, `internal/runnerproto/types.go`; include core evidence columns in 0020 and its core upgrade.

**Interfaces:** Add `PredicateSoftwareFeature="software_feature"`, `PredicateRenderedChange="rendered_change"`; `FreezeFeatureEvidence(ctx context.Context, scope Scope, h Handle, acceptanceHash, definitionHash string) error`. Extend `EvidenceRequirement` with `FrozenAcceptanceHash` and `RenderedApprovalHash`; define `RenderedApproval{CandidateHash, DiffHash, RenderHash, Decision, Person string; DecisionRevision int64}` registered only through `Store.ApproveRenderedChange(ctx context.Context, actor Actor, taskID, candidateHash, diffHash, renderHash, decision string, m Mutation) error` in new `internal/equipo/planning/rendered_approval.go`. The person field comes from that operation, never the submitted artifact. `decision` is `copy` or `design`; the current project `DecisionOwner` for that decision must match the verified actor in the write transaction. A requester or team owner has no implicit substitute authority. Changes affecting both decisions require both owners' approvals. `DecisionRevision` records the current `Project.Revision`, since `DecisionOwner` has no revision column today; recheck that project revision and the current decision/address before publication. Add `CapScope`, `CapResearch`, `RoleAcceptance`, `RoleAnswer` and `AnswerResult{Body string; Sources []SourceRef}`, where `SourceRef{Kind, ID, Hash string; Revision int64}` references observed material, not an arbitrary model assertion.

For read-only research add `TargetProjectRead` with project repository/base but no write ref; an empty evidence predicate is valid **only** for that target with research steps, and `CompleteReadWork(ctx context.Context, scope Scope, h Handle, answer ArtifactSpec) error` records the bounded sourced answer. There is no fabricated recommendation evidence predicate. Task 4 makes delivery to the conversation part of completion.

- [ ] **Tests first:** `TestFeatureFreezeBeforeBuild` requires acceptance from the scope attempt frozen by hash before candidate work, rejects replacement and late freeze, and denies build admission before freezing/base failure. `TestFeatureExactCandidateEvidence` requires trusted base-fail/candidate-pass acceptance, nonzero test counts, repository checks and distinct-family review on the exact candidate. `TestRenderedChangeApproval` requires checks, review and the current project copy/design decision owner's approval bound to the exact candidate and base-to-candidate diff, with a trusted render as a review aid. Deny a requester, unrelated member or team owner who does not hold that decision; reject a forged render, wrong candidate/diff, changed ownership or stale decision revision. `TestRenderedChangeEditAfterApproval` edits the candidate after review, checks and rendered approval, then proves publication is blocked until fresh independent review, checks, executor render and owner approval all bind to the new candidate/diff. Replaying any old evidence must fail even when the resulting pixels are identical. `TestReadWorkNoPublication` allows sourced answers with one provider, rejects missing/forged source refs and all publish/edit operations. `TestEvidenceKindsPreserveBug` retains frozen bug and historical reconciliation behavior.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/equipo/team ./internal/plan3test -run 'TestFeature|TestRenderedChange|TestReadWork|TestEvidenceKinds' -count=1`.
- [ ] **Implement:** Reuse trusted check attestations and immutable blob storage, never model-reported pass/fail. Keep acceptance tests outside workspaces and pass them by hash to the executor. All contributing builder families must differ from Review; if that is impossible, wait for a person to revise the plan. Read-only grants allow current members to inspect shared projects, but cannot authorize code changes through `bugAuthority` or forge publication. Recommendations and investigation checkpoints are delivery contracts; they do not require review/checks/merge or a second family. The trusted executor checks out the exact immutable candidate and renders it under the check containment policy. It records an attestation binding repository/base, candidate hash, diff hash, render hash and rendering recipe/environment. A specialist may request rendering but cannot supply a trusted screenshot or attest it. The approval UI presents the candidate diff and its attested render; the owner approves the candidate diff, using the render as an aid. Copy/design publication requires the decision-owner approval described above; Plan 4 routing is not needed to display a shared pending approval.
- [ ] **Green and guard mutations:** Mutate freeze timing/hash, executor provenance, candidate subject, family comparison, decision-owner checks, render provenance and read-only target restrictions independently. For `TestRenderedChangeEditAfterApproval`, separately retain stale review, stale checks and stale rendered approval and observe each guard fail before restoring it.
- [ ] **Implementation commit:** `feat: add feature evidence and sourced read-only results`.

### Task 4: Execute the persisted plan through the current runner

**Files:** Create `internal/equipo/planning/execution.go`, `internal/runner/planflow/{types,workflow,prompt,budget_test}.go`, `internal/plan3test/plan_workflow_test.go`; modify `task_prepare.go`, `runner_execution.go`, `runner_adapters.go`, `runnerproto/types.go`, runner `workflow.go`, `direct_workflow.go`, `runtime_direct.go`, `turn_prompt.go`, `tools.go`, `tool_proxy.go`, `tool_socket.go`, `witness.go`; provider `claude/{launcher,answers}.go`, `codex/{launcher,native_approval,answers}.go`, `provider/{policy,direct_certification}.go`, their policy/launch/broker tests, `internal/release/{manifest.json,manifest.go,manifest_test.go}`, and checks/forge integration tests.

**Interfaces:** `PlanJobSpec(task Task, project Project, p taskplan.Plan, policy team.Policy) (team.JobSpec,error)`; `runnerproto.StepBrief{PlanRevision int64; StepKey, SpecialistKey, Action string; SpecialistRevision int64; ArtifactHashes []string}` carried by `RunnerBrief`; `runner.NewPlanWorkflow(c BugWorkflowConfig) (*PlanWorkflow,error)` and `PlanWorkflow.Run(ctx context.Context, s *Supervisor, claim RunClaim) error`. Preserve `NewBugWorkflow` as a compatibility wrapper. Add scoped specialist tools `submit_acceptance`, `submit_answer`, `submit_render`, with strict payloads from Task 3 and no publication/check attestation verbs. `submit_render` requests trusted executor rendering for a captured candidate; any model-supplied render bytes or claimed attestation are refused.

- [ ] **Tests first:** `TestPlanWorkflowFeature` runs scope, frozen base failure, build, review, checks, publication/readback and human wait with fake providers and real local Git/checks. `TestPlanWorkflowRecommendation` delivers answer and sources once, creates no ref or mutable checkout and invokes neither publisher nor checks. `TestPlanWorkflowInvestigation` stops at its checkpoint and requires an explicit new plan revision to build. `TestPlanWorkflowSpecialistOrder` runs Copy/Design/Engineering/custom-compatible actions in persisted order with real step progress and actual selections. `TestPlanWorkflowConnectionPreference` proves a different eligible personal connection is chosen when available. Shared-home coordinator waiting is tested in Task 7, after its runtime exists. `TestPlanWorkflowNoMidStepSwitch` rejects account, policy or plan changes after dispatch; cancellation waits for namespace proofs. `TestPlanWorkflowProviderPolicies` exercises both real policy constructors and launchers with recorded process/RPC fixtures for scope, research, candidate building, Copy, Design and Review; assert the exact native/MCP inventory, action mapping, read-only constraints, unknown-action refusal and broker validation before approval. No live providers run in this test.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/... ./internal/plan3test -run '^TestPlanWorkflow' -count=1`.
- [ ] **Implement:** Replace `specialistFor` and `runtime_direct.go`'s reproduce/implement/review map with immutable step action/capability snapshots. In `claude/launcher.go`, change `nativeTools` and the hard-coded MCP allowlist for the new actions; in `codex/launcher.go`, change the corresponding MCP allowlist and action-specific filesystem/tool/thread/turn policy. Keep both permission brokers bound to the exact permitted tool name and arguments. Map scope to acceptance submission, research to answer submission, builders to candidate submission and Review to review submission; candidate builders may request trusted rendering. Research and scope read project material without a writable checkout; Copy/Design building gets only its certified candidate-writing profile. Unknown actions fail closed. Keep coordinator inventories separate in Task 6. Hash each new policy and add both providers’ certification cases. Task 11’s authorized live certification must cover every new executable profile before dispatch. Compose additional candidate-producing stages with captured immutable candidate artifacts; Review sees candidate material, never builder dialogue. Preserve the same-runner evidence/workspace requirement until an explicit cross-runner artifact transport exists. Select builders/reviewers separately: recommendations and feature scope can start with one family; review and publish readiness require an eligible independent reviewer. Register hashed source snapshots from the exact read-only checkout revision or authorized project/request records before accepting `SourceRef`. Model URLs cannot attest sources; no CARLOS fetch. Record answer delivery/card/thread changes atomically with read-work completion; a crash between artifact upload and delivery replays the delivery, not the provider turn. Preserve production Amadan readback after a lost write reply.
- [ ] **Green and guard mutations:** Break action mapping, frozen artifact handoff, answer-delivery uniqueness, immutable selection and no-publish research; observe failure. Run existing `TestDirectBugWorkflow` and `TestPublishDescriptionRecovery` with `-count=1` in their original runner/forge packages as regression guards. Run `make budget`; do not silently inherit an old policy certificate for a changed inventory.
- [ ] **Implementation commit:** `feat: execute revisioned plans with the direct runner`.

### Task 5: Give coordinator turns fenced authority and accounted admission

**Files:** Create `internal/equipo/conversation/{coordinator,coordinator_api}.go`, `internal/runnerproto/coordinator.go`, core admission/period-budget hooks in the existing `team` files, tests, `0021_coordinator.sql`; modify runner API routing, core budget/period queries, authority, policy and model/schema mirrors.

**Interfaces:** `CoordinatorBinding{ID, Person, RunnerID, ConnectionID string; Revision, Generation int64}`; `CoordinatorTurn{ID, MessageID, RequestID, ProviderSessionID, ContextHash string; Generation, Revision int64; State string}`; `CoordinatorClaim{Binding CoordinatorBinding; Turn CoordinatorTurn; Scope team.Scope; Handle team.Handle; Brief runnerproto.RunnerBrief; Context CoordinatorContext}`. Add `Execution.ClaimCoordinator(ctx context.Context, p RunnerPrincipal, turnID string, revision int64) (CoordinatorClaim,error)` and `Execution.CompleteCoordinator(ctx context.Context, p RunnerPrincipal, claim CoordinatorClaim, event runnerproto.Event) error`. Runner protocol exposes separate coordinator poll/claim/renew/event/containment operations under `/api/runner/v2/coordinator`, with capability negotiation; old v2 runners cannot receive them.

Declare these structures and Task 7’s `CoordinatorContext` wire types in `internal/runnerproto/coordinator.go`; Equipo aliases them rather than making the runner import the application. Add `Store.SaveCoordinatorBinding(ctx context.Context, actor Actor, runnerID, connectionID string, m Mutation) (CoordinatorBinding,error)`, `Store.ResetCoordinator(ctx context.Context, actor Actor, m Mutation) (CoordinatorBinding,error)` and `Store.RetryCoordinatorTurn(ctx context.Context, actor Actor, turnID string, m Mutation) (CoordinatorTurn,error)`. No submitted person or session ID is accepted. Reset/rebind first fences and contains active work, then increments generation; retry creates a new admitted turn only after uncertainty and containment are recorded. A process-completed event alone cannot prove all tool effects/delivery committed.

Core adds `TargetConversation`, `CapCoordinate`, and `CoordinatorGrantRef(person string) string`. This target accepts an empty evidence predicate only with coordinate steps and no repository/ref; completion means the admitted turn and its recorded results were durably delivered, never completion of the lifelong conversation. These are team-only model-call authority, never repository authority. A coordinator turn uses an ordinary fenced job/attempt with `Project=0` only for this target. Extend core budget accounting so its reservation, call/time/token usage and unknown exposure count against the **same team ceiling** and a configured per-person coordinator limit. Normal project jobs still require `Project>0` and a configured project budget. Add the core-owned versioned coordinator-limit rows and their app model/schema mirror in 0021 as assigned in the schema ownership section; include them in the same period reservation/exposure queries as team work, with no default grant of unlimited budget. `Store.SetCoordinatorLimits(ctx context.Context, actor Actor, person string, limits team.Limits, m Mutation) error` is owner-only; absent limits deny dispatch.

- [ ] **Tests first:** `TestCoordinatorSingleWriter` races two runners/tabs and admits one turn per person/team, preserving message order. `TestCoordinatorAuthorityRevoked` covers roster removal, role/connection change, generation mismatch, failed lookup and revoked runner before claim/renew/tool use. `TestCoordinatorBudgetSharesTeam` races project and coordinator admission against the last reservation and permits only one; uncertain/cancelled turns remain charged. `TestCoordinatorNoProjectBudgetBypass` refuses `Project=0` for ordinary jobs and refuses forge operations under conversation authority. `TestCoordinatorTurnReplay` returns one admission for duplicate request and rejects changed message/binding.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/equipo/team ./internal/plan3test -run '^TestCoordinator(Single|Authority|Budget|NoProject|Turn)' -count=1`.
- [ ] **Implement:** Reuse the core ledger, admission and period-budget transaction; do not add a separate accounting counter that can overspend concurrently. Serialize queued messages, pause when no personal connection/runner is available and never borrow another person's subscription. A project-specific turn also checks that project's provider restrictions before any project material enters the prompt; general turns receive only permitted project labels, not restricted repository context. The coordinator's connection is explicitly selected by its person. Task 4 applies Task 14's connection preference rule from the 3a stop: choose a different eligible personal connection for a specialist step when allowed by the current explicit pin/ask choice; otherwise Task 7 serializes the shared home and persists the coordinator turn’s visible waiting state. Do not hold a coordinator lease while waiting for specialist completion. Audit coordinator effects as `coordinator:<binding ID>`, with a separate delegating person field, not as a person write.
- [ ] **Green and guard mutations:** Break uniqueness, generation/fence, current membership, shared budget reservation and target restriction independently; test period rollover, overflow and unknown usage. Run `make migration-check`.
- [ ] **Implementation commit:** `feat: admit coordinator turns with person-bound authority`.

### Task 6: Expose only structured coordinator tools

**Files:** Create `internal/coordinator/{types,tools,tools_test,budget_test}.go`, `internal/equipo/conversation/tools.go`; modify `internal/runner/{tool_proxy,tool_socket,tools,tool_journal}.go`, provider policy constructors and runnerproto coordinator types; test `internal/plan3test/coordinator_tools_test.go`.

**Interfaces:** `CoordinatorToolCall{RequestID, Name string; Arguments json.RawMessage}`; `CoordinatorToolResult{ResourceID string; Revision int64; Value json.RawMessage}`; `Execution.CallCoordinatorTool(ctx context.Context, p RunnerPrincipal, claim CoordinatorClaim, call CoordinatorToolCall) (CoordinatorToolResult,error)`. `coordinator.ToolClient.Call(ctx context.Context, call CoordinatorToolCall) (CoordinatorToolResult,error)` is the runner-facing interface. The instance binds principal/session/turn/fence, never trusts them in arguments.

Add `runner.CoordinatorToolBinding{Claim runnerproto.CoordinatorClaim; Session provider.Session; Journal *Journal; Current func(context.Context) error; Call func(context.Context, runnerproto.CoordinatorToolCall) (runnerproto.CoordinatorToolResult,error)}` and `OpenCoordinatorToolProxy(ctx context.Context, binding CoordinatorToolBinding) (*ToolProxy,error)`. Declare call/result wire types in runnerproto and alias them in coordinator/Equipo. Keep the existing task `ToolBinding` path intact. Journal coordinator submissions by instance/binding generation/turn/attempt/fence/request ID in an ordered additive journal migration; never invent a task ID to pass a task-only guard. Automatic MCP permission approval and later execution must validate the same bound request hash.

Exact tools: `read_project(project_id)`, `read_task(task_id)`, `propose_plan(message_id, plan)`, `ask_person(message_id, question, options)`, `route_to_task(message_id, task_id)`, `post_message(body, source_refs)`, `suggest_preference(source_message_id, text)`, `suggest_specialist(source_message_ids, draft)`, `suggest_playbook(source_message_ids, draft)`. Each has a strict JSON schema with no unknown fields and the shared request ID. Suggestions are conversation records, not saves to the library. Only a later verified-person action can accept one.

Define `ClarificationQuestion{ID, MessageID, TurnID, Prompt, State string; Options []QuestionOption; Revision, Generation int64; ExpiresAt time.Time}` and `QuestionOption{ID, Label string}` in the coordinator wire types; store them in 0021’s coordinator question table. `Store.AnswerClarification(ctx context.Context, actor Actor, id, optionID, text string, m Mutation) error` accepts one declared option or bounded free text, once. A clarification may outlive a cleanly completed coordinator turn: its answer queues a new admitted turn. It is invalid after reset, replacement or its 24-hour expiry. It does not reuse runner-native permission authority or keep an idle model process alive.

- [ ] **Tests first:** `TestCoordinatorToolAllowlist` denies shell, arbitrary file/network, create-specialist/playbook, publication, approval, account selection changes and settlement tools; prose resembling a tool call has no effect. `TestCoordinatorToolScope` rejects other-person messages, unauthorized project content, wrong turn/fence and replay with changed arguments. `TestCoordinatorProjectInference` accepts a valid inferred project with visible attribution; ambiguity creates one question and no task, and correction uses Task 2's guarded path. `TestCoordinatorSuggestionOnly` proves suggestion tools create no specialist/playbook/preference confirmation. `TestCoordinatorToolCommitCrash` replays the original result after lost acknowledgement, including task, card, thread and audit IDs.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/coordinator ./internal/runner ./internal/plan3test -run '^TestCoordinator(Tool|Project|Suggestion)' -count=1`.
- [ ] **Implement:** Separate coordinator endpoint capabilities from task-attempt tools. Claude's coordinator has an empty built-in tool inventory and only Equipo MCP tools; Codex likewise has no shell/file/search/browser tools for this policy. Hash the exact inventory and certify it. No repository checkout is mounted into a coordinator. Validate a proposal's project/work authority and policy using the current delegated person inside the transaction, and retain the coordinator attribution. Never interpret natural-language output as a plan, answer, preference or action. Provider assistant text may be displayed as escaped commentary, but success/cards depend on tools and trusted events. Scope read results and redaction before they leave the instance.
- [ ] **Green and guard mutations:** Remove allowlist/schema/scope/replay guards and enable prose parsing separately; observe failure. Recheck both providers' broker-validation-before-approval tests.
- [ ] **Implementation commit:** `feat: add the scoped coordinator tool server`.

### Task 7: Start fresh coordinator turns from durable conversation context

**Files:** Create `internal/coordinator/{runtime,recovery,runtime_test,recovery_test}.go`, `internal/equipo/conversation/context.go`, `internal/plan3test/coordinator_continuity_test.go`; modify runner `service.go`, `runtime_direct.go`, journal/capture/recovery files, `turn_prompt.go` for purpose-specific prompt validation, and provider fixture tests.

**Interfaces:** `coordinator.Config{Launcher provider.Launcher; Tools ToolClient; OpenLaunch func(context.Context, runnerproto.CoordinatorClaim) (provider.Launch,error); Record func(context.Context, provider.Event) error}`; `coordinator.New(Config) (*Runtime,error)`; `Runtime.RunTurn(context.Context, runnerproto.CoordinatorClaim) error`; `Runtime.Stop(context.Context) error`. Use Task 5’s declared `CoordinatorContext{ConversationID, Hash string; Revision int64; Recent []MessageRef; ConfirmedDecisions, ConfirmedPreferences []ContextRef; Retrieved []ContextRef}` in the neutral wire types. `Store.CoordinatorContext(ctx context.Context, claim CoordinatorClaim) (CoordinatorContext,error)` builds an authorized snapshot inside the claim path and returns it in `CoordinatorClaim.Context`; `Turn.ContextHash` must match that snapshot. Define `MessageRef{ID, AuthorKind, Body string; Sequence, Revision int64}` and `ContextRef{Source SourceRef; Text string}` in the wire contract; retrieved text uses `[]ContextRef` as well. Source hashes/revisions bind all text to the instance snapshot. Confirmed decisions come from explicit person approvals/answers and confirmed preference records, never an unconfirmed model summary. Task 8 supplies persisted confirmed preferences; until then the production list is empty, never inferred. Task 7 tests context assembly with a fixture instance context source; Task 8 reruns continuity using the real preference operations so Task 7 does not depend on an unimplemented table.

The runner supplies namespace ownership, admission, capture and account leases. Hold the per-home lease for a whole active turn, including token refresh and containment, then release it. Task 14 prefers another eligible personal connection for specialist work. When the shared home is occupied, persist the blocking task ID and display `waiting for <task>` on the coordinator card, linked to that task, before acquiring the lease. This is pending copy; no provider call starts while waiting.

- [ ] **Tests first:** `TestCoordinatorSessionContinuity` drives real Claude/Codex launchers with recorded fixtures through the runner service. After turn one, close its namespace/lease, assert runtime/config removal, reopen the journal and restart with new launchers and empty session maps. Turn two retains the conversation ID but has a fresh provider ID and empty `ResumeSessionID`: Claude uses `--session-id` without `--resume`; Codex uses `thread/start`. Assert the next prompt contains bounded recent history, current confirmed decisions/preferences and scoped sources. Remove a fixture preference and revoke source access between turns; neither survives. Task 8 repeats with real preference edits/deletes. `TestCoordinatorContextBounds` checks the claim snapshot/hash, deterministic trimming, source scope, message-count limits, and raw/JSON-escaped prompt sizes at the cap and frame boundary. A long conversation of 16 KiB messages still produces turns by trimming older history; required instructions and confirmed decisions remain. Only oversized required content yields context-limit. `TestCoordinatorConnectionWaiting` owns the shared-home half of Task 4’s connection test: with only the coordinator connection eligible, specialist and coordinator never overlap the lease, the waiting card names/links the blocking task, and the coordinator continues after release without redispatching either turn. `TestCoordinatorCrashNeverRedispatches` crashes before/after durable intent, stdin, tool commit, frame commit and server ACK; only completed results replay, uncertain turns wait for the person. `TestCoordinatorFreshTurnRevalidates` denies changed identity, policy, provider/model or revoked connection; same-identity credential refresh requires fresh preflight. `TestCoordinatorStopContains` waits for every namespace and endpoint, retains unknown usage and rejects late answers. `TestCoordinatorUsageOnce` covers per-session accounting, duplicate final events and missing usage across fresh sessions and runner restarts.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/coordinator ./internal/runner ./internal/runner/provider/... ./internal/plan3test -run '^TestCoordinator(Session|Context|ConnectionWaiting|Crash|Fresh|Stop|Usage)' -count=1`.
- [ ] **Implement:** Each admitted coordinator turn opens a fresh provider session with `ResumeSessionID` empty. Seed it from `claim.Context`. Give coordinator prompts their own `maxCoordinatorPromptBytes = 48 << 10` cap, separate from the specialist 24 KiB cap. For the complete prompt, including instructions and context framing, require both `len(prompt) <= maxCoordinatorPromptBytes` and `len(json.Marshal(prompt)) + 8192 < provider.MaxFrameBytes`, using the turn-intent path’s 8 KiB margin. Apply the coordinator-specific check at context assembly, durable intent and dispatch; do not pass it through the specialist-only cap. Required instructions include team rules and confirmed preferences; retain them and confirmed decisions intact. Bound the recent window to 50 messages/32 KiB, drop optional retrieval as needed, then trim recent messages oldest-first until both serialized limits fit. Return context-limit only if required instructions and confirmed decisions alone exceed either limit. Preserve source IDs/revisions and hash the final trimmed snapshot before prompting. Retrieve only records the current person and selected provider may see; respect team rules and project provider restrictions. Prior assistant text is attributed history, never a confirmed decision. Bindings identify person/conversation; provider IDs are per-turn observations. Never preserve disposable homes or depend on launcher maps/provider history across turns.
- [ ] Attach events before `StartTurn`; each turn gets a new bounded attempt and namespace. After a clean boundary, close and contain the process before closing the account lease. Runner death or incomplete output never automatically resends the uncertain turn, even into a fresh session. Reconcile recorded effects and retain the unknown charge; an explicit retry creates a new admission and new context snapshot. Reset or connection change fences old work and increments generation before any new turn. Keep task-provider resume behavior unchanged where independently supported; this fresh-session requirement applies to coordinators.
- [ ] **Green and guard mutations:** Substitute a prior session ID, depend on deleted lease files or old launcher state, include a deleted/unconfirmed preference, bypass source scope or prompt/frame caps, disable oldest-first trimming or shared-home waiting, move durable barriers, resend uncertain prompts, ignore generation or reuse another session's usage baseline separately; require named failures and restore. Add journal upgrade/reopen tests without provider runs. Codex may revalidate its newly created thread within a turn using its existing RPC contract; that is not cross-turn coordinator resume.
- [ ] **Implementation commit:** `feat: seed fresh coordinator turns from stored conversation context`.

### Task 8: Make preferences inspectable and non-authoritative

**Files:** Create `internal/equipo/conversation/{preferences,preference_handlers,preference_views}.go`, `templates/preferences.html`, `internal/plan3test/preferences_test.go`, `0022_preferences.sql`; modify coordinator prompt construction and `copy.go`.

**Interfaces:** `Preference{ID, Text, Status, SourceMessageID string; Revision int64}` where status is `confirmed` or `inferred`; `Store.Preferences(ctx context.Context, actor Actor) ([]Preference,error)`; `Store.SetPreference(ctx context.Context, actor Actor, p Preference, m Mutation) (Preference,error)`; `Store.DeletePreference(ctx context.Context, actor Actor, id string, m Mutation) error`; `Store.ConfirmedPreferences(ctx context.Context, actor Actor, projectID int64) ([]Preference,error)`.

Also add typed `PersonalSettings{Landing string; Revision int64}` and `Store.SavePersonalSettings(ctx context.Context, actor Actor, in PersonalSettings, m Mutation) (PersonalSettings,error)`. Landing allows `conversation` or `work`, defaults to `conversation`, and is stored separately from learned prose preferences in 0022. A model cannot change it by inferring a preference.

- [ ] **Tests first:** `TestPreferencesConfirmedOnly` verifies prompts/plan decisions use confirmed entries only, and an inference cannot turn itself into confirmation. `TestPreferencesSourcePrivacy` denies cross-person source links, guesses and coordinator-supplied confirmation. `TestPreferencesCorrectionAndDelete` checks revisions, tombstone provenance, deletion from future prompts and invalidation of cached context. Rerun `TestCoordinatorSessionContinuity` with the persisted preference source, editing/deleting a preference between runner restarts and proving it is absent from the next fresh session prompt. `TestPreferencesCannotGrantAuthority` tries to approve, spend, select another person's account or override team rules with preference text; each fails.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test ./internal/coordinator -run '^TestPreferences|^TestCoordinatorSessionContinuity$' -count=1`.
- [ ] **Implement:** Show status, source and correct/delete/confirm forms. A direct personal edit is confirmed; a coordinator suggestion remains inferred until a person confirms it. Rebuild instruction context on the next turn and include source IDs/revisions; do not allow a stale session memory to drive decisions after deletion. All effectful operations recheck current policy independent of prompt content. Do not rewrite historical task instructions that already ran.
- [ ] **Green and guard mutations:** Break source scope, confirmation origin, deletion refresh and policy precedence separately; run `make migration-check`.
- [ ] **Implementation commit:** `feat: add sourced and correctable personal preferences`.

### Task 9: Build the live conversation, plan editor and question cards

**Files:** Create conversation views/handlers/templates from the file map, `internal/equipo/planning/handlers.go`, `templates/plan.html`, `internal/equipo/conversation/live.go`, `internal/plan3test/conversation_browser_test.go`; modify `app.go`, live observer/changes, task/question views, navigation, `copy.go` and `static/equipo.css`.

**Interfaces:** GET/POST `/conversation`, GET/POST `/tasks/{id}/thread`, GET/POST `/tasks/{id}/plan`, POST `/tasks/{id}/plan/approve`, POST `/tasks/{id}/project`; retain question-answer and cancellation routes. `Store.ConversationCards(ctx context.Context, actor Actor) ([]Card,error)` projects current plans/tasks/questions. New private live topic keys include team, person and resource; `application.allowConversation(r *http.Request, key string) bool` checks persisted membership/ownership on every authorization.

Add GET/POST `/settings/coordinator` for Task 5’s own binding/reset and owner-only coordinator limits; expose missing budget configuration as a setup state. Add POST `/conversation/questions/{id}/answer` for Task 6 clarification cards. The plan page has project approval and personal override forms backed by Task 2; these settings are usable in 3a, before the complete 3b settings API.

- [ ] **Tests first:** `TestConversationScriptless` posts a message, edits/reorders only unstarted steps, corrects a project and answers a card without JavaScript. `TestConversationNoProjectPicker` checks the composer lacks a project selector, chosen project is on the card, and ambiguity has one-tap options. `TestConversationLivePrivacy` denies another person's subscription, stops access after roster removal and emits nothing on rollback. `TestConversationQuestionRace` sends stale, expired, cancelled and duplicate answers and proves only one current answer can reach the original provider request. `TestConversationLayout` uses existing chromedp fixtures at phone/desktop widths and enlarged text: no split screen, initials, coloured left accents, wrapping values or lost keyboard focus.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestConversation(Scriptless|NoProject|Live|Question|Layout)' -count=1`.
- [ ] **Implement:** Use Rastrillo v0.30.1 `live.New` topics, `live.Hub` notifications and existing fragment rendering. Continue scriptless POST/redirect/get; live updates invalidate card regions after commit, never replace a composer draft or move focus. Preserve the hibernating/no-hub fallback and serve initial snapshots correctly before any event. Cards show plan revision, project correction action, playbook, picks/reasons, actual step progress and approval state. The coordinator waiting card names and links Task 7’s blocking task; test this in `TestConversationScriptless`. Route task replies with a short reference line. Coordinator clarification questions have their own persisted card lifetime; runner permissions keep the existing attempt/fence/expiry rules and original request. Free text never substitutes for a native permission response. Add a thread link from task, Journey and specialist pages.
- [ ] **Green and guard mutations:** Break private topic authorization, post-commit ordering, revision checks and layout constraints; restore. Run existing vendored-assets and live-gate tests.
- [ ] **Implementation commit:** `feat: add live conversation cards and task discussions`.

### Task 10: Establish the versioned person API and explicit CSRF dispatcher

**Files:** Create `internal/equipo/personapi/{types,validate,validate_test,budget_test,handler,auth,conversation}.go`, `internal/plan3test/person_api_test.go`, `docs/api/equipo-v1.openapi.json`, `0023_person_api_requests.sql`; modify `app.go`, auth/session revocation integration and copy keys. Reuse Plan 2b's CSRF dispatcher if its fix lands first; otherwise this task owns it.

**Interfaces:** `Store.PersonAPIHandler() http.Handler` mounted at `/api/v1`; `PersonPrincipal{Address, CredentialID string; SessionEpoch int64}` comes only from a verified identity. In 3a, person requests use the browser session. Define injectable `VerifyPersonBearer(context.Context, string) (PersonPrincipal,error)`: 3a production denies native tokens; tests use a deterministic verifier. Task 20 owns production native credentials and their challenge/approval/exchange flow.

- [ ] **Tests first:** `TestPersonAPIAuthAudiences` rejects runner, cleanup, coordinator and other-instance tokens, mixed cookie/bearer auth and forged person fields. `TestPersonAPIBrowserCSRF` uses the real app constructor and outer HTTP handler, not only `RunnerHandler` or `PersonAPIHandler`. Valid runner bearer POSTs and fixture-verified native person bearer POSTs reach their mutations without Origin, Referer or Fetch Metadata; cross-origin cookie POSTs fail before any write. Same-origin cookie writes succeed. Missing/invalid bearer and cookie-plus-bearer fail even when the request supplies same-origin headers; bearer on a cookie-only route also fails. Exercise registered runner cleanup credentials only on their existing cleanup lane. `TestPersonAPIRevisionReplay` asserts required `If-Match`, conflict on stale revision, duplicate result replay and changed-body conflict across browser/API. `TestPersonAPIConversationParity` checks private reads, task-thread visibility, cards and answers match HTML operations. `TestPersonAPIPeopleReadOnly` gives active members safe roster projections and denies writes or inactive-member reads.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/equipo/personapi ./internal/plan3test -run '^TestPersonAPI' -count=1`.
- [ ] **Implement:** Replace `app.go`'s global `a.Use(csrf.Protect(...))` with an explicit route/auth dispatcher. Cookie routes, including person API browser requests, pass through `csrf.Protect`/`csrf.SameOrigin`. Registered runner APIs go directly to their existing credential validators with cookies rejected; registered native person API routes require Task 20's person verifier and reject cookies before bypassing CSRF. Neither bearer lane passes through an outer browser-only CSRF wrapper. Public runner enrolment creation/token exchange retain their narrowly registered proof/rate-limited handlers; Task 20 adds separate person challenge/exchange handlers later. Never exempt all `/api` or trust the mere presence of an Authorization header. Keep framework sign-in/session handling and deny credentialed cross-origin access. API failures return JSON, not sign-in HTML.
- [ ] Implement the 3a API rows using shared application operations, including read-only `GET /people` for current members. Return address/display identity, active state and team role only, with no preferences, connection secrets or credential fields. Store API request/replay metadata in 0023 using Task 1's canonical mutation rules. Owner roster/budget mutation endpoints arrive in Task 20.
- [ ] **Green and guard mutations:** Restore the old global wrapper to prove the real-handler bearer tests fail; remove cookie protection to prove cross-origin writes fail the test; bypass audience, mixed-auth, current-roster and revision checks separately. Validate implemented 3a OpenAPI operations against route tests and run `make migration-check`. When depending on the upstream fix, record its revision and run these same app-level regressions here.
- [ ] **Implementation commit:** `feat: expose person API v1 through explicit auth and CSRF lanes`.

### Task 11: Prove and package the 3a usable stop

**Files:** Create `internal/plan3test/coordinator_acceptance_test.go`; modify relevant release tests/requirements, `Makefile` only for delegating targets, `copy.go`; create the 3a section in `docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md` and future reviewed `docs/plan-3-acceptance.md`.

**Interfaces:** No new product interface. Exercise Tasks 1–10 through real HTTP, the runner service, fake provider streams, local Git and the existing fake forge. Report separate offline pass, pending copy and pending live certification states.

- [ ] **Tests first:** `TestCoordinatorAcceptance3A` signs in two fixture people, starts a bug and feature from messages, gets one sourced recommendation with one family, edits a future step, answers a question, corrects an unstarted project, routes a reply, changes a preference, cancels active work and restarts mid-turn. Assert independent-family exact-candidate evidence, publication readback, human wait, isolated accounts and no duplicate task/turn/delivery. `TestCoordinatorReleaseNeedsPolicyCertification` rejects old/missing tuples and pending copy for new coordinator policies.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestCoordinator(Acceptance3A|Release)' -count=1`; expect missing behavior to fail.
- [ ] **Implement integration fixes:** Finish wiring discovered by the acceptance test. List every new runtime key from the copy inventory; obtain review before release through the later controller's chosen review channel, without starting a copy-review server in this task. Do not mark pending entries reviewed on the strength of the mockups. Prepare bounded live acceptance inputs and certification assertions; no provider run is authorized by this plan-writing session.
- [ ] **Green and gates:** Repeat targeted command; mutate duplicate-delivery, early-success and release-eligibility guards. Run `CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner`, `make migration-check`, then `make ci` once on a namespace-capable machine. Preserve `.amadan/ci` and `.amadan/ci.d/` delegation. Record the relevant Plan 2b gate result, changed policy identities and any remaining blocker. No fake provider fixture can certify a production tuple.
- [ ] **Usable acceptance and implementation commit:** After 2b dependencies and reviewed copy, Paul authorizes a bounded certification/try-out with his dedicated homes and disposable repository. He performs the three request kinds, sees the branch/evidence, cancels and merges manually. Keep the release disabled until this gate passes. Subject: `test: verify the coordinator conversation acceptance flow`.

## Plan 3b: Library, setup and the complete app API

### Task 12: Add custom specialists and versioned specialist templates

**Files:** Create `internal/equipo/library/{specialists,templates,handlers,budget_test}.go`, templates `specialist_form.html`, `template_library.html`, `internal/plan3test/specialist_library_test.go`, `0024_specialist_library.sql`; modify specialists, connection selection, navigation, icons, provider policy and copy keys.

**Interfaces:** `SpecialistInput{Key, Name, Icon, Instructions string; AllowedModels []ModelRef; Tools []string; ProjectIDs []int64; MaxConcurrent int}` with `ModelRef{Provider, Family, Model string}`; `Store.CreateSpecialist(ctx context.Context, actor Actor, in SpecialistInput, m Mutation) (Specialist,error)`; `UpdateSpecialist` with the same signature; `DeleteSpecialist(ctx context.Context, actor Actor, key string, m Mutation) error`. `TemplateRef{ID string; Version int64}`; `InstallSpecialistTemplate(ctx context.Context, actor Actor, ref TemplateRef, m Mutation) (Specialist,error)`; `SpecialistTemplateDiff(ctx context.Context, actor Actor, key string, target TemplateRef) (TemplateDiff,error)` where diff contains old/current/suggested field values.

Define `TemplateDiff{From, To TemplateRef; CurrentRevision int64; Old, Current, Suggested map[string]json.RawMessage}`. Applying it requires the current specialist/playbook revision and explicit selected fields; later catalog changes cannot silently alter the accepted diff.

- [ ] **Tests first:** `TestSpecialistLibraryCopies` installs two independent editable copies with template origin/version; changing a shipped template does not mutate either. `TestSpecialistRequiredDefaults` refuses Engineering/Review deletion or conversion away from their required roles. `TestSpecialistToolPolicy` refuses arbitrary commands, provider tools outside the certified catalog and a claimed tool set broader than project/team permission. `TestSpecialistScopeAndPermissions` allows active people to create team specialists, restricts edits/deletion to creator or owner, rejects other teams and preserves started snapshots. `TestSpecialistTemplateGroups` asserts all named templates and blank template exist with icon/name display.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test ./internal/runner/provider/... -run '^TestSpecialist(Library|Required|Tool|Scope|Template)' -count=1`.
- [ ] **Implement:** Preserve owner control of team rules and existing defaults. Add stable opaque keys, creator, archive state, icon catalog ID, allowed-model/tool/project sets and template provenance. Archiving a referenced specialist hides it from new plans but preserves historical cards; reject removal used by an unstarted plan until the person revises that plan. Offer template updates as field diffs accepted explicitly under revision checks. Ship Quality: QA and testing, Accessibility, Performance; Safety: Security, Privacy; Running things: Ops, Data, Support; Words and reach: Docs, Localisation, SEO; plus blank. Ops/Data templates grant no infrastructure or money authority. Ship catalog labels, descriptions and standing instruction text through individually pending `copy.go` entries, with catalog records referring to keys. On installation, copy approved values into the team-owned record; person-authored changes remain attributed content. All executable tool profiles must be certified; an unavailable combination remains unavailable.
- [ ] **Green and guard mutations:** Break copy isolation, required-role protection, tool subset and edit authority independently; run `make migration-check` and size budgets.
- [ ] **Implementation commit:** `feat: add custom specialists and template copies`.

### Task 13: Add playbooks, defaults and explicit template updates

**Files:** Create `internal/equipo/library/{playbooks,playbook_handlers,views}.go`, templates `playbooks.html`, `playbook_form.html`, `internal/plan3test/playbooks_test.go`, `0025_playbooks.sql`; extend template catalog, plan validation/coordinator tools and copy keys.

**Interfaces:** `PlaybookInput{ID, Name string; Kind taskplan.Kind; Steps []taskplan.Step; ProjectIDs []int64; Template TemplateRef}`; `Store.SavePlaybook(ctx context.Context, actor Actor, in PlaybookInput, m Mutation) (Playbook,error)`; `Store.DeletePlaybook(ctx context.Context, actor Actor, id string, m Mutation) error`; `Store.SetPlaybookDefault(ctx context.Context, actor Actor, projectID int64, kind taskplan.Kind, playbookID string, m Mutation) error`; `Store.InstantiatePlaybook(ctx context.Context, actor Actor, id string, taskID string) (taskplan.Plan,error)`. Provide a blank playbook template with the required review/checks/person tail already present. Define `Playbook` as persisted input plus creator/revision/archive fields; use Task 12's `TemplateDiff` for offered updates. A template install/update is explicit and revisioned; define `Store.InstallPlaybookTemplate(ctx context.Context, actor Actor, ref TemplateRef, m Mutation) (Playbook,error)` and `Store.PlaybookTemplateDiff(ctx context.Context, actor Actor, id string, target TemplateRef) (TemplateDiff,error)` alongside the specialist equivalents.

- [ ] **Tests first:** `TestPlaybookMandatorySteps` rejects removing review/checks/person from every saved playbook, including template copies. `TestPlaybookDefaultPrecedence` resolves project+kind, project-wide, kind-wide, then shipped kind template; only one default at each specificity. `TestPlaybookSnapshot` proves a later edit cannot change a task's instantiated revision. `TestPlaybookSuggestionNeedsPerson` creates only a suggestion until a verified-person save. `TestPlaybookTemplates` covers Bug, Website change, Infra change and Investigation, missing/archived specialists and deliberate update acceptance.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/taskplan ./internal/plan3test -run '^TestPlaybook' -count=1`.
- [ ] **Implement:** Reuse Task 2 validation. Active members create; creator/owner edits, owner controls project defaults; all changes are audited. Show the chosen playbook and any task-specific changes on the plan. Saved Investigation playbooks retain the mandatory tail but start at an explicit research/person checkpoint; later publishing requires new validation/admission, never an automatic leap past the checkpoint. Pure recommendations use Task 3's no-publication exception without instantiating a publishing playbook. Infra change is limited to repository changes, not production operations. Team continues to mean people.
- [ ] **Green and guard mutations:** Break required tail, precedence, immutable snapshot and person-save checks; run `make migration-check`.
- [ ] **Implementation commit:** `feat: add editable playbooks and project defaults`.

### Task 14: Complete personal connection choices and model reasons

**Files:** Create `internal/equipo/planning/selection.go`; modify `internal/equipo/{connections,connection_selection,connection_models,connection_handlers,connection_views,runner_execution}.go` for delegation and existing record fields, connection/project/plan templates and copy keys; create `internal/plan3test/plan_model_choice_test.go`.

**Interfaces:** Extend existing `ConnectionChoice` input and `connectionChoiceRecord` with `Mode` values `best_fit`, `pinned`, `ask`; retain project/person ticked connection IDs and pin. `Store.SelectPlanStep(ctx context.Context, actor Actor, taskID, stepKey string, m Mutation) (Selection,error)`; `Store.ConfirmPlanSelection(ctx context.Context, actor Actor, taskID, stepKey, connectionID, model string, m Mutation) (Selection,error)`. Selection retains current connection, choice and specialist revisions, reason, family, runner and allowance-known fields. Create `0026_connection_modes.sql`, add `Mode` with default `best_fit` to `connection_choices`, update models/schema and preserve every existing personal tick/pin. Unchanged historical choices therefore retain their current behavior.

- [ ] **Tests first:** `TestPlanModelChoiceOwnAccounts` covers two Claude and one Codex connections, person isolation, project ticks and provider/family rules. `TestPlanModelChoiceModes` verifies pinned behavior, explicit ask confirmation and deterministic best-fit within eligible choices, including unknown headroom. `TestPlanModelChoiceReviewFamily` blocks same-family Review regardless of pin/custom specialist. `TestPlanModelChoiceImmutableStep` preserves actual account/model/reason after a later settings change and never switches active work. `TestPlanModelChoiceUnavailable` keeps allowance/count unknown and reports the missing second family without borrowing accounts. `TestPlanModelChoiceCoordinatorConnection` covers an eligible alternative, all alternatives excluded by family/pin/ask restrictions, and no alternative: prefer the eligible non-coordinator connection; otherwise keep the selected shared connection and display the coordinator turn waiting for its lease. Assert a queued coordinator makes no provider call and resumes admission/dispatch only after the active specialist releases the lease.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestPlanModelChoice' -count=1`.
- [ ] **Implement:** Treat model-proposed fit/reason as a proposal within server-validated choices. Use known headroom only when supplied by a supported observation; otherwise label counted usage and unknown allowance. Plan approval and ask-each-pick are separate gates. Recheck current choice/specialist/connection revisions at claim and every turn. Pinning never defeats independent review. For best-fit selection, prefer an eligible connection other than the coordinator's before comparing fit/headroom. Eligibility includes provider/family rules, project ticks, pin and any explicit ask confirmation; never override the person's selection. If none is eligible, queue the coordinator while the specialist holds that shared home and show its waiting state in the conversation and status API. Release the lease at a clean turn boundary so neither side waits while holding it. Implement the preference and wait behavior in Task 4 for 3a, and extend it to these modes here. A later step may use another personal account with its own recorded reason; no mid-step failover. Keep source credential paths out of every person API response.
- [ ] **Green and guard mutations:** Mutate person filter, allowed-family intersection, pin exception, unknown handling and actual-selection immutability separately; run `make migration-check`.
- [ ] **Implementation commit:** `feat: show and guard per-step personal model choices`.

### Task 15: Accept invitations through verified person identity

**Files:** Create `internal/equipo/setup/{invites,invite_handlers,budget_test}.go`, `templates/invite.html`, `internal/plan3test/invites_test.go`, `0027_invitations.sql`; modify auth/roster routes and copy keys.

**Interfaces:** `Invitation{ID, Address, Role string; ExpiresAt time.Time; Revision int64; State string}`; `Store.CreateInvitation(ctx context.Context, actor Actor, address string, role Role, m Mutation) (Invitation,error)`; `Store.AcceptInvitation(ctx context.Context, actor Actor, id, secret string, m Mutation) (Member,error)`; `Store.RevokeInvitation(ctx context.Context, actor Actor, id string, m Mutation) error`. Issue a random single-use secret, store its keyed hash and a seven-day expiry; expose the link only to the inviting owner for deliberate sharing. No automatic email send is required.

- [ ] **Tests first:** `TestInviteVerifiedAddress` rejects a valid invite with the wrong/unverified keymail identity and does not create an active member on GET. `TestInviteReplayAndExpiry` covers identical retries, token reuse by another identity, expiry and revocation. `TestInviteCurrentAuthority` denies a removed inviter/owner's stale issuance action, protects the last owner and audits acceptance atomically. `TestInviteSignInPendingMember` allows verification of the invited identity before acceptance while denying every team resource until acceptance commits.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestInvite' -count=1`.
- [ ] **Implement:** Integrate with existing keymail verification rather than an invitation authentication bypass. Extend `NewAuth`’s current active-member-only `Authorize` callback to allow identity verification for an address with an unexpired, unrevoked invitation. The resulting session still fails `requireMember` until acceptance commits; a narrow verified-session invite handler does not use team-resource authorization. The acceptance page may read only safe invitation metadata after token validation; current membership is still mandatory elsewhere. Keep invitation secrets out of logs/audit/referrers. A verified sign-in can accept only the intended address and reviewed role. Record acceptance as the onboarding entry point. Task 16 initializes onboarding state from it without overwriting an existing person’s setup; this task does not depend on the later onboarding table.
- [ ] **Green and guard mutations:** Break verified-address, single-use, expiry, roster and audit checks; run `make migration-check`.
- [ ] **Implementation commit:** `feat: accept team invitations with verified identity`.

### Task 16: Install and pair the supported own-machine runner

**Files:** Create `internal/runner/setup/{install,install_test,budget_test}.go`, `internal/equipo/setup/{onboarding,onboarding_handlers}.go`, `templates/onboarding.html`, `0028_onboarding.sql`; modify `docs/mockups/onboarding.html` for the agreed pairing direction only after the later copy pass, `cmd/equipo-runner/main.go`, `internal/runner/enrol.go` and existing enrolment/config/packaging/release tests; create a versioned installer asset and `internal/plan3test/onboarding_install_test.go`.

**Interfaces:** `runnersetup.InstallUser(ctx context.Context, opts InstallOptions) (InstallResult,error)` with `InstallOptions{Release, Root, InstanceOrigin string; EnableService bool}` and `InstallResult{Version, BinaryPath, ServicePath, State string; Missing []string; LingeringEnabled bool}`; `Store.Onboarding(ctx context.Context, actor Actor) (OnboardingState,error)`; `Store.AdvanceOnboarding(ctx context.Context, actor Actor, step string, m Mutation) (OnboardingState,error)`. State records completed prerequisites independently, so resume does not rerun login or install.

Define `OnboardingState{Revision int64; CurrentStep, ProviderChoice, RunnerID, AccountSetupID string; Completed map[string]bool}`. Allowed step keys are `welcome`, `account`, `runner`, `specialists`, `first_task`; advancement checks persisted prerequisites, not a submitted completed flag. The account-choice stage may be complete while actual login remains pending on the runner stage. Reuse `BeginEnrolmentRequest`, machine public key, challenge proof, browser approval and runner credential audiences. The runner begins enrolment and prints the returned short code and verification address; the person types that code into the signed-in browser. Replace `internal/runner/enrol.go`’s hard-coded `Label: "equipo-runner"` with the actual machine label, defaulted from the hostname and editable by the person before enrolment. Carry it through `BeginEnrolmentRequest.Label`; show that same label and server request creation time on the approval page, requiring explicit confirmation after code entry. Do not prefill a code from a link or approve on GET. Route changed onboarding mockup wording through the same later copy pass as runtime strings, then apply approved words verbatim during Task 16. This revision changes only the plan.

- [ ] **Tests first:** `TestOnboardingInstallVersioned` verifies version/checksum, user-writable destination, no sudo, no global config edits, no shell interpolation of origin/path and refusal of unsupported OS/arch or uncertified release. `TestOnboardingPairingBound` asserts the runner prints the code, the browser requires typed entry and displays the real machine label/time, including a person-edited label rather than the fixed literal, rejects replay/expiry/wrong machine or a link-only approval, and pairs only after the intended person's verified browser approval. `TestOnboardingContainmentPreflight` covers missing/wrong bubblewrap version, disabled unprivileged user namespaces, the Ubuntu 24.04 AppArmor restriction and a successful namespace/pidfd probe. Each failure leaves install unavailable with the missing prerequisite and no service enabled. `TestOnboardingServiceLogout` reports "runner stops at logout" when user lingering is off; it does not enable lingering itself. `TestOnboardingInstallResume` retries partial install/pairing without duplicate service/runner and cleans only owned scratch. `TestOnboardingHostedUnavailable` shows Hosted by Equipo as later with no working launch route.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/setup ./cmd/equipo-runner ./internal/plan3test -run '^TestOnboarding(Install|Pairing|Containment|Service|Hosted)' -count=1`.
- [ ] **Implement:** Generate a one-line install command from the configured HTTPS instance origin and immutable release version. Download to private on-disk scratch, verify against the authenticated versioned manifest, then run the install-time containment preflight before enabling a user service or accepting runnable work. Require bubblewrap 0.11.0, working unprivileged user namespaces and pidfds using the release's actual namespace policy. On Ubuntu 24.04 detect/report the AppArmor unprivileged-user-namespace restriction; an executable version check alone is insufficient. Return `State=unavailable` with the missing/denied prerequisite and a reviewed diagnostic. Never run sudo, change sysctls or disable AppArmor. After preflight, start runner enrolment and print the code for typed browser approval as above. Handle absent user-service support as an explicit setup failure; do not invoke sudo. Pairing code is expiring, throttled and machine-key bound. The runner dials outbound only. Testing never enables a persistent service. Production service installation is the explicit install action. Inspect user lingering without changing it: when disabled, report "runner stops at logout" and do not claim unattended persistence across logout. Apply the supported setup ruling above; unsupported architectures remain unavailable pending certified packaging. No unconfined fallback.
- [ ] **Green and guard mutations:** Break manifest verification, code binding/typed entry, containment preflight, logout-state reporting, OS gate, user-only destination and retry uniqueness; run `make migration-check` and release packaging tests with fixtures.
- [ ] **Implementation commit:** `feat: add versioned user runner installation and pairing`.

### Task 17: Connect dedicated accounts and finish safe onboarding

**Files:** Create `internal/runner/setup/{account_login,account_login_test}.go`, `internal/runner/provider/login.go`, `internal/equipo/setup/accounts.go`, `internal/plan3test/onboarding_accounts_test.go`; modify runner command/config, onboarding views/routes, connection reports and copy keys.

**Interfaces:** `provider.LoginDriver` exposes `Begin(ctx context.Context, providerName, credentialHome string) (LoginChallenge,error)`, `Poll(ctx context.Context, challengeID string) (LoginResult,error)`, `Cancel(ctx context.Context, challengeID string) error`; `LoginChallenge{ID, VerificationURI, UserCode, Mode string; ExpiresAt time.Time}` and `LoginResult{State string; Identity provider.Identity}`. This driver runs only on the person's runner and invokes supported, unmodified CLI login. `Store.RequestAccountSetup(ctx context.Context, actor Actor, runnerID, providerName, label string, m Mutation) (AccountSetup,error)` returns a setup ID/status and allowlisted display metadata. Provider `LoginChallenge` is runner-local and is never serialized directly into an instance response. Home paths, provider device secrets and Claude browser-return codes stay runner-local.

Define `AccountSetup{ID, RunnerID, Provider, Label, State, Mode string; Challenge *LoginDisplay; ConnectionID string; Revision int64}` with states `waiting_runner`, `pending`, `connected`, `expired`, `denied`, `cancelled`, `unavailable`. Define `LoginDisplay{VerificationURI, UserCode string; ExpiresAt time.Time}` as an explicit safe projection for supported device authorization only. Claude browser mode has no instance challenge payload. Show its setup ID beside the pending `AccountSetup` so the person can run `equipo-runner account login --setup <id>` on that machine. Do not include a challenge ID that doubles as the provider's secret polling credential. The interactive subcommand matches the ID against a pending setup for this enrolled runner/person/generation, allocates the dedicated home, invokes the official CLI login on its terminal and reports sanitized status plus verified identity back through the authenticated runner channel. Refuse missing, wrong-runner, stale or cancelled setup IDs. Recheck the current roster before exposing or accepting results; the service never waits for terminal input.

- [ ] **Tests first:** `TestOnboardingAccountDedicatedHome` creates distinct private homes for two same-provider accounts, refuses interactive/shared homes, checks identity after login and proves no secret leaves the runner in HTTP, logs or journal events. `TestOnboardingDeviceFlow` uses fake supported CLI responses for approval, pending, expiry, denial, cancel and restart; no login success before identity readback. `TestOnboardingClaudeHeadlessBrowserLogin` drives `equipo-runner account login --setup <id>` through a terminal fixture and recorded official CLI login in a dedicated home. Assert the instance displays the matching pending setup ID, reject wrong/stale IDs, exercise the supported setup ruling’s browser/code exchange, verify identity locally and report sanitized status to that setup. Assert the code is absent from instance requests/responses, browser forms, logs, journals and audit events; cover cancellation, expiry and restart without a false connected state. `TestOnboardingNoDeviceCapability` chooses Claude's official browser flow when device auth is absent and returns unavailable only when no supported login flow exists; never invent a verification URL or scrape private OAuth endpoints. `TestOnboardingSafeFirstTask` starts a read-only sourced recommendation with one family and no branch/edit/publish; a change request asks for the second family before review. `TestOnboardingSpecialists` defaults the five specialists, keeps Engineering/Review required and installs selected library copies through Task 12.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/runner/... ./internal/plan3test -run '^TestOnboarding(Account|Device|Claude|NoDevice|Safe|Specialists)' -count=1`.
- [ ] **Implement:** Present the five conceptual stages: welcome, account choice, own-machine setup, specialists, safe first task. On a new machine, account choice can be saved at stage 2, but login waits until stage 3 has paired the local runner; the instance never temporarily hosts a subscription credential. Reuse `provider.OpenAccount` and same-identity refresh rules after login. Implement the supported setup ruling with verified CLI contracts, including `codex login --device-auth` for the compatible pin and the interactive Claude subcommand above. Its return code is terminal input, never argv; the instance has no code-entry, code-forwarding or OAuth callback role. Any browser callback listener binds loopback and is owned/closed by the setup process. Persist safe setup correlation, not provider secrets, across reconnects. Show multiple labeled connections and observed allowance/unknown state. A new account never replaces an existing credential home silently.
- [ ] **Green and guard mutations:** Break dedicated-home enforcement, identity readback, secret filtering, safe-first-task permissions and family gate; require failures. Live sign-in and any provider execution require Paul's later explicit action with dedicated accounts.
- [ ] **Implementation commit:** `feat: onboard personal accounts and a safe first task`.

### Task 18: Put Teams above the team on web and phone

**Files:** Create `internal/equipo/setup/{team_links,team_link_handlers}.go`, `templates/teams.html`, `internal/plan3test/teams_navigation_test.go`, `0029_team_links.sql`; modify navigation/chrome/index/layout, sign-in success handling, preference landing setting and copy keys.

**Interfaces:** `TeamLink{ID, Origin, Name string; LastSignedInAt *time.Time; Revision int64}`; `Store.TeamLinks(ctx context.Context, actor Actor) ([]TeamLink,error)`; `Store.RememberTeam(ctx context.Context, actor Actor, in TeamLink, m Mutation) (TeamLink,error)`; `ForgetTeam(ctx context.Context, actor Actor, id string, m Mutation) error`. GET `/teams` is a link directory, GET `/work` is the current team index. `Landing` preference is `conversation` (default) or `work` and is changed only by the person.

- [ ] **Tests first:** `TestTeamsHierarchy` checks desktop Teams link and phone Teams → team → page → task/thread back links with scripts disabled. `TestTeamsDirectoryPrivacy` scopes links to the person and rejects credentials, script URLs, fragments, userinfo and non-HTTPS remote origins. `TestTeamsNoFederatedAuthority` proves remembering a link creates no remote membership, credential sharing or server fetch. `TestTeamsUnavailableCounts` keeps remote counts absent/unknown and renders current-team errors as unknown. `TestTeamsLandingPreference` covers default, override and stable task deep links after sign-in.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestTeams' -count=1`.
- [ ] **Implement:** Remember the current instance after successful sign-in. Provide an explicit person-managed add/forget link form for other instances they have signed in to; make clear that this is their remembered directory, not a federation roster. Independent origins cannot automatically discover each other's browser sessions. Never trust a submitted `LastSignedInAt` as verified. This meets the brief's links-only web boundary; automatic cross-origin discovery and aggregated remote Needs you need a separate authenticated directory/client design. Native clients can later remember their own signed-in instances. Include Preferences, Playbooks and dynamic specialists in the current team's navigation; preserve phone landing preference and icon-plus-name display.
- [ ] **Green and guard mutations:** Break URL validation, private scope, back-link hierarchy and unknown count handling; run `make migration-check` and layout/vendored tests.
- [ ] **Implementation commit:** `feat: add the Teams directory and web navigation hierarchy`.

### Task 19: Add the durable notification outbox and subscription feed

**Files:** Create `internal/equipo/notifications/{models,outbox,api,budget_test}.go`, `internal/plan3test/notifications_test.go`, `0031_notifications.sql`; modify question/conversation/plan commit hooks, API schema, current-member revocation and copy keys.

**Interfaces:** `Notification{ID, Kind, ResourceID, DeepLink string; ResourceRevision int64; CreatedAt time.Time; State string}`; `Store.Notifications(ctx context.Context, actor Actor, cursor string, limit int) (personapi.Page[Notification],error)`; `Store.SubscribeNotifications(ctx context.Context, actor Actor, deviceID string, m Mutation) (NotificationSubscription,error)`; `Store.AcknowledgeNotification(ctx context.Context, actor Actor, subscriptionID, notificationID string, m Mutation) error`; `UnsubscribeNotifications` with the same actor/subscription/mutation pattern. Subscriptions belong to a person device credential and have independent delivery cursors. Wire responses contain no bearer or permission answer capability.

Define `NotificationSubscription{ID, DeviceID, Cursor string; Revision int64; Active bool; ExpiresAt time.Time}`; the recipient comes from the verified actor and is never a submitted field. Subscriptions expire at the earlier of 30 days from creation and the bound device credential's expiry. No implicit renewal on poll or ACK; a new authenticated subscribe action creates a replacement after expiry. Every feed read, live authorization and ACK checks expiry, current roster and device revocation. Revoking a device disables all its subscriptions in the same transaction. ACK requires a notification actually delivered on that subscription, and advances only a contiguous cursor; an out-of-order ACK cannot skip an earlier event.

- [ ] **Tests first:** `TestNotificationOutboxAtomic` commits question/task-ready/card changes and one recipient event together, emits nothing on rollback and deduplicates replay. `TestNotificationRecipientIsolation` denies other people and removed members, including stale live subscriptions. `TestNotificationReconnect` retries after lost acknowledgement, advances only the specified device cursor and preserves unread state across another device's ACK. `TestNotificationStaleAnswer` invalidates superseded question notifications and requires a fresh GET plus Task 10's revisioned person answer; no push payload grants authority. `TestNotificationSubscriptionExpiry` uses a fake clock at the exact deadline, verifies device expiry/revocation terminates access and live delivery, rejects later ACKs, and allows explicit re-subscription without losing unread questions. `TestNotificationNoExternalDelivery` registers no APNs/FCM/network sender and stores no provider secrets or arbitrary callback URL.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestNotification' -count=1`.
- [ ] **Implement:** Insert outbox rows in the effect's existing transaction, unique by recipient/event/resource revision. Feed delivery is at least once; clients deduplicate by notification ID. Keep task/question content private by default: the notification contains type, ID, revision and an instance-relative deep link; the authenticated client fetches current card/options. Support resumable GET polling and private Rastrillo invalidation for web; external mobile push is a later adapter over these records. Mark obsolete events superseded. Keep 30 days of acknowledged entries; a cursor older than retained history returns `410 cursor_expired` and a fresh-snapshot instruction, never silently skips pending questions. Unacknowledged current questions remain discoverable in Needs you. Plan 3 recipients are the requesting person and existing explicit human decision owners, not coordinator-to-coordinator routing.
- [ ] **Green and guard mutations:** Break commit atomicity, recipient scope, deduplication, independent cursor, expiry/device-revocation and stale-resource checks; run `make migration-check`.
- [ ] **Implementation commit:** `feat: add a person-scoped notification outbox`.

### Task 20: Complete and document the native-facing JSON API

**Files:** Extend `internal/equipo/personapi` projections; create its `devices.go`, `roster.go`, `budgets.go`, `internal/plan3test/{person_api_contract,person_device}_test.go`, `0030_person_devices.sql`; modify app auth dispatch, model/schema mirrors and thin store adapters; complete `docs/api/equipo-v1.openapi.json` and reviewed `docs/api/equipo-v1.md`; modify copy keys for exposed validation states.

**Interfaces:** Implement every 3b row below using the same store operations as HTML, including CRUD, template install/diff/apply, account choices, setup status and invitation acceptance. OpenAPI is the versioned contract, not autogenerated exposure of database models. Handler registration supplies operation IDs consumed by `TestPersonAPIContractCoverage`. Implement this task before Task 19 so subscriptions can bind real person-device credentials. Task 20 checks all non-notification routes; Task 19 adds its notification rows to the coverage test and Task 21 requires the whole contract.

**Device interfaces (3b):** `Store.BeginPersonDevice(ctx context.Context, publicKey, label, requestID string) (PersonDeviceChallenge,error)`; `ApprovePersonDevice(ctx context.Context, actor Actor, id, typedCode string, m Mutation) error`; `ExchangePersonDevice(ctx context.Context, proof PersonDeviceProof) (PersonCredential,error)`; `RevokePersonDevice(ctx context.Context, actor Actor, id string, m Mutation) error`. Use separate `equipo.person.v1` and `equipo.person.device.v1` audiences, with a 10-minute single-use key-bound nonce/signature challenge and five-second throttled polling. Device label and server creation time appear on the browser approval page; the person must type the code from the initiating client. A link or prefilled code cannot approve a device. The bearer expires after 30 days, is revocable immediately, and is stored only as a keyed hash.

Define `PersonDeviceChallenge{ID, DeviceSecret, UserCode, Challenge, VerificationURI string; ExpiresAt time.Time; PollIntervalSeconds int}`, `PersonDeviceProof{ID, DeviceSecret, Challenge, Nonce, Signature string}` and `PersonCredential{ID, Token, Audience, InstanceID string; ExpiresAt time.Time}`. Device secrets go only to the initiating client and the bearer only to a successful proof exchange, never to device lists. Rate-limit challenge creation and failed polls by source/challenge, consume approval and exchange atomically, and check current roster/session epoch on every use. For a lost exchange reply, permit the same signed nonce to retrieve the same encrypted result for at most 10 minutes; never mint another credential. Delete that result on expiry. Challenge creation and exchange are narrow public handlers with their own rate limits/proofs; approval remains a verified browser-session route under CSRF protection. Neither runner credentials nor provider login codes are accepted.

**Owner operations:** Add `GET /people` in Task 10; add owner-only `GET /roster`, `PUT /roster/{address}`, `GET /budgets` and `PUT /budgets` here. The roster mutation calls `SetMember` with explicit role/active/revision input and preserves last-owner and decision-owner assignment checks. Budget updates call `SaveBudgets` with `BudgetConfig` and current revision; reads wrap `Budgets` with current-owner authorization. Add idempotency through the same transaction as the existing operations, not a handler-side check followed by an unrelated write. Ordinary members can read the safe people projection but cannot mutate roster or read/change owner budget configuration. Coordinator limits remain the separately named owner operation from Task 5.

- [ ] **Tests first:** `TestPersonAPIContractCoverage` compares the current phase's implemented methods/routes/schemas with OpenAPI and fails for missing/undocumented operations. Task 19 extends its expected inventory to all notification routes; Task 21 permits no missing v1 operation. `TestPersonAPISharedOperations` runs specialist/playbook/project/connection/onboarding actions by HTML and JSON and compares authority, revisions, audits and results. `TestPersonAPIDeviceApproval` covers verified browser identity, typed code, visible label/time, matching key/nonce, current roster, throttling, expiry, single-use and lost-response replay; wrong audiences, link-only approval and revoked/session-epoch credentials fail. Repeat Task 10's real-handler CSRF test with actual Task 20 person credentials. `TestPersonAPIOwnerRosterBudgets` denies member/stale-owner mutations, preserves last owner and decision owners, checks revision/idempotency/audit rollback and proves lowered budgets affect subsequent admission. `TestPersonAPINativeAnswers` answers a question through a device credential, rejects stale/cancelled/other-recipient answers and never accepts an OS notification action as authentication. `TestPersonAPIPaginationUnknown` covers interleaved inserts, invalid cursors, bounded limits, null counts and private-field omission. `TestPersonAPISchemaCompatibility` reads fixed v1 fixtures and rejects unknown mutation fields/duplicate keys without silently binding models.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/equipo/personapi ./internal/plan3test -run '^TestPersonAPI(Contract|Shared|Native|Pagination|Schema|Device|Owner|BrowserCSRF|AuthAudiences)' -count=1`.
- [ ] **Implement:** Finish the endpoint/DTO/error inventory below and add request/response examples as contract fixtures. Document sign-in, credential revocation, browser CSRF, idempotency, revisions, cursor pagination, live reconnection and notification answer flow. Use the repository’s humane-docs guidance for that implementation documentation; API prose is future reviewed copy; list its sections for review with runtime keys before release. No native client, SDK or cross-team aggregation service. Do not expose provider session files, runner credentials, raw permission secrets or other people's private conversations through convenience expansions.
- [ ] **Green and guard mutations:** Remove one route/schema, bypass device key proof/typed-code approval/expiry or owner checks, bypass a shared operation, leak a private field and accept an answer without person auth; require failures. Ensure every UI action needed by native clients has an API equivalent.
- [ ] **Implementation commit:** `feat: complete the versioned person API contract`.

### Task 21: Verify the 3b onboarding-to-work path and release boundary

**Files:** Create `internal/plan3test/onboarding_acceptance_test.go`; extend API contract/release tests, `copy.go`, controller report and future reviewed acceptance documentation. Preserve Make/CI delegation.

**Interfaces:** No new product interface. Acceptance uses HTTP/person API, fake login/provider streams, a temporary home, the runner, local Git/checks and fake Amadan.

Acceptance covers the supported setup ruling with fixtures and reports live certification separately. It touches no real accounts, persistent services or remote repositories.

- [ ] **Tests first:** `TestCoordinatorAcceptance3B` accepts an invite, resumes interrupted setup, pairs Linux runner, creates two same-provider account homes plus a review family, installs and edits a specialist/template/playbook, chooses a default, receives a safe recommendation, starts a feature and answers through a device token. Exercise both provider paths and the unavailable runner option from that ruling, including Task 17’s interactive subcommand, terminal-only code handling and dedicated-home identity readback. Cover runner-print/browser-type pairing, failed containment preflight and lingering-off logout status. Assert all three mandatory publishing steps, correct personal accounts, no silent template updates, Teams links, one durable notification per effect and subscription expiry. `TestPlan3ReleaseBoundaries` refuses pending copy, uncertified policy/login/OS support, missing API operation, hosted runner claims and automatic merge/deploy.
- [ ] **Red:** `CGO_ENABLED=0 go test ./internal/plan3test -run 'TestCoordinatorAcceptance3B|TestPlan3ReleaseBoundaries' -count=1`.
- [ ] **Implement integration fixes:** Resolve only defects exposed by this path; update the controller report's dependency table against completed 2b review. Apply reviewed copy verbatim through the later controller's review channel. Treat failure of a required login path as a release blocker. Prepare versioned release artifacts only after branch review, copy and real policy certification; Paul installs and enables them.
- [ ] **Green and gates:** Repeat targeted tests and guard mutations; run `make migration-check`, `make ci` once after final changes and the contract/namespace release checks required by the settled 2b manifest. Test upgrade of an 0018 fixture with existing active/history data, plus 3a → 3b and idempotent reopen. No live login/provider action occurs without Paul's later explicit authorization. Record remaining unsupported setup paths as such, not passed acceptance. Clean all owned scratch/processes.
- [ ] **Usable acceptance and implementation commit:** Paul follows the supported install/login path, runs the safe recommendation, then a bounded feature through review/checks to a human merge. A teammate repeats with their own accounts. No Plan 4 settlement or CARLOS signal is claimed. Subject: `test: verify onboarding and the complete person API`.

## Person API v1 contract

Use OpenAPI 3.1.0, `info.version: 1.0.0`. Additive response fields fit v1; changed meanings or required inputs need a new major version. Routes below use `/api/v1` on this instance. Person authentication is browser session plus same-origin protection in 3a, with revocable device bearers added in 3b. Reject runner/coordinator credentials; path IDs grant no authority. Task 20’s public challenge/exchange routes require their separate proof and throttling.

GET returns explicit JSON projections and `ETag: "<revision>"`. Resource updates require `If-Match`; create/action requests require `Idempotency-Key` of 1–256 bytes. A duplicate key is checked before stale-revision rejection only after current authorization and exact canonical body comparison, so retry after a lost successful response returns the saved result. New input with a stale revision gets `409 revision_conflict`; missing precondition gets `428`; invalid input `422`; no valid identity `401`; denied current authority `403`; absent/non-visible private resources `404`; expired challenge/cursor `410`; unavailable runner/query `503`. Bodies are capped at 64 KiB, message text at 16 KiB; reject duplicate JSON keys/unknown mutation fields. Lists use opaque scope-bound cursors, limit default 50 and maximum 100. API errors contain stable codes/copy keys; prose is supplied by reviewed copy. Responses with personal data use `Cache-Control: no-store`.

| Part | Resource and operations | Result / shared operation |
| --- | --- | --- |
| 3a | `GET /me`; `GET /capabilities`; `GET /me/settings`; `PATCH /me/settings` | Person, current team, version/capabilities, typed personal settings and landing preference |
| 3b | `POST /auth/devices`; `POST /auth/devices/exchange`; browser `POST /auth/devices/{id}/approve`; `GET /auth/devices`; `DELETE /auth/devices/{id}` | Person device challenge, proof exchange, typed-code browser approval with device label/time, own devices/revocation |
| 3a | `GET /people` | Read-only current-team identity/role projection for active members; no private preferences or credentials |
| 3b | `GET /roster`; `PUT /roster/{address}` | Owner-only roster administration through guarded SetMember; last-owner and decision-owner protections |
| 3b | `GET /budgets`; `PUT /budgets` | Owner-only team/project BudgetConfig through guarded Budgets/SaveBudgets; revision and audit checks |
| 3a | `GET /conversation`; `POST /conversation/messages` | ConversationPage / SendMessage |
| 3a | `GET /conversation/cards`; `GET /cards/{id}` | Current task, question, proposal or suggestion projection with resource revision |
| 3a | `GET /tasks`; `GET /tasks/{id}`; `POST /tasks`; `POST /tasks/{id}/cancel` | Shared task list/detail; validated explicit task proposal; existing cancellation |
| 3a | `GET /tasks/{id}/thread`; `POST /tasks/{id}/thread/messages`; `POST /conversation/messages/{id}/route` | TaskThread, SendMessage and explicit RouteMessage |
| 3a | `GET /tasks/{id}/plan`; `PATCH /tasks/{id}/plan`; `POST /tasks/{id}/plan/approve`; `POST /tasks/{id}/project` | Current plan, EditPlan, ApprovePlan, CorrectTaskProject |
| 3a | `GET /questions/{id}`; `POST /questions/{id}/answer`; `POST /tasks/{id}/rendered-approval`; `POST /tasks/{id}/acknowledge-merge` | Clarification/native question union, typed answer, project copy/design decision-owner approval bound to the candidate diff and trusted render, and existing human merge acknowledgement; never merge itself |
| 3a | `GET /journey`; `GET /needs-you` | Real planned-step projections and current person's actionable work; nullable counts |
| 3a | `GET /preferences`; `POST /preferences`; `PATCH /preferences/{id}`; `DELETE /preferences/{id}` | Own inferred/confirmed preferences and guarded confirmation/correction/deletion |
| 3b | `GET /teams`; `POST /teams/links`; `PATCH /teams/links/{id}`; `DELETE /teams/links/{id}` | Remembered instance links; no federation access |
| 3b | `GET /accounts`; `POST /accounts`; `GET /projects`; `POST /projects`; `GET /projects/{id}`; `PATCH /projects/{id}` | Existing CARLOS-account labels and project bindings/owners; no CARLOS credential shortcut |
| 3b | `GET /projects/{id}/settings`; `PATCH /projects/{id}/settings`; `PATCH /projects/{id}/my-settings` | Team-owned rules/approval/default playbook versus own approval/connection overrides |
| 3b | `GET /specialists`; `POST /specialists`; `GET /specialists/{id}`; `PATCH /specialists/{id}`; `DELETE /specialists/{id}` | Specialist details/work counts/settings and creator/owner mutations |
| 3b | `GET /playbooks`; `POST /playbooks`; `GET /playbooks/{id}`; `PATCH /playbooks/{id}`; `DELETE /playbooks/{id}` | Playbook definitions and versioned copies |
| 3b | `GET /templates`; `GET /templates/{id}`; `POST /templates/{id}/install`; `GET /specialists/{id}/template-diff`; `GET /playbooks/{id}/template-diff`; `POST /specialists/{id}/template-update`; `POST /playbooks/{id}/template-update` | Version-pinned catalog, install, offered diff and explicit update acceptance |
| 3b | `GET /connections`; `GET /connections/{id}`; `PATCH /connections/{id}`; `DELETE /connections/{id}`; `PUT /projects/{id}/connections` | Own safe metadata/label/revoke/project choices; local credentials never returned or deleted by remote file path |
| 3b | `POST /tasks/{id}/steps/{key}/selection` | ConfirmPlanSelection, reason and immutable actual selection |
| 3a | `GET /coordinator`; `PATCH /coordinator`; `POST /coordinator/reset`; `POST /coordinator/retry`; `PATCH /coordinator/limits` | Own binding/status, explicit connection change at safe boundary, generation reset, retry after containment and owner-only limits |
| 3b | `GET /runners`; `GET /runners/{id}`; `POST /runners/enrol/approve`; `DELETE /runners/{id}` | Own runners, existing pairing approval/revocation; never runner bearer material |
| 3b | `GET /onboarding`; `POST /onboarding/advance`; `POST /account-setups`; `GET /account-setups/{id}`; `DELETE /account-setups/{id}` | Prerequisite state, runner-local login requests and safe challenge status/cancellation |
| 3b | `POST /invites`; `GET /invites/{id}`; `POST /invites/{id}/accept`; `DELETE /invites/{id}` | Owner invite creation/revoke, intended verified recipient's acceptance |
| 3b | `GET /notifications`; `POST /notification-subscriptions`; `DELETE /notification-subscriptions/{id}`; `POST /notification-subscriptions/{id}/ack` | Recipient outbox, per-device expiring subscription and idempotent acknowledgement |

Task 20 must implement missing thin application operations for API-only lifecycle actions: own connection label/revoke; coordinator reset/retry already belongs to Task 5 and subscription management to Task 19. Add `Store.RenameConnection(ctx context.Context, actor Actor, id, label string, m Mutation) error` and `Store.RevokeConnection(ctx context.Context, actor Actor, id string, m Mutation) error` in `connection_handlers.go`’s application-operation companion `connections.go`. Revocation fences dependent work and requests containment; it does not remotely erase a credential home. They use the same current-member, containment, generation and revision rules already specified; they cannot call a GORM model update directly from a handler. OpenAPI describes the question union (clarification choices/free text versus native permission), exact allowed answer shape and the original request revision. Notifications prompt a fetch; answers require `/questions/{id}/answer`, person auth and current revision. Journey cards include specialist category/action/model/account/reason, actual status and nullable usage; no percentage estimate.

## Copy inventory for the later review pass

Add these keys/meanings to `internal/equipo/copy.go` as individually pending entries; reuse unchanged reviewed labels. Include template descriptions, installer/runner diagnostics and API prose in review. Model messages remain attributed content. This planning revision approves no runtime copy.

| Owner task | Key groups and meanings |
| --- | --- |
| 1, 9 | `conversation.title`, `.empty`, `.composer`, `.send`, `.queued`, `.offline`, `.routed`, `.thread_link`, `.thread_reply`, `.route_confirmation`, `.private`, `.shared_thread` |
| 2, 9 | `plan.proposed`, `.edit`, `.approve`, `.immediate`, `.required`, `.inherit`, `.locked_step`, `.revision_conflict`, `.project`, `.correct_project`, `.replacement`, `.investigation_checkpoint`, `.playbook`, `.changes` |
| 3, 4 | `evidence.acceptance`, `.frozen`, `.render_approval`, `.sources`, `.answer_delivered`, `.missing_sources`, `.awaiting_person`, `.candidate_changed` |
| 5–7 | `coordinator.connection`, `.unavailable`, `.budget_needed`, `.queued`, `.interrupted`, `.uncertain`, `.retry`, `.reset`, `.identity_changed`, `.policy_changed`, `.waiting_connection`, `.waiting_task` (`waiting for <task>` with task link), `.context_limit`; all coordinator MCP tool descriptions/errors |
| 8 | `preferences.title`, `.confirmed`, `.inferred`, `.source`, `.confirm`, `.correct`, `.delete`, `.team_rule`, `.source_unavailable` |
| 9, 10 | `question.choose`, `.reply`, `.expired`, `.answered`, `.superseded`; API validation/auth/revision/cursor errors; device labels move to Task 20 |
| 12 | `specialists.new`, `.name`, `.icon`, `.instructions`, `.models`, `.tools`, `.projects`, `.required`, `.archive`; library group/template names, descriptions, blank template and update-diff actions |
| 13 | `playbooks.title`, `.new`, `.default`, `.kind`, `.steps`, `.used`, `.suggested`, `.save_suggestion`, `.update_available`; four playbook template labels/descriptions |
| 14 | `connections.add`, `.label`, `.remaining_unknown`, `.counted_usage`, `.best_fit`, `.pinned`, `.ask`, `.reason`, `.second_family`, `.selection_changed` |
| 15–17 | `invite.welcome`, `.accept`, `.expired`, `.wrong_person`; all five onboarding stage labels/actions; runner install/pairing/status errors, dedicated-home/device-login/pending/unsupported/cancel messages, hosted-later and Mac-coming-later labels, missing containment prerequisite, AppArmor restriction, runner-stops-at-logout status, headless browser return-code terminal instructions, actual machine label/time and typed-code instructions, pending account setup ID and interactive login command, safe-first-task choice; changed `docs/mockups/onboarding.html` wording shares this copy pass |
| 18 | `teams.title`, `.add`, `.forget`, `.remembered`, `.last_signin_unknown`, `.remote_unavailable`; phone parent labels and landing-screen settings |
| 19 | `notifications.question`, `.task_ready`, `.interrupted`, `.superseded`, `.subscribe`, `.unsubscribe`, `.cursor_expired`, `.subscription_expired`; no promise of live mobile push delivery |
| 20 | Device approval label/time, typed-code entry, expiry/revoke labels and owner roster/budget validation states |
| 11, 20, 21 | API guide sections and acceptance/setup instructions, reviewed separately from implementation identifiers; README remains untouched |

## Verification background

Prior read-only verification at `86852f1` found lease runtime cleanup and launcher-local session maps, fixed specialist action/tool inventories, an outer CSRF wrapper, existing budget exceptions, core schema version 7, runner-initiated pairing, guarded decision-owner/roster/budget operations and empty release certificates. These findings inform the tasks above; they do not establish implementation or live certification. The new context, coordinator limits and login/API flows remain planned work.

## Round 2 dispositions

- P2-1/P2-A: Remove default budget records; retain the integration time exception and permit measured runner/core raises with expected totals and reasons.
- P2-B: Carry context in the claim; cap complete coordinator prompts and escaped frames, trim oldest history first, and test long 16 KiB-message conversations.
- P2-C: Task 4 tests alternative connection selection; Task 7 tests coordinator waiting and lease release.
- P2-D: Match the pending setup ID through `equipo-runner account login --setup <id>` and test terminal login/reporting.
- P3s: Use the real machine label, name Task 1’s shared kernel, identify the blocking task on waiting cards, and review onboarding mockup copy before applying it.
- Trim: Remove round 1 dispositions and self-review restatements; retain one verification paragraph and one supported setup ruling.
