oficina / equipo Public

Plan 2: round 2 fixes applied (Astra); ready to build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 9b6bc39687946ff64016c5373faf564ca59ef86a parent 99a6321
1 file changed, +52 −37
  • docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md +52 −37

CI passed — run details

diff --git a/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md b/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
index 1c682d9b..5ef6373e 100644
--- a/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
+++ b/docs/superpowers/plans/2026-11-02-equipo-plan-2-runner.md
@@ -1,12 +1,12 @@
# Equipo runner implementation plan
-> **Future implementation:** use `superpowers:subagent-driven-development` task by task. The R1b planning session does not invoke that workflow or dispatch agents.
+> **Future implementation:** use `superpowers:subagent-driven-development` task by task. The R2 planning session does not invoke that workflow or dispatch agents.
**Goal:** Paul submits a bug, watches Engineering and Review, receives an Amadan review branch with evidence, and can cancel with verified containment.
**Architecture:** The instance owns tasks, connections, leases, budgets and evidence in its activation database. A Go user service on docs-t1 dials out, controls local Paseo through a pinned Node adapter, and owns the check executor and repository credentials.
-**Baseline:** Repository HEAD `2911a91`. Implement this plan in order, Task 0 then Tasks 1–18: 19 tasks. Task 0 is the new prerequisite; existing task numbers stay stable. This revision changes only this plan and authorizes no implementation, agents, commits, pushes or deployment.
+**Baseline:** Repository HEAD `99a6321` for this R2 revision (Foundation implementation baseline `2911a91`). Implement this plan in order, Task 0 then Tasks 1–18: 19 tasks. Task 0 is the new prerequisite; existing task numbers stay stable. This revision changes only this plan and authorizes no implementation, agents, commits, pushes or deployment.
**Sources:** `docs/superpowers/specs/2026-11-01-equipo-design.md` §§3.2–3.4, 4, 6–7, 9–10; roadmap Runner row; `2026-11-01-paseo-probe.md`; runner briefs and Round 1 findings in this directory. R1b supersedes R1's Codex prohibition and periodic refresh. Subscription calls mean dispatched Paseo turns, as ruled on 2026-11-02.
@@ -19,7 +19,7 @@
- Publish only the saved review branch through a disclosed Amadan agent account. Never merge, deploy or push the default branch. A changed candidate invalidates checks and review. Success delivers a verified branch; the app then waits for the named person's merge acknowledgement, attributed to that person rather than forge verification.
- Unknown outcomes stay unknown and charged. Cancellation, restart, missing events and quarantine release cannot create receipts or refunds. Subscription reservations are accounting limits, not provider-enforced token/currency ceilings.
- Preserve the day/sidebar shell, token colors, phone indexes/back links, scriptless forms, and byte-identical framework assets. No split screen, initials, progress percentages or coloured left-border accents.
-- Runtime strings, including runner diagnostics, belong only in `internal/equipo/copy.go`. Mark each draft `COPY REVIEW REQUIRED`; review and apply edits verbatim before release. This plan specifies keys/meaning, not final copy. Leave README unchanged. Use plain words without em dashes or exclamation marks.
+- App-owned runtime strings, including runner diagnostics, belong only in `internal/equipo/copy.go`. Mark each draft `COPY REVIEW REQUIRED`; review and apply edits verbatim before release. Framework-owned live strings stay in Rastrillo locale packs and are exempt from the copy.go rule. This plan specifies keys/meaning, not final copy. Leave README unchanged. Use plain words without em dashes or exclamation marks.
- Browser Actor comes from verified sessions; runner identity comes from its credential. Check the current roster and append audit inside each write transaction. Use its transaction handle throughout. No request-to-GORM binding or `scope.Owned` for shared records.
- Keep origin/key/SMTP requirements and first-boot-only owners. App tables belong in `Models`/`Schema`, framework tables only in `BootSchema`. Migrations are additive. Preserve one activation database and Foundation's closed execution default until Task 17.
- Builds use `CGO_ENABLED=0`. Keep default Go caches; scratch under on-disk `$TMPDIR`; servers bind `127.0.0.1`. No sudo. Remove owned scratch and stop test processes.
@@ -31,24 +31,28 @@ Plan 2 excludes cross-machine bundles/chunking, enrolment-response recovery, Jou
## Read isolation and Paul's ruling
-`ReadIsolation` remains a measured preflight capability per provider/version, permission mode, credential home and effective configuration hash. Canonical denied paths cover runner state/config/journal/bearer/cleanup files, the configured Amadan credential, actual Paseo and routed provider credential homes, `~/.ssh`, and resolved symlink targets. Reject workspaces inside those subtrees. Revalidate before creation and every turn; changed mode/home/routing/policy invalidates preflight. Permission answers cannot relax the trusted policy.
+`ReadIsolation` requires both current preflight and an exact `(provider, provider version, Paseo server version, config hash)` tuple in the instance build’s verified list, recorded in its release manifest after Task 18 passes the sentinel gate. `PaseoVersion` is the observed daemon server version, not the client package version. The effective configuration hash covers permission mode, credential home, routing and read policy. A runner-reported `true` for an unlisted tuple is stored as unconfined and requires the eligible connection’s owner acknowledgement and labels; it cannot add to the build’s list. Canonical denied paths cover runner state/config/journal/bearer/cleanup files, the configured Amadan credential, actual Paseo and routed provider credential homes, `~/.ssh`, and resolved symlink targets. Reject workspaces inside those subtrees. Revalidate before creation and every turn; changed mode/home/routing/policy invalidates preflight. Permission answers cannot relax the trusted policy.
Installed-source findings from Round 1: `@getpaseo/{client,protocol,server}` 0.14.0; provider options/agents under the installed CLI's `node_modules/@getpaseo/server/dist/server/server/agent/providers/`. These are inspection references, never runtime imports.
| Provider | Capability and dispatch decision |
|---|---|
-| Claude Code 2.1.312 | `ClaudeProviderOptionsSchema` and `buildOptions` support sandbox `filesystem.denyRead`, `failIfUnavailable` and permission deny rules. Use `modeId: "default"`, enabled filesystem sandbox, no excluded commands, `allowUnsandboxedCommands: false`, absolute built-in `Read(...)` denies. Keep `ReadIsolation=false` until Task 18 proves every sentinel and policy-tampering assertion. Claude must remain confined; no acknowledgement bypass. |
+| Claude Code 2.1.312 | `ClaudeProviderOptionsSchema` and `buildOptions` support sandbox `filesystem.denyRead`, `failIfUnavailable` and permission deny rules. Use `modeId: "default"`, enabled filesystem sandbox, no excluded commands, `allowUnsandboxedCommands: false`, absolute built-in `Read(...)` denies. Keep `ReadIsolation=false` until Task 18 proves every sentinel and policy-tampering assertion and the exact observed tuple is included in the instance build’s verified list and release manifest. Claude must remain confined; no acknowledgement bypass. |
| Codex CLI 0.165.0 / Paseo 0.14.0 | Legacy read-only/workspace-write modes do not deny protected reads. Command-only probes read an outside sentinel even with `sandbox_permissions=[]`; an explicit named filesystem deny profile blocked it while permitting the workspace control. Paseo's strict schema rejects the needed profile fields and maps legacy turn policies. Report `ReadIsolation=false`, reason `unsupported_per_agent_profile`. Paul permits this connection to run unconfined under the acknowledgement below. Do not report confinement, modify shared provider homes, invent passthrough fields or bypass Paseo. |
-**Paul's ruling, 2026-11-02:** for his own repositories, Codex may run without read isolation for now, clearly labelled. A **current team owner** must explicitly acknowledge each unconfined connection. Personal connection opt-in remains separate. No acknowledgement means no creation or dispatch. This exception changes only read-isolation eligibility; account pinning, identity, timeline, process ownership and every other gate still apply.
+**Paul's ruling, 2026-11-02:** for his own repositories, Codex may run without read isolation for now, clearly labelled. A **current team owner** must explicitly acknowledge each unconfined connection. The acknowledgement covers all projects in the team: Paul’s ruling is “his own repos”, and every project in his team is his. Personal connection opt-in remains separate. No acknowledgement means no creation or dispatch. This exception changes only read-isolation eligibility; account pinning, identity, timeline, process ownership and every other gate still apply.
-Task 6 persists `IsolationAcknowledgement{ID, ConnectionID, Owner, Provider, ProviderVersion, PaseoVersion, IsolationConfigHash string; AcknowledgedAt time.Time; ConnectionRevision int64}` and its audit in the owner transaction. No bulk or label-based acknowledgement; submitted owner/time/version fields cannot establish authority. Bind to trusted observed versions and connection identity. Revoke by owner action; provider identity/version or Paseo version changes automatically lapse it. A changed effective configuration/security revision also requires fresh preflight and acknowledgement; heartbeat/LastSeen updates do not change that revision. Recheck at assignment, claim, create and each turn/admission; version change fences pending work and contains affected running attempts before reuse. Never grandfather stale approvals.
+Task 6 persists `IsolationAcknowledgement{ID, ConnectionID, Owner, Provider, ProviderVersion, PaseoVersion, IsolationConfigHash string; AcknowledgedAt time.Time; ConnectionRevision int64}` and its audit in the owner transaction. No bulk or label-based acknowledgement; submitted owner/time/version fields cannot establish authority. Bind to the observed tuple and connection identity; the runner’s claimed `ReadIsolation` flag never controls lapse checks. Revoke by owner action; removal or demotion of the acknowledging owner, provider identity/version changes or observed Paseo daemon server version changes automatically lapse it. Check the acknowledging owner’s current roster role inside each write transaction; lookup errors deny access. A changed effective configuration/security revision also requires fresh preflight and acknowledgement; heartbeat/LastSeen updates do not change that revision. Recheck at assignment, claim, create and each turn/admission; version change fences pending work and contains affected running attempts before reuse. Never grandfather stale approvals.
-Snapshot `IsolationStatus` (`confined` or `unconfined`), acknowledgement ID and observed versions/config into each selection, attempt, step and evidence provenance. The runner derives these from the authorized assignment and observed session, never tool-submitted JSON. Persist the historical label even after acknowledgement expiry or later confinement. Executor evidence retains its own confined executor identity and the unconfined source-candidate/step lineage. Missing or stripped provenance fails registration/publication. Display literal `unconfined` on every affected task card, Journey chip, task detail/evidence entry and published review branch description. Mixed runs retain per-step labels and a task/publication summary if any contributing step was unconfined.
+A runner with any acknowledged unconfined connection enabled is **tainted**. Every step, evidence item (including executor evidence) and publication from that runner carries `unconfined`, whichever connection ran it. A concurrent Claude task on that runner is also labelled even when its own connection passes confinement. Connection capability and runner exposure are separate facts.
-Unconfined workspaces/environments still contain no injected credentials; hooks/helpers stay disabled, checks use the trusted confined executor, publication uses the runner-held credential, and Review uses another family. Unconfined means host read denial is unproven: do not claim that filesystem secrets or the tool capability file are unreadable by that agent. The fixed Equipo MCP helper is the sole approved helper; typed tool, lease and fence restrictions remain enforced. Claude's shell sandbox plus built-in denies must protect every path; arbitrary hooks/plugins/MCP helpers and unsandboxed retries remain forbidden.
+Snapshot connection `IsolationStatus` (`confined` or `unconfined`), runner taint, acknowledgement IDs and observed tuples into each selection, attempt, step and evidence provenance. Derive these from the instance-authorized assignment, enabled connections and observed session, never tool-submitted JSON. Propagate taint to already-running work when an acknowledged unconfined connection is enabled. Persist the historical label after acknowledgement expiry, disabling the connection or later confinement. Executor identity remains attributable but its evidence on a tainted runner is labelled `unconfined`. Missing or stripped provenance fails registration/publication. Display literal `unconfined` on every affected task card, Journey chip, task detail/evidence entry and published review branch description; retain it in the task/publication summary.
-**Restore confinement:** Task 9 owns the future supported per-agent Codex profile adapter. When Paseo ships it, remove that version's exception eligibility, construct the deny profile through its supported API, observe effective policy, and run Tasks 10/18 sentinel tests. The Paseo version change already lapses old acknowledgements. Require `ReadIsolation=true` before re-enabling Codex once the supported profile contract exists; retain historical unconfined labels. No global skip or permanent bypass flag.
+After each unconfined attempt is contained, rotate the runner’s bearer and cleanup tokens before further admission. Task 8 owns the credential transition; Tasks 15/17 wire it after verified containment. Revocation or expiry cannot be revived by rotation. Taint remains while any acknowledged unconfined connection is enabled; disabling one cannot erase exposure from work already affected.
+
+Unconfined workspaces/environments still contain no injected credentials; hooks/helpers stay disabled. Checks use the required command sandbox, with executor evidence subject to runner taint. Publication uses the runner-held credential, and Review uses another family. Unconfined means host read denial is unproven: do not claim that filesystem secrets or the tool capability file are unreadable by that agent. The fixed Equipo MCP helper is the sole approved helper; typed tool, lease and fence restrictions remain enforced. Claude's shell sandbox plus built-in denies must protect every path; arbitrary hooks/plugins/MCP helpers and unsandboxed retries remain forbidden.
+
+**Restore confinement:** Task 9 owns the future supported per-agent Codex profile adapter. When Paseo ships it, remove that version's exception eligibility, construct the deny profile through its supported API, observe effective policy, and run Tasks 10/18 sentinel tests. The Paseo version change already lapses old acknowledgements. Record the passing tuple in the instance build’s verified list and release manifest, then require `ReadIsolation=true` before re-enabling Codex once the supported profile contract exists; retain historical unconfined labels. No global skip or permanent bypass flag.
## Storage and dependencies
@@ -71,7 +75,7 @@ JSON-only policy/evidence extensions need no columns. Task 6 builds instance sel
### Task 0: Upgrade Foundation to Rastrillo v0.30.0
-**Files:** `go.mod`, `go.sum`, app locale-pack import, `static/`, `templates/layout.html`, `internal/equipotest/browser_test.go`, compatibility tests; Makefile/CI only if needed to retain the existing gates. No Foundation behavior expansion.
+**Files:** `go.mod`, `go.sum`, app locale-pack import, `static/`, `templates/layout.html`, `internal/equipotest/browser_test.go`, `internal/equipotest/foundation_test.go`, compatibility tests; Makefile/CI only if needed to retain the existing gates. No Foundation behavior expansion.
Checked against local tag `v0.30.0` in `/home/paulca/amadan.net/rastrillo/rastrillo`, including `go.mod`, `serve.go`, `auth/{auth,handlers,signin}.go`, `pow`, `sessions`, `migrate`, `ui/{funcs,ui,vendored}.go`, `harness`, `budget`, `db`, `dbtest`, `csrf`, `mail`, `background`, `perf`, and `docs/site/{live,reference/live}.md`:
@@ -88,7 +92,7 @@ Checked against local tag `v0.30.0` in `/home/paulca/amadan.net/rastrillo/rastri
| Browser harness/chromedp | `harness.New`, `WithScrollbars`, `Screen` remain. `Rig.Run` now takes `chromedp.Action[chromedp.Void]`; dependency graph uses chromedp v0.21.0/cdproto v0.158.6. Port `Evaluate`/Location/screenshots to typed `harness.Evaluate[T]`, `Read` or `Into`; selectors to `chromedp.CSS`; custom `ActionFunc`/`.Do(ctx)` helpers to `chromedp.Func(func(ctx, target) error)` and typed actions/`cdp.Call`. Port CDP cookie, media and script-disable calls to command constants with params. Preserve navigation waits, assertions and scripts-off coverage. |
| `budget.Main`, CLI budget size/test; `perf.Middleware`, `perftest`; mail/background/CSRF | Budget, performance, mail and background APIs used here are unchanged. `csrf.Protect(origin, ...Option)` remains compatible with existing calls; no new exemptions for browser forms. Keep all Make gates and TestMain budgets. |
-- [ ] **Red:** Add `TestRastrilloUpgradeContract` checking linked version/floor, default-English Handler boot and static assets including live.js. Run `go test ./internal/equipotest -run 'TestRastrilloUpgradeContract|TestVendoredAssetsMatchTheLibrary' -count=1`; the upgrade assertion fails on v0.28.0. Retain the existing Foundation suite as regression coverage.
+- [ ] **Red:** Add `TestRastrilloUpgradeContract` checking linked version/floor, default-English Handler boot and static assets including live.js. Run `go test ./internal/equipotest -run 'TestRastrilloUpgradeContract|TestVendoredAssetsMatchTheLibrary' -count=1`; the upgrade assertion fails on v0.28.0. Update `TestFoundationFailsClosed/private_routes` to require the redirect `/signin?return_to=%2F` for unauthenticated `/`, preserving its status and access-denial assertions. Run `go test ./internal/equipotest -run TestFoundationFailsClosed/private_routes -count=1` before and after the upgrade. Retain the existing Foundation suite as regression coverage.
- [ ] **Implement:** `go mod edit -go=1.26.0`; `GOTOOLCHAIN=go1.26.10 go get amadan.net/rastrillo/rastrillo@v0.30.0`; `GOTOOLCHAIN=go1.26.10 go mod tidy`. Apply the table's locale/assets/browser changes, inspecting dependency diff. Use `ui.VendoredAssets("day")` as the authoritative copy set; do not broadly rewrite app files with doctor.
- [ ] **Green:** Repeat red; run Foundation's full `make ci`, plus `go test -tags browser ./internal/equipotest -run TestFoundationBrowserWalk -count=1` and the same with `EQUIPO_BROWSER_NO_JS=1`. Both widths 1280/390 remain covered. Check normal motion separately; record any reproducible framework transition issue rather than hiding it. Removing the locale import, changing a vendored byte or dropping the live asset must fail the relevant assertion. Do not weaken tests/budgets to accommodate the upgrade.
- [ ] **Commit:** `build: upgrade Foundation to Rastrillo v0.30.0`.
@@ -158,11 +162,11 @@ Checked against local tag `v0.30.0` in `/home/paulca/amadan.net/rastrillo/rastri
**Interfaces:** `ConnectionReport{LocalID, Provider, ProviderVersion, PaseoVersion, Family, Model, AccountLabel, Kind, UnavailableReason, IsolationConfigHash string; Available, ReadIsolation, AllowanceKnown bool; AllowanceRemaining int64}`. Stable connection/profile identity may expose multiple models. `Connection{ID, RunnerID, Person, LocalID string; Revision int64; LastSeen time.Time}`; `ConnectionChoice{ProjectID, Revision int64; ConnectionIDs []string; PinnedID string}`. Store `ReportConnections(ctx, principal, reports) error`, `SaveConnectionChoice(ctx, actor, choice) error`, `SelectConnection(ctx, person, projectID, specialist, excludedFamily) (Selection, error)`. Task service supplies person/project, never forms. Selection carries connection/runner/provider/family/model/account/revision, reason `pinned` or `first_allowed`, and isolation snapshot. Add owner-only `AcknowledgeUnconfined(ctx, actor, connectionID, expectedRevision) error` and `RevokeIsolationAcknowledgement` with the same binding.
-- [ ] **Tests:** `TestConnectionsBelongToPersonAndMachine`, `TestConnectionSelection`, `TestReviewWaitsForOtherFamily`, `TestAccountFailoverStops`, `TestProjectAccountNoDeleteAndASCIILabels`. Same account label across people never shares selection/credentials. Require personal opt-in; same-runner two-family preflight before build. Missing pin waits; stable fallback orders connection ID then model ID and respects fixed specialist model/concurrency. Actual account/family mismatch stops before first prompt; mid-step failover contains before reassignment. DELETE routes fail without record/audit changes; ASCII duplicates conflict, existing non-ASCII behavior stays.
+- [ ] **Tests:** `TestConnectionsBelongToPersonAndMachine`, `TestConnectionSelection`, `TestReviewWaitsForOtherFamily`, `TestAccountFailoverSelection`, `TestProjectAccountNoDeleteAndASCIILabels`. Same account label across people never shares selection/credentials. Require personal opt-in; same-runner two-family preflight before build. Missing pin waits; stable fallback orders connection ID then model ID and respects fixed specialist model/concurrency. `TestAccountFailoverSelection` uses seeded reports and instance selection only: reject an observed account/family mismatch against the saved binding, refuse an unavailable pinned account without selecting a replacement, and reject a report that cannot guarantee no-failover. Task 17 owns `TestAccountFailoverStops` for actual pre-prompt observation, mid-step failover containment and reassignment ordering. Task 6 neither starts a supervisor nor asserts physical containment. DELETE routes fail without record/audit changes; ASCII duplicates conflict, existing non-ASCII behavior stays.
- `TestUnconfinedConnectionRequiresAcknowledgement`: no ack/member/forged owner/wrong connection denies creation and dispatch; valid current-owner ack permits only eligible Codex, with personal opt-in and all other capabilities. `TestIsolationAcknowledgementLapses`: provider/Paseo upgrade, changed config/revision or revocation denies subsequent claim/turn, including stale tickets; Claude never takes this exception. Assert who/when/connection/provider/versions in audit and no credentials.
-- [ ] **Red/green:** `go test ./internal/equipotest -run 'TestConnections|TestConnectionSelection|TestReviewWaits|TestAccountFailover|TestProjectAccountNoDeleteAndASCIILabels|TestUnconfinedConnection|TestIsolationAcknowledgement' -count=1`; green also migration check. Mutate person/pin/family/owner/version filters.
-- [ ] **Implement:** Reports only cover profiles allowed by an operator-maintained, credential-free runner account-binding file. Enrolment does not claim every shared-daemon profile; email labels do not prove ownership. Supported routing must pin credential home, observe actual account and disable failover before prompting. Never change daemon defaults. Reports stale after 90 seconds without heartbeat. Unknown allowance stays unknown alongside counted Equipo usage. Revocation disables admission and requests containment. Persist acknowledgement and audit transactionally per the ruling; runtime capabilities remain truthful.
+ `TestUnconfinedConnectionRequiresAcknowledgement`: no ack/member/forged owner/wrong connection fails instance eligibility for creation and dispatch; valid current-owner ack permits only eligible Codex, with personal opt-in and all other capabilities. A forged Codex `ReadIsolation=true` report for an unlisted tuple is persisted as unconfined, still requires acknowledgement and produces labelled selection provenance. Assert this using seeded reports, without runner execution. `TestIsolationAcknowledgementLapses`: provider/observed daemon server upgrade, changed config/revision, revocation, or removal/demotion of the acknowledging owner invalidates the stored acknowledgement and denies instance eligibility. Lapse uses the observed tuple even if the report claims confinement. Cover all team projects and roster lookup failure. Task 8 adds stale claim/admission-ticket assertions and Task 17 adds live create/turn refusal; Claude never takes this exception. Assert who/when/connection/provider/versions in audit and no credentials.
+- [ ] **Red/green:** `go test ./internal/equipotest -run 'TestConnections|TestConnectionSelection|TestReviewWaits|TestAccountFailoverSelection|TestProjectAccountNoDeleteAndASCIILabels|TestUnconfinedConnection|TestIsolationAcknowledgement' -count=1`; green also migration check. Mutate person/pin/family/owner/version filters.
+- [ ] **Implement:** Reports only cover profiles allowed by an operator-maintained, credential-free runner account-binding file. Enrolment does not claim every shared-daemon profile; email labels do not prove ownership. Supported routing must pin credential home, observe actual account and disable failover before prompting. Never change daemon defaults. Reports stale after 90 seconds without heartbeat. Unknown allowance stays unknown alongside counted Equipo usage. Revocation disables admission and requests containment. Persist acknowledgement and audit transactionally per the ruling. Normalize reported isolation against the instance build’s verified tuple list before storing reports or selecting a connection. An unlisted tuple stays unconfined despite a reported `true`; missing preflight still denies confinement for a listed tuple.
- [ ] **Commit:** `feat: select allowed connections for each person's tasks`.
### Task 7: Create bug tasks and prepare their fixed plan
@@ -184,13 +188,13 @@ Checked against local tag `v0.30.0` in `/home/paulca/amadan.net/rastrillo/rastri
**Interfaces:** `AdmitOnce(ctx, scope, handle, actionID, requestID) (AdmissionTicket, error)` preserves legacy Admit; ticket has Dispatch, ExpiresAt, Incarnation. `Assignment{ID, TaskID, StepKey, WorkspaceKey string; Scope Scope; Selection Selection; Revision int64; Kind string}` (`prepare`, `step`). Brief carries target/instructions/standing instructions/selection/policy/artifact hashes; ConfirmedPreferences empty. ClaimRequest carries assignment/revision; response scope/handle/brief/lease deadline/cleanup token. Execution owns stores/reconciliation adapters and `Poll(ctx, principal, after) ([]Assignment, error)`, `Claim(ctx, principal, request) (ClaimResponse, error)`, `Sync(ctx) error`. Post-claim requests carry scope, handle, request ID, protocol version.
-- [ ] **Tests:** `TestRunnerCannotClaimOthersWork`, `TestRunnerFenceEveryMutation`, `TestRunnerLongPollRechecksRoster`, `TestSpecialistConcurrency`, `TestDispatchAdmissionExpires`, `TestAdmitLostReplyRetry`, `TestRevokedCleanupCannotRefund`. Lost reply retries return identical stored ticket, charge/event/deadline unchanged, including crash immediately after commit. Changed payload/binding conflicts; expired/cancelled/revoked/grant-changed/budget-reduced/incarnation-changed replay denies. Racing runners yield one handle. Wrong person/machine/connection/fence denies every mutation/answer. Revoke while polling returns no assignment. Specialist limit one holds across jobs despite core concurrency two. Five-second stale admission cannot execute. Authority/DB error never becomes assignment or zero status. Forged zero cleanup receipt retains full charge.
-- [ ] **Red/green:** `go test ./internal/equipotest ./internal/equipo/team -run 'TestRunnerCannot|TestRunnerFence|TestRunnerLong|TestSpecialistConcurrency|TestDispatchAdmission|TestAdmitLostReplyRetry|TestRevokedCleanupCannotRefund' -count=1`; green also migration check and per-endpoint binding mutations.
-- [ ] **Implement:** Persist admission request identity/dispatch/deadline/incarnation atomically with intent→dispatching. Retry revalidates authority/handle/budget/expiry and isolation acknowledgement. Runner journals request ID and consumes ticket once. Reserve assignment/specialist slot atomically; reconcile Claim crashes before effects.
+- [ ] **Tests:** `TestRunnerCannotClaimOthersWork`, `TestRunnerFenceEveryMutation`, `TestRunnerLongPollRechecksRoster`, `TestSpecialistConcurrency`, `TestDispatchAdmissionExpires`, `TestAdmitLostReplyRetry`, `TestRevokedCleanupCannotRefund`, `TestTaintedRunnerProvenance`, `TestUnconfinedContainmentRotatesTokens`. Lost reply retries return identical stored ticket, charge/event/deadline unchanged, including crash immediately after commit. Changed payload/binding conflicts; expired/cancelled/revoked/grant-changed/budget-reduced/incarnation-changed replay denies. Racing runners yield one handle. Wrong person/machine/connection/fence denies every mutation/answer. Revoke while polling returns no assignment. Specialist limit one holds across jobs despite core concurrency two. Five-second stale admission cannot execute. Authority/DB error never becomes assignment or zero status. Forged zero cleanup receipt retains full charge. Extend `TestIsolationAcknowledgementLapses` with stale claim/admission tickets after owner removal/demotion or observed tuple changes. `TestTaintedRunnerProvenance` uses seeded active assignments and fake validators to enable acknowledged Codex while a confined Claude task runs concurrently: both tasks’ steps and evidence are labelled, including already-running work. `TestUnconfinedContainmentRotatesTokens` uses seeded attempts and a fake containment validator: each accepted unconfined containment rotates the bearer and all cleanup tokens, old tokens fail, retries do not rotate twice, and revocation cannot be revived. Physical containment integration waits for Tasks 15/17.
+- [ ] **Red/green:** `go test ./internal/equipotest ./internal/equipo/team -run 'TestRunnerCannot|TestRunnerFence|TestRunnerLong|TestSpecialistConcurrency|TestDispatchAdmission|TestAdmitLostReplyRetry|TestRevokedCleanupCannotRefund|TestTaintedRunnerProvenance|TestUnconfinedContainmentRotatesTokens|TestIsolationAcknowledgementLapses' -count=1`; green also migration check and per-endpoint binding mutations.
+- [ ] **Implement:** Persist admission request identity/dispatch/deadline/incarnation atomically with intent→dispatching. Retry revalidates authority/handle/budget/expiry, the observed tuple against the build’s list, isolation acknowledgement and runner taint. Instance-derived taint overrides any submitted confined provenance at every step/evidence/publication boundary. Runner journals request ID and consumes ticket once. Reserve assignment/specialist slot atomically; reconcile Claim crashes before effects.
POST `/api/runner/v1/poll` waits at most 25 seconds outside transactions. POST suffixes `/claim`, `/renew`, `/prepare`, `/events`, `/artifacts`, `/intend`, `/admit`, `/receipts`, `/lost`, `/complete`, `/release`, `/stop`, `/contained`, `/connections`, `/heartbeat`; scoped artifact GET. Stored assignment/auth determines runner/person/account; handle alone grants nothing. Renew every 15 seconds; delivery includes incarnation/5-second deadline. Reject version mismatch. Bounds: action JSON 64 KiB, event 16 KiB, artifact 1 MiB.
- Historical receipt/containment reporting after cancel permits only exact known bindings. Each claim creates audience `cleanup`, retained locally at most 30 days; after revocation usable only for receipts/lost/contained, never new actions/permissions/evidence. Treat cleanup-only reports as untrusted observations: cannot reduce reserved or observed token/time high-water, cheaply settle unknown action or grant success. Keep charges open; corroborated owner-audited settlement may lower them. Separately validated process proof can release concurrency, not refund charges. Route tests use explicit fake validators until Task 15.
+ Historical receipt/containment reporting after cancel permits only exact known bindings. Each claim creates audience `cleanup`, retained locally at most 30 days; after revocation usable only for receipts/lost/contained, never new actions/permissions/evidence. Treat cleanup-only reports as untrusted observations: cannot reduce reserved or observed token/time high-water, cheaply settle unknown action or grant success. Keep charges open; corroborated owner-audited settlement may lower them. Separately validated process proof can release concurrency, not refund charges. Route tests use explicit fake validators until Task 15. After each verified unconfined containment, atomically replace the runner bearer and cleanup-token hashes, including tokens for concurrent attempts; invalidate old tokens without the normal overlap. Bind replacements to the existing scopes, fences, audiences and remaining lifetimes. Journal and atomically persist replacement credentials before further admission; failed or uncertain rotation blocks admission pending reconciliation. Cleanup for a revoked runner remains cleanup-only and cannot mint a live bearer. Preserve unknown charges and historical labels through rotation.
- [ ] **Commit:** `feat: serve scoped runner assignments and fenced reports`.
### Task 9: Build the version-pinned structured Paseo adapter
@@ -199,9 +203,9 @@ Checked against local tag `v0.30.0` in `/home/paulca/amadan.net/rastrillo/rastri
**Interfaces:** `paseo.Client`: Preflight(selection, ReadPolicy), CreateWorkspace(WorkspaceRequest), CreateAgent(AgentRequest), Subscribe(Agent, Cursor), Send(Agent, message, messageID), Respond(Agent, PermissionResponse), Stop(Agent), Archive(Agent), ArchiveWorkspace(Workspace). All accept context and return errors with their typed results. Subscription exposes Ready error channel, Events channel, Close. Agent retains server/agent/provider-session/workspace/account/provider/model/family IDs; Workspace server/project/workspace IDs and absolute path; Cursor epoch/sequence. `AgentRequest{Workspace; Selection; IdempotencyKey, ModeID string; ReadPolicy; Env map[string]string; ProviderOptions json.RawMessage; MCPServers map[string]MCPServer}` has no initial prompt. MCPServer explicitly serializes stdio type/command/args/env; reject other types for Equipo tools.
-Capabilities retain Version, AccountPinning, ObservedAccount, RecoverableTimeline, ProcessOwnership, MCPAtCreate, ReadIsolation, ReadIsolationReason and IsolationConfigHash. `ReadPolicy{DeniedPaths []string; ConfigHash string}` is trusted canonical configuration. Event retains kind/server/agent/session/turn/permission/epoch/sequence and raw bounded payload. Preflight is per selection/policy; ProcessOwnership is combined with Task 15 inspector coverage, never inferred from Paseo status.
+Capabilities retain Version, AccountPinning, ObservedAccount, RecoverableTimeline, ProcessOwnership, MCPAtCreate, ReadIsolation, ReadIsolationReason and IsolationConfigHash. `ReadPolicy{DeniedPaths []string; ConfigHash string}` is trusted canonical configuration. Event retains kind/server/agent/session/turn/permission/epoch/sequence and raw bounded payload. Preflight reports the observed provider version, daemon server version and effective config hash. Evaluate `ReadIsolation` against the build-verified tuple list as well as effective policy; neither a true runner flag nor pinned client packages prove confinement. Preflight is per selection/policy; ProcessOwnership is combined with Task 15 inspector coverage, never inferred from Paseo status.
-- [ ] **Tests:** `TestPaseoAdapterContract`, `TestSubscriptionReadyBeforePrompt`, `TestPaseoUnsupportedCapabilities`; Node cases `structured events`, `permission IDs`, `MCP at creation`, `workspace identity`, `unknown version`, `read isolation required`, `provider option schema`, `cancelAgent export`, `daemon credentials`. Replay structured probe events/questions/usage; reject human logs. No Send before Ready; preserve workspace/session IDs and permission IDs. Missing required capability denies with reason. Read-isolation case checks Claude refusal and Codex's explicit ack route, never a globally successful preflight.
+- [ ] **Tests:** `TestPaseoAdapterContract`, `TestSubscriptionReadyBeforePrompt`, `TestPaseoUnsupportedCapabilities`; Node cases `structured events`, `permission IDs`, `MCP at creation`, `workspace identity`, `unknown version`, `read isolation required`, `provider option schema`, `cancelAgent export`, `daemon credentials`. Replay structured probe events/questions/usage; reject human logs. No Send before Ready; preserve workspace/session IDs and permission IDs. Missing required capability denies with reason. Read-isolation case checks Claude refusal until its exact sentinel-passed tuple is listed, an unlisted forged-true Codex report taking the explicit acknowledgement/label route, and daemon/client version mismatch using the observed daemon version. Never treat this as a globally successful preflight.
- [ ] **Red/green:** `go test ./internal/runner/paseo -run 'TestPaseo|TestSubscriptionReady' -count=1`; `node --test runner/paseo/bridge.test.mjs`. Green through `make runner-adapter-test`, which checks Node/npm and runs locked `npm ci`. Add it to `ci` and `.amadan/ci.d/`; no missing-Node skip. Mutate readiness and permission forwarding.
- [ ] **Implement:** Pin client/protocol/server exactly 0.14.0, including transitive lock. Go supervises Node bridge; bounded stdin/stdout frames carry request IDs, redacted stderr diagnostics. Only configured local daemon, no start/stop, remote routing or plugin installation.
@@ -237,13 +241,13 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
**Interfaces:** Definition has version/repository/base, Commands, Reproduction command, Baseline `{Names []TestIdentity; Hash string}`; identity is package/name. Command has argv/dir/parser/timeout seconds. Reproduction has expected symptom, files `{Path; Bytes}`, test names. CaptureBaseline(def) → TestBaseline; ParseDefinition(bytes, repo, base) → Definition; Executor.Reproduce(def, repro, subjectCommit, candidateHash) → CheckResult; RepositoryChecks(def, candidate, candidateHash) → RepositoryCheckResult. CommandSandbox.Run(command, workspace, ReadPolicy, stdout, stderr) returns exit/error. Store PutBlob(principal, scope, handle, digest, bytes), Blob(principal, scope, digest); Register remains core artifact boundary.
-- [ ] **Tests:** `TestFrozenReproduction`, `TestTrustedBaseCheckDefinitions`, `TestExecutorEvidenceOutcomes`, `TestArtifactScopeAndLimits`, `TestReproductionOverlayCollision`, `TestRepositoryTestSetSuperset`, `TestRepositoryDeletedTestFile`, `TestRepositoryTSkipRejected`, `TestCheckSandboxDeniedPaths`. Changed frozen bytes/hash/commands fail. Base failure matches symptom with positive run/fail counts; candidate passes identical frozen tests. Compile failure, skips, zero tests, incomplete JSON, timeout, truncated-before-parsing output or zero-exit without tests fails. Reject traversal/absolute/symlink/duplicate paths, corruption, wrong base and oversized blobs. Candidate must pass baseline package/test/subtest set plus reproduction under identical tags/platform; renamed/deleted tests, skipped packages/subtests and t.Skip fail; extra passing tests are allowed. Agents cannot submit executor-attested results. Assert base SubjectHash is base commit, candidate SubjectHash is artifact hash.
+- [ ] **Tests:** `TestFrozenReproduction`, `TestTrustedBaseCheckDefinitions`, `TestExecutorEvidenceOutcomes`, `TestArtifactScopeAndLimits`, `TestReproductionOverlayCollision`, `TestRepositoryTestSetSuperset`, `TestRepositoryDeletedTestFile`, `TestRepositoryTSkipRejected`, `TestCheckSandboxDeniedPaths`. Changed frozen bytes/hash/commands fail. Base failure matches symptom with positive run/fail counts; candidate passes identical frozen tests. Compile failure, skips, zero tests, incomplete JSON, timeout, truncated-before-parsing output or zero-exit without tests fails. Reject traversal/absolute/symlink/duplicate paths, corruption, wrong base and oversized blobs. Candidate must pass baseline package/test/subtest set plus reproduction under identical tags/platform; renamed/deleted tests, skipped packages/subtests and t.Skip fail; extra passing tests are allowed. Agents cannot submit executor-attested results. Assert base SubjectHash is base commit, candidate SubjectHash is artifact hash. `TestExecutorEvidenceOutcomes` also requires `unconfined` on every executor result from a tainted runner, even for a concurrent confined connection; stripping taint fails registration.
- [ ] **Red/green:** `go test ./internal/runner/checks ./internal/equipotest -run 'TestFrozen|TestTrusted|TestExecutor|TestArtifact|TestReproductionOverlay|TestRepositoryTest|TestRepositoryDeleted|TestRepositoryTSkip|TestCheckSandboxDeniedPaths' -count=1`; green also migration check. Use actual small Go fixtures; mutate definition/symptom/count/hash guards.
- [ ] **Implement:** Read base `.equipo/checks.json` v1; `go-test-json` measures tests, `exit` only non-test gates. Base `.amadan/ci.d/` or `.amadan/ci` needs an explicit reviewed Go adapter preserving structured results; otherwise wait for setup. Freeze manifest and transitive scripts/Makefiles. Baseline includes required names/hash; result includes observed names/hash. Known failing bug test may be baseline; incomplete discovery/build failure is setup failure.
Repository checks run trusted material against a fresh immutable-export copy; reproduction runs separate scratch base/candidate copies. Overlay only test files; existing path must equal recorded base bytes or frozen bytes. Candidate-edited collision refuses, never overwrites the fix. Record subject commit/overlay hash/collision checks and delete scratch. Candidate runs require nonempty verified candidateHash; base uses empty candidateHash and base commit subject. At least one measured test command and every required repository gate must succeed. Task 15 combines immutable fetch and CaptureBaseline before final PreparedBug.CheckDefinitionHash.
- Production CommandSandbox is pinned command-only `codex sandbox -P equipo-checks` with explicit runner-built filesystem denies, required runtime/workspace reads, minimal env and no credentials. This named-profile CLI support is independent of Paseo agent support; owner acknowledgement cannot relax executor confinement. Per-path sentinel tests and readable workspace control are mandatory, with no unsandboxed fallback. Record configured Codex binary/version. Supervise process groups; command timeout ≤1,200 seconds and remaining attempt time. Parse incrementally before retaining 64 KiB per output stream. Freeze RoleReproduction before base completion/implementation. Blobs are immutable hash-verified activation-DB rows: ≤1 MiB each, ≤128 MiB uploaded/attempt. Reject larger work, no chunking or referenced-evidence GC.
+ Production CommandSandbox is pinned command-only `codex sandbox -P equipo-checks` with explicit runner-built filesystem denies, required runtime/workspace reads, minimal env and no credentials. This named-profile CLI support is independent of Paseo agent support; owner acknowledgement cannot relax the executor’s command sandbox. Its sandbox pass does not confer confined evidence identity on a tainted runner; persist runner-wide `unconfined` provenance on reproduction and repository-check results. Per-path sentinel tests and readable workspace control are mandatory, with no unsandboxed fallback. Record configured Codex binary/version. Supervise process groups; command timeout ≤1,200 seconds and remaining attempt time. Parse incrementally before retaining 64 KiB per output stream. Freeze RoleReproduction before base completion/implementation. Blobs are immutable hash-verified activation-DB rows: ≤1 MiB each, ≤128 MiB uploaded/attempt. Reject larger work, no chunking or referenced-evidence GC.
- [ ] **Commit:** `feat: execute frozen reproductions and base-pinned checks`.
### Task 12: Persist events and usage across reconnects
@@ -278,11 +282,11 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
**Interfaces:** forge.Publisher implements team.Adapter Classify/Execute/Reconcile. Payload repository/ref/head/candidate_hash from Task 4 plus immutable description/provenance digest. DispatchTicket includes Dispatch/Scope/Handle/Incarnation/ExpiresAt, issued by Admit. Instance adapters reconcile durable runner observations; Execute refuses instance-local effects. Provider actions are unsafe to replay without proof; forge publication is reconcilable.
-- [ ] **Tests:** `TestPublishQualifiedRef`, `TestPublishExactEvidence`, `TestPublishLostReceipt`, `TestPublishCredentialIsolation`, `TestPublishCancelRace`. `heads/main` maps to `refs/heads/heads/main`. Saved default, forged repo/ref, tags, changed candidate, stale ticket/wrong runner/missing evidence refuse before Git. Local receive hook sees exact commit. Lost Admit recovers same authorized ticket; duplicate delivery dispatches once. Lost push reply reconciles matching remote commit without second push; mismatch conflicts, query failure stays uncertain. Cancel before dispatch prevents push; after dispatch reconciles in-flight effect without branch deletion. TestPublishExactEvidence also checks description labels/readback; Task 16 later adds the combined surface test.
+- [ ] **Tests:** `TestPublishQualifiedRef`, `TestPublishExactEvidence`, `TestPublishLostReceipt`, `TestPublishCredentialIsolation`, `TestPublishCancelRace`. `heads/main` maps to `refs/heads/heads/main`. Saved default, forged repo/ref, tags, changed candidate, stale ticket/wrong runner/missing evidence refuse before Git. Local receive hook sees exact commit. Lost Admit recovers same authorized ticket; duplicate delivery dispatches once. Lost push reply reconciles matching remote commit without second push; mismatch conflicts, query failure stays uncertain. Cancel before dispatch prevents push; after dispatch reconciles in-flight effect without branch deletion. TestPublishExactEvidence also checks runner-wide labels on publication and executor evidence, including a confined task on a tainted runner, description ordering/readback and the incomplete state during any push-to-description window; Task 16 later adds the combined surface test.
- [ ] **Red/green:** `go test ./internal/runner/forge ./internal/equipotest -run 'TestPublish' -count=1`; mutate ref/identity/retry guards; retain core replay/receipt-conflict tests.
- [ ] **Implement:** ReadyToPublish before Intend, revalidate at Admit and immediately before Git. Verify deadline/incarnation/target/local immutable objects and isolation lineage. Credential-isolated Git, canonical HTTPS remote, hooks/helpers off, refspec `<commit>:refs/heads/<Ref>`. First creation uses `--force-with-lease=refs/heads/<Ref>:` expecting absence; never authorize replacement using an existing old head or unguarded force. Retry accepts only identical existing commit. Durable dispatch precedes Git; exact-target readback recovers receipt with disclosed agent identity; lack of visibility is not proven absence.
- Construct review branch description from persisted evidence, listing `unconfined` affected steps/connections/provider versions. Publish/read back via supported Amadan review-description surface using runner-held agent credential; name/verify that interface during implementation, no invented API or person credential. Include description identity in durable reconciliation, so lost replies cannot lose the label or duplicate publication. A pushed ref without confirmed required description is incomplete/uncertain, never delivered success. Default-branch changes/manual merges grant no push authority. Tests use bare local Git plus fake supported description transport.
+ Construct review branch description from persisted evidence, listing runner taint and `unconfined` steps/evidence/connections/provider versions, including executor evidence and confined connections on a tainted runner. Use `amadan branch describe` with the runner-held agent credential and verify its installed argument/readback contract during implementation. Describe the branch before the push, or atomically with it if Amadan supports that ordering. If Amadan requires the remote ref first and offers no atomic operation, the window is from successful push until description confirmation; the branch can be visible without its label during that window. Persist the pending description before pushing, apply it immediately afterward, and keep publication incomplete/uncertain until readback confirms it. No invented API or person credential. Include description identity in durable reconciliation, so lost replies cannot lose the label or duplicate publication. A pushed ref without confirmed required description is incomplete/uncertain, never delivered success. Default-branch changes/manual merges grant no push authority. Tests use bare local Git plus fake supported description transport.
- [ ] **Commit:** `feat: publish verified commits to qualified review refs`.
### Task 15: Drive the workflow and prove containment
@@ -295,7 +299,7 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
Production-inspector subprocess fixture: marked parent spawns environment-stripped detached child retaining attempt cwd, then exits. Remaining finds child and refuses Contain; exact-identity stop enables empty proof and dependent claim. A tracked child later changing cwd remains owned. Unreadable same-user /proc, PID reuse/interrupted inventory stays unknown; unrelated controls survive.
- [ ] **Red/green:** `go test ./internal/runner ./internal/equipotest -run 'TestRunnerBugWorkflow|TestCancel|TestRunnerLease|TestRunnerRestart|TestProcessIdentity|TestLinuxInspector|TestBugPreparationIntegration|TestBugPreparationCrash' -count=1`. Green uses fake client with real owned subprocesses; mutate cleanup order/process verification. Retain `TestTimeChargeWaitsForContainment`, cancellation/late-receipt regressions.
-- [ ] **Implement:** Wire preparation outbox/assignment/immutable fetch/baseline capture; replace fake validators with Tasks 11–13. Persist transitions/IDs before effects. Reproduce: create scoped agent, Ready, admit/send, freeze, executor verifies expected base failure. Implement: fresh agent returns clean candidate. Review: fresh different family submits verdict on exact candidate. Verify/publish are runner-only. Every model turn gets fresh admission and isolation/ack check; observed session precedes artifacts. Register while handle valid, Complete then archive/verify/Contain before dependents. Failed review/checks ends fixed run without publication or invented replanning. After all attempts contained, Conclude verifies publication and app waits for merge owner.
+- [ ] **Implement:** Wire preparation outbox/assignment/immutable fetch/baseline capture; replace fake validators with Tasks 11–13. Persist transitions/IDs before effects. Reproduce: create scoped agent, Ready, admit/send, freeze, executor verifies expected base failure. Implement: fresh agent returns clean candidate. Review: fresh different family submits verdict on exact candidate. Verify/publish are runner-only. Every model turn gets fresh admission and isolation/ack check; observed session precedes artifacts. Register while handle valid, Complete then archive/verify/Contain before dependents. After each unconfined containment, complete Task 8’s bearer/cleanup-token rotation before further admission; recovery resumes an unfinished rotation without reopening old credentials. Failed review/checks ends fixed run without publication or invented replanning. After all attempts contained, Conclude verifies publication and app waits for merge owner.
Renew every 15 seconds; stop with 10-second margin on 60-second lease using Linux elapsed/boot clock including suspend. Restart treats old authority expired pending instance validation; never reuse cached tickets. Cancel transaction fences/revokes first, reports requested until verified stopped; retain separate in-flight uncertainty. Graceful shutdown drains reports or leaves durable cleanup for service restart.
@@ -308,15 +312,15 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
**Interfaces:** Store TaskView(actor, taskID), Journey(actor), SpecialistWork(actor, key). Views contain ordered step cards, questions, selected/actual identity, isolation provenance, usage availability, evidence, cancellation and merge owner. Lists cover all active/waiting and this week's finished tasks, no pagination. Specialist counts/usage retain known flags. Durable app projection/core Events supply reads. Add page `Live live.View`; keep existing template map and call `live.Render(w, r, status, pages[name], "layout", data)` for live pages.
-- [ ] **Tests:** `TestTaskPages`, `TestTaskPagesUnknownCounts`, `TestTaskFormsCSRFAndRevision`, `TestTaskLiveRefresh`, `TestTaskLayoutRules`, `TestUnconfinedLabelEverySurface`. Scriptless form-to-detail, shared-member reads/current-actor writes, real counts across five specialists/rail, family wait, distinct requested/stopped, escaped descriptions/questions/refs/logs. Count errors return unavailable/503, never zero. Chips beside cards use category/action/model/account and non-color state, no task table/percentages/initials/accent borders. Test literal `unconfined` in card, each affected Journey chip, task detail/evidence and published description; confined controls have no false label, and replay/restart/expiry cannot strip history.
+- [ ] **Tests:** `TestTaskPages`, `TestTaskPagesUnknownCounts`, `TestTaskFormsCSRFAndRevision`, `TestTaskLiveRefresh`, `TestTaskLayoutRules`, `TestUnconfinedLabelEverySurface`. Scriptless form-to-detail, shared-member reads/current-actor writes, real counts across five specialists/rail, family wait, distinct requested/stopped, escaped descriptions/questions/refs/logs. Count errors return unavailable/503, never zero. Chips beside cards use category/action/model/account and non-color state, no task table/percentages/initials/accent borders. Test literal `unconfined` in card, each affected Journey chip, task detail/evidence and published description; confined controls on runners with no taint have no false label, while concurrent confined tasks and executor evidence on a tainted runner are labelled, and replay/restart/expiry cannot strip history. Include a forged Codex confined report for an unlisted tuple: acknowledgement is still required and every affected surface still says `unconfined`.
- `TestTaskLiveRefresh` covers Journey, all specialists and detail: authorized job notification refetches regions from the same URL/handler; forged other-team/job topics deny and other-team writes cause no wake. Removed member/DB error denies next fragment and stream reconnect. Rollback causes no notification; every committed job-changing path notifies after data is readable. Cover new job/list membership, completion/weekly expiry, restart boot ID, write-during-render, unknown counts, and scripts-off full GET. No meta-refresh/custom event feed. Browser editing/focus survives updates.
+ `TestTaskLiveRefresh` covers Journey, all specialists and detail: authorized job notification refetches regions from the same URL/handler; forged other-team/job topics deny and other-team writes cause no wake. Removed member/DB error denies next fragment and stream reconnect. Rollback causes no notification; every committed job-changing path notifies after data is readable. Cover task detail before a job exists following the team collection and switching to the job topic after preparation, new job/list membership, completion/weekly expiry, restart boot ID, write-during-render, unknown counts, and scripts-off full GET. No meta-refresh/custom event feed. Browser editing/focus survives updates.
- [ ] **Red/green:** `go test ./internal/equipotest -run 'TestTaskPages|TestTaskForms|TestTaskLive|TestTaskLayout|TestUnconfinedLabelEverySurface|TestReleaseCopyReviewed' -count=1`. Browser `go test -tags browser ./internal/equipotest -run TestRunnerTaskBrowserWalk -count=1`, plus `EQUIPO_BROWSER_NO_JS=1` variant, widths 1280/390. Test long names, keyboard/focus and overflow; inspect normal motion. Add every new private GET to TestPerfScreens with sign-in/setup; explicitly exclude streams, long-poll and downloads; `make perf`.
- [ ] **Implement live:** One `live.New(live.Config{Path: "/live", Topics: ..., Lifetime: 30*time.Second})` hub per app. Middleware precedes all handler reads. Mount Handler only when hub exists, behind existing requireMember; topic Allow also validates current roster and stored team/job association, denying lookup errors. Wire `Options.Live` for shutdown; embedded test servers close hub before Shutdown. `Allow` runs at stream open, so the 30-second lifetime bounds stale open-stream notices; every fragment read independently rechecks current authority immediately.
- Topic name `jobs`; key is 64-character lowercase SHA-256 of canonical typed `(teamID, jobID)` tuple, within live's single-key grammar. Never concatenate raw IDs with another slash. Team collection uses a distinct typed `(teamID, collection)` key; job creation/preparation without JobID wakes that collection. Detail subscribes to its job; Journey/specialist list regions subscribe to their team's collection, avoiding live's 64-topic limit with unpaginated lists. Allow resolves only authorized stored team/job keys, never caller-supplied team authority. Every job mutation notifies exact job plus team collection after commit in the same service path: preparation/assignments, leases/state, events/usage/evidence, questions/answers, cancel/contain, publication/merge acknowledgement, recovery and connection/ack changes affecting jobs. Inject a notifier into shared write services; deduplicate touched keys, publish nothing on rollback. Schedule weekly-window/staleness changes with NotifyAt and reconstruct schedules at boot. No global unkeyed wakeups.
+ Topic name `jobs`; key is 64-character lowercase SHA-256 of canonical typed `(teamID, jobID)` tuple, within live's single-key grammar. Never concatenate raw IDs with another slash. Team collection uses a distinct typed `(teamID, collection)` key; job creation/preparation without JobID wakes that collection. Task detail with no JobID subscribes to the team collection; once preparation creates a job, the next render subscribes to that job. Journey/specialist list regions subscribe to their team's collection, avoiding live's 64-topic limit with unpaginated lists. For `Allow`, build the hash-to-job lookup from persisted task/job rows and their stored Team.ID association, computing the same canonical hashes for the current member’s team; derive its collection key from that stored Team.ID. Resolve the requested hash through this lookup and recheck membership/association, denying missing mappings or query errors. Never derive team authority from caller-supplied IDs. Every job mutation notifies exact job plus team collection after commit in the same service path: preparation/assignments, leases/state, events/usage/evidence, questions/answers, cancel/contain, publication/merge acknowledgement, recovery and connection/ack changes affecting jobs. Inject a notifier into shared write services; deduplicate touched keys, publish nothing on rollback. Schedule weekly-window/staleness changes with NotifyAt and reconstruct schedules at boot. No global unkeyed wakeups.
- Templates define stable `region:<name>` wrappers/IDs using `hub.View(r).Attrs(...)`; Head uses framework translated paused/unconfirmed keys. Include always-present region:notice. Render only through full-page handlers/checks; live.Render handles no-store/Vary, fragment status/headers and navigation. Take flash only when its data callback says takeFlash; never drain it on background refresh. Use vendored live.js from Task 0, no handwritten EventSource/fragment engine. Keep answer/edit forms on separate ordinary pages and all links/forms functional without scripts. Scriptless pages reflect state at load; no timed whole-page refresh.
+ Templates define stable `region:<name>` wrappers/IDs using `hub.View(r).Attrs(...)`; Head uses framework translated paused/unconfirmed keys. These framework-owned live strings remain in Rastrillo locale packs, exempt from the app-owned copy.go inventory and release-copy gate. Include always-present region:notice. Render only through full-page handlers/checks; live.Render handles no-store/Vary, fragment status/headers and navigation. Take flash only when its data callback says takeFlash; never drain it on background refresh. Use vendored live.js from Task 0, no handwritten EventSource/fragment engine. Keep answer/edit forms on separate ordinary pages and all links/forms functional without scripts. Scriptless pages reflect state at load; no timed whole-page refresh.
Rastrillo v0.30.0 live docs exclude hibernating routes: enable hub only for an explicitly always-on deployment. On a hibernating instance use nil hub/static pages; do not silently prevent sleep. Task 18's live UI acceptance uses always-on configuration; Task 17's hibernation/witness tests retain the static mode.
- [ ] **Implement pages/copy:** GET `/tasks/new`, POST `/tasks`, GET `/tasks/{id}`, POST cancel/acknowledge-merge; replace Journey/Needs you/Connections/specialist activity. Owner recovery GET/POST `/settings/recovery[/release]`; personal project choice POST `/projects/{id}/connections`; owner-only POST `/connections/{id}/acknowledge-unconfined` and `/revoke-isolation-acknowledgement`. Show connection/provider versions and explicit acknowledgement meaning; retain personal opt-in separately. Merge acknowledgement requires current saved merge owner/revision/person-supplied Amadan reference; owners cannot impersonate them. Statuses 303/422/409/403/503 through copy keys.
@@ -332,13 +336,13 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
**Interfaces:** Runner Config includes Origin, StateDir, PaseoHome, NodePath, BridgePath, AmadanCredentialPath, AccountBindingsPath, CodexPath. LoadConfig(getenv), Enrol(cfg, output), Run(cfg); verbs enrol/run/preflight/tool/version. App adds ExecutionEnabled/ExecutionMarkerPath and explicit live always-on configuration. OpenExecution(d, path, cfg, store), Close; AppWithExecution/RouterWithExecution append Execution argument, old constructors remain disabled.
-- [ ] **Tests:** `TestRunnerConfig`, `TestRunnerHTTPClient`, `TestRunnerServiceLifecycle`, `TestExecutionStartupClosed`, `TestRunnerReleaseContract`, `TestExecutionHibernateWitness`, `TestRunnerServiceUsesLinuxInspector`, deferred `TestConnections*`/`TestAccountFailover*`. No TCP/inet listener/root; 0700 state/0600 credentials, atomic token writes/process lock. Reject cross-origin redirects/TLS failures before bearer reuse. Expiry needs enrolment; rotation cannot revive revoke. Disabled app opens no core/adapter. Enabled app shares writer, migrates/syncs budgets/Resume before dispatch; witness mismatch allows recovery only. Failure/SIGTERM closes core before DB. Clean stamped release includes exact dependencies and reviewed copy. Real service inspector repeats surviving-child test; fake-only wiring fails. Discovery honors bindings, no-failover, observed accounts and the confined/acknowledged-unconfined distinction, never claims Codex confinement.
-- [ ] **Red/green:** `go test ./cmd/equipo-runner ./internal/runner ./internal/equipotest -run 'TestRunnerConfig|TestRunnerHTTP|TestRunnerService|TestExecutionStartup|TestRunnerRelease|TestRunnerServiceUsesLinuxInspector|TestExecutionHibernateWitness|TestConnections|TestAccountFailover' -count=1`; green also `CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner`, `make runner-adapter-test`, `make migration-check`. Fake executables inspect packaging/service commands; do not install service.
+- [ ] **Tests:** `TestRunnerConfig`, `TestRunnerHTTPClient`, `TestRunnerServiceLifecycle`, `TestExecutionStartupClosed`, `TestRunnerReleaseContract`, `TestExecutionHibernateWitness`, `TestRunnerServiceUsesLinuxInspector`, deferred discovery `TestConnections*` and `TestAccountFailoverStops`. No TCP/inet listener/root; 0700 state/0600 credentials, atomic token writes/process lock. Reject cross-origin redirects/TLS failures before bearer reuse. Expiry needs enrolment; rotation cannot revive revoke. Disabled app opens no core/adapter. Enabled app shares writer, migrates/syncs budgets/Resume before dispatch; witness mismatch allows recovery only. Failure/SIGTERM closes core before DB. Clean stamped release includes exact dependencies and reviewed copy. Real service inspector repeats surviving-child test; fake-only wiring fails. Discovery honors bindings, no-failover, observed accounts and the confined/acknowledged-unconfined distinction, and normalizes forged confinement reports against the instance build’s verified tuple list. `TestAccountFailoverStops` uses the Task 15 supervisor: an actual pre-prompt account/family mismatch sends zero prompts; a mid-step account/family change fences and stops work, verifies containment, and prevents reassignment until containment completes. Task 6’s `TestAccountFailoverSelection` remains the report/selection test. Exercise create/turn refusal after acknowledging-owner removal/demotion or observed tuple changes. Repeat token-rotation tests through the real containment/service wiring and assert crash recovery cannot admit before rotation completes.
+- [ ] **Red/green:** `go test ./cmd/equipo-runner ./internal/runner ./internal/equipotest -run 'TestRunnerConfig|TestRunnerHTTP|TestRunnerService|TestExecutionStartup|TestRunnerRelease|TestRunnerServiceUsesLinuxInspector|TestExecutionHibernateWitness|TestConnections|TestAccountFailover|TestIsolationAcknowledgementLapses|TestUnconfinedContainmentRotatesTokens' -count=1`; green also `CGO_ENABLED=0 go build ./cmd/equipo ./cmd/equipo-runner`, `make runner-adapter-test`, `make migration-check`. Fake executables inspect packaging/service commands; do not install service.
- [ ] **Implement:** `EQUIPO_EXECUTION_ENABLED=1` opts in. Resolve activation, open one DB, apply app schema, attach execution, clear opts.DBPath; stop reconciliation then close core/DB. External witness/lock need stable storage across oficina hibernation, separate from DB history and not rolled back with backup. Preserved witness wakes normally; lost witness quarantines. Downtime cannot extend leases. Human deployment records actual storage survival; inability to preserve it requires quarantine, never auto-release.
- Explicit local config leaves provider homes unchanged. State holds machine key/bearer/journal/capabilities/sockets; operator-provisioned forge credential opens only in fetch/publish boundary. Enrol prints reviewed browser address/code, starts no browser server. Wire real Linux inspector, discovery/account bindings and command-sandbox version checks. Missing coverage/capability blocks dispatch; automatic acknowledgement expiry is enforced on startup/reports.
+ Explicit local config leaves provider homes unchanged. State holds machine key/bearer/journal/capabilities/sockets; operator-provisioned forge credential opens only in fetch/publish boundary. Enrol prints reviewed browser address/code, starts no browser server. Wire real Linux inspector, discovery/account bindings and command-sandbox version checks. Missing coverage/capability blocks dispatch; automatic acknowledgement expiry is enforced on startup/reports from the observed tuple and current acknowledging-owner role, regardless of claimed `ReadIsolation`. Load the immutable verified tuple list from the instance build; reports cannot extend it. Claude becomes eligible as confined only after its exact Task 18-passed tuple is included in that list.
- Systemd user unit: Type=simple, explicit executable/config, Restart=on-failure, bounded shutdown. Runner release is Linux/amd64 for docs-t1, with bridge/locked production Node packages including server 0.14.0; instance remains Linux/arm64 default. Manifest records Node v24.19.0 and Codex 0.165.0 command-sandbox prerequisite, refusing unverified versions. CI provisions/checks both; no skipped success or provider login required for command-only sandbox tests. Human installs/enables after Task 18. No shared-daemon modification or autonomous deployment.
+ Systemd user unit: Type=simple, explicit executable/config, Restart=on-failure, bounded shutdown. Runner release is Linux/amd64 for docs-t1, with bridge/locked production Node packages including server 0.14.0; instance remains Linux/arm64 default. The instance build embeds the exact `(provider, provider version, Paseo server version, config hash)` tuples that passed Task 18’s sentinel gate; record the same list and gate evidence in the release manifest. `TestRunnerReleaseContract` checks build/manifest equality and rejection of unlisted true reports. The manifest also records Node v24.19.0 and Codex 0.165.0 command-sandbox prerequisite, refusing unverified versions. CI provisions/checks both; no skipped success or provider login required for command-only sandbox tests. Human installs/enables after Task 18. No shared-daemon modification or autonomous deployment.
- [ ] **Commit:** `build: package the outbound runner and wire guarded startup`.
### Task 18: Verify the complete slice and prepare human acceptance
@@ -347,11 +351,11 @@ Installed ZeroSub 1.3.0 exposes `zerosub.state` and `zerosub.agents.account` but
**Interfaces:** TestRunnerEndToEnd starts real HTTP instance/Go runner with fake Paseo and local bare forge. TestPaseoLiveContract/ReadIsolation/TurnCalibration require tag paseo_live, `EQUIPO_LIVE_PASEO=1`, operator-selected disposable repository and enrolled connections; ordinary CI does not count them.
-- [ ] **Acceptance tests:** `TestRunnerEndToEnd` enrols Paul/second member, configures personal connections/budgets, then reproduce → fix → review → checks → publish → merge-owner wait. Verify exact remote checked/reviewed commit, frozen base-fail/candidate-pass, repository counts, independent-family provenance and label surfaces. Second member reads but cannot use Paul's connection; one family waits with zero dispatch. Claude confined plus Codex unconfined-acknowledged satisfies the two-family gate if all other capabilities pass. Unacknowledged Codex fails before creation/dispatch; version change invalidates ack. Exercise resubmission, crash after dispatch, lost event/receipt, instance restart/older-DB restore with newer/missing witness, budget lowering, roster/project edits, permission-wait/background-process cancellation. At most one publication, never false stopped/succeeded.
+- [ ] **Acceptance tests:** `TestRunnerEndToEnd` enrols Paul/second member, configures personal connections/budgets, then reproduce → fix → review → checks → publish → merge-owner wait. Verify exact remote checked/reviewed commit, frozen base-fail/candidate-pass, repository counts, independent-family provenance and label surfaces. Second member reads but cannot use Paul's connection; one family waits with zero dispatch. A build-verified Claude connection plus Codex unconfined-acknowledged satisfies the two-family gate if all other capabilities pass; the shared runner is tainted, so both families’ steps, all executor evidence and publication carry `unconfined`. Include a concurrent confined task and verify its labels and token continuity through required rotations. Unacknowledged Codex fails before creation/dispatch; version change invalidates ack. Exercise resubmission, crash after dispatch, lost event/receipt, instance restart/older-DB restore with newer/missing witness, budget lowering, roster/project edits, permission-wait/background-process cancellation. At most one publication, never false stopped/succeeded.
- [ ] **Red:** `go test ./internal/equipotest -run 'TestRunnerEndToEnd|TestUnconfinedConnectionRequiresAcknowledgement|TestIsolationAcknowledgementLapses|TestUnconfinedLabelEverySurface' -count=1`. Missing integration fails, skipped fixtures do not pass.
- [ ] **Implement:** Complete existing contracts only. Live assertions cover structured events/recovery, both providers' permission replies, per-agent MCP, observed credential-home/account, no-failover, usage completeness and stop/archive/process cleanup. Name missing upstream capability and failing assertion; no invented interface or test-only auth. Verify live views on always-on mode and scripts-off static fallback.
- [ ] **Offline green:** After targeted tests, run `make ci` once, browser walk scripts on/off, then once `go test -race ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipotest ./internal/runner/...`. Race verification may use required CGO; shipped builds remain CGO_ENABLED=0. Confirm all build/vet/format/staticcheck/govulncheck/gitleaks/budget/tests/migration/perf and adapter gates ran. New packages use budget TestMain, size limits unchanged. Report mutations/restoration; no full-suite loops without new failures/changes.
-- [ ] **Authorized live gate:** `EQUIPO_LIVE_PASEO=1 go test -tags paseo_live ./internal/runner/paseo -run 'TestPaseoLiveContract|TestPaseoLiveReadIsolation|TestPaseoLiveTurnCalibration' -count=1`. Preserve others' agents/projects/daemon. Claude must pass ReadIsolation: unique nonsecret sentinels in actual runner state, Amadan credential location, Paseo and each routed credential home, ~/.ssh; readable workspace control. For the credential file use disposable test credential under identical rule, never overwrite/read real secrets. Exercise shell cat, native Read/search, symlink aliases and sandbox/policy escape requests for every protected path. Trusted tool still authenticates. Unknown/skipped/readable protected sentinel fails Claude confinement. Repeat after restart/every enabled confined mode; clean only owned sentinels.
+- [ ] **Authorized live gate:** `EQUIPO_LIVE_PASEO=1 go test -tags paseo_live ./internal/runner/paseo -run 'TestPaseoLiveContract|TestPaseoLiveReadIsolation|TestPaseoLiveTurnCalibration' -count=1`. Preserve others' agents/projects/daemon. Claude must pass ReadIsolation: unique nonsecret sentinels in actual runner state, Amadan credential location, Paseo and each routed credential home, ~/.ssh; readable workspace control. For the credential file use disposable test credential under identical rule, never overwrite/read real secrets. Exercise shell cat, native Read/search, symlink aliases and sandbox/policy escape requests for every protected path. Trusted tool still authenticates. Unknown/skipped/readable protected sentinel fails Claude confinement. Repeat after restart/every enabled confined mode; clean only owned sentinels. Record each passing exact provider/provider-version/observed-daemon-server-version/config-hash tuple and gate evidence for Task 17’s final instance build and release manifest. A skipped or failed tuple never enters that list; live validation before the list is populated runs only as this bounded opt-in gate, not ordinary dispatch.
Codex subcase explicitly asserts ReadIsolation=false, current exact owner acknowledgement and unconfined provenance; it cannot be counted as a successful deny-read sentinel test. Unsupported reads alone no longer block this pair. Missing acknowledgement or any other capability still blocks; once supported per-agent Codex profiles ship, require its full sentinel gate through Task 9's restoration path. Both families must prove account routing/reconnect and absence of owned agent/background/terminal processes after cancel. Executor sentinel gate remains mandatory independently of agent status.
@@ -399,3 +403,14 @@ No Round 1 P3 decision/test is dropped. Original conflicting contracts remain re
- Replaced timed page refresh with Rastrillo live regions, authorized team/job keys, post-commit notifications, scriptless fallback, stream shutdown and always-on deployment constraint.
- Consolidated repeated rationale/assertion snippets into interfaces, tests, commands and shared rules; retained named tests, numerical bounds, migration ownership, security decisions and review dispositions.
- Verification for this planning revision: inspected repository HEAD and local Rastrillo tag/docs/source; compared old/new test inventories and checked task references, command selections and diff whitespace. Product tests, upgrades and live gates above remain future implementation work. Only this plan is edited; no agents, services, commits, pushes or deployment were started.
+
+## Round 2 dispositions
+
+- N1: The instance build and release manifest carry only Task 18 sentinel-passed isolation tuples. Tasks 6/9/17 use observed provider, provider version, daemon server version and config hash; unlisted true reports remain unconfined. Forged Codex confinement still needs acknowledgement and labels. Claude becomes confined only when its passing tuple is listed.
+- N2: The ruling and Tasks 8/11/14 apply runner-wide taint to every step, evidence item (including executor evidence) and publication. Concurrent confined tasks are labelled. After each unconfined containment, rotate bearer and cleanup tokens; Tasks 15/17 wire and recover that transition.
+- P2-6: Task 6 runs `TestAccountFailoverSelection` against seeded reports for binding mismatch, unavailable pins and missing no-failover guarantees. Task 17 runs `TestAccountFailoverStops` for actual pre-prompt refusal, mid-step containment and reassignment ordering with Task 15’s supervisor.
+- P3 / Task 0: Require the `TestFoundationFailsClosed/private_routes` redirect update to `/signin?return_to=%2F` and its targeted regression command.
+- P3 / Task 6: Acknowledgement lapses on its owner’s removal/demotion; `PaseoVersion` means observed daemon server version. Each connection acknowledgement covers every project in Paul’s team under his “own repos” ruling.
+- P3 / Task 14: Name `amadan branch describe`, require description before or atomically with push where supported, and state the visible-but-unlabelled window otherwise. Delivery stays incomplete until description readback succeeds.
+- P3 / Task 16: Jobless task detail follows the team collection, then switches to its job. `Allow` derives hash-to-job mappings from persisted task/job/team associations. Framework live strings remain exempt from copy.go.
+- Verification: Reviewed the plan against every R2 decision, checked task/test ownership and stale conflicting claims, and ran `git diff --check`. Only this plan is edited. Product tests and live gates remain future implementation work; no agents, processes, commits or pushes were started.