oficina / equipo Public

specs: connections rev 2b, remaining Astra round 1 findings

Sealed keys get a lifecycle: seal key derived from the enrolment
ed25519 key so the fingerprint binds it, payload bound to runner,
connection, provider, endpoint, attempt and a ten-minute expiry, replay
rejected, ack only after fsync, cancel marker, WAL and backup residue
stated. Local endpoints move to the Pi slice with a narrow host:port
listener, pinned address, refused redirects and four probes; public
endpoints stay on the CONNECT relay. OpenRouter PKCE hardened (S256,
attempt-bound callback, no referrer, query stripped from URL and log).
Routing selects a connection and model pair from a model map, records
the family, and fixes the order: eligibility, stickiness, tier floor,
preference, headroom; unknown capacity ranks below reported. Harness
exclusions become probes (cmd acp, Vibe run-server); Pi abort is idle;
per-harness containment proofs listed. TensorX and accounts contracts
reconciled; decisions and risks updated.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
claude eaf2f3862af0d1de41681c9ff54a668fe283709a parent f5cc2da
1 file changed, +186 −108
  • docs/superpowers/specs/2026-11-08-equipo-connections.md +186 −108

CI failed — run details

diff --git a/docs/superpowers/specs/2026-11-08-equipo-connections.md b/docs/superpowers/specs/2026-11-08-equipo-connections.md
index 6fa971f6..8fdab039 100644
--- a/docs/superpowers/specs/2026-11-08-equipo-connections.md
+++ b/docs/superpowers/specs/2026-11-08-equipo-connections.md
@@ -1,6 +1,7 @@
# Equipo Connections: accounts added from the app, any provider for any role
-Status: design for Paul's review, 2026-11-08. Drafted by Claude (Fable 5.1)
+Status: design for Paul's review, 2026-11-08, revision 2 after Astra's
+round 1 (NOT READY at 28f8455). Drafted by Claude (Fable 5.1)
on `design-connections` from `thin-v1-slice4c` (2d1edaf). Builds on the
approved thin v1 spec (`2026-11-06-equipo-thin-v1.md`, §§2, 3, 5, 6, 8) and
the accepted Mac runners spec (`2026-11-07-equipo-mac-runners.md`). Not
@@ -189,9 +190,10 @@ already do some of it, which sets the bar:
Messages API. Ollama and vLLM now serve `/v1/messages` natively
(`ANTHROPIC_BASE_URL=http://localhost:11434`,
`ANTHROPIC_AUTH_TOKEN=ollama`), so local models can run under the
- Claude harness with no proxy; OpenRouter, TensorX and Mistral cannot
- without a translating proxy, and Anthropic says it does not support
- routing Claude Code to non-Claude models.
+ Claude harness with no proxy, and TensorX documents the same route
+ (§1.5); OpenRouter and Mistral cannot without a translating proxy,
+ and Anthropic says it does not support routing Claude Code to
+ non-Claude models.
Neither covers every endpoint, which is why §1.4 verifies Pi and
OpenCode as the dedicated OpenAI-compatible harness. The verdict and the
@@ -278,11 +280,12 @@ but cannot ask a person; default provider is its own metered backend
(browser OAuth or `COMMAND_CODE_API_KEY`), with ChatGPT and Copilot
subscription logins and a BYOK file for Ollama, vLLM and OpenRouter
behind `--local-only`; no sandbox; auto-update, telemetry, a remote
-model catalogue and credit checks to switch off. Verdict: not a
-coordinator (no live relay, no long-lived mode); possible for
-Engineering and Review behind BYOK, proprietary, and nothing it does
-is unavailable in Pi. It stays in the plan as Paul asked, last, and
-is marked "Engineering and Review only" in the matrix.
+model catalogue and credit checks to switch off. It also documents `cmd acp` (ACP over stdio), which
+is a long-lived, prompt-and-permission protocol; whether its permission
+requests reach the host and whether MCP tools are callable under it is
+unprobed. Verdict: proprietary and backend-tied, nothing it does is
+unavailable in Pi, so it comes last; its coordinator cell is "probe
+`cmd acp` before deciding", not "no".
**Decision.** Pi is the one OpenAI-compatible harness for local
models, TensorX (chat wire), the Mistral API, OpenRouter and the CARLOS
@@ -361,11 +364,13 @@ spend is computed from tokens and the price table (Large 4 $0.70 in
and $2.10 out, Small 4 $0.15 and $0.60, Codestral 25.08 $0.30 and
$0.90).
-Vibe is also a candidate for the single OpenAI-compatible harness
-(§5): it has the headless mode, streaming JSON, MCP, resume, hooks and
-custom providers that §1.4 asks of Pi and OpenCode, with the drawback
-of being Mistral's product driving other people's models. The matrix
-in §5 scores it beside them.
+Vibe also documents an experimental `run-server` mode, so a long-lived
+coordinator process is not ruled out; whether it relays approvals to a
+host is unprobed, and the matrix marks its coordinator cell "probe
+`run-server` before deciding". It is a candidate for the single
+OpenAI-compatible harness too (headless mode, streaming JSON, MCP,
+resume, hooks, custom providers), with the drawback of being Mistral's
+product driving other people's models; §5 scores it beside Pi.
### 1.7 Later: Gemini and Muse
Both are parked, with the facts that decided it. Gemini CLI was
@@ -402,9 +407,11 @@ for `capabilities`. On the runner, the same connection is a dedicated
home `~/.local/share/equipo/accounts/<provider>-<n>` (today's layout),
a `connections` table row with the same id, and whatever the harness
keeps there. The existing `wire.Account {id, provider, email, healthy,
-headroom}` in `hello` grows into this record (§7); `accounts` as a word
-stays in the wire for compatibility and in copy as "accounts" where it
-reads better than "connections".
+headroom}` in `hello` is **replaced** by this record under
+`hello.connections` (§7), with the runner protocol version bumped as the
+Mac spec does; `accounts` leaves the wire. In copy the word "account"
+survives only where it names the provider's own thing ("your Claude
+account").
Every flow below is a **connection attempt**: the app POSTs
`/api/v1/connections` with `{provider, kind, runner_id}`, the instance
@@ -495,37 +502,75 @@ decides whether a Mac runner can hold more than one Claude account.
### 2.4 API keys, sealed to the runner
The app never sends a key to the instance in the clear, and the instance
-never stores one. The runner already holds an ed25519 identity key from
-enrolment (`internal/runner/enrol.go`); `hello` adds a `seal_key`, an
-X25519 public key derived for this purpose, and the instance republishes
-it on the `Runner` resource. The app seals the key with libsodium's
-`crypto_box_seal` (NaCl sealed boxes: ephemeral sender key, X25519,
-XSalsa20-Poly1305; one call in Swift, Kotlin, Go and the browser's
-libsodium build) and POSTs `{provider, kind: api_key, sealed}`. The
-instance copies the opaque bytes into the `connect` frame, keeps them
-only in the durable mailbox until the runner acks, then deletes the
-payload column and keeps the frame id. The runner opens the box, writes
-the key into the home (`ANTHROPIC_API_KEY` in a 0600 env file for
-Claude; `codex login --with-api-key` on stdin for Codex; the harness's
-own auth file for an endpoint), zeroes the buffer, makes one test call
-(`/v1/models` or the harness's cheapest request), and reports `healthy`
-or `provider_refused`. A sealed payload is capped at 4 KB and never
-logged; the mailbox table's payload column is excluded from every
-diagnostic dump, as credential bytes already are. The instance can read
-nothing, a database export carries nothing, and a replayed frame to a
-different runner cannot be opened. Rotation is "sign out, add again".
-
-### 2.5 Endpoints, with a test call
+never stores one it can read. The runner holds an ed25519 identity key
+from enrolment (`internal/runner/enrol.go`), whose fingerprint the owner
+checked on the approval page (`runner.fingerprint`). The **seal key** is
+the X25519 key derived from that same ed25519 key (the standard
+birational map, as libsodium's `crypto_sign_ed25519_pk_to_curve25519`),
+so the public key the instance republishes on `Runner.seal_key` is
+verifiable by the app against the fingerprint approved at enrolment,
+and a substituted key would not match it. The native apps compare and
+refuse; the web app trusts the instance it is served by, which is
+already true of everything it shows, and that limit is stated in the
+Connections screen's help text.
+
+**Sealing.** The app seals with libsodium `crypto_box_seal` over a
+payload `{secret, runner_id, connection_id, provider, endpoint_host,
+attempt, expires_at}`; the instance-visible fields (`runner_id`,
+`connection_id`, `provider`, `endpoint_host`, `attempt`, `expires_at`)
+travel beside the box in the clear and the runner **rejects the box if
+any of them differs from the plaintext inside**, if `expires_at`
+(ten minutes from sealing) has passed, if the connection attempt is
+not the one it is currently running, or if the `(connection_id,
+attempt)` pair has been seen before (a `seen_seals` table kept for a
+day). The instance copies the opaque box into the durable `connect`
+frame; the runner opens it, writes the secret into the home
+(`ANTHROPIC_API_KEY` in a 0600 env file for Claude; `codex login
+--with-api-key` on stdin for Codex; the harness's auth file for an
+endpoint), fsyncs, zeroes the buffer, and **only then acks** the
+frame; a crash before the ack means a resend, which the `seen_seals`
+check turns into a no-op if the write had landed. The instance then
+deletes the payload column. Honesty about that deletion: the
+ciphertext may persist in SQLite's WAL and in backups until they
+rotate. It is useless without the runner's private key, it names an
+attempt that cannot be replayed, and it expires in ten minutes, so the
+design accepts that residue and says so; it does not claim erasure.
+**Cancel** during `connecting` writes a `cancelled` marker the runner
+checks before writing the secret; a late success report for a
+cancelled attempt is dropped by the instance (`Attempt` and state
+checks as `chat/runner.go` does for turns) and the runner deletes the
+home. A sealed payload is capped at 4 KB and never logged; the mailbox
+payload column is excluded from every diagnostic dump, as credential
+bytes already are. Rotation is "sign out, add again". Sealed keys land
+in slice 2 with the endpoints; slice 1 has no key entry.
+
+### 2.5 Endpoints, with a test call (slice 2)
An endpoint connection is `{base_url, label, sealed key or none,
-harness}`. The runner resolves the host, refuses loopback and LAN
-addresses unless the connection is marked `local` (a local Ollama is the
-point, so `local` is allowed and the egress relay for that connection
-admits exactly that host and port), fetches `/v1/models`, makes a
-one-token completion with the first model, records the model list and
-the latency, and reports `healthy` with `models[]`. The card shows the
-models and lets the person pick a default; the router (§4) may use any
-of them. For OpenRouter the key can arrive by its PKCE flow (§2.6)
+harness, local}`. Two transports, because the existing egress relay
+cannot carry the local case: `egress/proxy.go` accepts one bounded
+CONNECT to a public DNS name on port 443, and the namespace's
+`localhost` is not the host's, so an Ollama on the runner's machine is
+unreachable through it by design. **Public endpoints** (TensorX,
+Mistral, OpenRouter, the CARLOS gateway) use the existing relay with
+the connection's host added to its allow list for that connection's
+actions, HTTPS only. **Local endpoints** use a second, narrower
+listener the runner opens outside the namespace and binds into it on a
+fixed loopback port: it forwards plain HTTP to exactly one `host:port`
+recorded on the connection (the host's loopback or a LAN address the
+person typed), resolves the name once at connect time and pins the
+address, refuses redirects (`3xx` is returned to the harness as an
+error, never followed), admits only the HTTP methods and paths an
+OpenAI-compatible client uses, and is mounted only for actions on that
+connection. The harness is pointed at the loopback port, not at the
+host. On connect the runner fetches `/v1/models`, makes a one-token
+completion with the first model, records the model list and latency,
+and reports `healthy` with `models[]`; the card shows the models and
+lets the person pick a default. Probes before this ships (slice 2):
+the local listener is unreachable from a step whose connection is not
+local; a redirect from the endpoint is refused; a DNS change after
+connect does not move the pinned address; the listener dies with the
+namespace. For OpenRouter the key can arrive by its PKCE flow (§2.6)
instead of typing.
### 2.6 OAuth without a paste: what each provider allows
@@ -548,16 +593,25 @@ sources in §1:
| Gemini (later) | Fixed Google client, loopback only; `NO_BROWSER` pastes a code; third-party use of the Code Assist service forbidden | Yes | CLI | CLI home |
Only OpenRouter (and Hugging Face) let a third party register or skip
-a client and receive the redirect at a URL Equipo controls; for them the
-redirect lands on the app and the exchange still happens on the runner,
-with the verifier sealed so the instance sees an opaque box. OpenRouter
-publishes "localhost callbacks are supported on any port"; whether a
-custom scheme is accepted is unconfirmed, so the native apps use an
-https app link to the Equipo web origin until that is checked. Codex
-needs no paste because device code is its own protocol. Claude is the
-one subscription where the loopback is the only no-paste path, and the
-terms make the paste belong to the CLI; Equipo's job is to make the
-same-machine case recognisable and the remote case honest.
+a client and receive the redirect at a URL Equipo controls. For
+OpenRouter the flow is hardened as follows: the app generates the
+verifier and uses `S256`; the `callback_url` is an instance route that
+carries the connection attempt id in its path and serves a page with
+`Referrer-Policy: no-referrer` whose first act is to read `code` from
+the query, replace the URL without the query (`history.replaceState`)
+and seal `{code, code_verifier}` to the runner bound to that attempt
+(§2.4); the instance's access log for that route omits the query
+string; a code older than ten minutes (OpenRouter's own expiry) or for
+an attempt that is not `connecting` is refused by the runner, which
+does the exchange at `/api/v1/auth/keys` and keeps the returned key.
+The instance sees the code for the duration of one request and
+never stores it; that is a weaker guarantee than for typed keys and
+the spec says so. Whether OpenRouter accepts a custom scheme is
+unconfirmed, so the native apps use an https app link to the Equipo
+origin. Codex needs no paste because device code is its own protocol.
+Claude is the one subscription where the loopback is the only no-paste
+path, and the terms make the sign-in belong to the CLI; Equipo's job is
+to make the same-machine case recognisable and the remote case honest.
### 2.7 Health, headroom, limits, refresh, sign out
@@ -752,47 +806,52 @@ enums with one-line definitions; a missing or invalid class defaults
to `medium`, `normal`, `feature` and is recorded as defaulted. The
coordinator does not choose a connection; it describes the job.
+**Models, not connections, have tiers and families.** A connection
+offers one or more models (a subscription offers the provider's
+current models; an endpoint offers its `models[]`). The runner ships a
+static **model map**: for each known model id, its family (`claude`,
+`gpt`, `glm`, `deepseek`, `kimi`, `qwen`, `mistral`, `llama`, …), its
+tier (`cheap`, `standard`, `strong`) and, for metered connections, a
+price per million tokens with a `price_version`; an unknown model is
+`cheap`, family `unknown`, and is reported so the map can be extended.
+Two endpoints serving the same model are two pairs with the same
+family and tier; one endpoint serving several families is several
+pairs. Every step and turn records the pair that ran and its family,
+and Review's `other_family` is judged on recorded families (§3).
+
**The policy.** A table, shipped as defaults and never edited by the
-person in v1: a class maps to a **tier** (`cheap`, `standard`,
-`strong`) per role. Engineering: `small` and `low` risk start `cheap`;
-`medium` or `normal` start `standard`; `large` or `high` start
-`strong`. Review: one tier above Engineering's, minimum `standard`,
-and another family where possible. Coordinator: always `standard` or
-above (it holds the person's context; a cheap coordinator is a false
-economy). Ask: the step's own connection. Each connection carries a
-tier from a static map the runner ships (Claude and Codex
-subscriptions `strong`; TensorX kimi-k3.1-pro and Mistral Large 4
-`standard`; glm-5.3-flash, deepseek-v4-flash, Small 4 and any local
-model `cheap`, with a local model's tier capped by its parameter count
-when the endpoint reports it) and a **cost signal**: `subscription`
-(headroom is the cost: free until limited), `metered` (a price per
-million tokens from the connection's price table, so dollars), or
-`free` (local). The choice function of §3 takes the tier as a filter
-(a `cheap` job may run on anything at or above `cheap`, preferring the
-cheapest cost signal with headroom; a `strong` job runs only on
-`strong`) and then applies preference, headroom and stickiness as
-before. Nothing here needs setup: with one Claude account every job
-lands there, exactly as today; add a local Ollama and small fixes
-start moving to it; add Codex and Review becomes cross-family.
-
-**Cheap-first escalation.** A `cheap` or `standard` first pass that
-fails checks or gets `changes_requested` is retried one tier up on the
-first fix round, on a different family if one is available; the second
-fix round (thin v1's `MaxFixRounds` 2) stays on the escalated tier.
-Escalation is recorded on the step as `escalated_from`. A `strong`
-first pass that fails stays `strong`; there is nowhere to go, and the
-fix-round cap already ends it at Needs you.
+person in v1: a class maps to a **tier floor** per role. Engineering:
+`small` and `low` risk floor at `cheap`; `medium` or `normal` at
+`standard`; `large` or `high` at `strong`. Review: one tier above
+Engineering's actual tier, minimum `standard`, another family where an
+eligible pair exists. Coordinator: `standard` or above. Ask: pinned to
+the step's pair. A pair's **cost signal** is `subscription` (within
+plan: no marginal cost until limited, overage priced if the person
+typed one), `metered` (price from the model map), or `free` (local).
+The choice function of §3 applies, in its fixed order: eligibility,
+stickiness, the tier floor as a filter, the preference, then headroom
+with the cheapest cost signal first among equals. Nothing here needs
+setup: with one Claude account every job lands there, exactly as
+today; add a local Ollama and small fixes start moving to it; add
+Codex and Review becomes cross-family.
+
+**Cheap-first escalation.** A first pass whose pair is below `strong`
+and that fails checks or gets `changes_requested` is retried one tier
+up on the first fix round, on a different family if an eligible pair
+exists; the second fix round (thin v1's `MaxFixRounds` 2) stays on the
+escalated tier. Escalation is recorded on the step as `escalated_from`.
+A `strong` first pass that fails stays `strong`.
**What the person sees.** One quiet line on the task card and in the
timeline: "Engineering on Codex, local model for the first pass" or
"Engineering on Claude (Paul prefers Claude)". The Usage page (§6)
sums it: "3 tasks moved to Codex while Claude was limited". Every
-decision is a `routing` row: task, step, role, class, tier,
-connection, reason (`preference`, `headroom`, `cheapest`,
-`escalated`, `failover`, `only_option`, `same_family_review`), so the
-line and the sum are read from data, not reconstructed. Override is
-per task ("Run on …", §3) or standing (the preference), and an override
-is a `reason: preference` row like any other.
+decision is a `routing` row: task, step, role, class, tier floor,
+connection, model, family, reason (`sticky`, `preference`, `headroom`,
+`cheapest`, `escalated`, `failover`, `only_option`,
+`same_family_review`), so the line and the sum are read from data.
+Override is per task ("Run on …", §3) or standing (the preference),
+and an override is a `reason: preference` row like any other.
## 5. Tools and safety per harness, and the capability matrix
@@ -820,7 +879,20 @@ namespace is the containment. On the owner's Mac (Mac spec §4) Claude
Code's `sandbox.enabled` profile is trusted for Claude steps; Codex and
Pi on the Mac are parked until probe P5 shows Codex's Seatbelt nests
under `srt`, and Pi, having no sandbox, would run under an `srt`
-profile of Equipo's own, which is slice F work there, not here. Each
+profile of Equipo's own, which is slice F work there, not here. **Termination comes from the namespace, never from the harness**: Pi's
+`abort` waits for the session to go idle and keeps the process alive
+(its RPC docs), Codex's `turn/interrupt` ends a turn, Claude's SIGINT
+ends a turn; Equipo kills the namespace and waits for the pidfd proof,
+as today. Before any harness earns a "yes" cell it passes the same
+**containment proofs** in CI and once on staging: it works through the
+CONNECT relay with no direct network (proxy support); a model tool
+cannot read the credential home or the runner's state (credential-read
+denial, tried by a hostile prompt in the fake and a `cat` in staging);
+shell is absent or restricted in the read-only roles; MCP tools are
+exactly the pinned set and nothing else is callable; and killing the
+namespace ends every descendant, including the harness's subprocesses
+(descendant termination). Claude passes these today; Codex and Pi get
+them as the first task of their slices. Each
harness gets a **fake CLI** in CI reproducing its pinned protocol from
recordings: `fakeclaude` exists, `fakecodex` is slice 1 here (the
app-server JSON-RPC including device-code login, `account/rateLimits`
@@ -831,11 +903,11 @@ and `thread/tokenUsage/updated`), `fakepi` is the local-models slice
|---|---|---|---|---|---|---|
| Claude subscription or API key, Claude Code | Yes (today) | Yes (today) | Yes (today) | Yes (today) | `rate_limit_event {utilization, resetsAt}`, one figure | Live; multi-account in 1 |
| ChatGPT plan or OpenAI key, Codex app-server | Yes: `turn/start`, MCP via `codex mcp`, approvals relayed | Yes: thin v1 §3 path | Yes: `sandbox_mode = read-only`, no write tools | Yes: `thread/resume` | `account/rateLimits` two windows with `resetsAt`, `thread/tokenUsage/updated` | 1 |
-| Local model (Ollama, vLLM, LM Studio), Pi | Yes, if the model handles tool calls; `cheap` tier, so chosen only by preference | Yes, `cheap` tier | Yes, read-only tool allowlist, `same_family` never (it is its own family) | Yes | None reported; HTTP 429 observation only | 2 |
+| Local model (Ollama, vLLM, LM Studio), Pi | Yes, if the model handles tool calls and the containment proofs pass; tier from the model map | Yes, `cheap` tier | Yes, read-only tool allowlist, `same_family` never (it is its own family) | Yes | None reported; HTTP 429 observation only | 2 |
| TensorX, Pi (chat wire) | Yes, `standard` tier for the larger models | Yes | Yes | Yes | 429 `retry-after`, `x-ratelimit-reset`, `x-ratelimit-remaining-*` | 2 |
| Mistral API or OpenRouter, Pi | Yes, `standard` | Yes | Yes | Yes | 429 `Retry-After`; OpenRouter key info endpoint later | 2 |
-| Mistral subscription, Vibe CLI | **No** in v1: `-p --output streaming` has no stdin-held long-lived mode documented, and headless denies asks rather than relaying them | Yes: `--auto-approve` inside the namespace, MCP, `--resume` | Yes: tool `permission` denies for edit and shell | Yes: `--resume <id>` | 429 `Retry-After`; plan budget not reported | 3 |
-| Command Code, BYOK `--local-only` | **No**: no long-lived mode, hooks cannot ask | Yes, `--yolo` inside the namespace | Yes, `--permission-mode plan` | Yes, `--resume` | Exit code 5 on rate limit only | 5 |
+| Mistral subscription, Vibe CLI | Probe `run-server` before deciding; `-p` alone denies asks rather than relaying them | Yes: `--auto-approve` inside the namespace, MCP, `--resume` | Yes: tool `permission` denies for edit and shell | Yes: `--resume <id>` | 429 `Retry-After`; plan budget not reported | 3 |
+| Command Code, BYOK `--local-only` | Probe `cmd acp` before deciding; `-p` hooks cannot ask | Yes, `--yolo` inside the namespace | Yes, `--permission-mode plan` | Yes, `--resume` | Exit code 5 on rate limit only | 5 |
| Gemini, Muse | Later | Later | Later | Later | | |
"Yes" in the Pi rows is conditional on the probes in §8 passing: RPC
@@ -1005,7 +1077,7 @@ then UI, then deploy, as thin v1 §8. Sizes are agent days.
| 1b Protocol and auth | `Connection` rows and homes, `connect`, `connection`, `disconnect` frames, `hello.connections`, `sync.connections`; Codex device code in the app; Claude same-machine loopback and the finish-on-runner card; health, `limited`, `sign_in_again` and the failure classifier of §3; Claude and Codex only, over the existing egress relay, no endpoints and no sealed keys | Headless: A1 device code against `fakecodex`, card shows the code, connection turns `healthy` with plan and windows; A2 device code refused (not enabled), `provider_refused`; A3 Claude same-machine against `fakeclaude` with a simulated loopback callback, `healthy` with the observed email; A4 remote case shows the finish-on-runner card and nothing else; A5 cancel during `connecting` defeats a late success (the runner's late `healthy` report for a cancelled attempt is dropped and the home deleted); A6 `rate_limit_event {rejected}` with and without `resetsAt` marks `limited` correctly; A7 an `auth` failure marks `sign_in_again`, never `limited`; A8 guard: no secret-shaped field in any frame, fixture or report | 1 day |
| 1c Failover and continuity | The choice function over pairs with stickiness; the `waiting` turn state; termination before failover; durable attempt advancement; tool-effect reconciliation (`tool_calls{turn}` request, replayed results by `(turn, name, canonical args)`, the resumed-attempt house rule); the switched line; Engineering retry on another pair after termination; `no_connection` waiting card; pinned ask | Headless: F1 two Claude accounts, the first hits a fake limit mid-turn, reply from the second with the switched line, no duplicate message; F2 quota failure immediately after each write tool in turn (`add_project`, `record_task`, `start_task`, `ask_person`, `set_project_home`), the new attempt's summary names the effect, and a repeated call is answered `replayed: true` with no second project, task or card; F3 runner crash between termination and attempt advancement, restart recovers the turn in `waiting` and advances once; F4 ack loss on the `turn{running, attempt: 2}` report, resend is a no-op; F5 cancel during `waiting` ends `cancelled`, cancel after advancement targets attempt 2 and a stale attempt-1 report is dropped; F6 Engineering step fails on quota, termination proof, attempt 2 on Codex, card shows both; F7 nothing eligible, `waiting` with `no_connection`, the card, then a connection returns and the reply arrives without the person resending; F8 the preferred connection returns, the next turn switches back with the line and resumes the old session with a fresh notebook injection; F9 ask on a step whose connection is `limited` fails `account_unavailable` and never moves. Staging witness: one real Codex device-code sign-in in the app, one real Codex refresh (thin v1's debt), one real Claude limit observed or injected by a `rate_limit_event` replay against the real CLI, three coordinator turns across the switch, one of them straight after `start_task` | 1.5 days |
| 1d UI | Connections list and Add in Settings, the connecting card, the switched line, the waiting card, the finish-on-runner card; no Usage page | Browser suite on A1, A4, F1, F7 | 0.5 day |
-| 2 Local models and metered endpoints through Pi | Pi probes P1 to P4 (RPC session across 100 fake turns; `extension_ui_request` relay for a blocked tool; MCP pinning; `abort` termination), `fakepi`, Pi containment profile in `policy.go`, endpoint connections with the test call and `local` hosts, sealed API keys (`seal_key`, sealed box in the web app and the Go client), OpenRouter PKCE on the web app, TensorX and Mistral API as endpoints with their price tables and 429 parsing, Pi usage into `usage`, tiers from the static map (no classes yet: an endpoint is chosen by preference or when nothing else is healthy) | Headless: P1 to P4 as tests; E1 add an Ollama endpoint, model list shown, a Review step runs on it with `other_family`; E2 sealed key round trip, instance database contains no plaintext (grep the SQLite file), replay to another runner fails to open; E3 TensorX 429 with `retry-after` marks `limited` with the right time; E4 OpenRouter PKCE callback to the web app, exchange on the runner against a fake. Staging: a real Ollama on docs-t1 or Tito Studio running one Review step and one small Engineering step; one real TensorX test call | 4 days (OpenCode fallback adds 2) |
+| 2 Local models and metered endpoints through Pi | Pi containment proofs and probes P1 to P5 (RPC session across 100 fake turns; `extension_ui_request` relay for a blocked tool; MCP pinning; credential-read denial; descendant termination under namespace kill), `fakepi`, Pi profile in `policy.go`; the local transport of §2.5 with its four probes; public endpoints over the relay; sealed keys with the §2.4 lifecycle (`seal_key` derived from the enrolment key, bound payload, `seen_seals`, ack after fsync, cancel marker); OpenRouter PKCE hardened as §2.6; TensorX and Mistral API as endpoints with the model map's prices and their harness-side 429 events; Pi usage into `usage`; tiers from the model map, no classes yet | Headless: P1 to P5 as tests; E1 add a local endpoint through the local listener, model list shown, a Review step runs on it with `other_family` by recorded family; E2 sealed key round trip, the instance database and its WAL contain no plaintext (grep the files), a box with a changed `connection_id` or an expired `expires_at` or a repeated attempt is refused, a replay to another runner fails to open; E3 a step on a non-local connection cannot reach the local listener; E4 a redirecting endpoint is refused; E5 OpenRouter callback to the instance route, query stripped from the URL and the access log, exchange on the runner against a fake; E6 Pi reports a 429 as an error event, connection `limited` without a reset time, probe clears it. Staging: a real Ollama on docs-t1 or Tito Studio running one Review step and one small Engineering step; one real TensorX test call | 5 days (OpenCode fallback adds 2) |
| 3 Routing and Usage page | `size`, `risk`, `kind` on `record_task` and `start_task`; the class-to-tier table; cheap-first escalation; routing lines on the task card; preferences per role and per task override; the Usage page with availability, spend, token tabs and routing lines; soft ceiling, 80% line and Pause (thin v1 slice 6's item, moved here); the sidebar dot; Mistral Vibe CLI as an Engineering and Review harness (`fakevibe`), subscription connection by the CLI's browser sign-in in the same-machine case and `MISTRAL_API_KEY` sealed otherwise | Headless: R1 a small, low-risk fix lands on the local model, fails checks, escalates to `standard` on another family, passes; R2 a high-risk task goes `strong` straight away; R3 preference set, switched line only on failover; R4 Usage sums equal the `usage` rows for each grouping and period (property test over random rows); R5 ceiling crossed, dot appears, Pause stops new metered steps and never the coordinator; V1 Vibe Engineering step with a fake. Staging: three routed tasks on the mix, page checked against the rows | 4 days |
| 4 Native apps and polish | Fixtures published, sealed box in Swift and Kotlin, `same_machine` detection on the Mac app, Connections and Usage screens | Contract fixtures replayed by the apps' own tests | app teams |
| 5 Command Code | BYOK `--local-only` Engineering and Review rows, `fakecmd`, containment profile with its network switches | One headless Engineering step, one Review step | 1.5 days |
@@ -1019,17 +1091,18 @@ staging witness runs before 1d.
## 9. Decisions for Paul
-1. **Claude on a remote runner stays a terminal step.** Anthropic's
- terms forbid Equipo intermediating the code or token, so when the
- browser is not on the runner's machine the app shows the honest
- card and the paste happens in `equipo-runner login claude` there,
- never in Equipo. The alternative, a device-side bridge in the native
- apps, is technically possible and is not built. Confirm, or say the
- risk is acceptable and the bridge goes on the list.
+1. **Claude signs in only to the unmodified binary.** On the runner's
+ machine by loopback, otherwise "finish signing in on the runner"
+ (`equipo-runner login claude` there, the paste going into the CLI).
+ No token importer and no device-side bridge, because Anthropic's
+ terms forbid Equipo handling the code or token and an owner's
+ acceptance cannot waive a provider's terms. Confirm; the
+ alternative is a Claude API-key connection for remote machines.
2. **Pi is the single OpenAI-compatible harness**, with OpenCode as the
fallback if the slice 2 probes fail, Vibe for the Mistral
- subscription only, and Command Code last and never a coordinator.
- Confirm, or name a different order.
+ subscription with `run-server` probed before it is given a
+ coordinator cell, and Command Code last with `cmd acp` probed the
+ same way. Confirm, or name a different order.
## 10. Risks
@@ -1046,6 +1119,11 @@ the container, as the design already assumed. Spend is an estimate
from tokens and a price table that someone must keep current, labelled
as such. TensorX's and Mistral's quieter corners (streamed tool-call
chunks, prompt caching, whether a plan key may be used from Pi) are
-marked unverified above and are probed, not assumed. The word count is
-above the brief because three sections were added on the way; nothing
-in them is optional for the design to hold together.
+marked unverified above and are probed, not assumed. Tool-effect reconciliation
+depends on the instance's stored results by call id and on a model
+honouring the resumed-attempt house rule; the `(turn, name, canonical
+args)` replay is the backstop and F2 tests it after every write tool.
+Sealed-box residue in WAL and backups is accepted and labelled, not
+erased. The word count is above the brief because four sections were
+added on the way; nothing in them is optional for the design to hold
+together.