Jobs plan: Astra round 4 fixes (no P1; 4 P2, 1 P3)
- restore is not bound to the card's revision, so Undo works after a dismissed job finishes stopping, with or without scripts. - Equipo's approval cards get the addendum's parts (Task 1.1c). - The machinery test skips only the permitted title link. - Words mode goes through answerQuestionSend; T17 checks the origin. - Exact record files, migration paths and test files. Review loop stops here: round 4 had no P1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+39
−13
docs/superpowers/plans/2026-11-25-jobs-that-keep-moving.md+39 −13
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 === [90m7:52PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m7:52PM[0m [32mINF[0m [1m1 commits scanned.[0m [90m7:52PM[0m [32mINF[0m [1mscanned ~2508457 bytes (2.51 MB) in 245ms[0m [90m7:52PM[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 7.171s 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.285s amadan.net/oficina/base/internal/webtest receipt: slow package 593ms amadan.net/oficina/base/internal/operations receipt: slow package 582ms amadan.net/oficina/base/internal/issuer receipt: slow package 191ms amadan.net/oficina/base/internal/consumer receipt: slow package 167ms amadan.net/oficina/base/internal/web receipt: slow test 1.51s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.09s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce receipt: slow test 510ms amadan.net/oficina/base/internal/operations TestOperationsRefusals receipt: slow test 300ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp receipt: slow test 260ms amadan.net/oficina/base/internal/issuer TestAuthorizeRefusals === 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-25-jobs-that-keep-moving.md b/docs/superpowers/plans/2026-11-25-jobs-that-keep-moving.md| index 4012ab6..74a0151 100644 |
| --- a/docs/superpowers/plans/2026-11-25-jobs-that-keep-moving.md |
| +++ b/docs/superpowers/plans/2026-11-25-jobs-that-keep-moving.md |
| @@ -139,7 +139,7 @@ The audit was not at `/home/paulca/amadan.net/carlos/base/.superpowers/sdd/2026- |
| ### Task 1.1b (Equipo): Decision parts on the cards decision cards left out |
| -The addendum applies to every decision in Equipo and in Base. `cf0614ec` gives parts to ask_person questions, directions, go-aheads and Publish cards; two kinds that ask the person to choose have none: placement cards (`placement_card.go`) and home confirmations (`CardHome`, raised by `set_project_home` in `tools.go`). The approvals (`CardSpecialist`, `CardResearchSources`, `CardResearchInventory`, `CardMergeShips`, `CardMergePolicy`, `CardAccess`) are approval cards, not choices with a recommendation, and keep their own detailed pages (K6); they are out of this task's scope and listed for Paul as **OP2** (should approvals carry a recommendation too?). |
| +The addendum applies to every decision in Equipo and in Base. `cf0614ec` gives parts to ask_person questions, directions, go-aheads and Publish cards; two kinds that ask the person to choose have none: placement cards (`placement_card.go`) and home confirmations (`CardHome`, raised by `set_project_home` in `tools.go`). The approvals (`CardSpecialist`, `CardResearchSources`, `CardResearchInventory`, `CardMergeShips`, `CardMergePolicy`, `CardAccess`) are decisions too and get their parts in Task 1.1c. |
| **Files:** `internal/equipo/chat/decision.go` (`placementDecision`, `homeDecision`), `internal/equipo/chat/placement_card.go`, `internal/equipo/chat/tools.go`, `internal/equipo/copy.go`, `internal/equipo/chat/decision_test.go`. |
| @@ -153,6 +153,22 @@ The addendum applies to every decision in Equipo and in Base. `cf0614ec` gives p |
| **Pending copy (Equipo's own pages):** `decision.placement.context` "This is new work, so it needs a place to live."; `decision.placement.why_new` "None of your projects fits it."; `decision.placement.why_existing` "It fits with {project}."; `decision.placement.detail_new` "Starts a new project for it."; `decision.home.context` "This sets where new projects go from now on."; `decision.home.context_clear` "New projects will be placed one by one again."; `decision.home.why` "It's where your other projects already are." |
| +### Task 1.1c (Equipo): Decision parts on approval cards |
| + |
| +The addendum covers every decision the person sees in Equipo, so the approval cards that stay on Equipo's pages (K6) get the four parts there too. Their existing details (the URLs, address prefixes, capabilities, policy or repository each grants) stay as they are and are the "link to the thing" where there is no preview; the parts add the plain sentence, what each option does, and Equipo's recommendation with its why. The recommendation is advice, never an answer: nothing is granted without the person's tap (K12). |
| + |
| +**Files:** `internal/equipo/chat/decision.go` (`approvalDecision`), `internal/equipo/chat/specialists.go`, `internal/equipo/chat/research.go`, `internal/equipo/chat/research_inventory.go`, `internal/equipo/chat/mergeauth.go`, `internal/equipo/chat/access_request.go` (each stores the parts with `setDecision` where it makes its card), `internal/equipo/copy.go`, `internal/equipo/chat/decision_approvals_test.go` (new). |
| + |
| +**Interfaces (Produces):** `func (t *txn) approvalDecision(kind string, c cardRecord) (context, recommended, why string, details []wire.OptionDetail)`: per kind, instance copy for context and each option's detail; the recommendation is the option that lets the work go on as asked (grant, approve, or the policy the Coordinator proposed) when the card's own checks found nothing unusual, and the cautious option otherwise, each with an instance why. |
| + |
| +- [ ] **Step 1: Failing test** `TestApprovalCardsDecisionParts`: for each of the six kinds, a new card has a context, a detail for every option, and a recommendation naming one of its options with a why; the existing grant details are unchanged; answering is unchanged (no option is pre-selected or applied). |
| +- [ ] **Step 2:** Run `go test ./internal/equipo/chat -run TestApprovalCardsDecisionParts -count=1`. Expected: FAIL. |
| +- [ ] **Step 3:** Implement with approved copy (Task 1.0). |
| +- [ ] **Step 4:** Run the same, then `go test ./internal/equipo/chat -run 'Specialist|Research|Access|MergePolicy|Ships' -count=1`. Expected: PASS. |
| +- [ ] **Step 5:** Commit `Approval cards say what they grant, what each answer does, and advise`. |
| + |
| +**Pending copy (Equipo's own pages):** for each of the six kinds, a context sentence, one detail per option, and a why for each possible recommendation; drafted by the implementer from each card's existing wording and reviewed in Task 1.0 before code (listed in the register as "approval decision parts"). |
| + |
| ### Task 1.2 (Equipo): Job card wire contract |
| **Files:** `internal/wire/assistant.go`, `internal/wire/assistant_test.go`, `docs/api/equipo-v1.md` ("Talk to the Assistant"), `docs/api/equipo-v1.openapi.json`. |
| @@ -190,7 +206,7 @@ const LinkFirstLook = "first_look" |
| ### Task 1.3 (Equipo): Phase 1 storage |
| -**Files:** `internal/equipo/migrations/0108_jobs_act.sql`, `schema.sql`, `internal/equipo/chat/store.go` (records), `internal/equipo/chat/receipts.go` (new). |
| +**Files:** `internal/equipo/migrations/0108_jobs_act.sql`, `internal/equipo/migrations/schema.sql`, `internal/equipo/chat/projects.go` (`cardRecord` gains the new `chat_cards` columns), `internal/equipo/chat/handoff.go` (`handoffRecord` gains `DismissPending`), `internal/equipo/chat/receipts.go` (new: `receiptRecord`, sweep row record), `internal/equipo/chat/receipts_test.go` (new). |
| ```sql |
| ALTER TABLE chat_cards ADD COLUMN dismissed_at datetime; |
| @@ -257,7 +273,7 @@ Ask by kind (phase 1): a question in the job lane → `AskQuestion`, text and la |
| - `TestJobAskPlacement`: labels are `Add to <display name>` and `A new site`, never a repository path. |
| - `TestJobAskDirectionCases`: deployed → status key `first_look_ready`, ask present, link rel `first_look`; queued → `making_first_look`, no ask; failed/declined → `ready_to_decide` with the can't-be-shown text; expired → `ready_to_decide` with the expired text. |
| - `TestJobAskNoCoordinatorWords`: the Coordinator's question text and option labels appear nowhere in the marshalled card. |
| - - `TestJobCardNoMachinery`: for each K11 preview state (deployed, queued, running, failed, declined, expired) and for a question linked to a task, the whole marshalled job card contains no branch URL and none of the machinery words (the Review Focus 2 list); a non-ready link has no URL. |
| + - `TestJobCardNoMachinery`: for each K11 preview state (deployed, queued, running, failed, declined, expired) and for a question linked to a task, every user-visible field of the card (`question`, `result`, `detail`, `context`, the ask's `text` and `note`, option labels and details, `recommended.why`, receipts, and each link's label and note) contains none of the machinery words (the Review Focus 2 list), **except** the one link with rel `equipo` (the job view's title link, the spec's exception), which is skipped; the decision `link` never has a branch URL, and a non-ready one has no URL at all. |
| - `TestJobAskWords`: words offered for an optionless worded question and for the fallback; not for a question with options and no `open_words`; never for placement. |
| - `TestJobAskDirectionOptions`: a direction ask's `options` are exactly `build`, `again`, `drop` with instance labels and details; `recommended.option` is one of them, with instance why copy for each (Review may recommend `drop`); `actions` holds none of them. |
| - [ ] **Step 2:** Run `go test ./internal/equipo/chat -run 'TestJobAsk|TestJobCardNoMachinery|TestAssistantMirrorDecision' -count=1`. Expected: FAIL on the new tests. |
| @@ -302,14 +318,14 @@ func (s *Store) ActOnJob(ctx context.Context, person, cardID string, in wire.Job |
| func (h *HTTP) jobAct(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) // POST /jobs/{id}/act |
| func (t *txn) actDone(h handoffRecord, person, action string) error // audit assistant.job.<action>, handoffActionRecord kind person_<action>, cancel a queued undispatched team_update of h, clear h's digest |
| ``` |
| -One transaction: ledger key `act:<card>:<key>` replay → card as now; project afresh; revision check; decision check (presented `decision` equals `decisionID` of the stored identity and the source card is still open at that revision and candidate); action offered now; then the path. `answer` with `choice` → `optionChoice` → `answerQuestion` in the job lane at the decision's revision (placement through `validatePlacementAnswer`); `answer` with `words` → words mode (K4): allowed only when `askTakesWords` (Task 1.5) holds for the bound decision, so never for placement; `answerQuestionOrigin` gains a `words bool` mode that skips the option check and keeps `originComposer`. Receipt `chose` (with the label shown) or `answered` (with the words). |
| +One transaction: ledger key `act:<card>:<key>` replay → card as now; project afresh; revision check; decision check (presented `decision` equals `decisionID` of the stored identity and the source card is still open at that revision and candidate); action offered now; then the path. `answer` with `choice` → `optionChoice` → `answerQuestion` in the job lane at the decision's revision (placement through `validatePlacementAnswer`); `answer` with `words` → words mode (K4): allowed only when `askTakesWords` (Task 1.5) holds for the bound decision, so never for placement. On main the option check and the forced `originGenerated` both live in `answerQuestionSend` (`projects.go`), which `answerQuestionOrigin` only wraps; so `answerQuestionSend` gains a `words bool` parameter: when true it skips the "must be one of the options" check and does not force `originGenerated` (the message keeps `originComposer`), and `validatePlacementAnswer` still runs (and refuses, as placement never reaches words mode). Every existing caller passes `false`; `ActOnJob` calls it with `true` for words. Receipt `chose` (with the label shown) or `answered` (with the words). |
| - [ ] **Step 1: Failing tests:** |
| - `TestJobActAnswer` (T2): an option answer reaches `answerQuestion` at the decision's revision; card goes `working` with a receipt naming the shown label; a queued `team_update` is cancelled; stale revision → `ErrCardConflict` with the card; withdrawn decision or a new question with identical words → `ErrDecisionGone`; `words` when `ask.words` is false → `ErrInvalid`. |
| - `TestJobActPlacement` (T3, phase 1 half): a placement tap passes `validatePlacementAnswer` and `create_project` makes exactly that repository. |
| - `TestJobActReplayAndRace` (Review Focus 1): same key twice → one answer, one receipt, same card; two keys racing on one revision → one 200, one `card_stale`. |
| - `TestJobActWordsBounds` (Review Focus 3): empty, whitespace, over `wire.MaxMessageBytes`, NUL, invalid UTF-8 → `ErrInvalid`; HTML is stored as given. |
| - - `TestFreeWordsMode` (T17): words accepted for an optionless question, for the bound fallback decision, and (with the column set directly) for `open_words`; refused against a question with options otherwise, and always for placement; origin `originComposer`. |
| + - `TestFreeWordsMode` (T17): words accepted for an optionless question, for the bound fallback decision, and (with the column set directly) for `open_words`; refused against a question with options otherwise, and always for placement; the persisted answer message has `Origin == originComposer` and the person's words as its text; an option answer through the same path still persists `originGenerated`. |
| - `TestJobActHTTP`: route codes 200/409/422/403/404; 409 body is `AssistantConflict` with the card. |
| - [ ] **Step 2:** Run `go test ./internal/equipo/chat -run 'TestJobAct|TestFreeWordsMode' -count=1`. Expected: FAIL. |
| - [ ] **Step 3:** Implement. |
| @@ -343,14 +359,14 @@ func (t *txn) jobSettled(h handoffRecord) (bool, error) // no followed task Canc |
| func (t *txn) settleDismiss(h handoffRecord) error // called where a termination, a merge end or a turn end is recorded; sets dismissed_at and sends the card with hidden:true |
| func (t *txn) mergeTaskAs(person, id string) (attempt int64, err error) // MergeTask's body (merge.go), moved: isOwner, creator, not final or cancelled, mergeOffered, personMerge; attempt 1 on success |
| ``` |
| -`Store.MergeTask` becomes `s.tx(…, CurrentPerson; attempt, err = t.mergeTaskAs(person, id))` and returns `(attempt, err)` as today, so `ActOnJob` runs the merge inside its own transaction with the decision check, ledger and receipt (one rollback for all). `retry` by the card's `stopRow.Retry`: `retryFailedStep` → `retryFailed(h)` as the person; `retryResend` → the hand-off's words sent again as `teamNudge`'s send; `retryMerge` → `mergeTaskAs` for the followed task whose merge failed (`MergeBranch` on the runner records an already-merged candidate as merged). `drop` → `dropJob(…, false)`, receipt `dropped`. `dismiss` is offered in every job view and on finished pills: on a finished job (done, dropped, stopped with nothing running) it sets `dismissed_at` and hides at once; on unfinished work it is `dropJob(…, true)` (drop, then hide once settled). The "Drop this job too?" confirm is Base's, before it sends `dismiss` (O2 as proposed). `restore` clears `dismissed_at` and `dismiss_pending`, never undoes a drop. A dismissed card and the cards attached to it leave the snapshot; nothing is deleted. |
| +`Store.MergeTask` becomes `s.tx(…, CurrentPerson; attempt, err = t.mergeTaskAs(person, id))` and returns `(attempt, err)` as today, so `ActOnJob` runs the merge inside its own transaction with the decision check, ledger and receipt (one rollback for all). `retry` by the card's `stopRow.Retry`: `retryFailedStep` → `retryFailed(h)` as the person; `retryResend` → the hand-off's words sent again as `teamNudge`'s send; `retryMerge` → `mergeTaskAs` for the followed task whose merge failed (`MergeBranch` on the runner records an already-merged candidate as merged). `drop` → `dropJob(…, false)`, receipt `dropped`. `dismiss` is offered in every job view and on finished pills: on a finished job (done, dropped, stopped with nothing running) it sets `dismissed_at` and hides at once; on unfinished work it is `dropJob(…, true)` (drop, then hide once settled). The "Drop this job too?" confirm is Base's, before it sends `dismiss` (O2 as proposed). `restore` clears `dismissed_at` and `dismiss_pending`, never undoes a drop. It is the one action **not** bound to the card's revision: a dismissed card that is still Stopping gets a new revision when termination hides it, so an Undo carrying the older revision (a scripts-off page, a slow tap) must still work. `restore` checks only that the card is the person's and is dismissed or dismiss-pending; on a card that is neither it answers the card as it is (200, no change). Restoring twice is harmless. A dismissed card and the cards attached to it leave the snapshot; nothing is deleted. |
| - [ ] **Step 1: Failing tests:** |
| - `TestJobActRetry` (T5): each K6 Try again runs its path; Try again after `merge_uncertain` where the candidate already reached the default branch records it merged and makes no merge call; a merge refused by `mergeTaskAs` (not offered any more) rolls back the receipt and ledger and answers `ErrDecisionGone` with the card; two racing Try again taps make one merge step. |
| - `TestMergeTaskUnchanged`: `MergeTask` still answers attempt 1 on success and its errors (`ErrForbidden`, `ErrTaskEnded`, `ErrNotMergeable`) as before; the existing merge tests pass unchanged. |
| - `TestJobDropDismiss` (T6): drop cancels created tasks only; restore brings back visibility, never the work; a dismissed card is absent from the snapshot and sent once with `hidden: true`. |
| - - `TestDropSettles` (T16): a drop-and-dismiss during a running Engineering step, during a merge, and with the runner disconnected keeps the card visible as Stopping until termination is proven; then hidden; restore after that restores visibility only; `dismiss_pending` survives a store reopen. |
| -- [ ] **Step 2:** Run `go test ./internal/equipo/chat -run 'TestJobActRetry|TestJobDropDismiss|TestDropSettles|TestMergeTaskUnchanged' -count=1`. Expected: FAIL. |
| + - `TestDropSettles` (T16): a drop-and-dismiss during a running Engineering step, during a merge, and with the runner disconnected keeps the card visible as Stopping until termination is proven; then hidden; restore after that restores visibility only; `dismiss_pending` survives a store reopen; `TestRestoreIgnoresRevision`: dismiss unfinished work → keep the revision R → termination hides the card (revision R+1) → `restore` with R succeeds; `restore` on a visible card changes nothing. |
| +- [ ] **Step 2:** Run `go test ./internal/equipo/chat -run 'TestJobActRetry|TestJobDropDismiss|TestDropSettles|TestRestoreIgnoresRevision|TestMergeTaskUnchanged' -count=1`. Expected: FAIL. |
| - [ ] **Step 3:** Implement; `teamCancel` calls `dropJob` after its tool-call checks; `MergeTask` calls `mergeTaskAs`. |
| - [ ] **Step 4:** Run the same, then `go test ./internal/equipo/chat ./internal/thintest -run 'Cancel|Handoff|Merge' -count=1`. Expected: PASS. |
| - [ ] **Step 5:** Commit `Try again, drop and dismiss a job; hide only once it has stopped`. |
| @@ -499,7 +515,7 @@ The client takes the capability per call (`WithCapabilities(ctx, bool) context.C |
| What it draws (no scripts needed): while `asking`, the ask strip under the pill title: context line, the link to the thing (or its note when not ready) **before** the options, one form button per option (detail under it when set), the recommended option marked with "Recommended" and its why, and "Something else" as a nested `<details>` with a one-line field "Tell me what you'd like" and "Send" when `ask.words`; a direction's or a replace's options drawn the same way, with their instance labels and details: `again` is a `<details>` whose field is labelled with the instance's `ask.note` (required, maxlength 1000) and `drop` a `<details>` confirm. The first-look link (`Go()`) is drawn on the pill and in the job view in **every** state that carries one, not only ready and done (today's `ask-job` and `ask-jobview` limit links to those two). **Outcome cards too** (addendum): the existing `ask-card` (go-ahead, Publish) draws the same context, link-before-options, recommended mark and option details, through one shared partial `ask-decision` used by both. While `stopped`, the detail line and its actions (Try again, Drop it, Dismiss). The job view: the same, plus receipts, Dismiss on finished jobs, and for unfinished work Drop it's confirm "Drop this job too?" with "Drop it" / "Keep it" when reached from Dismiss. Scripts-off Undo: when `/ask` is loaded with `dismissed` (a card id, `validJob` shape) and `rev` (an integer), the page draws "Dismissed." with an Undo form posting `action=restore`, that `revision` and a fresh key to `/ask/jobs/{id}/act`; it is drawn once, from the query only, and needs nothing stored. Look: option buttons are the ghost buttons; Try again and Build it the solid frost primary; Drop it and Dismiss quiet text buttons; the first-look link accent teal; reduced motion respected. |
| -- [ ] **Step 1: Failing tests (webtest):** `TestAskJobAskDrawn` (option forms carry `decision`, `choice`, `revision`, `key`; link before options; recommended marked), `TestAskJobDirectionDrawn` (options' instance labels and details; note label from `ask.note`), `TestAskJobFirstLookScriptsOff` (a working pill and its job view show the first-look link with scripts off), `TestAskJobDismissUndoScriptsOff` (dismiss → 303 with `dismissed` and `rev` → the page offers Undo → restore → the pill is back; a malformed `dismissed` or `rev` draws nothing), `TestAskJobStopDrawn`, `TestAskJobReceiptsDrawn`, `TestAskJobNoActionsWithoutAsk` (an older Equipo: nothing new drawn), `TestAskOutcomeDecisionDrawn` (a go-ahead and a Publish card show context, link before options, recommended and details; one with none of them draws as today). |
| +- [ ] **Step 1: Failing tests (webtest):** `TestAskJobAskDrawn` (option forms carry `decision`, `choice`, `revision`, `key`; link before options; recommended marked), `TestAskJobDirectionDrawn` (options' instance labels and details; note label from `ask.note`), `TestAskJobFirstLookScriptsOff` (a working pill and its job view show the first-look link with scripts off), `TestAskJobDismissUndoScriptsOff` (dismiss → 303 with `dismissed` and `rev` → the page offers Undo → restore → the pill is back; the same when the fake hides the card with a newer revision between the redirect and the Undo; a malformed `dismissed` or `rev` draws nothing), `TestAskJobStopDrawn`, `TestAskJobReceiptsDrawn`, `TestAskJobNoActionsWithoutAsk` (an older Equipo: nothing new drawn), `TestAskOutcomeDecisionDrawn` (a go-ahead and a Publish card show context, link before options, recommended and details; one with none of them draws as today). |
| - [ ] **Step 2:** Run `go test ./internal/webtest -run 'TestAsk(Job(Ask|Direction|Stop|Receipts|NoActions|FirstLookScriptsOff|DismissUndoScriptsOff)|OutcomeDecision)' -count=1`. Expected: FAIL. |
| - [ ] **Step 3:** Implement with approved copy (Task 1.0); add rows to `docs/copy-pending.md`. |
| - [ ] **Step 4:** Run. Expected: PASS. |
| @@ -719,7 +735,7 @@ The Coordinator's tool sequence, in the same turn: `ask_person` (placement, `Rep |
| ### Task 3.2 (Equipo): First look on the instance |
| -**Files:** `0110_first_look.sql` (`chat_tasks.first_look`), `internal/equipo/chat/tasks.go` (`record_task`), `internal/equipo/chat/review.go` (dispatch mode), `internal/equipo/chat/preview.go` (`schedulePreview` on first-look approval), `internal/equipo/chat/preview_security_test.go`. |
| +**Files:** `internal/equipo/migrations/0110_first_look.sql` (`chat_tasks.first_look`), `internal/equipo/migrations/schema.sql`, `internal/equipo/chat/tasks.go` (`record_task`), `internal/equipo/chat/review.go` (dispatch mode), `internal/equipo/chat/preview.go` (`schedulePreview` on first-look approval), `internal/equipo/chat/preview_security_test.go`. |
| `first_look` honoured only in a job lane (instance-assigned marker); Engineering's dispatch gets the limits as `FirstLookNote` (one static page, plain HTML and CSS, no build step, one pass), never in the brief; review dispatched with mode `first_look`; `schedulePreview` runs on that approval; `buildThisOne`'s brief carries no first-look limits. |
| @@ -789,7 +805,7 @@ Base keeps `first_look` links since Task 1.15; this proves the drawing on a work |
| ### Task 4.2 (Equipo): Replace a repeated request (K10) |
| -**Files:** `0111_jobs_replace.sql` (`chat_handoffs.replaced_by`), `internal/equipo/chat/handoff.go` (`teamRequest`: `replaces` in, `similar` out), `internal/equipo/chat/job_ask.go` (`AskReplace`), `internal/equipo/chat/job_act.go` (`replace`, `keep`), tests. |
| +**Files:** `internal/equipo/migrations/0111_jobs_replace.sql` (`chat_handoffs.replaced_by`, `chat_handoffs.replaces`), `internal/equipo/migrations/schema.sql`, `internal/equipo/chat/handoff.go` (`teamRequest`: `replaces` in, `similar` out; `handoffRecord` fields), `internal/equipo/chat/job_ask.go` (`AskReplace`), `internal/equipo/chat/job_replace_test.go` (new), `internal/equipo/chat/job_act.go` (`replace`, `keep`), tests. |
| `replaces` allowed only while the old job is the person's, open, no followed task beyond `investigated` and no step dispatched or running (`replaceable(old handoffRecord) (bool, error)`); else `replaces_busy`. The ask is `AskReplace` with options `replace` and `keep` (instance labels "Replace it" and "Keep both", details, context, `recommended` = `replace` with its why), per PD4; a tap sends the option's value as the action. Binding: the new job's card stores the replace decision in its own decision columns: `decision_card` = the **old** job card's id, `decision_rev` = that card's revision when the offer was made, `decision_cand` = `"replace"`; `chat_handoffs.replaces` (new column) names the old hand-off on the new one. A replace decision is **not** checked by Task 1.7's open-source-card rule (its source is a job card, not an open card); it has its own check, `func (t *txn) replaceStands(newCard cardRecord, old handoffRecord) (ok bool, why string, err error)`: the new card's ask is still this decision, the old job card is still at `decision_rev`, and `replaceable(old)`. At the tap, in one transaction, following `CarryOn`'s pattern (a `refused` value set inside the transaction, which then commits, and the error returned after it): when it does not stand because the old work has started (`why = "busy"`), the ask is cleared and the receipt "Kept both: the earlier one had already started." written, the transaction commits, and the answer is `ErrDecisionGone` with the card as it now is; when the old card's revision moved for any other reason, nothing is written and the answer is `ErrDecisionGone` with the card (the re-projected ask, if the offer still holds, carries the new revision). When it stands: `dropJob(person, old, true)`, `old.replaced_by = new.ID`, the ask cleared, receipts `replaced_by` on the old and `replaces` on the new. `keep` clears the ask. Any change to the old card (it moved on, the person answered something on it) moves its revision and so withdraws the offer. `similar`: the person's open jobs whose titles read alike (same normalised words, at least half shared). |
| @@ -834,7 +850,7 @@ A `done` job is a full pill for 24 h after `updated_at`, then drawn in the Finis |
| ### Task 4.6: Hand-off |
| - [ ] **Step 1:** Full gates once: Equipo `make ci`; Base `make ci`, `make browser`, `make native-check`. |
| -- [ ] **Step 2:** Write the handoff (the `handoff` skill): what shipped per phase, deploy steps taken or pending, open points (OP1 Try again on a missing merge credential, OP2 recommendations on approvals, O7, the follow-up design for approvals in Base). |
| +- [ ] **Step 2:** Write the handoff (the `handoff` skill): what shipped per phase, deploy steps taken or pending, open points (OP1 Try again on a missing merge credential, O7, the follow-up design for approvals in Base). |
| --- |
| @@ -846,6 +862,8 @@ DRAFT wording from the spec, for copy review before any code writes it. Keys are |
| **Addendum (Equipo, already drafted on `cf0614ec`):** the 34 `decision.*` and `assistant.decision.*` strings in that commit's `internal/equipo/copy.go`, marked `COPY REVIEW PENDING` there. |
| +**Addendum (Equipo's approval cards, Task 1.1c):** "approval decision parts": for `CardSpecialist`, `CardResearchSources`, `CardResearchInventory`, `CardMergeShips`, `CardMergePolicy` and `CardAccess`, one context sentence, one detail per option and one why per possible recommendation each (about 30 strings). They are drafted from each card's existing approved wording at the start of Task 1.0 and reviewed with the rest; no wording is proposed here because each depends on what that card already says. |
| + |
| **Addendum (Equipo's own placement and home cards, Task 1.1b):** "This is new work, so it needs a place to live.", "None of your projects fits it.", "It fits with {project}.", "Starts a new project for it.", "This sets where new projects go from now on.", "New projects will be placed one by one again.", "It's where your other projects already are." |
| **Equipo instance copy, job asks (Tasks 1.5, 1.8, 1.11):** |
| @@ -949,5 +967,13 @@ DRAFT wording from the spec, for copy review before any code writes it. Keys are |
| - P1 direction links could carry a branch URL and branch words into Base: one `assistantLink` conversion for every Assistant-card link, tested over every preview state (Task 1.5). |
| - P2 replace had no consistent conflict semantics: its own `replaceStands` check and `CarryOn`'s commit-then-refuse pattern (Task 4.2). |
| - P2 no scripts-off Undo: the redirect carries the dismissed card and revision, and the page offers a restore form (Tasks 1.17, 1.18). |
| -- P2 Equipo's placement and home cards had no decision parts: Task 1.1b; approvals listed as OP2. |
| +- P2 Equipo's placement and home cards had no decision parts: Task 1.1b; approvals listed as OP2. *(OP2 replaced by Task 1.1c in round 4.)* |
| - P2 default receipts could show Coordinator option text: `shownLabel` or a plain receipt (Tasks 2.4, 2.8). P2 contradictory capability tests made consistent (Task 1.17). P3 run filters and `dropJob`'s signature. |
| + |
| +**Astra, round 4 (2026-11-25): REVISE, no P1** (4 P2, 1 P3). All round-3 P1s resolved. The review loop stops at this round; its findings were applied once, not re-reviewed: |
| + |
| +- P2 scripts-off Undo failed after a deferred hide (the revision moves): `restore` is the one action not bound to the revision (Task 1.9; tests in 1.9 and 1.18). |
| +- P2 approvals were left out of the addendum: Task 1.1c gives Equipo's six approval cards their parts; OP2 withdrawn. |
| +- P2 the machinery test would have failed on the permitted title link: it checks user-visible fields and skips only the `equipo` link (Task 1.5). |
| +- P2 words mode named the wrapper: `answerQuestionSend` gains the mode; T17 checks the stored origin (Task 1.7). |
| +- P3 exact record files, migration paths and test files (Tasks 1.3, 3.2, 4.2). |