Abilities spec: Astra round 5 fixes (1 P1, 2 P2)
Job-lane Coordinator turns and work-changing Coordinator tools (including create_project and job cards answered in Equipo) are held without build; out-of-turn entry points refresh a stale board first; a blocked recovery of a possibly sent call stays unknown instead of expiring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+20
−5
docs/superpowers/specs/2026-11-26-assistant-abilities-design.md+20 −5
CI failed — 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 === [90m12:14PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m12:14PM[0m [32mINF[0m [1m1 commits scanned.[0m [90m12:14PM[0m [32mINF[0m [1mscanned ~2471899 bytes (2.47 MB) in 1.37s[0m [90m12:14PM[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 ./... budget: internal/webtest took 14.298s, over the 10s the default allows receipt: test step 18.754s 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 14.298s amadan.net/oficina/base/internal/webtest receipt: slow package 2.724s amadan.net/oficina/base/internal/issuer receipt: slow package 1.375s amadan.net/oficina/base/internal/consumer receipt: slow package 1.071s amadan.net/oficina/base/internal/operations receipt: slow package 508ms amadan.net/oficina/base/internal/e2e receipt: slow test 1.65s amadan.net/oficina/base/internal/issuer TestAuthorizeRefusals receipt: slow test 1.54s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.28s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce receipt: slow test 940ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp receipt: slow test 630ms amadan.net/oficina/base/internal/operations TestOperationsRefusals rastrillo: budget test: 1 problem(s) exit status 1 make: *** [Makefile:47: test] Error 1 amadan: step test failed: exit status 2 amadan: job failed at step test — its output is above, not at the tail of this log
diff --git a/docs/superpowers/specs/2026-11-26-assistant-abilities-design.md b/docs/superpowers/specs/2026-11-26-assistant-abilities-design.md| index e9c67ea..5543d9c 100644 |
| --- a/docs/superpowers/specs/2026-11-26-assistant-abilities-design.md |
| +++ b/docs/superpowers/specs/2026-11-26-assistant-abilities-design.md |
| @@ -1,6 +1,6 @@ |
| # Base's Assistant can do things out of the box; admins can limit it per person |
| -Status: **draft for Paul's review**, revision 5, 2026-11-26 (after Astra rounds 1 to 4, see Review). Design only: no implementation, merge or deploy. |
| +Status: **draft for Paul's review**, revision 6, 2026-11-26 (after Astra rounds 1 to 5, see Review). Design only: no implementation, merge or deploy. |
| Paul, 2026-11-26, after asking Base "What's the weather in Dublin?" and being sent to met.ie: |
| @@ -271,7 +271,8 @@ The board can't travel on the member's own bearer. A member can sign in to Equip |
| - in `PUT host`, as above; |
| - on a hint (below); |
| - at the start of every person turn when `confirmed_at` is older than 60 s, synchronously, with a 5 s bound; |
| - - every 60 s, as part of housekeeping, for every person with a turn running or a job that isn't finished. |
| + - every 60 s, as part of housekeeping, for every person with a turn running or a job that isn't finished; |
| + - before any other entry point that acts for the person outside a turn, when `confirmed_at` is older than 60 s. That covers the `/services/*` connection routes, `/oficina/connect*`, MCP's dispatcher and its background identity reads. The refresh runs outside the acting transaction, with a 5 s bound, and the act then reads the result (round 5, finding 2). An idle member's first act after a failed hint therefore sees the new board, and an expired copy is renewed by the next act rather than waiting for a turn. |
| - **The hint.** When a switch changes, Base calls `POST /api/v1/assistant/abilities/refresh` with the **target member's** bearer, which Base holds, and an empty body. The hint carries no data. Equipo fetches from the person's registered host within the call (5 s bound) and answers 200 `{revision}` with the revision it now holds. It answers 202 when it couldn't fetch, or when a fetch for that person ran less than 5 s ago. Base shows "applies now" only for a 200 whose revision is at least the one it saved (§8.1). A member who sends the hint themselves gains nothing. |
| - **How fetch results count** (round 1, findings 1 and 2; round 2, finding 4). |
| @@ -347,7 +348,8 @@ The two halves differ in authority and are kept apart on purpose. `Can` comes fr |
| A call counts as **in flight** once its gate has passed. A switch turned off after that doesn't stop that one request, which finishes and is reported. Every later request is refused, including the next request of the same lookup. An operation resolved differently from the one bound is refused `operation_changed`. |
| - **Every send path gets the gate** (round 4, finding 1). `Registry.Invoke` isn't the only way an operation leaves. MCP's once-only dispatcher sends approved calls with `SendPrepared`, and its recovery path sends again after a restart (MCP plan Tasks 24 and 25). Each of these: |
| - - reads `switches` in its claim transaction, where an approved go-ahead whose person has since lost the ability expires with `ability_off`; |
| + - reads `switches` in its claim transaction. An approved go-ahead **known not to have been sent** (state `approved`, never claimed for dispatch) whose person has since lost the ability expires with `ability_off`; |
| + - leaves a call that may already have been sent alone (round 5, finding 3). That is one claimed as `dispatching` by a process that died before recording the outcome. When the switch blocks its recovery, the call becomes MCP's `unknown`, never "This wasn't done." It isn't resent. If the service offers a read that can settle the outcome, that read is made only once the switch is on again; |
| - installs the same bound gate, called immediately before the operation's request, after any token refresh or other preparation. |
| A new send path must do the same, which a test pins: every provider request that performs an operation passes through `assist.Gate`. |
| @@ -379,7 +381,11 @@ So a Research step dispatched before the switch went off doesn't start, and one |
| ### 6.3 Equipo: jobs when `build` is off |
| - **Nothing new.** `team_request` and `team_add` are refused `ability_off`. The instance's sweep doesn't answer this person's taste questions or queue `team_update` turns that nudge their jobs (jobs spec K8). The dispatcher doesn't dispatch new steps for their hand-offs. |
| -- **Start authorization is the boundary** (round 2, finding 5). `Store.Authorize`, the start authorization of every step attempt (`equipo:internal/equipo/chat/runners.go:587-600`), refuses a step of a task followed by a hand-off whose person lacks `build`. It refuses with `ability_off` in the same transaction that would record the start. So: |
| +- **The job's own conversation is held too** (round 5, finding 1). Each job has its own Coordinator thread (lane `job:<id>`, assistant-jobs spec). Its turns can do work before any step exists, for example authorising a new repository (`create_project`, `authorizeCreate` in `equipo:internal/equipo/chat/tools.go:860`). So, for a job lane whose hand-off's person lacks `build`: |
| + - `dispatchNext` (`equipo:internal/equipo/chat/store.go:642`) doesn't dispatch the lane's queued turns. They wait, and are dispatched in order once Try again resumes the job (below); |
| + - in a job-lane turn already running, every Coordinator tool that starts or changes work is refused `ability_off` with fixed Coordinator-facing text: "Refused: the person this work is for can't have new work done right now. Stop here; don't start or change anything." That covers `create_project`, `project_created`, `add_project`, recording or starting a task, proposing a specialist or Research, and merge or publish requests. Reads, `status`, notes and cancelling still run; |
| + - an answer to a job-lane card from Equipo's own pages ("Open in Equipo") goes through the same check. A card that would start or change work is refused 403 `ability_off`, and dropping the job still works. |
| +- **Start authorization is the boundary for steps** (round 2, finding 5). `Store.Authorize`, the start authorization of every step attempt (`equipo:internal/equipo/chat/runners.go:587-600`), refuses a step of a task followed by a hand-off whose person lacks `build`. It refuses with `ability_off` in the same transaction that would record the start. So: |
| - a step dispatched but not yet started never starts; |
| - a step already running finishes, because its first grant was given, and nothing is left half done; |
| - no step starts after it, including a housekeeping retry. |
| @@ -392,7 +398,7 @@ So a Research step dispatched before the switch went off doesn't start, and one |
| - **The stop is stored, and Try again resumes it** (round 4, finding 3). A step that was never dispatched leaves no failed attempt, so K6's `retryFailed` (`equipo:internal/equipo/chat/handoff.go:1723-1752`, which needs `NeedsRetry`) can't resume it. So: |
| - the hand-off records `ability_held_at` (a new `chat_handoffs` column) the first time the dispatcher skips one of its steps, or `Authorize` refuses one, for `ability_off`; |
| - the job card reads that, not an attempt, for its stop row; |
| - - Try again on such a job is a new act path, `resumeAbilityHold`. In one transaction it checks the person holds `build`, clears `ability_held_at`, and puts every held task back where the dispatcher picks it up: a refused attempt becomes a fresh attempt, and an undispatched step is simply eligible again. It is idempotent per card revision and key, like every K2 action. |
| + - Try again on such a job is a new act path, `resumeAbilityHold`. In one transaction it checks the person holds `build`, clears `ability_held_at`, and puts every held task back where the dispatcher picks it up: a refused attempt becomes a fresh attempt, an undispatched step is simply eligible again, and the job lane's waiting turns are dispatched in order. It is idempotent per card revision and key, like every K2 action. |
| Nothing resumes by itself. An owner turning `build` back on doesn't restart someone's work without them. |
| - **Act endpoint.** `answer`, `build`, `again` and `retry` answer 403 `ability_off` with the card as it is now, like the 409 path (jobs plan PD5). |
| @@ -576,6 +582,9 @@ Tests come first, and each phase follows Equipo's "headless first" rule (thin v1 |
| - `TestPausedConnectionMakesNoRequest`: with `services` off and an access token still cached, publishing a service revision makes no identity read, `look` makes no `tools/list`, and no refresh runs. Disconnect still revokes. The same holds for Oficina with `apps_read` off. |
| - **Jobs.** |
| - `TestBuildOffRefusesStart`: a step dispatched before the switch went off isn't granted. A running step keeps its grant and finishes. No later step and no housekeeping retry starts. Run now can't release it. |
| + - `TestJobLaneTurnsHeld`: `build` goes off between the job's creation and its turn's dispatch: the turn isn't dispatched. Off while a job turn runs: `create_project` and starting a task are refused, and `status` and cancel run. A job card answered from Equipo's pages that would start work is refused, and drop works. Try again dispatches the waiting turns in order. |
| + - `TestIdleEntryPointRefreshes`: an idle connected member whose hint failed uses a `/services/*` route. The board is refreshed first and the new off is honoured. |
| + - `TestRecoveryBlockedStaysUnknown`: an external write succeeds, the process crashes before recording it, the switch goes off, and recovery runs. The call ends `unknown`, nothing is resent, and the person isn't told it wasn't done. An approval that was never claimed expires as `ability_off`. |
| - `TestAbilityHoldResumes`: `build` goes off and the current step finishes. The next step stays undispatched and `ability_held_at` is set. With `build` on again, Try again dispatches it. A refused attempt resumes the same way. Turning the switch on alone resumes nothing. A double tap resumes once. |
| - `TestBuildOffStopRowHasDrop` (T1). |
| - `TestGoLiveOffRefusesEveryPath` (answerMerge, answerPublish, MergeTask, act), `TestGoLiveOffNoAutoMerge`. |
| @@ -757,3 +766,9 @@ Model-facing instance texts (not copy; reviewed as code): the two isolated steps |
| - **P1, background service calls bypassing the switch.** Authenticated clients check the switch before any request, and `Registry.list` skips switched-off providers before listing (§6.1, §7.2). |
| - **P2, Try again for undispatched work.** `ability_held_at` on the hand-off and a `resumeAbilityHold` act path (§6.3). |
| - **P2, lookups in a connect's resume turn.** Not allowed: lookups run only in person turns (§4.2). |
| + |
| +**Round 5** (Astra, 2026-11-26): NOT READY, with 1 P1 and 2 P2. All were applied in revision 6. |
| + |
| +- **P1, job Coordinator turns not covered by `build`.** Job-lane turns aren't dispatched without `build`. Running job turns can't start or change work, `create_project` included, and job cards answered in Equipo's pages are checked the same way (§6.3). |
| +- **P2, idle entry points using a stale board.** Every out-of-turn entry point refreshes a board older than 60 s before acting (§5.3). |
| +- **P2, blocked recovery of a possibly sent call.** Only approvals known not to have been sent expire. A blocked recovery ends `unknown` and isn't resent (§6.1). |