Abilities plan: Astra round 1 fixes (6 P1, 4 P2)
Protocol 34 (33 landed on Equipo main); Carry on for held stopped jobs in Equipo, Base and the app; jobs card rows gate phase 2; a gate before every backend request, fallback included; search keys bound to the vendor origin with no redirects; a conservative follow-up rule for the pack; the Oficina app deny list; link-free answer rendering; prompts as shared wire constants.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+94
−47
docs/superpowers/plans/2026-11-27-assistant-abilities.md+94 −47
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 === [90m9:25AM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m9:25AM[0m [32mINF[0m [1m1 commits scanned.[0m [90m9:25AM[0m [32mINF[0m [1mscanned ~2572787 bytes (2.57 MB) in 257ms[0m [90m9:25AM[0m [32mINF[0m [1mno leaks found[0m === 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.73s 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 5.952s amadan.net/oficina/base/internal/webtest receipt: slow package 1.134s amadan.net/oficina/base/internal/issuer receipt: slow package 574ms amadan.net/oficina/base/internal/operations receipt: slow package 177ms amadan.net/oficina/base/internal/consumer receipt: slow package 164ms 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 900ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp receipt: slow test 510ms 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| index 7058cc6..405af76 100644 |
| --- a/docs/superpowers/plans/2026-11-27-assistant-abilities.md |
| +++ b/docs/superpowers/plans/2026-11-27-assistant-abilities.md |
| @@ -13,11 +13,11 @@ |
| **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. |
| +- **Equipo:** new worktree `/home/paulca/amadan.net/oficina/equipo-abilities`, branches `abilities-2` and `abilities-3` from `origin/main`, checked 2026-11-27 at `5ce16912` (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`: |
| +The spec cites Base `7b48b69` and Equipo `c2173971`. Both mains have moved. Anchors were re-read at Base `685f63c` and Equipo `9a4d2e47`, and the numbers again at Equipo `5ce16912` during review: |
| | Spec anchor | Now | |
| |---|---| |
| @@ -48,7 +48,7 @@ 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. |
| + - **Runner protocol 34.** Equipo main at `5ce16912` has `ProtocolCurrent = ProtocolAssistantFiles = Protocol33` (33 landed during this plan's review). `ProtocolLookup = Protocol34` (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 34 too. Whichever merges first takes 34, and the others take the next free number at rebase. Main moves fast: re-read `internal/wire/runners.go` when rebasing, and if 34 is gone, take the next free number and rename the tests with it. `TestProtocolLookupIs34` pins the number, and the single current-version assertion in `internal/wire/assistant_test.go` (today `Spoken(99) == 33`) moves to 34. |
| - **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.** |
| @@ -66,11 +66,17 @@ Neither the jobs plan nor the MCP plan has landed any code on either main. |
| - **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. |
| + - `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. `Chain.Search` takes a `Before` hook that runs immediately before **each** backend request, the fallback's included: the bound send gate, the cap, and the per-host pacer. A refusal there stops the chain, so a switch turned off while the primary answers means no request to the fallback. |
| + - Search requests use their own guarded client: `Redirects: 0`, so a 3xx is `bad_response` and never followed, and the key is set only on a request to the backend's fixed origin (`https://www.mojeek.com`, `https://api.search.brave.com`). The page-reading client carries no key and allows no extra headers. |
| - 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). |
| +- **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). Today it is offered only on `paused` cards: Equipo's card view (`chat/jobs.go:395`, `c.CarryOn && c.State == wire.JobPaused`), Base's `Card.Clean`, `chat.html`, `ask.js` and the native `offersCarryOn` all check that. So: |
| + - **Equipo (Task 2.10)** offers `carry_on` on a `stopped` card too, but only when the hand-off has `ability_held_at` and the person holds `build` again. `carry_on_connection` stays empty, so no "other plan" line is drawn. The detail then changes from `assistant.job.detail.ability_off` to `assistant.job.detail.ability_back`. `Store.CarryOn` on a held hand-off runs `resumeAbilityHold`. |
| + - **Base and the app (Task 1.6b, phase 1, before Equipo step 2)** accept and draw `carry_on` on a `stopped` card exactly as on a `paused` one. |
| + - **Old Base or app:** the control is dropped and the detail line still says what to do. The person can resume by asking the Assistant: `team_nudge` on a held hand-off, in a person turn, runs `resumeAbilityHold`. That is the person's own act, as dropping by asking is. |
| + - **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 2.12b, or the jobs plan's Task 1.6 as amended by 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; |
| @@ -116,11 +122,11 @@ Neither the jobs plan nor the MCP plan has landed any code on either main. |
| | 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 | |
| +| 3a | Equipo | Phase 3 instance with protocol 34 known, deployed with `EQUIPO_ABILITIES=web=off` | `web_lookup` isn't listed to a runner below 34, 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 34 | |
| | 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 | | |
| +| 5 | both | Jobs plan phase 1 with spec §7.1's changes (Task 5.3), then MCP S1 and S2 with §7.2's changes. If jobs plan phase 1 landed before step 2, its card rows ship in step 2 (Task 2.12b) | The jobs plan's own switches (`BASE_JOB_ACTIONS`) | |
| 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. |
| @@ -205,11 +211,12 @@ Nothing here goes in a repository. The values are never printed. |
| **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. |
| +**Interfaces:** Consumes `Message.Lookups` (Task 1.2). Produces `func lookupMarkdown(text string) template.HTML` in `ask_cards.go`: a pre-pass turns `[label](url)` into `label` and leaves bare URLs and autolinks as plain text, then the text is rendered like `richMarkdown(text, true)` (bold, italics, lists) with links off. `richMarkdown` itself is unchanged, since its `strict` flag only governs emphasis. `LookupAnswer` calls it. `ask.js` mirrors it as `lookupMarkdown`, and native as `LookupMarkdown`. |
| - [ ] **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`. |
| + - `TestLookupMarkdownNoLinks`: a Markdown link, a bare URL, an autolink and `<script>` in an answer are shown as escaped text, and the source links are still links. |
| - [ ] **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. |
| @@ -222,6 +229,7 @@ Nothing here goes in a repository. The values are never printed. |
| - [ ] **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`. |
| + - `TestAskLookupMarkdownNoLinks`, the same cases as `TestLookupMarkdownNoLinks`. |
| - [ ] **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. |
| @@ -232,13 +240,26 @@ Nothing here goes in a repository. The values are never printed. |
| **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`; |
| + - `testLookupAnswerAndSources`, `testLookupMarkdownNoLinks` and `testClientCapabilityLookup` (native): the app sends `Base-Client-Capabilities: lookup_answers`, and an answer's links and bare URLs are drawn as text; |
| - `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.6b (Base, native): Carry on for a held job (AD4) |
| + |
| +**Files:** `internal/equipo/chat.go` (`Card.CleanAt` keeps `carry_on` on `stopped` job cards), `internal/web/templates/partials/chat.html`, `internal/look/static/ask.js`, `native/apple/Sources/BaseKit/` (`offersCarryOn`), `internal/equipo/equipo_test.go`, `internal/webtest/ask_test.go`, `internal/browsertest/ask_test.go`, native tests. |
| + |
| +- [ ] **Step 1: Failing tests:** |
| + - `TestCardCleanStoppedCarryOn`: `carry_on` is kept on a stopped job card and dropped on any card that isn't a job; |
| + - `TestStoppedCarryOnDrawn`, with scripts off and on: the existing Carry on now control posts to `/ask/cards/{id}/carry_on`, and no "other plan" line is drawn without `carry_on_connection`; |
| + - `testStoppedCarryOn` (native). |
| +- [ ] **Step 2:** Run `go test ./internal/equipo ./internal/webtest -run 'StoppedCarryOn|CardCleanStopped' -count=1`, `make browser` and `make native-check`. Expected: FAIL. |
| +- [ ] **Step 3:** Implement. |
| +- [ ] **Step 4:** Run. Expected: PASS. |
| +- [ ] **Step 5:** Commit `Ask: offer Carry on for a stopped job when Equipo says so`. |
| + |
| ### Task 1.7 (Base): Phase 1 gates |
| - [ ] **Step 1:** Run `make ci` and `make browser`. Expected: both green. Run `make native-check` where available. |
| @@ -456,14 +477,16 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| ### 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`. |
| +**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` and `assistant.job.detail.ability_back`, pending until Task 0.1), `internal/equipo/chat/handoff.go` (`teamNudge`), `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. |
| +- Produces: the job state `stopped`, with result copy "Stopped" (the approved key). While `build` is off, the detail is `assistant.job.detail.ability_off` filled with `Ask()` and there is no `carry_on`. Once the person holds `build` again, the detail is `assistant.job.detail.ability_back` and `carry_on` is true, with no `carry_on_connection`. The card view's `paused`-only condition (`jobs.go:395`) gains this case. `team_nudge` on a held hand-off in a person turn also calls `resumeAbilityHold` (AD4). `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. |
| + - `TestBuildOffStopRowHasCarryOn`, AD4's form of T1: `carry_on` and `ability_back` with `build` on, and no `carry_on` (Detail only) with it off. |
| + - `TestNudgeResumesHeldJob`: in a person turn, with `build` on. |
| + - `TestHeldJobResumeThroughBase` (thintest, with the fake Base from phase 1): stopped, switch restored, the person taps Carry on now, and the next step dispatches. |
| - `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. |
| @@ -474,10 +497,13 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| **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`. |
| +**Interfaces:** Produces two checks, both true for a task with no hand-off: |
| +- `func (t *txn) goLiveByActor(actor, taskID string) (bool, error)`: the **answering** person holds `go_live`. It is called in `answerMerge`, `answerPublish`, `MergeTask` and (Task 2.12b) the act endpoint's go-ahead and Publish options. |
| +- `func (t *txn) goLiveForTask(taskID string) (bool, error)`: the **hand-off's** person holds `go_live`. It is called where no person answers: merge authority's automatic merge, `authorizeMergeLease`, `authorizePublish` (start and deploy check), and the ready projection. |
| - [ ] **Step 1: Failing tests:** |
| - - `TestGoLiveOffRefusesEveryPath` (`answerMerge`, `answerPublish`, `MergeTask`). |
| + - `TestGoLiveOffRefusesEveryPath` (`answerMerge`, `answerPublish`, `MergeTask`, each checked by actor). |
| + - `TestGoLiveLastChecksUseHandoffPerson`: the hand-off's person loses `go_live` after an approval, and `authorizeMergeLease` and `authorizePublish` refuse. |
| - `TestGoLiveOffNoAutoMerge`. |
| - `TestGoLiveOffAfterApproval`. |
| - `TestGoLiveOffReadyProjection`: "Ready to try" with the detail, a preview link, and no go or publish option. |
| @@ -497,6 +523,15 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| - [ ] **Step 4:** Run. Expected: PASS. |
| - [ ] **Step 5:** Commit `Abilities: Research for a person's job needs web`. |
| +### Task 2.12b (Equipo): The jobs plan's card rows, if it landed first |
| + |
| +Only if jobs plan phase 1 has merged by the time `abilities-2` is rebased for merge (spec §9 step 5). When it applies, Task 2.13 can't merge or deploy until this task's tests pass. |
| + |
| +- [ ] **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 2.13 (Equipo): Phase 2 end to end and versions in between |
| **Files:** `internal/thintest/abilities_e2e_test.go` (new). |
| @@ -506,7 +541,7 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| - `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 3:** Run `make ci`. Expected: green. If jobs plan phase 1 is on main, Task 2.12b's `TestJobActAbilityOff` and `TestCapableButNotAllowed` must be among the passing tests. |
| - [ ] **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) |
| @@ -519,9 +554,10 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| **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.Redirects int` (page reads 5; searches and services 0) and `Config.Timeouts` (page reads: 5 s connect, 10 s to first byte, 15 s per request, 25 s per page including redirects; searches: 10 s); |
| - `Config.UserAgent`; |
| - - `Do(ctx, req, limit)` takes per-request extra headers only from `req.Header` keys on `Config.AllowHeaders` (lookups: `X-Subscription-Token`); |
| + - `Config.Credential *Credential` with `Credential{Origin, Header, Param string}`. The guard adds the key, as a header or a query parameter, only when the request's origin equals `Origin` exactly, and refuses `Redirects > 0` with a credential. Only the two search clients set it; |
| + - `func WithDeny(ctx context.Context, hosts []string) context.Context`, which adds per-request denied hosts to `Config.Deny`, each hop included; |
| - 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. |
| @@ -533,6 +569,8 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| - `TestFetchBounds`. |
| - `TestNoCredentialsSent`. |
| - `TestRedirectsZeroForServices`. |
| + - `TestCredentialBoundToOrigin`: a sentinel key goes only to the configured origin, a credential with redirects is refused at `New`, and a 302 from the fake vendor to another host is not followed, so that host receives nothing. |
| + - `TestWithDenyEachHop`. |
| - `TestHTTPTypedTriedAsHTTPSOnce`. |
| - `TestGuardNeverDialsInTests`. |
| - `TestRefusalLogsRuleAndDomainOnly`. |
| @@ -570,9 +608,9 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| **Interfaces:** |
| - Produces: |
| - - `func NewMojeek(c *guard.Client, key string) Searcher` and `func NewBrave(c *guard.Client, key string) Searcher`; |
| + - `func NewMojeek(key string, g guard.Config) Searcher` and `func NewBrave(key string, g guard.Config) Searcher`, each building its own guarded client with `Redirects: 0` and its `Credential` (Mojeek: param `api_key` on `https://www.mojeek.com`; Brave: header `X-Subscription-Token` on `https://api.search.brave.com`); |
| - `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)`; |
| + - `type Before func(ctx context.Context, backend string) error` and `func (c Chain) Search(ctx context.Context, q string, n int, before Before) (results []Result, backend string, err error)`, which calls `before` immediately before each backend request; |
| - `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. |
| @@ -589,14 +627,15 @@ ALTER TABLE chat_assistant_hosts ADD COLUMN capabilities text; -- omitted if j |
| - `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. |
| + - `TestBeforeRunsForEachBackend`: `before` is called once for the primary and once for the fallback, and a refusal from it for the fallback means no fallback request. |
| - [ ] **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 |
| +### Task 3.4 (Equipo): Protocol 34 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`. |
| +**Files:** `internal/wire/runners.go` (`Protocol34`, `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: |
| @@ -618,33 +657,34 @@ func ValidQueryResult(r LookupResult) error // ≤2 queries, each 1..200 chara |
| func ValidAnswerResult(r LookupResult, results int) error // answer 1..1200 characters, used ⊆ [0,results), no queries |
| ``` |
| - Below 33, `Encode` refuses `lookup_step` (`ErrProtocol`). |
| + Below 34, `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`. |
| + - `TestProtocolLookupIs34`, and the current-version assertion moved to `Spoken(99) == 34`. |
| - `TestLookupFramesRoundTrip`. |
| - `TestLookupFramesNotDurable`. |
| - - `TestEncodeRefusesLookupBelow33`. |
| + - `TestEncodeRefusesLookupBelow34`. |
| - `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`. |
| +- [ ] **Step 5:** Commit `wire: protocol 34, 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`. |
| +**Files:** `internal/wire/lookup_prompts.go` (new), `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. |
| +- The prompts aren't sent in the frame. They are constants in `internal/wire/lookup_prompts.go`, compiled into both instance and runner and selected by `Stage`: `LookupQueryPrompt`, `LookupAnswerPrompt` (whose tone line is Task 0.1's approved text), `LookupWebHeader` (spec §4.2 step 6's header, verbatim), and `func FenceWeb(results []SearchResult, pages []LookupPage) string`, which quotes and fences them as MCP §9.5 does, escaping any fence marker inside the text. They are reviewed as code. A prompt change needs a runner release, which is how glance prompts work today. 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`. |
| + - `TestAnswerStepFencesWebText` (in `internal/wire`): the header comes first, every result and page is inside a fence, and a page containing the fence marker can't close it. |
| - [ ] **Step 2:** Run `CGO_ENABLED=0 go test ./internal/runner/... -run 'LookupStep' -count=1`. Expected: FAIL. |
| - [ ] **Step 3:** Implement. |
| - [ ] **Step 4:** Run. Expected: PASS. |
| @@ -652,7 +692,7 @@ func ValidAnswerResult(r LookupResult, results int) error // answer 1..1200 char |
| ### 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. |
| +**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_followup.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: |
| @@ -667,12 +707,14 @@ 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`. |
| + - `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 earlier lookup questions **only when this message is a follow-up** by `isFollowUp` (below): up to 2 earlier composer messages from turns with a `shown` or `failed` lookup in the last 30 minutes, the newest first, 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 isFollowUp(message string) bool` in `chat/lookup_followup.go`, a conservative instance rule. It is true only for a message of at most 6 words that either starts with a fixed follow-up marker (`and`, `what about`, `how about`, `also`, `same for`, `then`, `y`, `¿y`, `qué tal`, `y para`, compared in lower case after leading punctuation) or has at most 3 words ("Tomorrow?", "In Cork?"). Anything else is a new question, and the pack holds no earlier question. The second earlier question goes in only when the first was itself a follow-up. |
| + - `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 ≥ 34, 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`. |
| + - `TestPackFollowUpOnly`: "And tomorrow?" after "What's the weather in Dublin?" holds the earlier question. "How much is a flight to Lisbon?" after a lookup about a medical clinic holds none. A chain of three follow-ups holds at most 2. |
| - `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. |
| @@ -690,10 +732,10 @@ CREATE INDEX chat_lookup_person ON chat_lookups(person, created_at); |
| - 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. |
| + - `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 passes `Chain.Search` a `Before` that calls `assist.Gate`, `Usage.Take` and the pacer, and calls `assist.Gate` and the pacer before each page read. It builds the per-lookup deny list with `func (s *Store) lookupDeny(ctx context.Context, person string) ([]string, error)`: the instance origin, every `EQUIPO_ASSISTANT_HOSTS` origin, oficina-connect's origin and the forge host from config, plus the origins of the person's Oficina apps from `base_apps`. That list is read through the base provider and cached per person in memory, refreshed when older than 60 s and kept for at most 10 minutes. With no list available, the lookup fails `lookup_failed`. The list is passed through `guard.WithDeny`. 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; |
| + - the primary speaks protocol 34 or later; |
| - `Draws(lookup_answers)`; |
| - the inventory is `Ready`; |
| - `FromConfig` reported a usable backend. |
| @@ -712,6 +754,8 @@ CREATE INDEX chat_lookup_person ON chat_lookups(person, created_at); |
| - `TestLookupAuditNoQuery`. |
| - `TestAnswerStepBudget`. |
| - `TestRevokedMidLookupStopsNextRequest` (Review Focus 5). |
| + - `TestOficinaAppOriginRefused`: a publicly addressed app origin from `base_apps` is refused when typed and when reached by a redirect. `TestDenyUnavailableFailsClosed`. |
| + - `TestRevokedDuringPrimaryNoFallback`: `web` goes off while the fake primary is answering with an error, and the fake fallback receives zero requests. |
| - `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. |
| @@ -753,7 +797,7 @@ CREATE INDEX chat_lookup_person ON chat_lookups(person, created_at); |
| - `TestMuseumThenCalendarAsksForTime`. |
| Then the versions in between: |
| - - `TestStep3WithOldRunner`: protocol 32, so `web_lookup` isn't listed and the reply is as today; |
| + - `TestStep3WithOldRunner`: protocol 33, 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. |
| @@ -787,9 +831,9 @@ Planning only: the executor runs this with the operator. No key is printed. |
| **Interfaces:** |
| - Produces: |
| - - `type Abilities map[string]bool`; |
| + - `type AbilitySet 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 Abilities(ctx context.Context, db *sql.DB, memberID string) (AbilitySet, 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 }`. |
| @@ -909,19 +953,10 @@ Planning only: the executor runs this with the operator. No key is printed. |
| - [ ] **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`; |
| + - **jobs plan:** renumber protocols from the next free (34 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. |
| @@ -932,6 +967,7 @@ 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: | |
| +| `assistant.job.detail.ability_back` | Base, under a held job's "Stopped" once building is on again (AD4) | Building is on again. You can carry on with this, or drop it. | |
| | `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 | |
| @@ -939,4 +975,15 @@ These go through Task 0.1 with the spec's register. All are DRAFT. |
| ## Review |
| -(Astra rounds are recorded here.) |
| +**Round 1** (Astra, gpt-6-astra, read-only, 2026-11-27): NOT READY, with 6 P1 and 4 P2. All were applied. |
| + |
| +- **P1, protocol 33 taken.** Main moved to `5ce16912` with `ProtocolAssistantFiles = Protocol33`. Lookups take 34 (AD1). |
| +- **P1, Carry on is offered only on paused cards** in Equipo, Base and the app. AD4 now offers it on held stopped cards, and adds Task 1.6b (Base and native, phase 1), the `ability_back` line, and `team_nudge` as the conversational path for old clients. |
| +- **P1, job actions gated too late** when the jobs plan lands first. Task 5.2 is now Task 2.12b, a precondition of phase 2's merge. |
| +- **P1, the fallback search ran without its own gate.** `Chain.Search` takes a `Before` hook that runs before each backend request (AD3, Tasks 3.3 and 3.7). |
| +- **P1, a search key could follow a redirect.** Search clients have `Redirects: 0`, and the key is bound to the vendor's origin (`guard.Credential`, Task 3.1). |
| +- **P1, earlier questions entering unrelated packs.** `isFollowUp` is a conservative instance rule, and anything else carries no earlier question (Task 3.6). |
| +- **P2, the Oficina app origins in the deny list.** `lookupDeny` plus `guard.WithDeny`, failing closed (Task 3.7). |
| +- **P2, interfaces.** `store.AbilitySet`; `goLiveByActor` and `goLiveForTask` (Tasks 4.1, 2.11). |
| +- **P2, links in answers.** `lookupMarkdown` on the server, in JS and in native (Tasks 1.4 to 1.6). |
| +- **P2, prompt transport.** The prompts are constants in `internal/wire/lookup_prompts.go`, selected by stage (Task 3.5). |