plan: name the new protocol ProtocolHostedRunners (39)
ProtocolHostedChecks already exists (Protocol5, hub hosted CI).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+3
−3
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md+3 −3
Intent
Human
Paul accepted all recommendations on 2026-11-30. Start building slice 2 tasks in order, Opus building and Astra reviewing per task. Stop at the dev drill and the production bring-up; both need Paul's GO. Never merge to main.
diff --git a/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md b/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md| index 8c7964ca..0eda77bf 100644 |
| --- a/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md |
| +++ b/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md |
| @@ -37,7 +37,7 @@ Slice 1a built the controller, the adapter and the reaper, with no egress stack: |
| - Spec §17's five rules apply to every task: a hello is diagnostic only (Fable M8); untrusted text enters prompts only through `wire.QuotedData` under a source label (Fable M4); a sandbox that runs candidate code has no network (Fable H3). |
| - Egress names are exact fully qualified hostnames on port 443, copied into each launch record. No wildcard, suffix match, IP literal or `amadan.net` in a VM's set. An unset name blocks launch. |
| - Every new instance route checks the current roster inside its transaction; lookup errors deny. An unknown count stays unknown and denies admission. |
| -- Migrations additive, the next free number at the time (latest on main is `0124_step_renders.sql`). Protocol: one new number, `wire.ProtocolHostedChecks`, the next free at build time (main's highest is 38); confirm with the coordinator before code. Hosted placement requires it on both the primary and the hosted runner, so no older runner sees a hosted frame or transfer. |
| +- Migrations additive, the next free number at the time (latest on main is `0124_step_renders.sql`). Protocol: one new number, `wire.ProtocolHostedRunners`, the next free at build time (main's highest is 38); confirm with the coordinator before code. Hosted placement requires it on both the primary and the hosted runner, so no older runner sees a hosted frame or transfer. |
| - Package budgets (`.rastrillo/budgets.txt`): `internal/runner/thin`, `internal/runner`, `internal/wire`, `internal/runner/provider` and `internal/hostedctl` are at their recorded sizes. New code goes in new packages (each task names them); any line added to one of those five, or to `internal/equipo/chat`, raises its record in the same commit with the reason. |
| - Copy: new runtime strings only in `internal/equipo/copy.go`, marked pending with `python3 scripts/copy-status.py pending`, listed in `docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json`. Never accepted by an agent. Plain words, no em dashes, no exclamation marks. |
| - Tests first. Each guard gets a mutation check: break it, watch the named test compile, run at least one test and fail on its assertion (a build error, an infrastructure error or a run of zero tests does not count), restore. Record commands and results in `docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md`. |
| @@ -445,7 +445,7 @@ Hold, with `window = HostedLaunchWindow + lifetime`: `window` seconds against ea |
| 1. The step has a live job (checked first, whatever else has changed): `pending`, `launching`, `enrolling` keep `waiting_hosted` with no new hold; `enrolled` sets `RunnerID` to the job's runner and dispatches; `stopping` keeps `waiting_hosted` until proof arrives, then rule 2 applies. |
| 2. The step's last job `failed`, or `ended` without a report: if `retries < 1` and its stop proof is recorded, go on to rule 5 with `retry_of` set; else fail the step with that job's reason. |
| 3. Needs a hosted VM cannot meet (a Mac, a tag the image lacks): today's path, unchanged. |
| -4. The primary is not online or speaks below `ProtocolHostedChecks`: `waiting_hosted` if the project setting is on (the step waits for its primary as hosted work, never falls back to running on the primary); after `OfflineLimit` the step resolves `runner_offline`. |
| +4. The primary is not online or speaks below `ProtocolHostedRunners`: `waiting_hosted` if the project setting is on (the step waits for its primary as hosted work, never falls back to running on the primary); after `OfflineLimit` the step resolves `runner_offline`. |
| 5. Admit: `hostedAdmit`; on success create the job `pending` and set `waiting_hosted`; on refusal set `hosted_limit` with the reason. |
| Both placements are in `waitingPlacements`. A step with a live hosted job is exempt from offline withdrawal, by job identity. If the primary is offline past `OfflineLimit` while a job waits, the step resolves `runner_offline` and the job is stopped. |
| @@ -511,7 +511,7 @@ H3 is closed by Tasks 2, 4, 6, 7 and 9 (exact hosts, authenticated proxy, fronti |
| **Files:** Modify `internal/runner/thin/research.go:664-691`, `internal/equipo/chat/runners.go` (placement and `Authorize` at `:931`), `internal/wire/runners.go:860-866`. Create `internal/runner/thin/research_quote_test.go`, `internal/equipo/chat/protocol_floor_test.go`. |
| -**Interfaces:** every untrusted value in Research's prompt enters through `wire.QuotedData` under a label: `Task title`, `Task brief`, `Question`, `Specialist brief`, `Person's words`, and for each source `Source <n> URL`, `Source <n> title`, `Source <n> text`, `Image <n> description`; the `<<<`/`>>>` and `=== source` fences go. `wire.ProtocolHostedChecks` also marks this quoting. Placement and `Authorize` refuse Research on a runner below it, and Engineering, Design and Research below `ProtocolInjectionDefences` (28), with reason `runner_update_needed`; a queued command for such a runner is re-checked at `Authorize`. Then the folding at `wire/runners.go:860-866` is deleted. |
| +**Interfaces:** every untrusted value in Research's prompt enters through `wire.QuotedData` under a label: `Task title`, `Task brief`, `Question`, `Specialist brief`, `Person's words`, and for each source `Source <n> URL`, `Source <n> title`, `Source <n> text`, `Image <n> description`; the `<<<`/`>>>` and `=== source` fences go. `wire.ProtocolHostedRunners` also marks this quoting. Placement and `Authorize` refuse Research on a runner below it, and Engineering, Design and Research below `ProtocolInjectionDefences` (28), with reason `runner_update_needed`; a queued command for such a runner is re-checked at `Authorize`. Then the folding at `wire/runners.go:860-866` is deleted. |
| - [ ] **Red:** `TestResearchQuotesEveryValue` (a title containing `>>>`, a source title containing a fake `=== source` line and a URL containing a quote each stay inside their quoted value). `TestProtocol38RunnerGetsNoResearch`. `TestQueuedResearchRecheckedAtAuthorize`. `TestNoBriefFolding`. |
| - [ ] **Green:** `go test ./internal/runner/thin ./internal/equipo/chat ./internal/wire -run 'TestResearchQuotes|TestProtocol38|TestQueuedResearch|TestNoBriefFolding' -count=1`. |