oficina / base Public

Plan: assistant abilities, lookups and the per-person switchboard

Six phases from the approved spec (revision 8): copy review and
operator keys first; Base draws lookup answers; Equipo enforcement;
lookups (Mojeek with Brave fallback, protocol 33, migrations 0112 to
0114); Base switchboard (migrations 0013, 0014); acceptance and the
changes the jobs and MCP plans need.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev f2db2c98e9bfdbf737515ee6c8d3b77e63f198ce parent b4d3b19
1 file changed, +942 −0
  • docs/superpowers/plans/2026-11-27-assistant-abilities.md +942 −0

CI passed — run details

CI log
=== build ===
CGO_ENABLED=0 go build ./...
=== vet ===
go vet ./...
=== fmt-check ===
=== staticcheck ===
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./...
=== govulncheck ===
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
No vulnerabilities found.
=== gitleaks ===
9:19AM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
9:19AM INF 1 commits scanned.
9:19AM INF scanned ~2562364 bytes (2.56 MB) in 277ms
9:19AM INF no leaks found
=== budget ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 22 directories within budget
=== script-test ===
scripts/prepare-apps_test.sh
ok   releases lookup failure stops before ship
ok   app owned elsewhere stops the script
ok   apps listing failure stops before create
ok   ambiguous release dir is refused
ok   explicit version resolves the ambiguity
ok   releases match is exact, not substring
ok   shipped version is only promoted, existing app not created
ok   fresh account creates, ships, promotes to edge, enables
ok   failing promote stops the script
ok   ship is retried while uploads are rate limited
all passed
hack/fonts_test.sh
fonts_test: ok
=== test ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./...

receipt: test step 6.796s against a 60s target (the gate's other steps are not in this figure)
receipt: 16 packages ran, 0 cached, 6 without tests, 0 failed
receipt: slow package 6.025s amadan.net/oficina/base/internal/webtest
receipt: slow package 867ms amadan.net/oficina/base/internal/issuer
receipt: slow package 587ms amadan.net/oficina/base/internal/operations
receipt: slow package 182ms amadan.net/oficina/base/internal/consumer
receipt: slow package 166ms amadan.net/oficina/base/internal/web
receipt: slow test 1.51s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot
receipt: slow test 1.08s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce
receipt: slow test 610ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp
receipt: slow test 520ms amadan.net/oficina/base/internal/operations TestOperationsRefusals
receipt: slow test 220ms amadan.net/oficina/base/internal/webtest TestAskZoneAgainOnANewConnection
=== native ===
strings: copy review's strings.json is not here (git-ignored); its comparison skipped
strings: 119 in the catalog, 116 used
worktree-lib_test: ok
diff --git a/docs/superpowers/plans/2026-11-27-assistant-abilities.md b/docs/superpowers/plans/2026-11-27-assistant-abilities.md
new file mode 100644
index 0000000..7058cc6
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-27-assistant-abilities.md
@@ -0,0 +1,942 @@
+# Assistant Abilities: Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** Base's Assistant answers questions about the world (weather, opening hours, news, prices) in the reply, with sources and no card, through an isolated lookup on the Equipo instance; and the Base owner can turn each of seven abilities off for any member, enforced by Equipo wherever the Assistant acts.
+
+**Architecture:** Base keeps the switchboard (per-member rows, audit, owner-only person page) and serves it over the per-member host channel (`GET /api/v1/abilities`, host token only). Equipo fetches, stores and expires each person's copy, and reads it through one function, `switches`, at every enforcement point: `look`, `use`, a send gate bound to the operation, team operations, step start authorization, the last merge and publish checks, Research, connect routes and authenticated provider clients. Lookups are a `web` provider whose one operation, `web_lookup`, takes no input. The instance builds a question pack from the person's own words, has the person's runner write queries and an answer in two tool-less, session-less steps over live-only frames, searches through a swappable `Searcher` (Mojeek, with Brave as fallback), reads pages through a guarded client, and attaches the answer and sources to the reply. The Assistant only ever sees a fixed `shown` result.
+
+**Tech Stack:** Go on both sides (Base `go 1.26`; Equipo as its `go.mod`), chi, SQLite (Base `database/sql`, Equipo GORM), vanilla JS in Base's `internal/look/static/ask.js`, Swift/SwiftUI in `native/apple`, Rastrillo budgets in both repositories.
+
+**Spec:** `docs/superpowers/specs/2026-11-26-assistant-abilities-design.md` on Base branch `assistant-abilities` (revision 8, with Paul's Rulings of 2026-11-27). Section references (§) are to it. Executors read both.
+
+**Repositories and branches (for execution):**
+
+- **Base:** worktree `/home/paulca/.cache/base-abilities`, branch `assistant-abilities` (this plan's branch; implementation branches `abilities-1` … per phase from `origin/main`, checked 2026-11-27 at `685f63c`). Paths in Base tasks are relative to it.
+- **Equipo:** new worktree `/home/paulca/amadan.net/oficina/equipo-abilities`, branches `abilities-2` and `abilities-3` from `origin/main`, checked 2026-11-27 at `9a4d2e47` (production runs `10659d1f`). Paths in Equipo tasks are relative to it.
+
+## Checked against current main (2026-11-27)
+
+The spec cites Base `7b48b69` and Equipo `c2173971`. Both mains have moved. Anchors were re-read at Base `685f63c` and Equipo `9a4d2e47`:
+
+| Spec anchor | Now |
+|---|---|
+| `SetHost` `assistant_tools.go:101-132` | `chat/assistant_tools.go:105` |
+| `remoteCall` (tx) `:256`, `runRemote` | `:256`, `:589`; `Store.remoteCall` `:454`; `ServeRemoteCalls` `:347` |
+| `Registry.list`, `Look`, `Invoke` | `assist/registry.go:72`, `:116`, `:216`; `Forget` `:63` |
+| `Decide` `operation.go:55-70` | `assist/operation.go:58`; `MaxResult = 48<<10` "inside the 64 KB tool frame" |
+| `OnUnconnected` `chat_wiring.go:75-94` | `chat_wiring.go:97`; providers built at `:92` |
+| `Store.Authorize` `runners.go:587-600` | `chat/runners.go:599` |
+| `authorizeResearch`, `toolResearch` | `chat/research.go:726`, `:76`; `toolResearchSecret` `:61` |
+| `dispatchNext` `store.go:642` | `chat/store.go:643`; person-turn note block at `store.go:420` (`openQuestionsNote`) |
+| `authorizeMergeLease` `mergeauth.go:412-447` | `chat/mergeauth.go:417` |
+| `authorizePublish`, `publishRefusal` | `chat/publish.go:297`, `:313`; `answerPublish` `:201`; `answerMerge` `merge.go:116`; `MergeTask` `merge.go:481` |
+| `projectCreated` `tools.go:890-925` | `chat/tools.go:902` |
+| `retryFailed` `handoff.go:1723-1752` | `chat/handoff.go:1723` |
+| Carry on now | `Store.CarryOn` `chat/job_paused.go:203`; Base relay `POST /ask/cards/{id}/carry_on` |
+| Message origin | `messageRecord.Origin`, `originComposer` (`chat/placement_consent.go:12`) |
+| Typed addresses | `websource.Mentions(text) []URL` (`internal/websource/mentions.go:16`) |
+| Readable text | `extractHTML` in `internal/runner/webread/extract.go:89` (moved in Task 3.2) |
+| Runner frame limit | `wire.MaxFrameBytes = 256 << 10`; the 56 KiB answer-step budget (§4.3) stays as specified |
+| `wire.AssistantMessage` (spec §4.6) | There is no such type. The message is `wire.Message` (`internal/wire/api.go:165`) and it gains `Lookups` |
+| `team_add`, `team_ask` | Not on main (jobs plan Tasks 1.10, 2.5). `abilityFor` maps them so they are gated when they land |
+| Base person routes | `/people` in `internal/web/app.go:201`; owner flag `IsOwner` in `people.html` |
+| Base markdown | `richMarkdown` (`internal/web/ask_cards.go:35`), matched by `ask.js` (`TestAskMarkdownMatchesServer`) |
+
+Neither the jobs plan nor the MCP plan has landed any code on either main.
+
+## Plan decisions
+
+- **AD1 Numbers this plan takes** (checked against both `origin/main`s and the two related plans on 2026-11-27).
+ - **Runner protocol 33.** Equipo main has `ProtocolCurrent = ProtocolUnfinishedWork = Protocol32`. `ProtocolLookup = Protocol33` (Task 3.4). The jobs plan's PD1 (30, 31, 32) and the MCP plan's 29 were all taken on main by `ProtocolStuckTasks`, `ProtocolChangeFiles`, `ProtocolUnfinishedWork` and `ProtocolPinnedRelease`, so both of those plans renumber from 33 too. Whichever merges first takes 33, and the others take the next free number at rebase. `TestProtocolLookupIs33` pins the number; the single current-version assertion (`internal/wire/assistant_test.go:84`, today `Spoken(99) == 32`) moves to 33.
+ - **Equipo migrations 0112 and 0114** (and **0113** only if this plan builds the inventory). Main ends at `0111_notification_actions.sql`. Phase 2 takes `0112_assistant_abilities.sql`, phase 3 takes `0113_instance_inventory.sql` (only when MCP Task 7 hasn't landed) and `0114_lookups.sql`. The spec's one migration (§9) is split so that each deploy step carries its own. The jobs plan's 0107 to 0111 and the MCP plan's 0095 to 0106 are all taken on main, so both renumber. The rule for all three plans: take the next free number when the branch is rebased for merge, and never reuse one.
+ - **Base migrations 0013 and 0014.** Main ends at `0012_ask_disconnected.sql`. Phase 1 takes `0013_ask_clients.sql`, with exactly the jobs plan Task 1.17 schema (AD2). Phase 4 takes `0014_abilities.sql` (the spec's `0013_abilities.sql`, renumbered). If the jobs plan's 0013 lands first, this plan doesn't add its own, and phase 4 still takes 0014.
+- **AD2 Pieces shared with the other plans: whichever lands first builds them, in the shape given here.**
+
+ | Piece | Built here in | The other plan's task | The one that lands second |
+ |---|---|---|---|
+ | Base per-member client capabilities: `ask_clients`, `SeeAskClient`, `Base-Client-Capabilities`, `Base-Capabilities` built from a list | Task 1.1 | jobs 1.15, 1.17 | adds its value (`job_actions`) to the list and its deploy switch `BASE_JOB_ACTIONS`, which gates only `job_actions` |
+ | Equipo `noteCapabilities` and `chat_assistant_hosts.capabilities` | Task 2.1 (column), Task 2.4 (recording) | jobs 1.3, 1.4 | drops the column from its migration; `t.capable(person)` is `t.switches(person).Draws(wire.CapJobActions)` (spec §7.1) |
+ | Guarded client `internal/websource/guard` | Task 3.1 | MCP 6 | uses it as is; services pass `Redirects: 0` |
+ | Instance inventory and `EQUIPO_INSTANCE_PREFIXES` | Task 3.1b | MCP 7 | uses it as is |
+ | `EQUIPO_ABILITIES` replacing `EQUIPO_SERVICES_ADD`/`_REVIEW` and `services.PermsFrom(Switches)` | Task 2.4 (config) | MCP 11 is rewritten (spec §7.2) | MCP 11 builds `PermsFrom` on Task 2.4's `Switches` |
+ | Send gate on MCP's `SendPrepared` and recovery | `assist.WithGate` in Task 2.7 | MCP 24, 25 | MCP calls `assist.Gate` in its claim and send (spec §7.2); `TestEveryOperationRequestGated` (Task 2.7) fails until it does |
+
+ This plan doesn't edit the jobs or MCP plan documents. Task 5.3 lists the changes each needs, from spec §7, for whoever executes them.
+- **AD3 One search interface; Mojeek first, Brave as fallback (Ruling Q1).** New Equipo package `internal/websearch`:
+ - `type Searcher interface { Name() string; Search(ctx context.Context, query string, n int) ([]Result, error) }` with `Result{Title, URL, Snippet, Date string}`, and failures as `*websearch.Error{Backend, Class string}`, where `Class` is one of `limit`, `auth`, `unavailable`, `bad_response`. An `Error` never carries a URL, a query or a key, because Go's `*url.Error` would print the Mojeek key, which travels in the query string.
+ - Backends: `mojeek` (`GET https://www.mojeek.com/search?api_key=…&q=…&fmt=json&t=8&date=1`. `response.status` is `"OK"`, or an error text such as `"ERROR: Daily Limit Reached"`, which counts as `limit`. Results come from `response.results[]` `{url, title, desc, date}`) and `brave` (`GET https://api.search.brave.com/res/v1/web/search?q=…&count=8` with `X-Subscription-Token`. Results come from `web.results[]` `{title, url, description, age}`. 429 counts as `limit`, 401 and 403 as `auth`). Both go through the guarded client (Task 3.1). The executor confirms the field names against each vendor's API docs before writing the fixtures.
+ - `Chain{Primary, Fallback Searcher; Usage Usage}` tries the fallback, once per query, when the primary fails for any class, when its monthly cap is spent, or when it returns no results. A failed fallback means no more tries.
+ - Config, all operator-held: `EQUIPO_WEB_SEARCH` (`mojeek` or `brave`), `EQUIPO_WEB_SEARCH_FALLBACK` (`brave`, `mojeek` or empty), `EQUIPO_MOJEEK_KEY`, `EQUIPO_BRAVE_KEY`, `EQUIPO_MOJEEK_MONTHLY_CAP` and `EQUIPO_BRAVE_MONTHLY_CAP` (queries per UTC calendar month, an integer above 0). Keys are stored with `carlos secrets set` from 1Password (vault "Oficina") and never committed. Swapping the backend is a config change. A backend that is named but has no key or no cap is left out. The instance logs `web_search.misconfigured backend=<name>`, never the value. With no usable backend, `web_lookup` isn't listed.
+ - The cap is counted on the instance in `chat_web_search_usage(backend, month, used)` (Task 3.3), incremented in the gate transaction before each request, so it holds even where a vendor has no cap of its own. Once both caps are spent the lookup fails `lookup_limit`. The operator also sets the vendor-side cap where the vendor offers one.
+ - No live API calls in CI. Tests use `websearchtest.Fake` and recorded fixtures served by TLS test servers through the guard's `TestDial`. In a test binary the guard refuses any real dial (Task 3.1, `TestGuardNeverDialsInTests`).
+- **AD4 Try again before the jobs plan.** Spec §6.3's stop row needs a Try again tap. On main the only person-facing resume path is Carry on now (`Store.CarryOn`, Base `POST /ask/cards/{id}/carry_on`, label already approved). Until jobs plan phase 1 lands, the `ability_off` stop row sets `carry_on` when the person holds `build` again, and `Store.CarryOn` on a hand-off with `ability_held_at` runs `resumeAbilityHold`. Base needs no new control. Dropping works by asking the Assistant (`team_cancel`), as for every stopped job today. Once jobs plan phase 1 lands, the same function backs K2 `retry`, and the row gains its Drop it and Dismiss actions (Task 5.3).
+- **AD5 Keys in Base.** Base can't import Equipo's `wire`. `internal/equipo/abilities.go` in Base repeats the seven keys in §3's order. `TestAbilityKeysMatchSpec`, in both repositories, pins the list `web, apps_read, apps_write, build, go_live, services, services_add`.
+- **AD6 Copy before code (spec §9 step 0).** Task 0.1 runs copy review over `scratch-abilities-copy/copy-review/strings.json` (prepared with this plan, submitted by the controller). Code tasks write only approved wording and reference strings by key:
+ - Equipo strings go in `internal/equipo/copy.go` (or the chat package's copy table), marked with `scripts/copy-status.py pending` until approved, so `make copy-release-check` refuses unapproved ones;
+ - Base strings go in templates and `ask.js` with rows in `docs/copy-pending.md`;
+ - native strings go in `native/apple/Sources/BaseKit/Resources/Localizable.xcstrings`.
+
+ Tests assert keys, not wording, except where an approved text is pinned. Model-facing instance texts (spec copy register, last paragraph) are reviewed as code, except the answer step's tone, which is in the copy file.
+- **AD7 The pack's date** is written `2006-01-02, Monday` in the person's zone (`chat_person_zones`). The city is the zone's last path element with underscores as spaces (`Europe/Dublin` gives "Dublin", `America/Argentina/Buenos_Aires` gives "Buenos Aires"), and is empty for `UTC` and `Etc/*`.
+- **AD8 One live call channel.** `lookup_step` is the first instance-to-runner frame that isn't durable. `runnerConn` gains a live queue next to `write`'s command loop, and the instance tracks waiters by `(lookup, stage, nonce)`. `Frame.Durable` doesn't list either new frame, and `TestLookupFramesNotDurable` pins that.
+
+## Global Constraints
+
+- **Switches only narrow.** Every existing gate stays: `Decide`, the `asked` check, merge authority, the owner's Publish, Research's Allow and MCP's outbound rule. No switch, header, fallback or error ever widens what may happen (§2 anti-goals, §5.3).
+- **Defaults on.** Every key is on for every member. The Base owner always holds every ability and is the admin (`canAdminister`). Reviewing services is owner-only and isn't on the board (§3).
+- **Errors deny.** A read error, a missing copy, a revoked copy or one more than 10 minutes past `confirmed_at` refuses every switched operation `unavailable` (§5.3).
+- **Timings (§5.3):** fetch bound 5 s; refresh when `confirmed_at` is older than 60 s; housekeeping refresh every 60 s for people with a running turn or an unfinished job; expiry 10 min; hint throttle 5 s.
+- **Lookup caps (§4.2):** 2 per turn, 100 per person in a rolling 24 h, 1 request per second per host from the instance, 2 queries of at most 200 characters, 8 results per query, 3 reads, at most 5 sources, at most 2 lookups per reply, a pack of at most 4 KiB, 2 earlier lookup turns within 30 min, an answer of at most 1,200 characters, a step timeout of 20 s, a 40 s end-to-end limit with about 15 s as the target.
+- **Guarded client (§4.3):** https on 443 only; an `http://` the person typed is tried once as https; `websource.CheckHost` plus the deny list; every DNS answer must pass `websource.PublicAddress` and lie outside the inventory; the dial goes to the checked IP with a `Control` re-check; no keep-alive; at most 5 redirects for lookups and none for services; `GET` only; headers `User-Agent: OficinaLookup/1`, `Accept`, `Accept-Encoding: gzip` (plus the backend's key header for searches); no cookies, `Authorization`, `Referer` or environment proxy. Time limits: 5 s connect, 10 s to first byte, 15 s per request, 25 s per page with its redirects, 10 s per search. Size limits: headers 32 KiB, bodies 2 MiB decompressed, URLs 2 KiB. Types sniffed: HTML, text, JSON, XML, RSS and Atom.
+- **Answer step budget (§4.3):** serialized input at most 56 KiB; snippets at most 300 bytes and titles at most 200 bytes, cut at a character boundary; page text at most 16 KiB, then the lowest-ranked page is cut first; `truncated` is set whenever anything was cut.
+- **Never stored:** page text, snippets and the pack. Never logged: a query, a URL path, a person's words or a key. Refusals log the rule and the registrable domain only (§4.3, §4.7).
+- **Outcomes, not machinery.** No Equipo, team, runner, task, branch, merge, repository, MCP, server or token in any Base-visible string. The reply test runs the jobs plan's `machinery_words` list (Equipo, team, Coordinator, runner, task, branch, merge, check, repository, Amadan) where it exists, or this plan's copy of it in `internal/thintest/machinery_words.go` (Task 3.10).
+- **Base pages work with scripts off** (spec 12.5), with no windows or OS chrome (18.2).
+- **Every API change is additive.** An older Base, runner or app keeps today's behaviour or better, and is never shown a switch that isn't enforced (§9, "Versions in between").
+- **Gates:**
+ - Equipo: `make ci` green, including `copy-release-check`, `migration-check` and `budget`;
+ - Base: `make ci` and `make browser` green, and `make native-check` on a Mac with Xcode for native tasks;
+ - budgets are updated in `.rastrillo/budgets.txt` in the commit that grows a file.
+- **Shared machine:** servers bind `127.0.0.1`; scratch goes under `$TMPDIR`; `GOCACHE` stays at its default; run targeted `go test ./pkg -run TestX` while iterating, and full suites once per task before committing.
+- **Commits:** subject under 80 characters, a blank line, a body, then `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`.
+
+## Review Focus
+
+1. **A Mojeek key leaking through an error.** The Mojeek key rides in the query string, and Go's `*url.Error` prints the full URL. A transport failure, a timeout or a redirect refusal must never put the key in a log, an audit row, a tool result or a stored `code`. Test: `TestSearchErrorsNeverCarryKey` (Task 3.3). It forces each failure class with a key `KEY-SENTINEL` and asserts the sentinel is absent from the returned error, the captured `slog` output and the stored lookup row.
+2. **Odd zones and dates in the pack.** `UTC`, `Etc/GMT+1`, an empty zone, `America/Argentina/Buenos_Aires`, and a turn at 23:59:59 local time across a DST change all need to work. The person expects "today" to be their own today, and no city made up when there isn't one. Test: `TestPackZoneCityAndDate` (Task 3.6).
+3. **The same toggle twice, or from two tabs** (a double click with scripts, a form resubmitted after Back). The person expects one audit row, one revision bump, and a status line that matches what is saved, never a 500. Test: `TestAbilityToggleTwiceOneAudit` (Task 4.1, store) and `TestAbilityTogglePostedTwice` (Task 4.3, webtest).
+4. **A typed address that isn't a page**: `ftp://x`, `http://192.168.1.1`, `bit.ly/x` redirecting to a private address, a 2 MiB PDF, `example.com:8080`, a URL over 2 KiB. Each gets an honest `nothing_found` or `lookup_unsupported`, never a request to a private network and never a hang. Test: `TestTypedAddressesRefusedOrSkipped` (Task 3.7).
+5. **A member removed or reconnected while a lookup is in flight.** The next search or read after the 401 revoke is refused, and the reply still commits with what was already shown. Test: `TestRevokedMidLookupStopsNextRequest` (Task 3.7).
+
+## Deploy order and switches
+
+| Step | Repo | What | What keeps old clients safe |
+|---|---|---|---|
+| 0 | both | Copy review (Task 0.1); operator prepares keys and caps (Task 0.2) | Nothing ships before it |
+| 1 | Base | Phase 1: draw lookup answers on the web and native; read-time fallback for native requests without the client header; `lookup_answers` in `Base-Capabilities` per member | Harmless alone: no Equipo sends `lookups` yet. An old Equipo ignores the header value |
+| 2 | Equipo | Phase 2: enforcement (migration 0112) | Old Base: the board 404s and operations 200, so the defaults apply as `legacy` and are renewed (today's behaviour); `PUT host` still succeeds by the same rule. On an instance without `EQUIPO_ASSISTANT_HOSTS`, Equipo owners are admin |
+| 3a | Equipo | Phase 3 instance with protocol 33 known, deployed with `EQUIPO_ABILITIES=web=off` | `web_lookup` isn't listed to a runner below 33, to a person whose Base hasn't sent `lookup_answers`, before the inventory is confirmed, or without a usable backend |
+| 3b | Equipo | Runners (`upgrade-thin.sh`) | `Encode` refuses `lookup_step` below 33 |
+| 3c | operator | Set and confirm `EQUIPO_INSTANCE_PREFIXES`; store keys and caps; remove `web=off`; run the weather check (Task 3.11) | |
+| 4 | Base | Phase 4: the switchboard (migration 0014) | Equipo enforces from step 2, so the person page never promises what isn't enforced. If an environment gets step 4 before step 2, the lead line reads `abilities.later` (Task 4.3) |
+| 5 | both | Jobs plan phase 1 with spec §7.1's changes, or §7.1's card rows if it landed first (Task 5.3); then MCP S1 and S2 with §7.2's changes | |
+
+Each step goes to staging (`*.oncarlos.com`) first, then to production (`*.oficina.works`) after Paul's live check. The versions in between are tested as deployed (Tasks 2.13, 3.10, 4.8). The planner deploys nothing.
+
+---
+
+## Phase 0. Copy and operator preparation
+
+### Task 0.1: Copy review
+
+**Files:** `/home/paulca/amadan.net/carlos/base/scratch-abilities-copy/copy-review/strings.json` (prepared with this plan: the spec's copy register plus the strings this plan adds, marked `PLAN` in their notes), then the spec's copy register and `docs/copy-pending.md`.
+
+- [ ] **Step 1:** The controller submits `strings.json` through the `copy-review` skill and waits for Paul's edits.
+- [ ] **Step 2:** Apply the returned text verbatim to the spec's copy register (a commit on `assistant-abilities`), and add every Base key to `docs/copy-pending.md` with its approved text.
+- [ ] **Step 3:** Commit `Abilities copy: Paul's reviewed wording`. No code task starts before this commit exists.
+
+### Task 0.2 (operator): Search keys, caps and retention
+
+Nothing here goes in a repository. The values are never printed.
+
+- [ ] **Step 1:** Put the Mojeek API key in 1Password, vault "Oficina", item "Mojeek Search API". Ask Mojeek in writing for zero retention of queries on this key, and keep the reply with the item.
+- [ ] **Step 2:** Create the Brave Search API key, set a monthly limit in Brave's dashboard, and store it in the same vault as "Brave Search API".
+- [ ] **Step 3:** Choose the monthly caps (queries) for each backend, for staging and for production, and record them in the items' notes.
+- [ ] **Step 4:** Done when both items exist and the caps are recorded. The keys are installed on the instance in Task 3.11.
+
+## Phase 1. Base draws lookup answers (Base)
+
+### Task 1.1 (Base): Client capabilities per member (shared with the jobs plan, AD2)
+
+**Files:**
+- Create: `internal/store/migrations/0013_ask_clients.sql`, `internal/store/askclients.go`, `internal/web/ask_caps.go`, `internal/equipo/abilities.go` (`CapLookupAnswers = "lookup_answers"`, `KnownCapabilities`; Task 1.2 adds the keys)
+- Modify: `internal/equipo/equipo.go` (`call`, and `Events`'s own request), `internal/web/ask_relay.go`, `docs/api/base-native-v1.md`
+- Test: `internal/store/askclients_test.go`, `internal/webtest/ask_caps_test.go`
+
+**Interfaces:**
+- Produces:
+ - `CREATE TABLE ask_clients (member_id integer NOT NULL, client text NOT NULL, caps text NOT NULL DEFAULT '', seen_at datetime NOT NULL, PRIMARY KEY (member_id, client))`, byte for byte the jobs plan's. `member_id` is the member number (`member_numbers`, `store.MemberNumber`).
+ - `func SeeAskClient(ctx context.Context, db *sql.DB, member int64, client, caps string) error` and `func AskClients(ctx context.Context, db *sql.DB, member int64, since time.Time) ([]AskClient, error)`, package functions like the rest of `internal/store`.
+ - `func (a *app) askCaps(ctx context.Context, member int64) []string` returns each value of `equipo.KnownCapabilities` (today `[]string{equipo.CapLookupAnswers}`; the jobs plan appends `job_actions` behind `BASE_JOB_ACTIONS`). A value is withheld while any native client of the member seen in the last 30 days last called without it.
+ - `func WithCapabilities(ctx context.Context, caps []string) context.Context` in `internal/equipo`, which sets `Base-Capabilities: <comma-joined>` on every call and on `Events`.
+ - `func clientCaps(r *http.Request) (native bool, caps []string)`, which reads `Base-Client-Capabilities` on native `/ask/*` requests.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestSeeAskClientNewest` (store): the newest caps per client win.
+ - `TestAskCapsWebOnly`: a member with no native rows gets `lookup_answers`.
+ - `TestAskCapsWithheldForOldNative`: a native call without the header withholds it for 30 days, a newer call with it restores it, and so does a row older than 30 days.
+ - `TestCapabilityHeaderOnEveryCall`: snapshot, events, messages, answer, carry_on and time-zone calls each carry the header, and `RegisterHost`'s body is unchanged.
+- [ ] **Step 2:** Run `go test ./internal/store ./internal/webtest -run 'AskClient|AskCaps|CapabilityHeader' -count=1`. Expected: FAIL (undefined).
+- [ ] **Step 3:** Implement. Web cookie sessions aren't recorded. Every relayed call in `ask_relay.go` wraps its context with `equipo.WithCapabilities(ctx, a.askCaps(ctx, n))`, where `n` is `store.MemberNumber` of the signed-in member.
+- [ ] **Step 4:** Run the same. Expected: PASS.
+- [ ] **Step 5:** Commit `Ask: record each app's capabilities; send Base-Capabilities per member`.
+
+### Task 1.2 (Base): The Equipo client carries lookups
+
+**Files:** `internal/equipo/chat.go`, `internal/equipo/abilities.go` (adds `AbilityKeys`, AD5), `internal/equipo/equipo_test.go`.
+
+**Interfaces:**
+- Produces: `type Lookup struct { Answer string `json:"answer"`; Sources []Source `json:"sources"` }`; `type Source struct { URL, Title string }`; `Message` gains `Lookups []Lookup `json:"lookups,omitempty"``; `func (m Message) Clean() Message`; `func (m Message) PlainLookups() Message`, which folds the lookups into `Text` as `\n\n<answer>\n\n<ask.fallback_sources>\n<url>` per source (Base's own copy of the fallback label) and sets `Lookups` to nil; `const MaxLookupAnswer = 1200`, `MaxLookupSources = 5`, `MaxLookupTitle = 120`, `MaxLookups = 2`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestCleanLookupBounds`: an answer of 1,200 characters is kept and one of 1,201 is dropped; 6 sources are cut to 5; a title of 121 characters is cut to 120 at a rune boundary; 3 lookups are cut to 2.
+ - `TestCleanLookupHTTPSOnly`: `http:`, `javascript:` and relative URLs are dropped.
+ - `TestPlainLookupsFolds`.
+ - `TestAbilityKeysMatchSpec` (AD5).
+- [ ] **Step 2:** Run `go test ./internal/equipo -run 'Lookup|AbilityKeys' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. `Clean` is applied wherever messages are decoded (snapshot, events, message page).
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Equipo client: lookups on a message, cleaned and bounded`.
+
+### Task 1.3 (Base): Fake Equipo sends lookups
+
+**Files:** `internal/equipo/equipotest/chat.go`, `internal/webtest/fake_lookup_test.go` (new).
+
+**Interfaces:** Produces `(f *Fake) ReplyWithLookups(turn, text string, lookups ...equipo.Lookup)`. The fake serves `lookups` only to calls carrying `Base-Capabilities` with `lookup_answers`, and otherwise the plain-text fallback, as Equipo does (Task 3.9).
+
+- [ ] **Step 1: Failing test** `TestFakeLookupFallbackWithoutCapability`.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run TestFakeLookup -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Fake Equipo: replies with lookups and the plain fallback`.
+
+### Task 1.4 (Base): The answer and its sources drawn on the server
+
+**Files:** `internal/web/templates/partials/chat.html`, `internal/web/ask_cards.go` (`func (v askView) LookupAnswer(text string) template.HTML` and `func sourceHost(u string) string`), `internal/look/static/*.css` (the quiet Sources line), `internal/webtest/ask_lookup_test.go` (new).
+
+**Interfaces:** Consumes `Message.Lookups` (Task 1.2). `LookupAnswer` is `richMarkdown(text, true)` with links rendered as their text.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestLookupDrawn` (scripts off): the answer is escaped, a Markdown link in it is shown as text, the Sources line is labelled with key `ask.sources`, and each source is a link with `target="_blank" rel="noopener noreferrer nofollow"` and its host after it.
+ - `TestTwoLookupsDrawnInOrder`.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run 'TestLookupDrawn|TestTwoLookups' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement: after the reply's text, each answer, then its Sources line.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Ask: draw a lookup's answer and sources under the reply`.
+
+### Task 1.5 (Base): `ask.js` draws lookups from the message event
+
+**Files:** `internal/look/static/ask.js`, `internal/browsertest/ask_lookup_test.go` (new).
+
+- [ ] **Step 1: Failing browser tests:**
+ - `TestAskLookupMatchesServer`: the DOM drawn from a `message` event equals the server-drawn HTML, for a fixture with two lookups, a link in an answer and a multibyte title.
+ - `TestAskLookupSourcesNewTab`.
+- [ ] **Step 2:** Run `make browser` (or `go test ./internal/browsertest -run AskLookup -count=1`). Expected: FAIL.
+- [ ] **Step 3:** Implement with the existing markdown routine and the existing safe-link rules.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Ask: draw lookups live as they arrive`.
+
+### Task 1.6 (Base, native): Lookups in the Mac and iPhone app
+
+**Files:** `native/apple/Sources/BaseKit/` (message model and reply view), `Localizable.xcstrings` (`ask.sources`), `native/apple/Tests/` (new tests), `internal/web/ask_relay.go` (fold for native requests without the client header), `docs/api/base-native-v1.md`.
+
+- [ ] **Step 1: Failing tests:**
+ - `testLookupAnswerAndSources` and `testClientCapabilityLookup` (native): the app sends `Base-Client-Capabilities: lookup_answers`;
+ - `TestNativeWithoutClientHeaderGetsPlainLookups` (webtest): `/ask/state` and `/ask/events` answers to a native request without the header carry `PlainLookups()`, never `lookups`.
+- [ ] **Step 2:** Run `make native-check` and `go test ./internal/webtest -run TestNativeWithoutClientHeader -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS. Without a Mac with Xcode, hand the native half to someone who has one (jobs plan PD10). The web half still ships.
+- [ ] **Step 5:** Commit `Native: draw lookup answers and say so to Base`.
+
+### Task 1.7 (Base): Phase 1 gates
+
+- [ ] **Step 1:** Run `make ci` and `make browser`. Expected: both green. Run `make native-check` where available.
+- [ ] **Step 2:** Push `abilities-1`, review, merge, and deploy to staging, then production after Paul's check (deploy step 1).
+
+## Phase 2. Equipo enforcement first (Equipo)
+
+### Task 2.1 (Equipo): Keys, wire types and storage
+
+**Files:**
+- Create: `internal/wire/abilities.go`, `internal/wire/abilities_test.go`, `internal/equipo/migrations/0112_assistant_abilities.sql`, `internal/equipo/chat/abilities_store.go`
+- Modify: `internal/equipo/migrations/schema.sql`, `internal/equipo/chat/models.go` (register records), `internal/equipo/chat/handoff.go` (`handoffRecord.AbilityHeldAt *time.Time`)
+
+**Interfaces:**
+- Produces:
+ - In `wire`: `AbilityWeb … AbilityServicesAdd` (spec §5.5); `var Abilities = []string{…}` in §3's order; `CapJobActions = "job_actions"`, `CapLookupAnswers = "lookup_answers"`; the codes `CodeAbilityOff = "ability_off"`, `CodeAbilityUnmapped = "ability_unmapped"`, `CodeOperationChanged = "operation_changed"`, `CodeHostUnverified = "host_unverified"`, `CodeHostElsewhere = "host_elsewhere"`, `CodeResearchOff = "research_off"`.
+ - `type AbilityBoard struct { Revision int64 `json:"revision"`; Admin bool `json:"admin"`; Ask string `json:"ask"`; Abilities map[string]bool `json:"abilities"` }`, which is Base's answer.
+ - `type AssistantAbilities struct { Abilities map[string]bool `json:"abilities"`; Fixed []string `json:"fixed"`; Ask string `json:"ask"` }`.
+ - `type AbilitiesRefreshed struct { Revision int64 `json:"revision"` }`.
+ - Migration:
+
+```sql
+CREATE TABLE chat_assistant_abilities (person text NOT NULL, origin text NOT NULL, revision integer NOT NULL,
+ abilities text NOT NULL, admin boolean NOT NULL DEFAULT 0, ask text, source text NOT NULL,
+ fetch_seq integer NOT NULL, confirmed_at datetime, revoked_at datetime,
+ authoritative_seen boolean NOT NULL DEFAULT 0, PRIMARY KEY (person, origin));
+ALTER TABLE chat_handoffs ADD COLUMN ability_held_at datetime;
+ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if jobs plan 1.3 landed first (AD2)
+```
+
+ - `abilitiesRecord` (GORM, table above), with `func (r abilitiesRecord) board() (wire.AbilityBoard, error)`.
+ - `const SourceBase = "base"`, `SourceLegacy = "legacy"`.
+
+- [ ] **Step 1: Failing tests:** `TestAbilityKeysMatchSpec` (AD5); `TestAbilityBoardIgnoresUnknownKeys` (decode `{"abilities":{"web":true,"future":false}}` and keep only known keys); `TestMigrationModels` (existing, must stay green).
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/wire ./internal/equipo/chat -run 'AbilityKeys|AbilityBoard|MigrationModels' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement, and regenerate `schema.sql`.
+- [ ] **Step 4:** Run the tests and `make migration-check`. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: keys, Base's board on the wire, and its storage`.
+
+### Task 2.2 (Equipo): Fetching the board from Base
+
+**Files:** `internal/equipo/chat/abilities_fetch.go` (new), `internal/equipo/chat/abilities_fetch_test.go` (new), `internal/equipotest/base.go` (fake Base: `/api/v1/abilities` and `/api/v1/operations` with a scripted status per call).
+
+**Interfaces:**
+- Consumes: `Store.Host(ctx, person) (origin, token string, ok bool, err error)` (`assistant_tools.go:146`).
+- Produces:
+ - `func (s *Store) fetchBoard(ctx context.Context, origin, token string) (board wire.AbilityBoard, outcome fetchOutcome, err error)`, where `fetchOutcome` is one of `fetchOK`, `fetchLegacy` (a 404 with operations 200, considered only when the caller says `authoritative_seen` is false), `fetchRevoked` (401 from either route) or `fetchFailed`. The bound is 5 s, and the route is `GET <origin>/api/v1/abilities` with `Authorization: Bearer <host token>`.
+ - `func (s *Store) RefreshAbilities(ctx context.Context, person string) (revision int64, fresh bool, err error)`: one fetch per person at a time (a per-person mutex), `fetch_seq` taken before the request, and the result applied by the §5.3 table in one transaction. It reports `fresh` when it applied a 200 or a legacy renewal.
+- Audits: `assistant.abilities.revision_down`, `assistant.abilities.revoked`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilitiesFetchApplies200`: `confirmed_at` is set and `authoritative_seen` becomes true.
+ - `TestUnchangedBoardStaysConfirmed`.
+ - `TestLegacyPromotedByAnyRevision`.
+ - `TestStaleFetchDoesNotOverwrite`: two fetches overlap and the older one's answer arrives last.
+ - `TestRevisionDownAudited`.
+ - `TestAbilities401RevokesAtOnce`.
+ - `TestAbilities404AfterBoardIsFailure`.
+ - `TestLegacyBaseAcrossExpiry`: three 10-minute periods of operations-only renewals, then a 200, then a 404, which counts as a failure.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'Abilities|Legacy|StaleFetch|RevisionDown|UnchangedBoard' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. The fetch runs outside any transaction.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: fetch each person's board from Base and apply it`.
+
+### Task 2.3 (Equipo): `PUT host` verifies before it counts
+
+**Files:** `internal/equipo/chat/assistant_tools.go` (`SetHost`), `internal/equipo/chat/assistant_http.go` (409 answers), `internal/thintest/assistant_host_contract_test.go`.
+
+**Interfaces:** `SetHost` first calls `fetchBoard` with the offered token (5 s, outside the transaction), then commits the host and the board together. It answers 409 `host_unverified` for any other outcome, and 409 `host_elsewhere` under §5.3's "One Base at a time" rule. Audit: `assistant.host`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilitiesFetchOnHost`.
+ - `TestHostUnverifiedRefused`: an invalid token, a 401, a 5xx, and a 404 after a board was stored are each refused, and the earlier registration and board stay.
+ - `TestHostLegacyAccepted`: an old Base, board 404 and operations 200, stores the defaults as `legacy`.
+ - `TestHostElsewhereRefused`: §10.1's three cases.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/thintest -run 'OnHost|HostUnverified|HostLegacy|HostElsewhere' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. `Registry.Forget(person)` runs on a committed change, as today.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `PUT host: verify the token with Base before it counts`.
+
+### Task 2.4 (Equipo): `switches`, the operator's fixed keys, and capability recording
+
+**Files:**
+- Create: `internal/equipo/chat/switches.go`, `internal/equipo/chat/switches_test.go`, `internal/equipo/chat/capability.go`
+- Modify: `internal/equipo/config.go` (`EQUIPO_ABILITIES`), `internal/equipo/chat/assistant_http.go` (`noteCapabilities` first in every `MountAssistant` route)
+
+**Interfaces:**
+- Produces:
+ - In `switches.go`: `type Switches` exactly as in spec §5.5; `func (t *txn) switches(person string) (Switches, error)`; `func (s Switches) Can(ability string) bool`; `func (s Switches) Admin() bool`; `func (s Switches) Draws(capability string) bool`; `func (s Switches) Off() []string` (the keys that are off, in §3's order); `func (s Switches) Ask() string`.
+ - `type Fixed map[string]string`, with values `off` or `owners`, parsed from `EQUIPO_ABILITIES` as `key=off,key=owners`. An unknown key or value refuses boot through the existing config error path, with an operator log line and no new copy.
+ - `Can(k)` is the conjunction of:
+ - the stored copy (missing, revoked, or more than 10 minutes past `confirmed_at` denies);
+ - the operator's fixed value (`owners` passes only when `admin`);
+ - the implications (`apps_write` needs `apps_read`, `services_add` needs `services`).
+
+ With `EQUIPO_ASSISTANT_HOSTS` set and no verified host, everything switched is off. With it unset, the defaults apply and an Equipo owner is `admin`.
+ - `func (h *HTTP) noteCapabilities(r *http.Request, p personapi.PersonPrincipal)` and `func (s *Store) SetCapabilities(ctx, person, value string) error`, which writes only on change.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestSwitchesDefaultsWithoutHosts`.
+ - `TestNoVerifiedHostNothingSwitched`.
+ - `TestAbilitiesExpireAfter10Minutes`.
+ - `TestAbilitiesOperatorFixed`: `web=off` turns `web` off for the owner too, and `services_add=owners` gives a member false and the admin true.
+ - `TestAppsWriteImpliesRead`.
+ - `TestSwitchesReadInsideTx`: a board update between two reads in one transaction isn't seen, and a read error denies.
+ - `TestCapableButNotAllowed`: `Draws(job_actions)` true with `Can(build)` false.
+ - `TestCapabilityRecordedWithoutPutHost`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/equipo -run 'Switches|NoVerifiedHost|Expire|OperatorFixed|ImpliesRead|CapableBut|CapabilityRecorded' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: one switches() read, operator fixed keys, capabilities`.
+
+### Task 2.5 (Equipo): When the board is refreshed, and the hint
+
+**Files:** `internal/equipo/chat/abilities_refresh.go` (new), `internal/equipo/chat/store.go` (person-turn start), `internal/equipo/chat/housekeeping.go` (60 s pass), `internal/equipo/chat/assistant_http.go` (two routes), and the out-of-turn entry points: `internal/equipo/oficina_connect.go` (`/oficina/connect*`), and `/services/*` and MCP's dispatcher once MCP lands.
+
+**Interfaces:**
+- Produces:
+ - `func (s *Store) refreshIfStale(ctx context.Context, person string) error`, which runs a refresh when `confirmed_at` is older than 60 s (5 s bound, outside the acting transaction);
+ - `POST /api/v1/assistant/abilities/refresh` (person bearer, empty body), which answers 200 `wire.AbilitiesRefreshed`, or 202 when the fetch failed or one ran less than 5 s ago;
+ - `GET /api/v1/assistant/abilities`, which returns the caller's own `wire.AssistantAbilities`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilitiesHintFetches`.
+ - `TestAbilitiesTurnStartRefresh`.
+ - `TestAbilitiesActiveRefreshEvery60s`: a long-running turn and an unfinished job are both refreshed, and an idle person isn't.
+ - `TestIdleEntryPointRefreshes`, with `/oficina/connect` as the entry point here; MCP adds `/services/*`.
+ - `TestOwnAbilitiesRoute`: the route shows fixed keys and `ask`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/thintest -run 'Hint|TurnStartRefresh|Every60s|IdleEntryPoint|OwnAbilities' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: refresh at turn start, every minute, before acts; the hint`.
+
+### Task 2.6 (Equipo): `abilityFor`, `look`, `use`, and the turn's note
+
+**Files:** `internal/equipo/chat/ability_map.go` (new), `internal/equipo/assist/registry.go` (`Look` and `list` take a filter), `internal/equipo/chat/assistant_tools.go` (`remoteCall` tx check, refusal), `internal/equipo/chat/store.go:420` (note block), `internal/equipo/chat/abilities_note.go` (new).
+
+**Interfaces:**
+- Produces:
+ - `func abilityFor(op assist.Operation) (key string, ok bool)`, the spec §6.1 table. `team_status`, `team_cancel`, the `base_*` reads and `ask_person` return `("", true)`. An unknown provider returns `ok == false`.
+ - `type Filter func(op assist.Operation) bool`, so `(r *Registry) Look(ctx, person, query string, keep Filter)` and `list(ctx, person, keep Filter)`. `list` skips a provider whose whole key is off before calling its `List`.
+ - The refusal text (model-facing, reviewed as code), filled with the plain name and `Ask()`: `abilityOffText(name, ask string) string`.
+ - `func (t *txn) abilitiesNote(person string, listed bool) (string, error)`, which writes the two §6.1 note lines, in place of nothing.
+ - Plain names come from Equipo copy keys `assistant.ability.<key>.name`, which carry the same approved text as Base's `abilities.<key>.name`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestLookHidesOffOperations`.
+ - `TestUseRefusesAbilityOff`: table over every row of `abilityFor`.
+ - `TestUnmappedOperationRefused`.
+ - `TestListSkipsOffProvider`: the provider's `List` isn't called.
+ - `TestTurnNoteFollowsSwitches`.
+ - `TestUseAuditsCode`: `assistant.use` records `ability_off`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/equipo/assist -run 'LookHides|UseRefuses|Unmapped|ListSkips|TurnNote|UseAudits' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. The per-person list cache is dropped (`Forget`) when the stored board changes.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: look and use follow the switches; one map of keys`.
+
+### Task 2.7 (Equipo): The send gate, and authenticated clients
+
+**Files:** `internal/equipo/assist/gate.go` (new), `internal/equipo/assist/http.go`, `internal/equipo/assist/oficina.go`, `internal/equipo/assist/registry.go` (`Invoke` installs it), `internal/equipo/chat/assistant_tools.go` (`runRemote` builds the bound gate), `internal/equipo/assist/gate_test.go`, `internal/equipo/chat/send_gate_test.go`.
+
+**Interfaces:**
+- Produces:
+ - `type GateFunc func(op Operation) error`, `func WithGate(ctx context.Context, f GateFunc) context.Context` and `func Gate(ctx context.Context, op Operation) error`. With no gate on the context, `Gate` refuses `ability_unmapped`, so a missing gate fails closed.
+ - Every provider calls `Gate` immediately before the request that performs the operation: in `http.go` before the operation's `POST`, in `oficina.go` after `teams` and before the `POST`, and (Task 3.7) before each search and read.
+ - The bound gate is `func (s *Store) sendGate(person string, bound assist.Operation) assist.GateFunc`: one short transaction reads `switches`, and the gate refuses `operation_changed` when `op` differs from `bound` in provider, name, `ReadOnly` or `Scope`.
+ - `func (s *Store) clientAllowed(ctx, person, key string) error` is called by the Oficina connection read and token refresh before any authenticated request. Revocation and Disconnect are exempt.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestSendGate`: the switch goes off at each of §10.1's four points and nothing is sent; switched off after the gate passed, that request completes and the next is refused.
+ - `TestGateBindsOperation`.
+ - `TestGateMissingFailsClosed`.
+ - `TestEveryOperationRequestGated`: walks each provider with a recording `http.RoundTripper` and fails if a request that performs an operation is made without a `Gate` call just before it.
+ - `TestPausedConnectionMakesNoRequest`, for Oficina with `apps_read` off; MCP extends it to services.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/assist ./internal/equipo/chat -run 'Gate|PausedConnection' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: a bound gate before every request that performs an operation`.
+
+### Task 2.8 (Equipo): Connect cards and the Oficina connect routes
+
+**Files:** `internal/equipo/chat_wiring.go` (`OnUnconnected`), `internal/equipo/oficina_connect.go` (`/oficina/connect` and `/oficina/connect/finish`), `internal/equipo/oficina_connect_abilities_test.go` (new).
+
+- [ ] **Step 1: Failing tests:**
+ - `TestOficinaConnectNeedsAppsRead`: no card is raised, and `POST /oficina/connect` and `/finish` answer 403 `ability_off`.
+ - `TestExistingOficinaConnectionKeptUnused`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/... -run 'OficinaConnectNeeds|KeptUnused' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. The connect card is raised only when the person has `apps_read`.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: Oficina connect needs apps_read`.
+
+### Task 2.9 (Equipo): `build`: team operations, step starts and job lanes
+
+**Files:** `internal/equipo/chat/handoff.go` (`teamRequest`, `teamReply`, `teamNudge`), `internal/equipo/chat/runners.go` (`Authorize`), `internal/equipo/chat/store.go` (`dispatchNext`), `internal/equipo/chat/runner.go` (the dispatch after a reconnect), `internal/equipo/chat/tools.go` (work-changing Coordinator tools, `projectCreated`), `internal/equipo/chat_page.go` (`chatCardAnswer`, refusing with `chat.card.ability_off`), `internal/equipo/chat/ability_hold.go` (new), `internal/equipo/chat/build_off_test.go` (new).
+
+**Interfaces:**
+- Produces:
+ - `func (t *txn) buildAllowed(h handoffRecord) (bool, error)`, which reads `switches(h.Person).Can(build)`;
+ - `func (t *txn) holdForAbility(h handoffRecord) error`, which sets `ability_held_at` once;
+ - `func (t *txn) abilityHeld(h handoffRecord) bool`, which every shared dispatch path checks first;
+ - the Coordinator-facing refusal text `buildOffCoordinatorText` (spec §6.3, reviewed as code).
+- `projectCreated` accepts a report bound to an authorisation recorded before the hold, and refuses an unbound one.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestBuildOffRefusesStart`.
+ - `TestJobLaneTurnsHeld`.
+ - `TestTasklessJobHoldResumes` (with Task 2.10's resume).
+ - `TestProjectCreatedAfterSwitchOff`.
+ - `TestHeldWorkIgnoresSwitchAndReconnect`: `build` goes back on and the runner reconnects, and nothing is dispatched.
+ - `TestTeamOpsRefusedBuildOff`: `team_request`, `team_reply` and `team_nudge` are each refused `ability_off`, and `team_status` and `team_cancel` still run.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'BuildOff|JobLaneTurnsHeld|TasklessJob|ProjectCreatedAfter|HeldWork|TeamOpsRefused' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. The sweep and housekeeping skip a person without `build` and don't count them against caps.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: build off holds a person's jobs at the next step`.
+
+### Task 2.10 (Equipo): The stop row, and Try again resumes the hold
+
+**Files:** `internal/equipo/chat/jobs.go` (`jobState` and `jobView` read `ability_held_at`), `internal/equipo/chat/job_paused.go` (`CarryOn` on a held hand-off, AD4), `internal/equipo/chat/ability_hold.go` (`resumeAbilityHold`), `internal/equipo/copy.go` (`assistant.job.detail.ability_off`, pending until Task 0.1), `internal/equipo/chat/ability_hold_test.go`.
+
+**Interfaces:**
+- Produces: the job state `stopped`, with result copy "Stopped" (the approved key) and detail `assistant.job.detail.ability_off` filled with `Ask()`. `carry_on` is true only while the person holds `build`. `func (t *txn) resumeAbilityHold(h handoffRecord, rev int64, key string) error` is idempotent per card revision and key. It clears the hold, makes a refused attempt a fresh one, makes undispatched steps eligible, and dispatches the lane's waiting turns in order.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilityHoldResumes`: a double tap resumes once.
+ - `TestBuildOffStopRowHasCarryOn`, AD4's form of T1: `carry_on` with `build` on, and no `carry_on` (Detail only) with it off.
+ - `TestCarryOnRefusedWithoutBuild`: 403 `ability_off` with the card.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'AbilityHold|StopRow|CarryOnRefused' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: a held job says why, and Carry on resumes it`.
+
+### Task 2.11 (Equipo): `go_live`: taps, automatic merging and the last checks
+
+**Files:** `internal/equipo/chat/merge.go` (`answerMerge`, `MergeTask`), `internal/equipo/chat/publish.go` (`answerPublish`, `publishRefusal` gains `ability_off`), `internal/equipo/chat/mergeauth.go` (`authorizeMergeLease`; merge authority skips the task), `internal/equipo/chat/jobs.go` (the ready projection: no go or publish option, detail `assistant.job.detail.go_live_off`), `internal/equipo/chat/go_live_off_test.go`.
+
+**Interfaces:** Produces `func (t *txn) goLiveAllowed(taskID string) (bool, error)`, which is true when the task has no hand-off; otherwise the answering person and the hand-off's person must both hold `go_live`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestGoLiveOffRefusesEveryPath` (`answerMerge`, `answerPublish`, `MergeTask`).
+ - `TestGoLiveOffNoAutoMerge`.
+ - `TestGoLiveOffAfterApproval`.
+ - `TestGoLiveOffReadyProjection`: "Ready to try" with the detail, a preview link, and no go or publish option.
+ - `TestEquipoPageWorkOutsideBoard`: work with no hand-off is unaffected.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'GoLiveOff|EquipoPageWork' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: go_live checked at the tap and at the last merge and publish`.
+
+### Task 2.12 (Equipo): Research needs `web`
+
+**Files:** `internal/equipo/chat/research.go` (`toolResearch` refuses `research_off` with the spec's text; `authorizeResearch` refuses `ability_off`), `internal/equipo/chat/research_test.go`.
+
+- [ ] **Step 1: Failing test** `TestResearchNeedsWeb`: `toolResearch` is refused, and so is `authorizeResearch` for a step dispatched before the switch went off. The step's own Allow card is unchanged.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run TestResearchNeedsWeb -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: Research for a person's job needs web`.
+
+### Task 2.13 (Equipo): Phase 2 end to end and versions in between
+
+**Files:** `internal/thintest/abilities_e2e_test.go` (new).
+
+- [ ] **Step 1: Failing tests** (fake Base, fake runner):
+ - `TestOldBaseKeepsTodaysBehaviour`: Equipo at step 2 with Base at 0 or 1. Every key is on as `legacy`, renewed across 30 minutes, and `PUT host` succeeds.
+ - `TestWebOffReplyNamesOwner`: with `web` off and a stub `web_lookup` registered behind the map, the reply is one line naming `ask`, and no machinery words appear.
+ - `TestStagingAcceptance4Headless`: the member disconnects in Base and posts with their own Equipo bearer, and nothing switched runs.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/thintest -run 'OldBase|WebOffReply|StagingAcceptance4' -count=1`. Expected: FAIL, then implement any gaps.
+- [ ] **Step 3:** Run `make ci`. Expected: green.
+- [ ] **Step 4:** Commit `Abilities: phase 2 end to end`. Push `abilities-2`, review, merge, and deploy to staging, then production (deploy step 2).
+
+## Phase 3. Lookups (Equipo)
+
+### Task 3.1 (Equipo): The guarded client (shared with MCP Task 6, AD2)
+
+**Files:**
+- Create: `internal/websource/guard/guard.go`, `internal/websource/guard/dial.go`, `internal/websource/guard/guard_test.go`
+- Modify: `internal/websource/websource.go` (export `CheckHost`)
+
+**Interfaces:**
+- Produces: MCP plan Task 6's `Inventory`, `Config`, `Response`, `Refusal`, `New` and `Do`, at the new path, with these additions:
+ - `Config.Redirects int` (lookups 5, services 0) and `Config.Timeouts` (lookups: 5 s connect, 10 s to first byte, 15 s per request, 25 s per page including redirects);
+ - `Config.UserAgent`;
+ - `Do(ctx, req, limit)` takes per-request extra headers only from `req.Header` keys on `Config.AllowHeaders` (lookups: `X-Subscription-Token`);
+ - decompression with the limit applied after it;
+ - `Response.FinalURL`, plus `Response.Type` sniffed as one of `html`, `text`, `json`, `xml`, `feed`, or `unsupported`;
+ - `func Registrable(host string) string` for logs.
+- Refusal rules gain `downgrade` and `too_many_redirects`. Under `testing.Testing()`, `Do` refuses `unavailable` unless `TestDial` is set (AD3).
+
+- [ ] **Step 1: Failing tests:**
+ - MCP Task 6's list.
+ - `TestFetchSSRF`: spec §10.1's whole list, with the redirect cases at `Redirects: 5`.
+ - `TestFetchBounds`.
+ - `TestNoCredentialsSent`.
+ - `TestRedirectsZeroForServices`.
+ - `TestHTTPTypedTriedAsHTTPSOnce`.
+ - `TestGuardNeverDialsInTests`.
+ - `TestRefusalLogsRuleAndDomainOnly`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/websource/... -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement on the pattern of `internal/runner/webread/fetch.go` (resolver, dialer with `Control`).
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `websource: one guarded client for lookups and services`.
+
+### Task 3.1b (Equipo): The instance inventory (shared with MCP Task 7, AD2; skip if landed)
+
+**Files:** As MCP plan Task 7, with the migration numbered `0113_instance_inventory.sql`. The card's copy keys `services.inventory.question` and `services.inventory.confirm` are reviewed in Task 0.1.
+
+- [ ] **Steps 1 to 5:** As MCP plan Task 7, including its tests (`TestInventoryNotReadyWithoutPrefixes`, `TestInventoryCardAndConfirm`, `TestInventoryDriftStopsRequests`, `TestInventoryInside`). Commit `Instance inventory confirmed by an owner`.
+
+### Task 3.2 (Equipo): Readable text from a page
+
+**Files:** `internal/websource/readable.go` (new: `extractHTML` and its helpers moved from `internal/runner/webread/extract.go`), `internal/runner/webread/extract.go` (calls it), `internal/websource/readable_test.go`.
+
+**Interfaces:** Produces `func Readable(body []byte, typ string, base URL) (title, text string)`. Scripts and styles are dropped. Feeds give their item titles and summaries, JSON is pretty-printed, and XML gives its text nodes.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestReadableDropsScript`.
+ - `TestReadableFeedItems`.
+ - `TestWebreadUnchanged`: the existing webread tests stay green.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/websource ./internal/runner/webread -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `websource: readable text shared by Research and lookups`.
+
+### Task 3.3 (Equipo): Search backends: Mojeek, Brave and the fallback chain
+
+**Files:**
+- Create: `internal/websearch/websearch.go` (`Searcher`, `Result`, `Error`, `Chain`, `Usage`), `internal/websearch/mojeek.go`, `internal/websearch/brave.go`, `internal/websearch/websearchtest/fake.go`, `internal/websearch/testdata/{mojeek_ok,mojeek_limit,mojeek_empty,brave_ok,brave_429}.json`, `internal/websearch/websearch_test.go`
+- Modify: `internal/equipo/config.go` (AD3's six variables), `internal/equipo/migrations/0114_lookups.sql` (the usage table here; Task 3.6 adds the rest of the file before merge)
+
+**Interfaces:**
+- Produces:
+ - `func NewMojeek(c *guard.Client, key string) Searcher` and `func NewBrave(c *guard.Client, key string) Searcher`;
+ - `type Usage interface { Take(ctx context.Context, backend string) (ok bool, err error) }`, backed by `chat_web_search_usage(backend text, month text, used integer, PRIMARY KEY(backend, month))` with `month` as `2006-01` UTC, where `Take` increments only while `used < cap`;
+ - `func (c Chain) Search(ctx context.Context, q string, n int) (results []Result, backend string, err error)`;
+ - `func FromConfig(cfg Config, guard *guard.Client, usage Usage) (Chain, bool)`, where `false` means no usable backend;
+ - `websearchtest.Fake{Results map[string][]Result; Fail map[string]*Error; Calls []string}`.
+- Snippets are cut at 300 bytes and titles at 200, at a rune boundary. Results that aren't https are dropped.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestMojeekParsesFixture` and `TestBraveParsesFixture`.
+ - `TestMojeekStatusErrorIsLimit` (`"ERROR: Daily Limit Reached"`).
+ - `TestBrave429IsLimit`, `TestBrave401IsAuth`.
+ - `TestChainFallsBackOnError`, `TestChainFallsBackOnEmpty`, `TestChainFallsBackOnCap`.
+ - `TestChainNoFallbackConfigured`.
+ - `TestChainBothCapsSpentIsLimit`.
+ - `TestMonthlyCapResetsByUTCMonth`.
+ - `TestBackendSwapByConfig`: `EQUIPO_WEB_SEARCH=brave` with no fallback uses Brave only.
+ - `TestMisconfiguredBackendLeftOut`: no key or no cap. The log line names the backend and not the value.
+ - `TestSearchErrorsNeverCarryKey` (Review Focus 1).
+ - `TestNoPersonDataInSearchRequest`: the request carries only `q`, the count, the format and the key.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/websearch/... ./internal/equipo -run 'Mojeek|Brave|Chain|MonthlyCap|BackendSwap|Misconfigured|SearchErrors|NoPersonData' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `websearch: Mojeek with Brave as fallback, monthly caps, fakes`.
+
+### Task 3.4 (Equipo): Protocol 33 and the lookup frames
+
+**Files:** `internal/wire/runners.go` (`Protocol33`, `ProtocolLookup`, `ProtocolCurrent`), `internal/wire/lookup.go` (new), `internal/wire/frames.go` (decode both frames; not in `Durable`), `internal/wire/api.go` (`Message.Lookups`), `internal/wire/wiretest/testdata/frames/{lookup-step,lookup-result}.json`, `internal/wire/assistant_test.go`, `internal/wire/lookup_test.go`.
+
+**Interfaces:**
+- Produces:
+
+```go
+const FrameLookupStep = "lookup_step" // instance to runner, live only
+const FrameLookupResult = "lookup_result" // runner to instance, live only
+const (LookupStageQuery = "query"; LookupStageAnswer = "answer")
+type LookupPack struct { Question string `json:"question"`; Earlier []string `json:"earlier,omitempty"`; City string `json:"city,omitempty"`; Date string `json:"date"` }
+type LookupStep struct { Lookup string `json:"lookup"`; Attempt int `json:"attempt"`; Nonce string `json:"nonce"`; Stage string `json:"stage"`; Pack LookupPack `json:"pack"`; Results []SearchResult `json:"results,omitempty"`; Pages []LookupPage `json:"pages,omitempty"`; Truncated bool `json:"truncated,omitempty"` }
+type SearchResult struct { Title, URL, Snippet, Date string } // json lower-case
+type LookupPage struct { URL, Title, Text string }
+type LookupResult struct { Lookup string; Attempt int; Nonce, Stage string; Queries []string; Answer string; Used []int; Code string }
+type AssistantLookup struct { Answer string `json:"answer"`; Sources []LookupSource `json:"sources"` }
+type LookupSource struct { URL string `json:"url"`; Title string `json:"title"` }
+// wire.Message gains Lookups []AssistantLookup `json:"lookups,omitempty"`
+const (MaxLookupPack = 4 << 10; MaxLookupStepBytes = 56 << 10; MaxLookupAnswer = 1200; MaxLookupQueries = 2; MaxLookupQuery = 200; MaxLookupSources = 5; MaxLookupsPerReply = 2)
+func ValidQueryResult(r LookupResult) error // ≤2 queries, each 1..200 characters, no other fields set
+func ValidAnswerResult(r LookupResult, results int) error // answer 1..1200 characters, used ⊆ [0,results), no queries
+```
+
+ Below 33, `Encode` refuses `lookup_step` (`ErrProtocol`).
+- Decoding is strict: unknown fields fail.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestProtocolLookupIs33`, and the current-version assertion moved to `Spoken(99) == 33`.
+ - `TestLookupFramesRoundTrip`.
+ - `TestLookupFramesNotDurable`.
+ - `TestEncodeRefusesLookupBelow33`.
+ - `TestLookupStepsStrictJSON`: three queries, a 201-character query, or an answer with an extra field each fail.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/wire/... -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `wire: protocol 33, live-only lookup frames, lookups on a message`.
+
+### Task 3.5 (Equipo, runner): The two isolated steps on the runner
+
+**Files:** `internal/runner/thin/lookup.go` (new), `internal/runner/thin/link.go` (dispatch `lookup_step`), `internal/runner/provider/claude/launcher.go` and `internal/runner/provider/codex/launcher.go` (a lookup call on glance terms), `internal/runner/provider/claude/lookup_policy_test.go`, `internal/runner/provider/codex/lookup_policy_test.go`, `internal/runner/thin/lookup_test.go`.
+
+**Interfaces:**
+- Produces: `func (e *engine) lookupStep(ctx context.Context, s wire.LookupStep) wire.LookupResult`. It runs with the person's lightest configured model (Q7), as the glance does, with `--tools ""` (Claude) or the glance's no-tool Codex config. It has no resume, no notebook and no desk. It runs in `os.MkdirTemp` under the runner's state directory and removes that directory on return. The timeout is 20 s. It logs only the stage, a code and byte counts, and the payloads are kept out of journals and diagnostic captures. It replies with `FrameLookupResult` live on the same connection.
+- The two prompts are fixed instance texts sent in the frame's pack context and reviewed as code. The runner adds nothing of the person's.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestLookupStepsIsolated`: the argv has `--tools ""`, no `--resume`, and a session directory inside the temp directory, which is gone afterwards.
+ - `TestLookupStepEphemeralOnRunner`: a sentinel in a page's text is absent from the journal, the diagnostics capture and the provider session directory.
+ - `TestLookupStepTimeout`: 20 s gives code `lookup_failed`.
+ - `TestLookupStepBadJSON`: model output that isn't strict JSON gives `lookup_failed`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/runner/... -run 'LookupStep' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `runner: lookup steps with no tools, session or transcript`.
+
+### Task 3.6 (Equipo): Lookup storage, the question pack and the live channel
+
+**Files:** `internal/equipo/migrations/0114_lookups.sql` (completed), `internal/equipo/migrations/schema.sql`, `internal/equipo/chat/lookup_store.go`, `internal/equipo/chat/lookup_pack.go`, `internal/equipo/chat/lookup_live.go`, `internal/equipo/chat/stream.go` (`runnerConn` live queue, `read` delivers `lookup_result`), and tests beside each.
+
+**Interfaces:**
+- Produces:
+ - Migration (with Task 3.3's usage table):
+
+```sql
+CREATE TABLE chat_lookups (id text PRIMARY KEY, person text NOT NULL, turn_id text NOT NULL, attempt integer NOT NULL,
+ seq integer NOT NULL, call_id text NOT NULL, state text NOT NULL, queries text, reads text, answer text,
+ sources text, code text, created_at datetime NOT NULL);
+CREATE INDEX chat_lookup_turn ON chat_lookups(turn_id, attempt, seq);
+CREATE INDEX chat_lookup_person ON chat_lookups(person, created_at);
+```
+
+ `queries` is JSON `[{q, backend}]`. `reads` is JSON `[{url, final_url, status, bytes, sha256, code}]`. `state` is one of `running`, `shown` or `failed`.
+ - `func (t *txn) lookupPack(person string, turn turnRecord, now time.Time) (wire.LookupPack, error)`. It uses this turn's newest person message with `Origin == originComposer` in the Assistant lane, plus up to 2 earlier composer messages from turns with a `shown` or `failed` lookup in the last 30 minutes, and never from before the person's most recent `reset` command (`notebook.go:134`) or, once MCP Task 34 lands, before the lane epoch. City and date follow AD7, and the pack is cut to 4 KiB, the oldest earlier question first.
+ - `func (s *Store) lookupStep(ctx context.Context, person string, step wire.LookupStep) (wire.LookupResult, error)`. It sends on the person's primary runner connection at protocol ≥ 33, waits at most 20 s, and fails `lookup_failed` when the connection ends or the runner restarts. It accepts only a result whose `(Lookup, Attempt, Nonce, Stage)` matches, and it is never written to `runner_commands`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestQuestionPackContents`.
+ - `TestPackExcludesUnrelatedHistory`.
+ - `TestPackZoneCityAndDate` (Review Focus 2).
+ - `TestPackFourKiB`.
+ - `TestLookupStepEphemeral`: page text never appears in `runner_commands` or instance logs; a dropped connection fails the attempt and nothing is resent; a stale answer is ignored.
+ - `TestPackRespectsEpoch`, added when MCP Task 34 is present. Until then it is skipped with that reason.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'Pack|LookupStepEphemeral' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement, and regenerate `schema.sql`.
+- [ ] **Step 4:** Run the tests and `make migration-check`. Expected: PASS.
+- [ ] **Step 5:** Commit `Lookups: storage, the question pack, and a live runner call`.
+
+### Task 3.7 (Equipo): The `web` provider and `web_lookup`
+
+**Files:** `internal/equipo/chat/web_provider.go` (new), `internal/equipo/chat/lookup.go` (new: the run), `internal/equipo/chat_wiring.go` (register `c.WebProvider()` after the team provider), `internal/equipo/chat/lookup_test.go`, `internal/equipo/chat/lookup_safety_test.go`.
+
+**Interfaces:**
+- Consumes: `assist.Gate` (Task 2.7), `guard.Client` (3.1), `websource.Readable` (3.2), `websearch.Chain` (3.3), `lookupPack` and `lookupStep` (3.6), and `callFrom(ctx)` for the call row.
+- Produces:
+ - Provider `web`, with one operation: `web_lookup`, `ReadOnly: true`, input schema `{"type":"object","additionalProperties":false}`, and description exactly as in spec §4.1.
+ - `func (s *Store) webLookup(ctx context.Context, call toolCallRecord) (json.RawMessage, error)` runs spec §4.2 steps 1 to 8. It reads `websource.Mentions` first, at most 3, from the composer message (step 2). It refuses a query that `websource.LooksSecret` flags. It calls `assist.Gate` before each search and each read. It enforces 1 request per second per host through `type hostPacer struct` on the Store (keyed by host, in memory) and the 40 s limit through the context. It returns only the fixed `shown` result, or a failure code, as model-facing text.
+ - Listed only when all of these hold:
+ - the turn's kind is `person`;
+ - the primary speaks protocol 33 or later;
+ - `Draws(lookup_answers)`;
+ - the inventory is `Ready`;
+ - `FromConfig` reported a usable backend.
+ - A delivery retry of the same call id returns the stored result.
+ - Audit: `assistant.lookup` with the person, counts, registrable domains and code.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestLookupInputIsEmpty`.
+ - `TestLookupsOnlyInPersonTurns` (a connect's resume turn is refused).
+ - `TestReadsPickedByRank`.
+ - `TestTypedAddressesRefusedOrSkipped` (Review Focus 4).
+ - `TestAssistantNeverSeesWebText`.
+ - `TestLookupCaps`: a third lookup in a turn, the 101st in 24 hours, and the per-host rate are each refused.
+ - `TestSecretLookingQueryRefused`.
+ - `TestLookupPageTextNotStored`.
+ - `TestLookupAuditNoQuery`.
+ - `TestAnswerStepBudget`.
+ - `TestRevokedMidLookupStopsNextRequest` (Review Focus 5).
+ - `TestLookupUnsupported`: an older runner, a client without `lookup_answers`, no inventory, and no backend each leave it unlisted.
+ - `TestLookupExemptFromOutboundRule`, added with MCP Task 27. Until then it is skipped with that reason.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'Lookup|ReadsPicked|TypedAddresses|AssistantNeverSees|SecretLooking|AnswerStepBudget|RevokedMid' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Lookups: web_lookup, run by the instance from the person's words`.
+
+### Task 3.8 (Equipo): The reply shows its lookups
+
+**Files:** `internal/equipo/chat/store.go` (`reply` attaches the final attempt's `shown` rows, in `seq` order, at most 2), `internal/equipo/chat/assistant_http.go` (snapshot, events, message page), `internal/equipo/chat/lookup_view.go` (new: `func lookupsFor(turn string, attempt int) []wire.AssistantLookup`, and link stripping), `internal/equipo/copy.go` (`assistant.activity.lookup`, pending until Task 0.1), `internal/equipo/chat/lookup_view_test.go`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestTwoLookupsOneReply`.
+ - `TestAnswerLinksStripped`.
+ - `TestLookupActivityLabel`: the `activity` event uses key `assistant.activity.lookup`.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run 'TwoLookups|AnswerLinks|LookupActivity' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Lookups: attach answers and sources to the reply`.
+
+### Task 3.9 (Equipo): The plain-text fallback for clients that can't draw answers
+
+**Files:** `internal/equipo/chat/lookup_view.go` (`func plainLookups(m wire.Message) wire.Message`, with copy key `assistant.lookup.fallback_sources`), `internal/equipo/chat/assistant_http.go` (applied per read when the request lacks `lookup_answers`), `internal/equipo/chat/lookup_view_test.go`.
+
+- [ ] **Step 1: Failing test** `TestLookupFallbackForOldClients`: a snapshot and an event read without the capability get the folded text, the stored message is unchanged, and the Assistant's context gets nothing.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/equipo/chat -run TestLookupFallback -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Lookups: plain-text fallback at read time for older clients`.
+
+### Task 3.10 (Equipo): Conversations end to end, and versions in between
+
+**Files:** `internal/thintest/lookup_e2e_test.go` (new: a fake backend through `websearchtest`, fake pages behind the guard's `TestDial`, and the fake runner answering the two steps with scripted JSON), `internal/thintest/machinery_words.go` (only if the jobs plan's list isn't there).
+
+- [ ] **Step 1: Failing tests:** spec §10.1's four conversations:
+ - `TestWeatherDublinGetsForecast`;
+ - `TestAndTomorrowUsesEarlierQuestion`;
+ - `TestWebOffOneLineNamesOwner`;
+ - `TestMuseumThenCalendarAsksForTime`.
+
+ Then the versions in between:
+ - `TestStep3WithOldRunner`: protocol 32, so `web_lookup` isn't listed and the reply is as today;
+ - `TestStep3WithOldNative`: no `lookup_answers`, so it isn't listed, and history reads get the fallback.
+- [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/thintest -run 'Weather|AndTomorrow|WebOffOneLine|Museum|Step3With' -count=1`. Expected: FAIL, then fix gaps in their owning tasks' files.
+- [ ] **Step 3:** Run `make ci`. Expected: green.
+- [ ] **Step 4:** Commit `Lookups: conversations end to end against fakes`. Push `abilities-3`, review and merge.
+
+### Task 3.11 (operator, acceptance): Staging lookups and the weather check
+
+Planning only: the executor runs this with the operator. No key is printed.
+
+- [ ] **Step 1:** Deploy the instance to staging with `EQUIPO_ABILITIES=web=off`, then the runners (`upgrade-thin.sh`). Confirm with `GET /api/v1/assistant/abilities` that `web` is fixed off.
+- [ ] **Step 2:** Set `EQUIPO_INSTANCE_PREFIXES`. An Equipo owner confirms the inventory card.
+- [ ] **Step 3:** Store the keys from 1Password without echoing them: `carlos secrets set EQUIPO_MOJEEK_KEY="$(op read 'op://Oficina/Mojeek Search API/credential')"` in a shell without `set -x` or history, as `scripts/staging-thin.py` does for `EQUIPO_INSTANCE_KEY`. Do the same for `EQUIPO_BRAVE_KEY`. Set `EQUIPO_WEB_SEARCH=mojeek`, `EQUIPO_WEB_SEARCH_FALLBACK=brave` and both monthly caps from Task 0.2.
+- [ ] **Step 4:** Remove `web=off` and restart.
+- [ ] **Step 5: Acceptance (spec §10.3 item 1).** Paul asks Base "What's the weather in Dublin?". Pass: in one reply, within about 15 seconds, a forecast with at least one source, and no card. Run it 5 times across a day. Pass needs 5 out of 5 with a forecast, not a link elsewhere. Record each run's time, its code and which backend answered (`chat_lookups.queries`).
+- [ ] **Step 6:** If step 5 fails on content (no forecast in the answer) rather than on time or plumbing, do Task 3.12. Otherwise skip it.
+- [ ] **Step 7:** After Paul's check, repeat steps 1 to 5 on production (deploy step 3).
+
+### Task 3.12 (Equipo, only if Task 3.11 step 5 fails): A keyless forecast source (Q9)
+
+**Files:** `internal/equipo/chat/lookup_forecast.go` (new), `internal/equipo/chat/lookup_forecast_test.go`.
+
+**Interfaces:** `type Forecaster interface { Forecast(ctx context.Context, city, date string) (wire.LookupPage, bool, error) }`. It goes through the guarded client and `assist.Gate`, under `web`. The source is a keyless public forecast API, chosen with Paul at this point. Its page is added to the answer step's `Pages` only when the query step's queries mention weather or forecast words in the pack's language. It counts as one of the 3 reads.
+
+- [ ] **Steps 1 to 5:** `TestForecastAddedForWeatherQuestion` and `TestForecastNotAddedOtherwise` (failing, then passing), implement, commit `Lookups: a public forecast as one more input for weather`, and repeat Task 3.11 step 5.
+
+## Phase 4. The switchboard (Base)
+
+### Task 4.1 (Base): Storage, defaults and audit
+
+**Files:** `internal/store/migrations/0014_abilities.sql` (spec §5.2's SQL), `internal/store/abilities.go` (new), `internal/store/remove.go`, `internal/store/abilities_test.go`.
+
+**Interfaces:**
+- Produces:
+ - `type Abilities map[string]bool`;
+ - `func canAdminister(m Member) bool` (`m.Role == "owner"`) and its exported form `func CanAdminister(m Member) bool`;
+ - `func Abilities(ctx context.Context, db *sql.DB, memberID string) (Abilities, int64, error)`;
+ - `func SetAbility(ctx context.Context, db *sql.DB, admin, member, key string, allowed bool) (revision int64, changed bool, err error)`, with the errors `ErrNotAdmin`, `ErrNotMember`, `ErrUnknownAbility` and `ErrIsOwner`;
+ - `func AbilityChanges(ctx context.Context, db *sql.DB, memberID string, limit int) ([]AbilityChange, error)` and `type AbilityChange struct { By, Ability string; Allowed bool; At time.Time }`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilitiesDefaultsOn`.
+ - `TestAdminIsOwnerOnly`.
+ - `TestOwnerAlwaysAll`.
+ - `TestSetAbilityAudited`.
+ - `TestSetAbilityRevision`.
+ - `TestAbilityToggleTwiceOneAudit` (Review Focus 3).
+ - `TestRemoveMemberKeepsAudit`.
+ - `TestSetAbilityRechecksAdminInTx`.
+- [ ] **Step 2:** Run `go test ./internal/store -run 'Abilit|AdminIsOwner|OwnerAlways|RemoveMemberKeeps' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: per-member switches with an audit trail`.
+
+### Task 4.2 (Base): `GET /api/v1/abilities` over the host channel
+
+**Files:** `internal/operations/abilities.go` (new: `AbilitiesPath = "/api/v1/abilities"`), `internal/operations/operations.go` (operation entries gain `Ability string`; a write with its key off answers 403 `ability_off`), `internal/web/app.go` (`withOperations` also routes `AbilitiesPath`), `internal/operations/abilities_test.go`.
+
+**Interfaces:** Answers `{"revision", "admin", "ask", "abilities"}` with every key present (spec §5.3). The member comes from `s.member(r)` (host token only). `ask` is the owner's display name.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestAbilitiesEndpoint`: a host token only; a member's bearer or a cookie gets 401; another member's token gets that member.
+ - `TestAbilitiesEveryKeyPresent`.
+ - `TestWriteOperationNeedsAbility`: a test-registered write with `Ability: "apps_write"` is refused 403 when that key is off.
+- [ ] **Step 2:** Run `go test ./internal/operations -run 'Abilities|WriteOperationNeeds' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Abilities: serve a member's board to Equipo on the host channel`.
+
+### Task 4.3 (Base): The person page
+
+**Files:** `internal/web/people.go` (`personPage`, `setAbility`), `internal/web/app.go` (`GET /people/{number}`, `POST /people/{number}/abilities`), `internal/web/templates/person.html` (new), `internal/web/templates/people.html` (owner rows link to the member's page), `internal/look/static/*.css`, `internal/webtest/person_test.go` (new).
+
+**Interfaces:**
+- Consumes: Task 4.1's store; `equipo.AbilityKeys` (AD5); `(c *Client) OwnAbilities(ctx, token)` from Task 4.4 for fixed keys.
+- Every string comes from Task 0.1's approved keys.
+- Rows follow §3's order, with `services_add` indented. Each row has its name, line, and an On/Off pair with `aria-pressed` in its own form. A disabled row reads `abilities.implied` or `abilities.fixed`. The off-consequence lines follow, then Recent changes (the last 20), and `abilities.owner` on the owner's page.
+- A POST answers 303 back to the page, 422 for an unknown key, 409 for a fixed key, and 404 for a non-owner, all with Base's existing form protections.
+- The lead line is `abilities.lead`, or `abilities.later` while `BASE_ABILITIES_FROM` (date, config; empty by default) is in the future. That covers the §9 step 4 exception.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestPersonPageOwnerOnly`.
+ - `TestAbilityToggleScriptsOff`.
+ - `TestAbilityImpliedRows`.
+ - `TestAbilityFixedRow`.
+ - `TestCannotLimitOwner`.
+ - `TestRecentChangesOnlyWithRows`.
+ - `TestAbilityTogglePostedTwice` (Review Focus 3).
+ - `TestPeopleRowsLinkForOwner`.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run 'PersonPage|AbilityToggle|AbilityImplied|AbilityFixed|CannotLimit|RecentChanges|PeopleRows' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `People: a page per member with what their assistant can do`.
+
+### Task 4.4 (Base): The hint and the saved status
+
+**Files:** `internal/equipo/abilities.go` (`(c *Client) RefreshAbilities(ctx, token string) (revision int64, now bool, err error)`, `(c *Client) OwnAbilities(ctx, token string) (Own, error)`), `internal/equipo/equipotest/chat.go` (the fake records refresh calls and their bearer), `internal/web/people.go`, `internal/webtest/person_test.go`.
+
+**Interfaces:** After `SetAbility` changes something, Base calls `RefreshAbilities` with the **target member's** Equipo bearer, when it holds one. The status is `abilities.saved_now` only for a 200 with a revision at least the saved one. Every other outcome shows `abilities.saved_later`.
+
+- [ ] **Step 1: Failing tests:** `TestHintSentWithTargetBearer`, `TestSavedStatusFollowsRevision`.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run 'HintSent|SavedStatus' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `People: tell Equipo a member's switches changed`.
+
+### Task 4.5 (Base): Toggling in place with scripts
+
+**Files:** `internal/look/static/ask.js`, or a small `people.js` if the page doesn't load `ask.js` (follow the repository's pattern), `internal/browsertest/person_test.go` (new).
+
+- [ ] **Step 1: Failing browser test** `TestAbilityToggleInPlace`: focus stays on the pressed button; the status line (`role="status"`) is announced once; a network failure shows `abilities.save_failed` and restores the previous pressed state.
+- [ ] **Step 2:** Run `go test ./internal/browsertest -run TestAbilityToggleInPlace -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement. The same POST is sent with `Accept: application/json`, and the server answers `{status, rows}`.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `People: switches change in place with scripts on`.
+
+### Task 4.6 (Base): The person's own line, on the web and in the app
+
+**Files:** `internal/web/settings.go`, `internal/web/templates/settings.html` (a row in the Ask Base section), `internal/web/api.go` (`/api/v1/me` gains `abilities_off`, a list of plain names), `native/apple/Sources/BaseKit/` (the Settings row), `Localizable.xcstrings`, `internal/webtest/settings_test.go`, `internal/webtest/api_test.go`, native tests.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestSettingsOwnLine`: "all", "some" with names and the owner, and nothing for the owner.
+ - `TestApiMeAbilitiesOff`.
+ - Native: `testSettingsAbilitiesLine`, `testAbilityOffStopRow` and `testReadyGoLiveOff`. The last two draw the stop and ready details from the card's own fields.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run 'SettingsOwnLine|ApiMeAbilitiesOff' -count=1` and `make native-check`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Settings: say what the assistant can do for you`.
+
+### Task 4.7 (Base): Relays pass `ability_off`; `registerHost` handles 409
+
+**Files:** `internal/web/ask_relay.go` (`/ask/cards/{id}/answer` and `/ask/cards/{id}/carry_on`, plus `/ask/jobs/{id}/act` once the jobs plan has it), `internal/web/ask_connect.go` (`registerHost`), `internal/equipo/chat.go` (`ErrAbilityOff` with the card), `internal/webtest/ask_test.go`.
+
+- [ ] **Step 1: Failing tests:**
+ - `TestActAbilityOffRelayed`: scripts get 403 JSON with the card; without scripts, a 303 to `/ask` where the pill shows the reason.
+ - `TestRegisterHostUnverified`: a 409 `host_unverified` or `host_elsewhere` is retried on the next connect, and the member's link stays.
+- [ ] **Step 2:** Run `go test ./internal/webtest -run 'AbilityOffRelayed|RegisterHostUnverified' -count=1`. Expected: FAIL.
+- [ ] **Step 3:** Implement.
+- [ ] **Step 4:** Run. Expected: PASS.
+- [ ] **Step 5:** Commit `Ask: pass ability_off through; retry an unverified host`.
+
+### Task 4.8 (Base): Phase 4 gates and versions in between
+
+- [ ] **Step 1: Failing test** `TestBaseStep4WithEquipoStep3` (webtest, fake Equipo at step 3): a toggle sends the hint, Settings shows the line, and the person page shows fixed keys from `OwnAbilities`.
+- [ ] **Step 2:** Run `make ci`, `make browser`, and `make native-check` where available. Expected: green.
+- [ ] **Step 3:** Commit `Abilities: phase 4 end to end`. Push `abilities-4`, review and merge. Deploy to staging, then production after Paul's check (deploy step 4).
+
+## Phase 5. Acceptance and the other plans
+
+### Task 5.1 (acceptance): Staging switchboard checks (spec §10.3 items 2 to 4)
+
+- [ ] **Step 1:** Paul turns off `build` for a test member with a job under way. Pass: the job stops after its current step with the approved line, and dropping it by asking the Assistant works (AD4). Turning `build` back on offers Carry on now (Try again once the jobs plan lands), which carries the job on.
+- [ ] **Step 2:** With `web` off for that member, the weather question gets the one-line answer naming Paul.
+- [ ] **Step 3:** The member disconnects Ask Base in Settings and tries the Assistant through their own Equipo access. Pass: nothing switched runs.
+- [ ] **Step 4:** Record the results in the PR for `abilities-4`. Then repeat on production after Paul's check.
+
+### Task 5.2 (Equipo): The jobs plan's card rows, if it landed first
+
+Only if jobs plan phase 1 merged before phase 2 of this plan (spec §9 step 5).
+
+- [ ] **Steps 1 to 5:**
+ - Failing tests `TestJobActAbilityOff` (every action), the T1 invariant with `build` off and with `go_live` off, and `TestCapableButNotAllowed` against the K2 act endpoint.
+ - Then the card's `actions` and its options are computed from the state and `Can`, and `resumeAbilityHold` backs `retry`.
+ - Commit `Abilities: job cards offer only what the switches allow`.
+
+### Task 5.3: What the jobs and MCP plans must change (handed over, not done here)
+
+- [ ] **Step 1:** Before either plan is executed, its executor applies spec §7 and AD1/AD2 to it, as a commit on that plan's branch:
+ - **jobs plan:** renumber protocols from the next free (33 or later) and migrations from the next free; Task 1.4 becomes `Draws`; Tasks 1.5, 1.6, 1.7, 1.10, 1.11, 1.12, 1.15, 1.17, 2.4, 2.7, 2.8, 2.12 and T13 as spec §7.1; `ask_clients` and `Base-Capabilities` already exist (Task 1.1), so it adds only `job_actions`;
+ - **MCP plan:** renumber protocol 29 and migrations 0095 to 0106 from the next free; Task 6 is `internal/websource/guard` (already built, Task 3.1); Task 7 is already built (Task 3.1b); Task 11 is rewritten on `Switches` (spec §7.2), without `service_settings`, `service_permissions`, `EQUIPO_SERVICES_ADD` or `EQUIPO_SERVICES_REVIEW`; Tasks 8, 15, 17, 18, 24, 25, 27, 28, 38 and 40 as spec §7.2, including `assist.Gate` in `SendPrepared` and recovery with spec §10.1's `TestApprovedConfirmExpiresWhenOff`, `TestSendPreparedGate` and `TestRecoveryBlockedStaysUnknown`, and `TestPackRespectsEpoch` and `TestLookupExemptFromOutboundRule` un-skipped.
+- [ ] **Step 2:** Done when both plan documents carry the changes and their Astra review passes.
+
+## Copy register additions (this plan)
+
+These go through Task 0.1 with the spec's register. All are DRAFT.
+
+| Key | Where | Text |
+|---|---|---|
+| `ask.fallback_sources` | Base, in the plain text an older app gets instead of a drawn answer (Task 1.6) | Sources: |
+| `abilities.save_failed` | Base, person page, with scripts, when a toggle couldn't be saved | That didn't save. Try again. |
+| `chat.card.ability_off` | Equipo's own conversation page, when a job card that would start work is answered there while `build` is off | Building is turned off for you, so this can't start. You can still drop it. |
+| `services.inventory.question`, `services.inventory.confirm` | Equipo's own page, owners only (MCP Task 7's strings, reviewed here if this plan builds the inventory) | Before your assistant can look things up on the web or reach other services, confirm the network this server is on. / Confirm |
+| The answer step's tone | The instructions the answer step follows; what it writes is shown to the person | Answer only the question asked, in plain words, in at most a few short sentences or a short list. Use only what the quoted pages say. If they don't answer it, say so in one line. Don't add links. |
+
+## Review
+
+(Astra rounds are recorded here.)