SLICE4B-PROGRESS; time budgets for the headless suite and checks
The headless suite gains 4b_ask and measured 182.9s on loaded CI; runner/checks, unchanged, measured 61.1s there. Progress log with the staging check and the open witness question.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+199
−2
.rastrillo/budgets.txt+2 −2docs/superpowers/plans/SLICE4B-PROGRESS.md+197 −0
CI passed — run details
Intent
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 5d450d07..9d667334 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -16,7 +16,7 @@ time internal/equipotest 300s Final fix package rerun measured 187.035s (review |
| size internal/equipo 12000 - Thin v1 slice 4 adds the thin sidebar (rail.go), review and checks lines on the task card and pages, and their copy (about 190 lines). Thin v1 slice 3 adds the task card, the thin Tasks and Projects pages and their actions over the chat store, and their copy (about 280 lines). Thin v1 slice 2 adds activity labels, card copy and card rendering on the chat page (about 250 lines); slice 1 added the chat wiring and page (about 180 lines) beside code its slice 7 sweep deletes (the live hub, the old coordinator); lower then. Task 7 keeps the existing ceiling by moving transaction-bound event lookup into conversation. Measured 10796 source and 437 test lines; roster, database, pending copy and execution wiring remain here. |
| size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged. |
| -time internal/runner/checks 60s CI worker measured 44.553s (44.6s rounded); 60s gives 34 percent headroom. Shared baseline capture reduces repeated Go runs; retain the CI allowance for sandbox sentinels, timeout and child cleanup. |
| +time internal/runner/checks 75s CI worker measured 44.553s (44.6s rounded), and 61.1s on the loaded slice 4b CI run (package unchanged); 75s gives 23 percent headroom over that. Shared baseline capture reduces repeated Go runs; retain the CI allowance for sandbox sentinels, timeout and child cleanup. |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). Parallel plan graphs and removal of repeated progress floods reduced their local targeted run from 146.920s to 30.784s; the original bug graph retains volume coverage. Keep 330s for journal, proxy, recovery and namespace integration, with 13 percent headroom. |
| perf GET /api/runner/v2/artifacts/{assignment}/{artifact} skip Authenticated runner artifact download, not a browser GET screen. Runner long-poll and blob downloads use POST and are outside the screen inventory. |
| @@ -37,7 +37,7 @@ time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; niced se |
| time internal/tryequipo 30s Release starter-set controller K3 records CI runs of 10.8s and 13.1s; 30s retains the guide integration checks with headroom on the shared runner. |
| size internal/runner/thin 8000 - Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808. Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path; measured 7685. |
| time internal/thintest 30s Thin v1 contract tests: a real instance and a scripted runner per test, fixtures replayed against every request, frame and event. Slice 3 adds the task, step-sync and grant contracts; CI measured 14.805s. 30s keeps room for the slice 4 review contracts. |
| -time internal/headless 180s Thin v1 headless suite: real instance, runner and bubblewrap per scenario (spec 7, under two minutes) |
| +time internal/headless 240s Thin v1 headless suite: real instance, runner and bubblewrap per scenario (spec 7, under two minutes). Slice 4b adds 4b_ask (a task to ready to merge, then four questions; about 12s); loaded CI measured 182.9s for the package, 135s for TestHeadless itself. 240s keeps 30 percent headroom. |
| perf GET /api/v1/turns/{id} skip Thin v1 person API: bearer-only JSON for devices, not a browser screen. |
| perf GET /api/v1/events skip Thin v1 person event stream (Server-Sent Events), long-lived by design; not a screen. |
| perf GET /api/runner/stream skip Thin v1 runner WebSocket, bearer-only and long-lived; not a browser screen. |
diff --git a/docs/superpowers/plans/SLICE4B-PROGRESS.md b/docs/superpowers/plans/SLICE4B-PROGRESS.md| new file mode 100644 |
| index 00000000..ae429905 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/SLICE4B-PROGRESS.md |
| @@ -0,0 +1,197 @@ |
| +# Slice 4b progress: ask the implementer |
| + |
| +Branch `thin-v1-slice4b` from `thin-v1-slice4` (ca0a65c). Spec: |
| +`docs/superpowers/specs/2026-11-06-equipo-thin-v1.md` §§1-5, 7, 8, and |
| +Paul's ruling of 2026-11-07: "The co-ordinator should be dealing with |
| +the highest-level. If I want specifics I should be able to go in and ask |
| +the implementing agent." First open issue of `SLICE4-PROGRESS.md`. |
| +Conventions and scripts as in `SLICE1-PROGRESS.md` to `SLICE4-PROGRESS.md`. |
| + |
| +## Done |
| + |
| +1. Contracts (`internal/wire/questions.go`, fixtures): resource |
| + `Question` (task, step, specialist, asker, text, state `queued | |
| + running | answered | failed | cancelled`, reason, attempt, answer, |
| + timing); `POST /api/v1/tasks/{id}/questions` `{text, |
| + idempotency_key, specialist}` (202 with the Question; same key and |
| + another body 409; `not_askable`, `task_ended`, 403 for anyone but the |
| + creator), `GET /api/v1/questions/{id}`, `POST |
| + /api/v1/questions/{id}/cancel` (202 `{attempt}`, 409 |
| + `question_ended`); event `question` to every active member; |
| + `Task.questions`, `Step.askable`. The answer streams as the chat's |
| + `delta` and `activity` events with resource `question` and the |
| + question's id as `turn_id`; the answered question replaces the |
| + draft. Frames `ask`, `cancel_ask`, `forget_task` (to the runner), |
| + `answer` (back), all durable; `Sync.asks`, `StepReport.askable`. |
| + `AddressesReview` (whole word review, reviewer, reviewed...). New |
| + fixtures `api/question.json`, `api/ask-request.json`, |
| + `api/event-question.json`, `frames/ask.json`, `cancel_ask.json`, |
| + `answer.json`, `forget_task.json`; task, step, sync fixtures gained |
| + the new fields. |
| + |
| +2. Instance (`internal/equipo/chat/questions.go`, migration 0045): |
| + questions are team records; only the task's creator (an owner) asks |
| + or cancels. Target: the specialist chosen, else Review when the text |
| + addresses it and Review can answer, else the newest askable |
| + Engineering step. Question, event and `ask` command in one |
| + transaction; one question of a task with the runner at a time, the |
| + next dispatched when it ends. Answer reports only from the step |
| + person's primary runner, current attempt, forward only; deltas and |
| + activity go to every member under resource `question` (labels: |
| + reading the code, searching the code, "Looking at the change…"). |
| + Cancel: at once if never dispatched, else `cancel_ask` and the |
| + runner's report ends it. A sync that no longer holds an acked |
| + question fails it (`interrupted`). A task becoming done or cancelled |
| + stops its questions and sends `forget_task`. `read_task` leaves the |
| + questions out (the coordinator never relays them). The thin `GET |
| + /questions/{id}` hands the old engine's question ids to its handler |
| + until the slice 7 sweep. |
| + Tests: `TestContractAskImplementer`, `TestPagesTaskThread`. |
| + |
| +3. Runner (`internal/runner/thin/ask.go`, provider action `answer`): |
| + - Keep sessions: Engineering and Review copy their transcript (only |
| + `projects/-workspace/<session>.jsonl`, never a credential) into |
| + `sessions/<person>/steps/<step key>/` once the namespace's exit is |
| + verified, record it (`kept_sessions`: step, attempt, task, |
| + account, session id, commit, bytes) and report `askable` (Engineering |
| + when pushed, Review with its verdict). The worktree is recreated |
| + from the commit on demand, not kept. |
| + - Asking: the step's own session `--resume`d on its own account in |
| + the same containment, profile `answer`: a fresh read-only tree of |
| + the exact commit (bwrap read-only mount and settings `denyWrite` |
| + /workspace), native tools Read, Glob, Grep only (permission |
| + callback `ReadPermission`), and three read-only git tools the runner |
| + runs on its private repository (`git_log` base..commit, `git_diff` |
| + optionally one path, `git_show` of a commit in that history only); |
| + no Bash, Write, Edit, push or forge. `--include-partial-messages`: |
| + text and activity stream as `delta`/`activity`. The transcript is |
| + kept again after, so a follow-up continues the session. The prompt |
| + tells it to say plainly it can't change anything from here. |
| + - Questions share the step engine's one queue (arrival order), so a |
| + question waits for a running step and never runs beside one; a |
| + cancel that comes first holds the question; a restart ends running |
| + questions (`runner_restarted`), never runs one twice. |
| + - Retention: `forget_task` deletes the task's kept sessions; any kept |
| + session unused for 14 days goes, and any directory no record names; |
| + the sweep runs on every engine wake and hourly, and logs the count |
| + and bytes kept. |
| + Tests: `TestAnswerPolicyIsReadOnly`, `TestAnswerGitIsReadOnly`, |
| + `TestKeptSessionsForgetAndExpire`, |
| + `TestSweepKeptStaysUnderTheSessionRoot`, `TestAskQueuesWithSteps`, |
| + `TestRecoverAsks`. |
| + |
| +4. Fake CLI: `[Equipo: question]` answers "From my session: <the last |
| + reply in its transcript>", `ask:git` (git_diff), `ask:read:<path>`, |
| + `ask:write:<path>`, `asksleep:<ms>`. |
| + |
| +5. Headless `4b_ask` (fake CLI in real bwrap, local forge): a task to |
| + ready to merge keeps two sessions; Engineering answers from its own |
| + session (its step summary), reads the change through git and a file |
| + through Read; Review, addressed by name, answers from its own and its |
| + write is denied ("I can't change anything from here."); a follow-up |
| + continues Engineering's session; the answer streams (first activity |
| + and text seen before the answer); the branch is unchanged; a long |
| + question is cancelled; after the person merges the task is done, the |
| + kept sessions are gone and asking is 409. `4b_witness` is staging |
| + only (`EQUIPO_STAGING_ASK_TASK`). |
| + |
| +6. Coordinator: house rule 2026-11-07.8. No file paths, line numbers or |
| + code mechanics in replies, even on request; for specifics it points |
| + at the task ("You can ask Engineering on [title](link).", or Review |
| + about the review). `TestOpeningPointsToAskTheImplementer`. |
| + |
| +7. UI: the task page's thread (`work_task.html`) holds the creator's |
| + questions and answers, and notes, oldest first, rendered like the |
| + chat (own bubble, answer with the specialist's name and markdown, |
| + the thinking line while waiting or running, a quiet line when one |
| + ended). The composer is the chat's (`#chat-composer`, click anywhere |
| + to focus, docked sticky on the page's own colour) with a quiet |
| + "Asking Engineering · change" line (`ask-target.js`): it follows the |
| + text (Review when addressed) and change switches explicitly; one |
| + specialist only, no change. For a teammate, or before anyone can |
| + answer, the composer adds a note as before. `chat-stream.js` follows |
| + the thread with the chat's pieces (`[data-chat-stream][data-task]`): |
| + question streams only, background send reconciled by id, the |
| + answered question settles into its draft element; the conversation |
| + ignores question streams. `TestBrowserTaskThread` (1280 mouse, 390 |
| + touch; no reload). |
| + |
| +8. Mutation checks (risky paths; each observed failing a test unless |
| + noted): creator check (with the target-person check behind it), one |
| + question at a time, the task's end and forget, answer after the |
| + question ended, resume of the kept session, the read-only profile |
| + and its native tools, `git_show` outside the change, the kept-session |
| + path guard, Engineering `askable`, the question event listener and |
| + the Review routing in the page. Survived, as defence in depth: the |
| + ask's permission callback swapped for Engineering's (the read-only |
| + policy refuses the write first); removing either the forget frame's |
| + directory removal or its row deletion alone (the orphan sweep, or the |
| + removal, covers the other). |
| + |
| +## Decisions |
| + |
| +- Sessions are kept as transcripts, like the coordinator's; the tree |
| + is recreated from the commit on demand (cheap, and nothing in it can |
| + drift). Disk: one transcript per Engineering or Review attempt; |
| + measured on staging once a step runs on this release (open issue). |
| +- A question resumes the step on the account that ran it. If that |
| + account is unhealthy the question fails `account_unavailable`. |
| +- The answering session gets read-only git as runner-side tools rather |
| + than a shell: no shell in the namespace can modify anything because |
| + there is no shell. |
| +- Questions run in the one step queue: simplest way to never run beside |
| + a write step; a question may wait behind another task's step. |
| +- Thread notes stay: a teammate's composer adds notes, and the creator's |
| + does until a specialist can answer. |
| +- `read_task` returns no questions; the coordinator points to the task. |
| +- Default target is the newest askable Engineering step (after a fix |
| + round, the fix round's session). |
| + |
| +## Staging |
| + |
| +Release d976251 (built by `scripts/staging-thin.py build`, deployed with |
| +`--swap hold` at 20:54:26, both runner units installed by 20:55:22, |
| +about a minute), no live run: |
| +- `tk2jhc6z46ar` (suite, ready to merge on b9bc2406): its steps ran on |
| + slice 4, which deleted each step's session with its runtime home, so |
| + none is askable (`askable: false` on all three steps). `POST |
| + .../questions` answers `409 not_askable` and the page shows the note |
| + composer, not the ask line. Nothing can resume those sessions. |
| + |
| +## Live runs (budget: 8 ask turns, 2 coordinator turns) |
| + |
| +Used: none. |
| + |
| +## Open issues |
| + |
| +- The staging witness needs a task whose Engineering and Review steps |
| + ran on this release: a new suite task costs one coordinator turn and |
| + one Engineering and one Review step, which the budget does not cover. |
| + Waiting for the controller's go-ahead; then `EQUIPO_STAGING_ASK_TASK= |
| + <task> scripts/staging-thin.py suite 4b_witness` asks the three |
| + questions (3 ask turns) and records answers and timings. |
| +- Disk cost of kept sessions is not yet measured live (the runner logs |
| + `kept sessions kept=<n> bytes=<b>` on each sweep). |
| +- Version skew as in slice 4: an old runner refuses `ask` and |
| + `forget_task`; install runners right after the instance. |
| +- A question waits behind any running step on the runner, including |
| + another task's. |
| + |
| +## Copy for review |
| + |
| +Accepted for now with the existing marker in `copy.go` and listed in |
| +the plan 3 inventory: |
| +- `work.thread` "Questions and notes", `work.thread_empty` "No |
| + questions or notes yet." |
| +- `work.ask.target` "Asking %s", `work.ask.change` "change", |
| + `work.ask.placeholder` "Ask %s about this work" |
| +- `work.ask.queued` "Waiting for its turn…" |
| +- `work.ask.failed` "%s couldn't answer: %s.", `work.ask.cancelled` |
| + "Question cancelled.", `work.ask.reason.session_gone` "its session for |
| + this work is no longer kept", `work.ask.reason.task_ended` "the task |
| + has ended" |
| +- `chat.activity.read_change` "Looking at the change…" |
| + |
| +## Blockers |
| + |
| +The live witness (above): a decision on the extra live runs. |