oficina / equipo Public

hosted: renumber to protocol 40 and migrations 0126-0131

design-feedback-1 took protocol 39 and migration 0125 and reaches main
first (coordinator ruling 2026-12-01). wire.ProtocolHostedRunners is
Protocol40; Protocol39 stays as design-feedback-1 declares it. The six
hosted migrations move up one (git mv, contents unchanged); the Research
floor follows to 40. Tests, budgets, plans and the progress record
follow; mutations RN1-RN3 recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 671ff55eea132f929878112c44e73a61b755799c parent b7af294
37 files changed, +125 −79
  • .rastrillo/budgets.txt +4 −4
  • docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json +1 −1
  • docs/superpowers/plans/2026-11-30-hosted-slice-4-needs.md +1 −1
  • docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md +2 −2
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +1 −1
  • docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md +58 −22
  • docs/superpowers/plans/HOSTED-SLICE2-RULINGS.md +1 −0
  • internal/equipo/chat/hosted_jobs_test.go +6 −6
  • internal/equipo/chat/protocol_floor_test.go +11 −10
  • internal/equipo/chat/research.go +1 −1
  • internal/equipo/chat/specialist_grants_test.go +3 −3
  • internal/equipo/hosted_settings_test.go +10 −6
  • internal/equipo/migrations/{0125_hosted_checks_setting.sql => 0126_hosted_checks_setting.sql} +0 −0
  • internal/equipo/migrations/{0126_hosted_jobs.sql => 0127_hosted_jobs.sql} +0 −0
  • internal/equipo/migrations/{0127_hosted_limits.sql => 0128_hosted_limits.sql} +0 −0
  • internal/equipo/migrations/{0128_hosted_job_deadline.sql => 0129_hosted_job_deadline.sql} +0 −0
  • internal/equipo/migrations/{0129_hosted_job_admission.sql => 0130_hosted_job_admission.sql} +0 −0
  • internal/equipo/migrations/{0130_checkpoints.sql => 0131_checkpoints.sql} +0 −0
  • internal/hostedproxy/e2e_test.go +1 −1
  • internal/hostedproxy/egress_test.go +1 −1
  • internal/hostedproxy/proxytest/harness.go +2 −2
  • internal/runner/hosted/hosted_test.go +1 −1
  • internal/thintest/mixed_protocol_contract_test.go +3 −2
  • internal/thintest/scheduler_contract_test.go +1 −1
  • internal/wire/assistant_files_test.go +1 −1
  • internal/wire/assistant_test.go +1 −1
  • internal/wire/change_diffs_test.go +1 −1
  • internal/wire/change_files_test.go +1 −1
  • internal/wire/design_test.go +1 −1
  • internal/wire/hosted_test.go +1 −1
  • internal/wire/injection_test.go +2 −2
  • internal/wire/lookup_test.go +1 −1
  • internal/wire/mac_engineering_test.go +1 −1
  • internal/wire/places_test.go +1 −1
  • internal/wire/runners.go +4 −1
  • internal/wire/stuck_test.go +1 −1
  • internal/wire/warm_test.go +1 −1
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 62cc7057..13344ad3 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -16,8 +16,8 @@ time internal/equipotest 300s Final fix package rerun measured 187.035s (review
time internal/equipo/hostedrun 60s Hosted slice 2: a 200-seed dispatcher simulation on the real chat store and the real controller over TLS; measured 14s on a loaded 16 CPU box; 60s covers a 4 CPU runner.
time internal/hostedtest 300s Hosted slice 2 chain (tag hostedchain, own CI lane): instance, controller, proxies and a real runner per VM in bubblewrap, eight tests; measured 128s under load 84.
-size internal/equipo 25562 9338 Design's copy, /api/team; hosted slice 2: placement, enrolment, pack receipts' machine key, pending hosted copy keys; measured 25562/9338.
-size internal/wire 9962 - Protocols 31 to 38 (facts, diffs, evidence, CI units, files, places, lookups, Mac, Design); 39 hosted runners: placement, packs, deps, checkpoints; measured 9962.
+size internal/equipo 25562 9342 Design's copy, /api/team; hosted slice 2: placement, enrolment, pack receipts' machine key, pending hosted copy keys; renumber: the setting migration is 0126, after 0124; measured 25562/9342.
+size internal/wire 9965 - Protocols 31 to 38 (facts, diffs, evidence, CI units, files, places, lookups, Mac, Design); 40 hosted runners: placement, packs, deps, checkpoints (renumbered from 39: Protocol40); measured 9965.
size internal/equipotest - 12693 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures, Rastrillo asset contract, renderer archive link; measured 0/12693 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
@@ -61,7 +61,7 @@ perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON
perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen.
perf GET /api/v1/assistant/abilities skip Assistant person API: bearer-only JSON for Base's Settings line, not a browser screen.
-size internal/equipo/chat 47593 22648 Facts, diffs, previews, merges, CI, places, lookups, Mac, D1, Design, grants; hosted slice 2: hosted packs, admission and feed checks, placement; 47593/22648.
+size internal/equipo/chat 47593 22649 Facts, diffs, previews, merges, CI, places, lookups, Mac, D1, Design, grants; hosted slice 2: hosted packs, admission and feed checks, placement; renumber: the Research floor's 39 row; 47593/22649.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
@@ -76,7 +76,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally).
size internal/headless - 13400 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files; restart wait; live site waits; card answer; scenario 7; Mac M9, mixed versions; 13400.
-size internal/thintest - 42663 Protocol 31 to 38 contracts, Design end to end; hosted slice 2 Task 26: protocol 39 rows, older primaries' Research ends runner_update_needed; 42663.
+size internal/thintest - 42664 Protocol 31 to 38 contracts, Design end to end; hosted slice 2 Task 26: protocol 39 and 40 rows, older primaries' Research ends runner_update_needed; 42664.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
diff --git a/docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json b/docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json
index e330f97a..673ed088 100644
--- a/docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json
+++ b/docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json
@@ -298,7 +298,7 @@
},
{
"key": "work.reason.runner_update_needed",
- "where": "Task view and pause line, why Research did not run: the runner speaks a protocol older than Research's quoted prompt needs (below 39); nothing ran (Task 26)",
+ "where": "Task view and pause line, why Research did not run: the runner speaks a protocol older than Research's quoted prompt needs (below 40); nothing ran (Task 26)",
"draft": "the runner needs an update before it can do this",
"paul_sees": true,
"reviewed": "the runner needs an update before it can do this",
diff --git a/docs/superpowers/plans/2026-11-30-hosted-slice-4-needs.md b/docs/superpowers/plans/2026-11-30-hosted-slice-4-needs.md
index 757cd28a..2ef59bf6 100644
--- a/docs/superpowers/plans/2026-11-30-hosted-slice-4-needs.md
+++ b/docs/superpowers/plans/2026-11-30-hosted-slice-4-needs.md
@@ -36,7 +36,7 @@ not do so nothing is rebuilt, and what slice 4 needs from the gateway.
proxy.
- **Candidate packs back to the primary,** which alone publishes (spec §8). Workers already return
packs today; the hosted worker adds the same path.
-- **Checkpoint and handover at the 8-hour limit** (spec §3), on top of Task 27's acknowledgement; the runner side produces the `PackReceipt` that task requires. Task 27's acknowledgement refuses a job that is not `enrolled`; a handover happens while the job drains, so slice 4 must let a `draining` job be acknowledged too (and migration 0130 still blocks DELETE).
+- **Checkpoint and handover at the 8-hour limit** (spec §3), on top of Task 27's acknowledgement; the runner side produces the `PackReceipt` that task requires. Task 27's acknowledgement refuses a job that is not `enrolled`; a handover happens while the job drains, so slice 4 must let a `draining` job be acknowledged too (and migration 0131 still blocks DELETE).
- **Pi certification**: the Engineering containment tests in the image (the 5 codex-dependent tests
the spike could not run, now with Pi and codex present), and the egress matrix with the relay as
the only route to the gateway.
diff --git a/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md b/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
index 0b8f2260..efa23c90 100644
--- a/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
+++ b/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
@@ -61,8 +61,8 @@ controller host and leaves the rest at about $1.15 a day until Paul decides.
`scripts/release-hosted.sh` pushes the tag `hosted-<DEV_VERSION>` for the unmerged pin and
creates the release. A published release is never replaced. *Recommendation:* publish
`hosted-0.0.1` as the dev drill's release; production takes its own release after the merge.
-2. **Staging runs the branch.** Hosted checks need this branch's instance (migrations 0125 onward,
- protocol 39) and the owner's staging runner at protocol 39. *Recommendation:* deploy the pin to
+2. **Staging runs the branch.** Hosted checks need this branch's instance (migrations 0126 onward,
+ protocol 40) and the owner's staging runner at protocol 40. *Recommendation:* deploy the pin to
staging with `scripts/staging-thin.py release` (0.3) and keep it there until the branch merges:
main's instance would meet a database with migrations it does not know.
3. **Who starts the checks.** The account plan has Paul start them. *Recommendation:* Paul, on a
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index fa43fce4..87eac2dd 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -7252,7 +7252,7 @@ records remain unchanged.
| `usage.hosted.note` | These are estimates. Each hosted machine counts at four times the base price, which is the most it can be billed, so the real cost is usually lower. Days and months follow UTC. | Usage page, hosted machines block: the note under the figures saying they are estimates and how they are counted (Task 25) (hosted runners slice 2, 2026-12-01) | COPY ACCEPTED BY DELEGATION (Luna, 2026-12-01) |
| `usage.hosted.unknown` | Unknown | Usage page, hosted machines block: shown in place of a figure that could not be read; never a zero (Task 25) (hosted runners slice 2, 2026-12-01) | COPY ACCEPTED BY DELEGATION (Luna, 2026-12-01) |
| `hosted.limits.too_low` | Each limit must leave room for one check run: at least 1 hosted machine at once, 100 minutes a day and $2.07 a month. | Error page after saving per-person hosted limits below one checks run (fewer than 1 machine, 100 minutes a day or $2.07 a month; Task 25 review round 1 ruling) (hosted runners slice 2, 2026-12-01) | COPY ACCEPTED BY DELEGATION (Luna, 2026-12-01) |
-| `work.reason.runner_update_needed` | the runner needs an update before it can do this | Task view and pause line, why Research did not run: the runner speaks a protocol older than Research's quoted prompt needs (below 39); nothing ran (Task 26) (hosted runners slice 2, 2026-12-01) | COPY ACCEPTED BY DELEGATION (Luna, 2026-12-01) |
+| `work.reason.runner_update_needed` | the runner needs an update before it can do this | Task view and pause line, why Research did not run: the runner speaks a protocol older than Research's quoted prompt needs (below 40); nothing ran (Task 26) (hosted runners slice 2, 2026-12-01) | COPY ACCEPTED BY DELEGATION (Luna, 2026-12-01) |
## Task 21
diff --git a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
index 30f58257..e30be260 100644
--- a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
@@ -1,5 +1,7 @@
# Hosted runners slice 2: progress
+Renumbered 2026-12-01 (coordinator ruling; design-feedback-1 took protocol 39 and migration 0125 and reaches main first): `wire.ProtocolHostedRunners` is `Protocol40` (protocol 40), and this slice's migrations are 0126 to 0131 (`0126_hosted_checks_setting`, `0127_hosted_jobs`, `0128_hosted_limits`, `0129_hosted_job_deadline`, `0130_hosted_job_admission`, `0131_checkpoints`). Prose below uses the new numbers; quoted commands and test output from before the renumber keep the numbers they printed (39, 0125 to 0130). See `## Renumber`.
+
## Task 1
Wire contracts for hosted checks. Protocol ruling (coordinator, c5c15e9c): `wire.ProtocolHostedRunners = Protocol39`, now `ProtocolCurrent`; `ProtocolHostedChecks` stays `Protocol5` (release slice 1's hub checks).
@@ -1374,7 +1376,7 @@ Each guard alone is redundant end to end: a real checkout fails on a cancelled c
## Task 18
-The owner setting "Run checks in a hosted VM": migration `0125_hosted_checks_setting.sql` (`chat_projects.hosted_checks`, `hosted_checks_owner`, `hosted_checks_revision`, additive, off for every existing row; `schema.sql` appended), `internal/equipo/chat/hosted_setting.go` (`SetHostedChecks`, `txn.hostedChecks`, and `HostedSettings`, the owners' list the page reads), `internal/equipo/hosted_settings.go` (routes, handler), `templates/hosted_settings.html`, the Settings section in `settings_hub.go` / `settings_hub.html` / `render.go`, and `Config.HostedRunners` (`EQUIPO_HOSTED_RUNNERS` exactly `1`) carried into `application.hostedRunners` in `app.go`.
+The owner setting "Run checks in a hosted VM": migration `0126_hosted_checks_setting.sql` (`chat_projects.hosted_checks`, `hosted_checks_owner`, `hosted_checks_revision`, additive, off for every existing row; `schema.sql` appended), `internal/equipo/chat/hosted_setting.go` (`SetHostedChecks`, `txn.hostedChecks`, and `HostedSettings`, the owners' list the page reads), `internal/equipo/hosted_settings.go` (routes, handler), `templates/hosted_settings.html`, the Settings section in `settings_hub.go` / `settings_hub.html` / `render.go`, and `Config.HostedRunners` (`EQUIPO_HOSTED_RUNNERS` exactly `1`) carried into `application.hostedRunners` in `app.go`.
Rules: a write needs a current session and a current owner, read inside the write transaction, at the revision the owner saw (`ErrCardConflict` otherwise), on an active project; it is audited in the same transaction (`project.hosted_checks`, `<project>/revision:<n>/enabled:<bool>`), and a failed audit rolls it back. `hostedChecks` counts the setting only while the project is active and the owner who last changed it is still an owner; a roster lookup error denies. Without the flag the section is not in the menu and neither `GET /conversation/settings/hosted` nor `POST /settings/hosted` is registered; with it, owners alone see and use it (the page and the save both check again).
@@ -1418,7 +1420,7 @@ Mutations (exact-string replace from a script under `$TMPDIR`, one at a time, re
## Task 19
-Hosted jobs store. Migration `0126_hosted_jobs.sql` (new tables only; `schema.sql` appended): `hosted_jobs` with the brief's columns verbatim (`attempt_id` primary key), partial unique indexes `hosted_jobs_live_step` (`step_id` where `state <> 'ended' AND state <> 'failed'`: one live job a step), `hosted_jobs_runner` (`runner_id <> ''`: a runner bound to one job), `hosted_jobs_code` (`code_hash <> ''`), index `hosted_jobs_person(person, state)`; `hosted_challenges` (`runner_id`, `nonce_hash` primary key, `expires_at`, `used_at`; index on `runner_id`). `internal/equipo/chat/hosted_jobs.go`: the record `HostedJob` (exported, `TableName` `hosted_jobs`) and `hostedChallengeRecord`, both in `Models`; states `HostedJobPending` ... `HostedJobFailed`; `HostedCharge` (seconds per UTC day `2006-01-02`, USD micros per UTC month `2006-01`; keys and non-negative amounts checked; stored as JSON in the `*_json` columns, `Hold()` and `Used()` read them back); `HostedEndProof` (`Stop *hostedwire.StopProof`, `NeverLaunched`, `ObservedAt` on the instance's clock), stored in `stop_proof_json`.
+Hosted jobs store. Migration `0127_hosted_jobs.sql` (new tables only; `schema.sql` appended): `hosted_jobs` with the brief's columns verbatim (`attempt_id` primary key), partial unique indexes `hosted_jobs_live_step` (`step_id` where `state <> 'ended' AND state <> 'failed'`: one live job a step), `hosted_jobs_runner` (`runner_id <> ''`: a runner bound to one job), `hosted_jobs_code` (`code_hash <> ''`), index `hosted_jobs_person(person, state)`; `hosted_challenges` (`runner_id`, `nonce_hash` primary key, `expires_at`, `used_at`; index on `runner_id`). `internal/equipo/chat/hosted_jobs.go`: the record `HostedJob` (exported, `TableName` `hosted_jobs`) and `hostedChallengeRecord`, both in `Models`; states `HostedJobPending` ... `HostedJobFailed`; `HostedCharge` (seconds per UTC day `2006-01-02`, USD micros per UTC month `2006-01`; keys and non-negative amounts checked; stored as JSON in the `*_json` columns, `Hold()` and `Used()` read them back); `HostedEndProof` (`Stop *hostedwire.StopProof`, `NeverLaunched`, `ObservedAt` on the instance's clock), stored in `stop_proof_json`.
Lifecycle (`moveHostedJob`, the one place every move goes through: listed move, then proof for an end, then a write conditional on the state and revision read, then `system hosted.job <attempt>:<from>><to>` audited in the transaction):
- `newHostedJob(hostedJobSpec{Step, Size, Hold, RetryOf, At})`: reads the step and its task in the transaction (task, project, person and step attempt come from them, not the caller), the person must pass `authority.Me` (a removed member or a lookup error denies), a known size, a non-empty hold, no live job for the step (`ErrHostedJobLive`), and a retry only of the same step's ended or failed job that holds proof (`Retries` = its `Retries` + 1). Attempt ID `hj_` + 26 characters (under the 64 of Task 4's ruling). `admitted_at` = `At`. Audited `<attempt>:pending`.
@@ -1443,7 +1445,7 @@ Mutations (exact-string replace from a script under `mktemp -d`, one at a time,
- **238** never-launched evidence for a launched job. `if j.LaunchID == "" && j.VMRef == "" && j.RunnerID == "" {` became `if true || ...`. `-run 'TestEndNeedsProof|TestHostedJobForRunner'`: exit 1, `hosted_jobs_test.go:211: ended: hj_... with never launched, but it launched = <nil>, state ended` and `hosted_jobs_test.go:302: an enrolled job ended as never launched: <nil>`. Restored.
- **239** no live-job check in the store. `if live != 0 {` became `if false && live != 0 {`. `-run TestOneLiveJobPerStep`: exit 1, `hosted_jobs_test.go:243: second live job: duplicated key not allowed` (the table's index still refused it, but not as `ErrHostedJobLive`). Restored.
- **240** retry of an unproven job. `prior.StepID != s.ID || prior.Live() || !prior.proven()` lost `|| !prior.proven()`. First run: exit 0 (no test reached it, since no move ends a job without proof); a case was added (a job set to `failed` by hand, no proof). Rerun: exit 1, `hosted_jobs_test.go:273: a retry of a job with no proof: <nil>`. Restored.
-- **241** a non-additive migration. `ALTER TABLE chat_projects DROP COLUMN hosted_checks_revision;` appended to 0126. `-run TestMigrationAdditive`: exit 1, `hosted_jobs_test.go:439: equipo/0126_hosted_jobs changed chat_projects:` (the column missing after). Restored.
+- **241** a non-additive migration. `ALTER TABLE chat_projects DROP COLUMN hosted_checks_revision;` appended to 0127. `-run TestMigrationAdditive`: exit 1, `hosted_jobs_test.go:439: equipo/0126_hosted_jobs changed chat_projects:` (the column missing after). Restored.
- **242** the live index without its condition. `ON hosted_jobs(step_id) WHERE state <> 'ended' AND state <> 'failed';` became `ON hosted_jobs(step_id);`. Same command: exit 1, `hosted_jobs_test.go:450: constraint failed: UNIQUE constraint failed: hosted_jobs.step_id (2067)`. Restored.
Notes for Tasks 20 to 22: `failed` is reached only through `stopping` (any live state goes to stopping on a failure, then needs proof), so the dispatcher's `HostedFailed` should move the job to stopping with its reason and end it once proof or never-launched evidence arrives. `admitted_at` is the limit admission time (Task 20's settle start). The admission record columns (`cert_*`), `code_used_at` and `hosted_challenges` have no writers yet (Tasks 21 and 22).
@@ -1503,7 +1505,7 @@ Tests (`hosted_limits_test.go`):
- `TestLimitCountErrorDenies`: admission's own answer with the jobs table, the limits table or the roster table renamed away, the person removed, or a hold that cannot be read: `ok=false`, no reason, an error. Bad size and lifetimes: `ErrInvalid`.
- `TestOwnerRaisesLimit`: the defaults at revision 0 when there is no row, applied as two running. Refused cases: a member, a person not on the roster, out-of-range limits, a stale revision, the roster unavailable, a failing audit. None of them takes effect. An owner raises the limit to three: revision 1, one exact audit line and one audit row from inside the transaction, and the third job is admitted. A second write at revision 0 is a conflict. A removed owner is refused.
-Green: the same command, ok (9 tests). The whole chat package once: ok (25.2 s). `./internal/equipo -run 'Migration|Schema'`: ok. `TestMigrationAdditive` (covers 0127 as additive): ok. `make migration-check budget build vet`: exit 0 after raising the chat record to 46013/20214 with the reason. gofmt and `git diff --check`: clean.
+Green: the same command, ok (9 tests). The whole chat package once: ok (25.2 s). `./internal/equipo -run 'Migration|Schema'`: ok. `TestMigrationAdditive` (covers 0128 as additive): ok. `make migration-check budget build vet`: exit 0 after raising the chat record to 46013/20214 with the reason. gofmt and `git diff --check`: clean.
Mutations (exact-string replace in `internal/equipo/chat/hosted_limits.go` from a script under `mktemp -d`, one at a time, `CGO_ENABLED=0 go test ./internal/equipo/chat -run '<test>' -count=1`, restored from a copy and compared with `filecmp`: identical each time):
- **258** (the brief's) count only `enrolled` jobs: `if j.Live() {` became `if j.State == HostedJobEnrolled {`. `-run 'TestLimitsHoldAndSettle|TestLimitsRace'`: exit 1, `hosted_limits_test.go:118: admission of st-c at 2026-11-08 12:10:00 +0000 UTC: hj_... "" <nil>, want refused "running"` and `hosted_limits_test.go:189: admitted 4, refused 0, jobs 4`. Restored.
@@ -1560,12 +1562,12 @@ Controller ruling (Task 19's): `hostedctl.Controller.Get` and `Admission` answer
1. The step's live job is read first. `pending`, `launching` and `enrolling` wait (`waiting_hosted`, no new hold). `enrolled` goes to the job's runner once that runner and the primary are both online at `ProtocolHostedRunners`; otherwise it waits. `stopping` waits. A live job for another step attempt is stopped (`step_moved`).
2. Only with `SetHostedRunners(true)` and the project's setting on: the step attempt's last ended or failed job is retried once (`retry_of`); a second end resolves the step not run with the job's reason (`hosted_enrol_timeout`, `hosted_vm_lost`, else `hosted_unavailable`).
3. Needs a VM cannot meet (anything beyond `linux`), or no valid base and candidate for the hosted pack: today's path.
- 4. Primary offline or below 39: `waiting_hosted`, no job.
+ 4. Primary offline or below 40: `waiting_hosted`, no job.
5. `hostedAdmit` then `newHostedJob` with `hostedHoldFor(HostedChecksSize, HostedChecksLifetime, now)` at `now`, in the same transaction; refused: `hosted_limit` with the reason in `Reason`. A count or read error returns the error and nothing is written.
- `runnerInfo.Hosted`/`HostedStep` (one query for the person's runners). `fits(step, needs, refused)`: a hosted runner fits only its live job's step. Engineering never picks or pins a hosted runner.
- `Authorize`: a runner bound to a hosted job is granted only for that job's step and attempt while the job is `enrolled`, read in the transaction.
- `waitingPlacements` includes `waiting_hosted` and `hosted_limit`.
-- `offline`: a `waiting_hosted` step resolves `runner_offline` once its primary has been offline (or below 39) for `OfflineLimit`, counting from the later of the wait's start and the primary's last sight. Its job stops through the step-terminal hook. A step on a hosted runner is never withdrawn, and a hosted runner is never the "other runner that fits".
+- `offline`: a `waiting_hosted` step resolves `runner_offline` once its primary has been offline (or below 40) for `OfflineLimit`, counting from the later of the wait's start and the primary's last sight. Its job stops through the step-terminal hook. A step on a hosted runner is never withdrawn, and a hosted runner is never the "other runner that fits".
- `dispatchStep`: a step on its job's hosted runner opens the hosted pack (`openHostedPack`) instead of the ordinary checks transfer.
- `saveStep`: a checks step that ends stops its live jobs (`step_ended`).
- Store methods for the dispatcher, each one transaction: `HostedLive`, `HostedSweep` (step ended, gone, moved on, task ended or cancelling, person no longer a member: stopping; a roster lookup error stops nothing), `HostedLaunching` (pending to launching, or a new code for a launching job with no intent, no call in flight and no launch; the person must be a member), `HostedLaunchReturned`, `HostedLaunched` (or the VM recorded on a job already stopping), `HostedAdmitted` (valid only when the controller says so and it names the job's launch, VM, epoch and certificate; an older record is ignored), `HostedFailed`, `HostedStopped`, `HostedNeverLaunched`, `HostedReplaces` (the predecessor only when it ended with stop proof), `PlaceHosted` (steps whose placement can change now).
@@ -1605,7 +1607,7 @@ Mutations (an exact-string replace from a script under `mktemp -d`, one at a tim
- **281** dispatch with one end ready (`ready < 2` became `ready < 1`). `-run 'TestPrimaryLostDuringEnrolment|TestEnrolledJobDispatches'`: exit 1, `hosted_place_test.go:283: VM below the protocol: "" on "H1", want waiting` and `:450: enrolled with the primary away: "" on "H1"; want waiting, nothing sent`. Restored.
- **282** a stopping job does not hold its step. `-run TestPlacementDuringStopping`: exit 1, `hosted_place_test.go:477: while stopping: 1 jobs (stopping), want the one stopping` (the step resolved). Restored.
- **283** retried more than once (`Retries >= 1` became `>= 5`). Same test: exit 1, `hosted_place_test.go:490: retry spent: queued "" with 3 jobs; want cannot_run hosted_enrol_timeout`. Restored.
-- **284** a primary below 39 admits a job. `-run TestHostedNeedsCapablePrimary`: exit 1, `hosted_place_test.go:210: old primary: placed "waiting_hosted" on "" with 1 jobs, want waiting_hosted, no job`. Restored.
+- **284** a primary below 40 admits a job. `-run TestHostedNeedsCapablePrimary`: exit 1, `hosted_place_test.go:210: old primary: placed "waiting_hosted" on "" with 1 jobs, want waiting_hosted, no job`. Restored.
- **285** Mac checks hosted. `-run TestMacChecksNeverHosted`: exit 1, `hosted_place_test.go:197: Mac checks placed "waiting_hosted" needs ["macos","xcode"] with 1 jobs, want waiting_mac and no job`. Restored.
- **286** admitted at the limit. `-run TestHostedWaitsAtLimit`: exit 1, `hosted_place_test.go:319: at the limit: "waiting_hosted" "" with 1 jobs, want hosted_limit running`. Restored.
- **288** never-launched evidence from a refusal (`ErrForbidden` taken as absent). `-run TestDispatcherNeverLaunchedEvidence`: exit 1, `dispatcher_test.go:742: Get answering hostedclient: this key may not do that: ended, settled 2026-11-08 12:12:00 +0000 UTC`. Restored.
@@ -1636,11 +1638,11 @@ Not mutation-checked: the cancelled-task branch of `hostedStepAgain`, and `Hoste
1. **Critical, corrected ruling: an abandoned intent is not never-launched evidence until the VM's lifetime has run out.** A launch whose reply was lost may have made a VM the intent never linked. The provider ends that VM at the launch's maximum duration, which is the job's lifetime. So:
- `HostedNeverLaunched.holds` takes `abandoned` only when observed at or after `LaunchBy + Lifetime + 2m`; `absent` (the signed 404) keeps `LaunchBy + 2m`.
- - The job keeps its lifetime: a new `lifetime` column, added in place to unreleased migration 0126 and to `schema.sql`. Placement sets it to `HostedChecksLifetime`; the launch's `MaxLifetimeMS` comes from it.
+ - The job keeps its lifetime: a new `lifetime` column, added in place to unreleased migration 0127 and to `schema.sql`. Placement sets it to `HostedChecksLifetime`; the launch's `MaxLifetimeMS` comes from it.
- The dispatcher asks for abandoned evidence only after that time. Until then it keeps calling `Stop`, so the controller's proof ends the job once the unlinked VM is gone.
- `HostedReplaces` returns an error for a predecessor holding neither stop proof nor evidence that holds. It names the predecessor whenever its proof is a stop proof.
- The integration test also found that `hj_` attempt IDs are refused by the controller (`400 invalid`): attempt IDs are the provider's client token, letters, digits and '-' only. Jobs are now `hj-` IDs.
-2. **The enrolment window is kept on the job.** A new `running_seen_at` column (0126 in place) is set once by `HostedRunning` the first time `Admission` reports the VM running. `watch` checks the deadline from the job row before asking `Admission`, so neither a restart nor a controller outage extends it. The process memory for it is removed.
+2. **The enrolment window is kept on the job.** A new `running_seen_at` column (0127 in place) is set once by `HostedRunning` the first time `Admission` reports the VM running. `watch` checks the deadline from the job row before asking `Admission`, so neither a restart nor a controller outage extends it. The process memory for it is removed.
3. **Retry.** `hostedJobSpec.Attempt` is the step attempt the placing transaction holds. A person's Retry and a replacement increment it before the step is saved. `newHostedJob` refuses one below the stored attempt and records it.
4. **Simulation.**
- Its fake controller now models launches whose reply was lost after the VM was made. Such a VM is unlinked: the intent has no ref until a replay links it. Stopping abandons it, it runs on until its lifetime or a death, and proof comes only once it is gone. The provider's lifetime limit applies to every VM. "At most one live VM per step" counts unlinked VMs.
@@ -1719,7 +1721,7 @@ Mutations (each through the Edit tool, then restored and the brief's command run
### Task 22 review round 1 (t22-r1.md: items 1 to 4; concern 5 deferred)
1. **A stale admission no longer authorises.** `hostedAdmitted` now returns `(valid, accepted, err)`; `accepted` is false when the record is older than the one held and was not written. `HostedEnrolAdmit` admits only an accepted record. Test (in `TestEnrolNeedsCertifiedAdmission`): while the enrolment's admission call is in flight, a refusal is recorded at `hostedNow + 1s` (`HostedAdmitted`); the older positive answer then arrives. Refused, no runner, and the newer refusal stays (`cert_valid` false, checked at `+1s`).
-2. **The controller's deadline caps credentials.** New column `hosted_jobs.deadline` (migration `0128_hosted_job_deadline.sql`, one `ALTER TABLE ... ADD COLUMN`; `schema.sql` appended). `HostedLaunched(ctx, attempt, v, asked)` now takes the time the request that returned `v` was made. The dispatcher passes the time read before its `Launch` or `Get` call (`launch`, `job`, `neverLaunched`). The store keeps `asked + v.DeadlineInMS` (`hostedDeadlineSeen`, applied on both the enrolling and the learn-VM branches), written only when no earlier deadline is held, so it is never extended. `hostedDeadline` in the instance is `min(launch_by + lifetime, deadline)`, and a job with no recorded deadline is issued nothing. Test (in `TestHostedCredentialCappedAtDeadline`): a launching job gets a launch view with 40 minutes left, from a request started a minute before (`hostedNow - 1m`). The deadline is kept as `hostedNow + 39m`, before launch-by plus lifetime (`+95m`), and the enrolment and a renewal 20 minutes later both expire at `+39m`.
+2. **The controller's deadline caps credentials.** New column `hosted_jobs.deadline` (migration `0129_hosted_job_deadline.sql`, one `ALTER TABLE ... ADD COLUMN`; `schema.sql` appended). `HostedLaunched(ctx, attempt, v, asked)` now takes the time the request that returned `v` was made. The dispatcher passes the time read before its `Launch` or `Get` call (`launch`, `job`, `neverLaunched`). The store keeps `asked + v.DeadlineInMS` (`hostedDeadlineSeen`, applied on both the enrolling and the learn-VM branches), written only when no earlier deadline is held, so it is never extended. `hostedDeadline` in the instance is `min(launch_by + lifetime, deadline)`, and a job with no recorded deadline is issued nothing. Test (in `TestHostedCredentialCappedAtDeadline`): a launching job gets a launch view with 40 minutes left, from a request started a minute before (`hostedNow - 1m`). The deadline is kept as `hostedNow + 39m`, before launch-by plus lifetime (`+95m`), and the enrolment and a renewal 20 minutes later both expire at `+39m`.
3. **The 2-minute window always applies (coordinator ruling).** In transaction 2, a recorded, valid, running admission is a sighting. With `running_seen_at` unset, it is recorded at the admission's asked time, in the same transaction, revision bumped and audited `<attempt>:running_seen`. Enrolment then requires `now` before the earliest sighting plus `HostedEnrolTimeout`. On a refusal the sighting and the record are committed. Tests (in `TestEnrolRefusesReplayAndWrongVM`):
- With no prior sighting, a prompt enrolment succeeds and records the sighting at the admission's time.
- An enrolment whose admission call takes the full 2 minutes (the fake clock moves while it is in flight) is refused, with no runner, and its sighting is recorded.
@@ -1851,7 +1853,7 @@ Certified results from hosted workers (Fable M8).
- the job's latest admission record has `cert_valid` set, and its `cert_checked_at` is within `AdmissionFresh` of the report's arrival (`t.now()`), either side;
- the record itself, kept whole in the new `admission_json`, says `CertValid`, state `running`, and names this attempt, the job's launch, VM and epoch, the job's certificate digest (pinned by the first record), and the image recorded at enrolment (new `image_digest`).
A lookup error is false and is returned, so the report's transaction rolls back and the durable report is retried. Bad JSON is false.
-- **Store:** migration `0129_hosted_job_admission.sql` adds `image_digest` and `admission_json` to `hosted_jobs`; `schema.sql` is appended. The image digest was not recorded before this task. `HostedEnrolAdmit` records the admitting record's image, once. `hostedAdmitted` writes the record as `admission_json` along with `cert_*`. A record naming a different image from the enrolment's is no longer valid, so it refuses renewals too.
+- **Store:** migration `0130_hosted_job_admission.sql` adds `image_digest` and `admission_json` to `hosted_jobs`; `schema.sql` is appended. The image digest was not recorded before this task. `HostedEnrolAdmit` records the admitting record's image, once. `hostedAdmitted` writes the record as `admission_json` along with `cert_*`. A record naming a different image from the enrolment's is no longer valid, so it refuses renewals too.
- **`stepReport`** (judgement branch): for a worker's checks, `certified := hostedCertified(...)`. A runner bound to a hosted job that is not certified keeps nothing: no result, no sandbox, no base checks, no taint. Its job moves to `stopping` with reason `uncertified` (`hostedUncertified`). Once the VM's stop proof arrives, Task 21's path (`hostedFinish`, then `hostedStepAgain`, then `placeHosted` rule 2) places the step again once under the same attempt. A second failure ends it `cannot_run` `hosted_unavailable` (`hostedFailure` maps the unknown stop reason). A certified result keeps `bubblewrap` only when it reported `bubblewrap` and the runner is untainted. The primary-only `BaseChecks` branch also reads a certified worker's `BaseChecks`. Any other worker follows the old rules: seatbelt only, otherwise `none` and tainted.
- **`acceptBaseChecks(l, role, certified, s, v)`** accepts the primary, or a worker only when `certified`.
- **`cleanHello`**: its comment now says a hello is diagnostic only. No decision reads the hello.
@@ -2117,7 +2119,7 @@ Budgets, with reasons: `internal/equipo` 25478/9069 → 25524/9235; `internal/eq
## Task 26
-Fable M4 residue: Research's prompt quotes every untrusted value, and only a runner at protocol 39 or later gets Research.
+Fable M4 residue: Research's prompt quotes every untrusted value, and only a runner at protocol 40 or later gets Research.
Coordinator ruling (option 2): this commit covers Research only. The Engineering and Design floor below `ProtocolInjectionDefences` (28) is deferred, and so is deleting the brief folding in `wire/runners.go`. The folding stays while Engineering can reach runners below 28.
@@ -2127,16 +2129,16 @@ What changed:
- **The Research prompt** (`internal/runner/thin/research.go`). Every value enters through `wire.QuotedData` under its label: `Specialist brief`, `Person's words`, `Task title`, `Task brief`, `Question`, `Source <id> URL`, `Source <id> type`, `Source <id> title`, `Source <id> text` and `Image <id> description`. The `<<<`/`>>>` and `=== source` fences are gone. `pageTitle` splits webread's `Title:` first line from an HTML page's text.
- **The floor** (`internal/equipo/chat/protocol_floor.go`).
- `promptFloor` is Research at `wire.ProtocolHostedRunners`.
- - `dispatchResearch` ends a step placed on a runner last seen below 39 as cancelled, `runner_update_needed`, with nothing dispatched. A runner that never connected passes, and its start authorization checks it.
+ - `dispatchResearch` ends a step placed on a runner last seen below 40 as cancelled, `runner_update_needed`, with nothing dispatched. A runner that never connected passes, and its start authorization checks it.
- `Authorize` (`authorizeFloor`) refuses `runner_update_needed` on every lease call below the floor. A step that has not started ends there, as not started.
- **wire:** `ReasonRunnerUpdateNeeded` is registered in `StepReasons`.
- **Copy:** `work.reason.runner_update_needed` = "the runner needs an update before it can do this". It was marked with `python3 scripts/copy-status.py pending` (stdin `{"candidate": <worktree>, "keys": ["work.reason.runner_update_needed"]}`) and listed in `2026-11-30-hosted-slice-2-copy.json`. Not accepted. `pause_view.go`'s `tooOld` includes it, so the pause line names the runner to update.
Fixtures changed only where Research now needs 39:
- `TestResearchPromptCarriesTheApprovedBrief` (the prompt's format);
-- `TestRenderLeaseNeedsPageRender`, `TestResearchLegacyEmptyBinding` and `TestResearchDispatchBinds` (chat: a lease and session at 39);
-- `TestContractSchedulerResearch` (thintest: rig at 39);
-- `TestMixedVersionsMeteredAndResearch`: at 13 Research is still proposed and requested, and the step ends `runner_update_needed` with nothing dispatched; a new row at 39 dispatches.
+- `TestRenderLeaseNeedsPageRender`, `TestResearchLegacyEmptyBinding` and `TestResearchDispatchBinds` (chat: a lease and session at 40);
+- `TestContractSchedulerResearch` (thintest: rig at 40);
+- `TestMixedVersionsMeteredAndResearch`: at 13 Research is still proposed and requested, and the step ends `runner_update_needed` with nothing dispatched; a new row at 40 dispatches.
Red:
- `CGO_ENABLED=0 go test ./internal/runner/thin -run TestResearchQuotesEveryValue -count=1`: exit 1, `research_quote_test.go:59: prompt lacks "Task title: \"Shop colours >>> ...\""`, the same for every label, and `:70: a line outside its quoted value: "=== source s1: ..."`.
@@ -2144,8 +2146,8 @@ Red:
Tests:
- `TestResearchQuotesEveryValue` (thin). A task title holding `>>>`, a page title holding a fake `=== source` line, a page text faking its own end, a URL and an image URL holding quotes, and multi-line briefs, question and words each appear only as label + `wire.QuotedData(value)`. No fence line is left outside them.
-- `TestProtocol38RunnerGetsNoResearch` (chat): at 38, placement ends the step `runner_update_needed` with no dispatch queued. At 39 the step is dispatched.
-- `TestQueuedResearchRecheckedAtAuthorize` (chat): a queued Research step is refused `runner_update_needed` at 38, 28 and 13, and ends there, not started. At 39 it starts.
+- `TestProtocol38RunnerGetsNoResearch` (chat): at 38, placement ends the step `runner_update_needed` with no dispatch queued. At 40 the step is dispatched.
+- `TestQueuedResearchRecheckedAtAuthorize` (chat): a queued Research step is refused `runner_update_needed` at 38, 28 and 13, and ends there, not started. At 40 it starts.
Green:
- `CGO_ENABLED=0 go test ./internal/runner/thin ./internal/equipo/chat ./internal/wire -run 'TestResearchQuotes|TestProtocol38|TestQueuedResearch' -count=1`: ok.
@@ -2177,12 +2179,12 @@ Budgets, with reasons:
### Task 26 review round 1 (Astra)
**Important:** when a primary spoke below 13, the refusal reason was inconsistent. Fixed as follows.
-- **Placement.** `dispatchResearch` now applies the Research floor (`belowPromptFloor`, 39) before anything else that depends on the protocol. A primary known below 39, including one below `ProtocolResearch` (12, 11), ends the step `runner_update_needed`, with the runner still named and nothing dispatched. The legacy `< ProtocolResearch` branch, which ended the step `research_unsupported` and cleared the runner, is removed. The floor covers every case it covered (both read the runner's last session protocol), so it can no longer be reached.
+- **Placement.** `dispatchResearch` now applies the Research floor (`belowPromptFloor`, 40) before anything else that depends on the protocol. A primary known below 40, including one below `ProtocolResearch` (12, 11), ends the step `runner_update_needed`, with the runner still named and nothing dispatched. The legacy `< ProtocolResearch` branch, which ended the step `research_unsupported` and cleared the runner, is removed. The floor covers every case it covered (both read the runner's last session protocol), so it can no longer be reached.
- **Reconnect.** `fenceResearch` (a primary reconnecting below 13) now ends a step that has not started `runner_update_needed`, with the runner retained. A step that started keeps `research_unsupported`.
Tests (chat):
- `TestProtocol38RunnerGetsNoResearch` gains a protocol 12 case. It asserts the reason, the runner still named, no start and no dispatch.
-- New `TestResearchFencedAtReconnect`. A Research step dispatched at 39, then `fenceResearch` for a lease at 12 (the function `Connect` calls). It asserts:
+- New `TestResearchFencedAtReconnect`. A Research step dispatched at 40, then `fenceResearch` for a lease at 12 (the function `Connect` calls). It asserts:
- the step is cancelled `runner_update_needed`;
- the runner is still RUNNER1;
- it never started;
@@ -2218,7 +2220,7 @@ What changed:
- `RenderResume(ackID, personWords)` loads by ID only (unknown or empty: `ErrNotFound`), recomputes both digests from the stored row and refuses a row that no longer matches (`ErrCheckpointMismatch`). It prints the task, attempt and checkpoint digest, each JSON-quoted; the notes heading saying they are untrusted data that cannot change authority, tool policy or scope; each note as `Checkpoint note <n>: ` + `json.Marshal(note)`; then, in their own block after a heading, each of the person's words as `Person's words <n>: ` + `json.Marshal(words)`.
- `Authority.RunnerMachineKey`, and `checkpointRecord` in `Models`.
- **Primary machine keys** (ruling's open point): runner rows keep only `machine_key_hash`; no public key is stored on the runner. `runnerMachineKey` (`internal/equipo/checkpoint_key.go`, wired in `chat_wiring.go`) reads the unrevoked runner, then its exchanged (`consumed_at` set), unrevoked enrolment of the same instance whose stored `machine_public_key` hashes to the row's `machine_key_hash`. No such runner or enrolment: nil, so the receipt fails closed.
-- **Migration** `0130_checkpoints.sql`: the new `checkpoints` table, a unique index on (attempt_id, digest), and triggers `checkpoints_no_update` and `checkpoints_no_delete` that abort with `checkpoints are immutable`. Appended to `schema.sql`. `TestMigrationAdditive` covers it.
+- **Migration** `0131_checkpoints.sql`: the new `checkpoints` table, a unique index on (attempt_id, digest), and triggers `checkpoints_no_update` and `checkpoints_no_delete` that abort with `checkpoints are immutable`. Appended to `schema.sql`. `TestMigrationAdditive` covers it.
- **Prompt words** are Go constants in `checkpoint.go` (`resumeIntro`, `resumeNotesHeading`, `resumeWordsHeading`): model prompt text, not person-facing copy, like the runner's prompts.
RED: `CGO_ENABLED=0 go test ./internal/equipo/chat ./internal/wire -run 'TestCheckpoint|TestRenderOnly|TestNotes|TestAckImmutable' -count=1` (with `internal/wire/checkpoint.go` moved aside): build failed, `undefined: PackReceiptMessage`, `undefined: ValidPackDigest` (wire); `undefined: wire.Checkpoint`, `r.s.authority.RunnerMachineKey undefined`, `undefined: wire.PackReceipt` (chat).
@@ -2244,7 +2246,7 @@ Mutations: an exact-string replace from a script under `mktemp -d`, one at a tim
- **M7** the receipt checked against the runner it names, not the current primary (the ID check dropped; key and message from `r.PrimaryRunnerID`). Same command: exit 1, `checkpoint_test.go:200: a worker's receipt: <nil>, want ErrNoReceipt` and `:207: a former primary's receipt: <nil>, want ErrNoReceipt`. Restored.
- **M8** notes not JSON-quoted (`": \"" + n + "\""`). `-run TestNotesCannotEscape`: exit 1, `checkpoint_test.go:300: resume holds a raw line break other than newline`. Restored.
- **M9** a superseded lease accepted (`false && err != nil` after `t.current`). `-run TestCheckpointBindsEverything`: exit 1, `checkpoint_test.go:152: checkpoint on a superseded lease acknowledged`. Restored.
-- **M10** both triggers cut from `0130_checkpoints.sql`. `-run TestAckImmutable`: exit 1, `checkpoint_test.go:420: UPDATE checkpoints SET notes_json = … = <nil>, want the immutability trigger to refuse it` (also the digest UPDATE and the DELETE). Restored.
+- **M10** both triggers cut from `0131_checkpoints.sql`. `-run TestAckImmutable`: exit 1, `checkpoint_test.go:420: UPDATE checkpoints SET notes_json = … = <nil>, want the immutability trigger to refuse it` (also the digest UPDATE and the DELETE). Restored.
- **M11** the machine key not checked against the runner's key hash (in the query and the loop). `go test ./internal/equipo -run TestCheckpointMachineKeyFromEnrolment -count=1`: exit 1, `checkpoint_key_test.go:72: runnerMachineKey(R3) = 48075a59… <nil>, want`. Restored.
- **M12** a key from an enrolment never exchanged (`consumed_at IS NOT NULL` dropped). Same command: exit 1, `checkpoint_key_test.go:72: runnerMachineKey(R2) = 5e212c09… <nil>, want`. Restored.
@@ -3286,3 +3288,37 @@ Mutation checks, each restored and the test green again:
`TestPlanCertInvocationsParse` FAILED "-controller-tls-pin must be 64 hex digits".
- `plantest.Callers`' dev caller changed to an ARN in 149757027610: `TestPlanImgInvocationsParse`
FAILED "-expect-role ... is not a caller ARN in account 640012953448".
+
+## Renumber (2026-12-01)
+
+Coordinator ruling: design-feedback-1 took protocol 39 and migration 0125 and reaches main first.
+`wire.ProtocolHostedRunners` is now `Protocol40`; `Protocol39 = 39` stays, on the same line and in
+the same place design-feedback-1 declares it, so that line merges as a no-op. Migrations
+`0125_hosted_checks_setting` to `0130_checkpoints` are now `0126_hosted_checks_setting`,
+`0127_hosted_jobs`, `0128_hosted_limits`, `0129_hosted_job_deadline`, `0130_hosted_job_admission`
+and `0131_checkpoints` (`git mv`, contents unchanged). The Research floor follows
+`ProtocolHostedRunners`, so it is 40. `TestHostedSettingMigrationOff` now asks for 0126 after 0124
+(not directly after it), so it holds once `0125_design_feedback` sits between them.
+
+Tests changed: the wire current-protocol pins (`Spoken(99)`, `ProtocolCurrent`) to 40 and
+`TestHostedRunnersProtocol` to `Protocol40` with `Spoken(39) == 39`; `TestProtocol38RunnerGetsNoResearch`
+and `TestQueuedResearchRecheckedAtAuthorize` refuse Research at 39 too; `TestMixedVersionsMeteredAndResearch`
+has a 39 row (Research proposed, not dispatched) and a 40 row (dispatched); the migration ID tests
+name 0126 and 0127; the proxy fakes answer "protocol 40".
+
+Green: `go test ./internal/wire -count=1`; `./internal/equipo/chat -run 'TestProtocol38RunnerGetsNoResearch|TestQueuedResearchRecheckedAtAuthorize|TestResearchFencedAtReconnect|TestMigrationAdditive|TestHosted|Research|Grant'`;
+`./internal/equipo -run 'Migration|Schema|TestHostedSetting'`; `./internal/thintest -run 'TestMixedVersionsMeteredAndResearch|TestContractSchedulerResearch'`;
+`./internal/hostedproxy/... ./internal/runner/hosted`: all ok. `make budget` ok after raising
+internal/wire (9965), internal/equipo (9342 test), internal/equipo/chat (22649 test) and
+internal/thintest (42664 test).
+
+Mutation checks, each restored and green again:
+- **RN1** `ProtocolHostedRunners = Protocol39`. `go test ./internal/wire -run TestHostedRunnersProtocol`:
+ FAIL `hosted_test.go:16: hosted runners 39, current 39, spoken 39`. `./internal/equipo/chat -run TestProtocol38RunnerGetsNoResearch`:
+ FAIL `protocol_floor_test.go:66: Research placed on a protocol 39 primary: {... State:queued ...}`.
+- **RN2** the Research floor at 39 (`promptFloor` returned `wire.Protocol39`). `./internal/thintest -run TestMixedVersionsMeteredAndResearch`:
+ FAIL `mixed_protocol_contract_test.go:85: Research at 39: [{... State:queued ...}]`.
+ `./internal/equipo/chat -run TestQueuedResearchRecheckedAtAuthorize`: FAIL `protocol_floor_test.go:95: Research start at protocol 39: ""`.
+- **RN3** the setting migration file back at `0125_hosted_checks_setting.sql`. `./internal/equipo -run TestHostedSettingMigrationOff`:
+ FAIL `hosted_settings_test.go:127: the hosted setting migration must be 0126, after 0124`.
+ `./internal/equipo/chat -run TestMigrationAdditive`: FAIL `hosted_jobs_test.go:561: no 0126_hosted_checks_setting, or <nil>`.
diff --git a/docs/superpowers/plans/HOSTED-SLICE2-RULINGS.md b/docs/superpowers/plans/HOSTED-SLICE2-RULINGS.md
index c0f55134..1c867497 100644
--- a/docs/superpowers/plans/HOSTED-SLICE2-RULINGS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE2-RULINGS.md
@@ -70,3 +70,4 @@ Every ruling the controller made on Paul's behalf while building Tasks 1 to 33,
- Ruling: plan3 inventory rows for the 34 hosted keys say COPY REVIEW REQUIRED (what TestPlan3ReleaseBoundaries accepts) though copy-status.py pending writes PENDING; no acceptance implied, release still blocked — cost if wrong: rerunning `pending` flips them back and the test fails; follow-up: make the test accept both.
- Pins: ada99ffd (HostAMI ami-045c7b3c3ad6e4cc1 via one SSM read in kass; BaseImageVersion 4; 23 AL2023 RPMs; GitSHA256; resolver 169.254.169.253 to confirm in Task 34; bwrap/codex URLs stay empty, supplied via --image-inputs). Blockers found: pinned bwrap needs glibc 2.38 (AL2023 2.34); image scan 158 findings. Ruling: both are engineering; build bwrap 0.11.0 from pinned upstream source in a digest-pinned AL2023 container, reproducible, pinned for the hosted image only; resolve scan findings with narrow reviewed allowances; Astra reviews — cost if wrong: a later bwrap rebuild/pin change before Task 34.
- Image blockers: 801a3118 (bwrap 0.11.0 built from source on AL2023, 4 identical builds, hosted pin 1ebd5a3d; personal pin unchanged), 9b36915c (scan allowances bound to rule+bytes, 72 entries; runner findings are not secrets). Dry run assembles IMAGE_DIGEST sha256:e1cce421... Rulings: (a) pin python3 from the same AL2023 release (containment suite needs it); (b) delete /usr/local/go/src/**/testdata in the image (compilers never need it; removes the 2015 third-party AWS key fixture and its allowances) rather than ask Paul — cost if wrong: someone running go test std in the VM (never done); (c) fix plan3test budget overrun from 8ed317b6.
+- Ruling (renumber, coordinator 2026-12-01): design-feedback-1 also took protocol 39 and migration 0125 and merges to main first, so hosted runners renumber: wire.ProtocolHostedRunners = Protocol40 (Protocol39 = 39 kept, declared as design-feedback-1 declares it); migrations 0125 to 0130 become 0126 to 0131 (0126_hosted_checks_setting, 0127_hosted_jobs, 0128_hosted_limits, 0129_hosted_job_deadline, 0130_hosted_job_admission, 0131_checkpoints); the Research floor is 40. Supersedes the protocol 39 and 0125-onward numbers in the rulings above — cost if wrong: a merge that leaves two protocols at 39 or two migrations at 0125.
diff --git a/internal/equipo/chat/hosted_jobs_test.go b/internal/equipo/chat/hosted_jobs_test.go
index 4e43c1e0..aff9b301 100644
--- a/internal/equipo/chat/hosted_jobs_test.go
+++ b/internal/equipo/chat/hosted_jobs_test.go
@@ -540,7 +540,7 @@ func TestHostedJobAuditAtomic(t *testing.T) {
// TestMigrationAdditive: from the hosted slice 2 migrations on, each one
// only adds. Every table, column and index before it is still there,
-// unchanged, after it; 0126 adds exactly hosted_jobs and
+// unchanged, after it; 0127 adds exactly hosted_jobs and
// hosted_challenges, and its live-job index keeps one live job a step.
// The migrations are internal/equipo's (its Schema), read from disk.
func TestMigrationAdditive(t *testing.T) {
@@ -552,13 +552,13 @@ func TestMigrationAdditive(t *testing.T) {
all := schema.All()
first := -1
for i, m := range all {
- if m.ID == "equipo/0125_hosted_checks_setting" {
+ if m.ID == "equipo/0126_hosted_checks_setting" {
first = i
}
}
d, err := migrate.Replay(ctx, all[:max(first, 0)])
if first < 0 || err != nil {
- t.Fatal("no 0125_hosted_checks_setting, or", err)
+ t.Fatal("no 0126_hosted_checks_setting, or", err)
}
defer d.Close()
sawJobs := false
@@ -609,12 +609,12 @@ func TestMigrationAdditive(t *testing.T) {
t.Errorf("%s changed %s:\n%+v\n%+v", m.ID, tb.Name, tb, cut)
}
}
- if m.ID != "equipo/0126_hosted_jobs" {
+ if m.ID != "equipo/0127_hosted_jobs" {
continue
}
sawJobs = true
if strings.Join(added, " ") != "hosted_challenges hosted_jobs" {
- t.Fatalf("0126 added %v", added)
+ t.Fatalf("0127 added %v", added)
}
if _, err := d.ExecContext(ctx, "INSERT INTO hosted_jobs(attempt_id, step_id, state) VALUES ('a1', 's1', 'ended'), ('a2', 's1', 'failed'), ('a3', 's1', 'pending')"); err != nil {
t.Fatal(err)
@@ -629,6 +629,6 @@ func TestMigrationAdditive(t *testing.T) {
}
}
if !sawJobs {
- t.Fatal("no 0126_hosted_jobs")
+ t.Fatal("no 0127_hosted_jobs")
}
}
diff --git a/internal/equipo/chat/protocol_floor_test.go b/internal/equipo/chat/protocol_floor_test.go
index aea772ad..6df57903 100644
--- a/internal/equipo/chat/protocol_floor_test.go
+++ b/internal/equipo/chat/protocol_floor_test.go
@@ -53,11 +53,12 @@ func (r *hkRig) speaks(protocol int) {
// Placement on a primary known to speak 38 ends the step
// runner_update_needed, before any dispatch is queued, its runner still
// named for the update; so does one below ProtocolResearch (12), the
-// same refusal. At 39 the same step is dispatched there.
+// same refusal, and so does 39, the protocol just below. At
+// ProtocolHostedRunners (40) the same step is dispatched there.
func TestProtocol38RunnerGetsNoResearch(t *testing.T) {
r, l, _ := grantRig(t)
r.floorRunners()
- for _, protocol := range []int{wire.ProtocolDesign, wire.ProtocolMetered} {
+ for _, protocol := range []int{wire.Protocol39, wire.ProtocolDesign, wire.ProtocolMetered} {
old := r.floorResearch(l, "k_old_"+itoa64(int64(protocol)))
r.speaks(protocol)
st := r.dispatchNow(old.ID)
@@ -72,23 +73,23 @@ func TestProtocol38RunnerGetsNoResearch(t *testing.T) {
r.speaks(wire.ProtocolHostedRunners)
st := r.dispatchNow(cur.ID)
if wire.StepTerminal(st.State) || st.RunnerID != "RUNNER1" {
- t.Fatalf("Research at protocol 39: %+v", st)
+ t.Fatalf("Research at protocol 40: %+v", st)
}
if c, d := r.dispatched(cur.ID); c.RunnerID != "RUNNER1" || d.Research == nil {
- t.Fatalf("Research at protocol 39 not dispatched: %+v %+v", c, d)
+ t.Fatalf("Research at protocol 40 not dispatched: %+v %+v", c, d)
}
}
// TestQueuedResearchRecheckedAtAuthorize: a Research dispatch queued
// before this check (an instance upgraded with it queued, or a primary
// that went back to an older runner) is refused at its start
-// authorization below 39. The step ends runner_update_needed, never
-// started; at 39 it starts.
+// authorization below 40. The step ends runner_update_needed, never
+// started; at 40 it starts.
func TestQueuedResearchRecheckedAtAuthorize(t *testing.T) {
r, l, _ := grantRig(t)
r.speaks(wire.ProtocolHostedRunners)
research := r.researchStep(l, "k_queued")
- for _, protocol := range []int{wire.ProtocolDesign, wire.ProtocolInjectionDefences, wire.ProtocolResearch} {
+ for _, protocol := range []int{wire.Protocol39, wire.ProtocolDesign, wire.ProtocolInjectionDefences, wire.ProtocolResearch} {
l.Protocol = protocol
if refused := r.authorize(l, research, ""); refused != wire.ReasonRunnerUpdateNeeded {
t.Fatalf("Research start at protocol %d: %q", protocol, refused)
@@ -100,10 +101,10 @@ func TestQueuedResearchRecheckedAtAuthorize(t *testing.T) {
}
l.Protocol = wire.ProtocolHostedRunners
if refused := r.authorize(l, research, ""); refused != "" {
- t.Fatalf("Research start at protocol 39: %q", refused)
+ t.Fatalf("Research start at protocol 40: %q", refused)
}
if r.stepNow(research.ID).StartedAt == nil {
- t.Fatal("Research at protocol 39 did not start")
+ t.Fatal("Research at protocol 40 did not start")
}
}
@@ -119,7 +120,7 @@ func TestResearchFencedAtReconnect(t *testing.T) {
r.speaks(wire.ProtocolHostedRunners)
s := r.floorResearch(l, "k_fenced")
if st := r.dispatchNow(s.ID); st.State != wire.StepQueued || st.RunnerID != "RUNNER1" {
- t.Fatalf("Research at protocol 39: %+v", st)
+ t.Fatalf("Research at protocol 40: %+v", st)
}
old := l
old.Protocol = wire.ProtocolMetered
diff --git a/internal/equipo/chat/research.go b/internal/equipo/chat/research.go
index fded23f1..4460f3e9 100644
--- a/internal/equipo/chat/research.go
+++ b/internal/equipo/chat/research.go
@@ -589,7 +589,7 @@ func (t *txn) dispatchResearch(k *taskRecord, s *stepRecord) error {
return nil
}
// Nor to a runner known to speak below the quoting of its prompt
- // (promptFloor, 39, which covers one below ProtocolResearch too): it
+ // (promptFloor, 40, which covers one below ProtocolResearch too): it
// ends runner_update_needed, the runner named for its update.
if old, err := t.belowPromptFloor(*s); err != nil || old {
if old {
diff --git a/internal/equipo/chat/specialist_grants_test.go b/internal/equipo/chat/specialist_grants_test.go
index 9d570f04..11422396 100644
--- a/internal/equipo/chat/specialist_grants_test.go
+++ b/internal/equipo/chat/specialist_grants_test.go
@@ -453,7 +453,7 @@ func TestRenderLeaseNeedsPageRender(t *testing.T) {
t.Fatal("a Design step's lease below 38")
}
// A Research step (bound to web.research) never renders, on a
- // connection that can run it (39, its prompt's quoting).
+ // connection that can run it (40, its prompt's quoting).
rs := r.researchStep(l, "k_research")
cur := l
cur.Protocol = wire.ProtocolHostedRunners
@@ -514,7 +514,7 @@ func (r *hkRig) researchStep(l Lease, task string) stepRecord {
// new one's binding is checked too; revoking cancels both.
func TestResearchLegacyEmptyBinding(t *testing.T) {
r, l, _ := grantRig(t)
- // Research runs on a runner at 39 (its prompt's quoting).
+ // Research runs on a runner at 40 (its prompt's quoting).
r.speaks(wire.ProtocolHostedRunners)
l.Protocol = wire.ProtocolHostedRunners
bound := r.researchStep(l, "k_bound")
@@ -550,7 +550,7 @@ func TestResearchLegacyEmptyBinding(t *testing.T) {
// binding of the grant the task's project resolves to.
func TestResearchDispatchBinds(t *testing.T) {
r, l, _ := grantRig(t)
- // Research runs on a runner at 39 (its prompt's quoting).
+ // Research runs on a runner at 40 (its prompt's quoting).
r.speaks(wire.ProtocolHostedRunners)
l.Protocol = wire.ProtocolHostedRunners
s := r.researchStep(l, "k_r")
diff --git a/internal/equipo/hosted_settings_test.go b/internal/equipo/hosted_settings_test.go
index 72b3c495..ebb0984d 100644
--- a/internal/equipo/hosted_settings_test.go
+++ b/internal/equipo/hosted_settings_test.go
@@ -109,18 +109,22 @@ func TestHostedSettingPage(t *testing.T) {
}
}
-// TestHostedSettingMigrationOff: the migration follows 0124 and leaves
-// every existing project off, with no owner and revision 0.
+// TestHostedSettingMigrationOff: the migration (0126; 0125 is Design
+// feedback's) comes after 0124 and leaves every existing project off,
+// with no owner and revision 0.
func TestHostedSettingMigrationOff(t *testing.T) {
all := Schema.All()
- at := -1
+ at, renders := -1, -1
for i, m := range all {
- if m.ID == "equipo/0125_hosted_checks_setting" {
+ switch m.ID {
+ case "equipo/0126_hosted_checks_setting":
at = i
+ case "equipo/0124_step_renders":
+ renders = i
}
}
- if at < 1 || all[at-1].ID != "equipo/0124_step_renders" {
- t.Fatal("the hosted setting migration must follow 0124")
+ if at < 1 || renders < 0 || renders >= at {
+ t.Fatal("the hosted setting migration must be 0126, after 0124")
}
ctx := context.Background()
d, err := migrate.Replay(ctx, all[:at])
diff --git a/internal/equipo/migrations/0125_hosted_checks_setting.sql b/internal/equipo/migrations/0126_hosted_checks_setting.sql
similarity index 100%
rename from internal/equipo/migrations/0125_hosted_checks_setting.sql
rename to internal/equipo/migrations/0126_hosted_checks_setting.sql
diff --git a/internal/equipo/migrations/0126_hosted_jobs.sql b/internal/equipo/migrations/0127_hosted_jobs.sql
similarity index 100%
rename from internal/equipo/migrations/0126_hosted_jobs.sql
rename to internal/equipo/migrations/0127_hosted_jobs.sql
diff --git a/internal/equipo/migrations/0127_hosted_limits.sql b/internal/equipo/migrations/0128_hosted_limits.sql
similarity index 100%
rename from internal/equipo/migrations/0127_hosted_limits.sql
rename to internal/equipo/migrations/0128_hosted_limits.sql
diff --git a/internal/equipo/migrations/0128_hosted_job_deadline.sql b/internal/equipo/migrations/0129_hosted_job_deadline.sql
similarity index 100%
rename from internal/equipo/migrations/0128_hosted_job_deadline.sql
rename to internal/equipo/migrations/0129_hosted_job_deadline.sql
diff --git a/internal/equipo/migrations/0129_hosted_job_admission.sql b/internal/equipo/migrations/0130_hosted_job_admission.sql
similarity index 100%
rename from internal/equipo/migrations/0129_hosted_job_admission.sql
rename to internal/equipo/migrations/0130_hosted_job_admission.sql
diff --git a/internal/equipo/migrations/0130_checkpoints.sql b/internal/equipo/migrations/0131_checkpoints.sql
similarity index 100%
rename from internal/equipo/migrations/0130_checkpoints.sql
rename to internal/equipo/migrations/0131_checkpoints.sql
diff --git a/internal/hostedproxy/e2e_test.go b/internal/hostedproxy/e2e_test.go
index f5ec306e..9f237f6c 100644
--- a/internal/hostedproxy/e2e_test.go
+++ b/internal/hostedproxy/e2e_test.go
@@ -208,7 +208,7 @@ func TestFrontingMatrix(t *testing.T) {
noHits(t, h)
// Positive control: the runner's own request and its stream.
- if status, body, err := get(t, h, vm, "/api/runner/protocol"); err != nil || status != 200 || body != "protocol 39" {
+ if status, body, err := get(t, h, vm, "/api/runner/protocol"); err != nil || status != 200 || body != "protocol 40" {
t.Fatalf("GET /api/runner/protocol = %d %q, %v", status, body, err)
}
openSocket(t, h, vm)
diff --git a/internal/hostedproxy/egress_test.go b/internal/hostedproxy/egress_test.go
index 527ffe0b..b72442da 100644
--- a/internal/hostedproxy/egress_test.go
+++ b/internal/hostedproxy/egress_test.go
@@ -306,7 +306,7 @@ func newEnv(t *testing.T) *env {
e.originCA = newTestCA(t, "origin CA")
e.setOriginCert(e.originCA, testHost)
e.handler.Store(http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- _, _ = io.WriteString(w, "protocol 39")
+ _, _ = io.WriteString(w, "protocol 40")
})))
e.origin = httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
e.hits.Add(1)
diff --git a/internal/hostedproxy/proxytest/harness.go b/internal/hostedproxy/proxytest/harness.go
index 014877f6..fd869d98 100644
--- a/internal/hostedproxy/proxytest/harness.go
+++ b/internal/hostedproxy/proxytest/harness.go
@@ -849,7 +849,7 @@ func (h *Harness) Handle(path string, fn http.HandlerFunc) { h.routes.Store(path
// startOrigin is a TLS origin for name on 127.0.0.1: a path given to
// routes is served by its handler; otherwise GET /api/runner/protocol
-// answers "protocol 39", GET /api/runner/stream is a WebSocket echo, and
+// answers "protocol 40", GET /api/runner/stream is a WebSocket echo, and
// anything else answers its method and path.
func (h *Harness) startOrigin(caCert *x509.Certificate, caKey *ecdsa.PrivateKey, name string, hits *atomic.Int64, routes *sync.Map) *httptest.Server {
leaf := issueServer(h.t, caCert, caKey, name)
@@ -861,7 +861,7 @@ func (h *Harness) startOrigin(caCert *x509.Certificate, caKey *ecdsa.PrivateKey,
}
switch r.URL.Path {
case "/api/runner/protocol":
- _, _ = io.WriteString(w, "protocol 39")
+ _, _ = io.WriteString(w, "protocol 40")
case "/api/runner/stream":
ws, err := websocket.Accept(w, r, nil)
if err != nil {
diff --git a/internal/runner/hosted/hosted_test.go b/internal/runner/hosted/hosted_test.go
index 00c5fac7..006329c3 100644
--- a/internal/runner/hosted/hosted_test.go
+++ b/internal/runner/hosted/hosted_test.go
@@ -297,7 +297,7 @@ func TestTransportFailsOver(t *testing.T) {
vm := h.Issue(t, proxytest.LaunchID)
dead := deadAddr(t)
c := hosted.NewHTTPClient([]netip.AddrPort{dead, h.Proxy.EgressAddr()}, h.InterceptPin, func() *tls.Certificate { return &vm.Cert })
- if status, body, err := get(c, protocolURL); err != nil || status != http.StatusOK || body != "protocol 39" {
+ if status, body, err := get(c, protocolURL); err != nil || status != http.StatusOK || body != "protocol 40" {
t.Fatalf("GET through the second proxy = %d %q, %v", status, body, err)
}
f := enrolOn(h)
diff --git a/internal/thintest/mixed_protocol_contract_test.go b/internal/thintest/mixed_protocol_contract_test.go
index 8f59052a..9380f2fe 100644
--- a/internal/thintest/mixed_protocol_contract_test.go
+++ b/internal/thintest/mixed_protocol_contract_test.go
@@ -11,7 +11,7 @@ import (
// connections (an API-key connect reaches it) but is never offered
// Research (propose_specialist and research say it needs an update, and
// nothing is dispatched); at 13 both work, but Research is placed only
-// at 39 (its prompt's quoting, hosted slice 2 Task 26): at 13 the step
+// at 40 (its prompt's quoting, hosted slice 2 Task 26): at 13 and 39 the step
// ends runner_update_needed with nothing dispatched; at 11 both are
// refused. The protocols are written as numbers, so pointing
// ProtocolResearch back at 12 fails here.
@@ -25,7 +25,8 @@ func TestMixedVersionsMeteredAndResearch(t *testing.T) {
{"11", wire.Protocol11, false, false, false},
{"12", wire.Protocol12, true, false, false},
{"13", wire.Protocol13, true, true, false},
- {"39", wire.Protocol39, true, true, true},
+ {"39", wire.Protocol39, true, true, false},
+ {"40", wire.Protocol40, true, true, true},
} {
t.Run(c.name, func(t *testing.T) {
r := newToolRigSaying(t, c.protocol, personWords)
diff --git a/internal/thintest/scheduler_contract_test.go b/internal/thintest/scheduler_contract_test.go
index 6cb65fb7..e5fe1789 100644
--- a/internal/thintest/scheduler_contract_test.go
+++ b/internal/thintest/scheduler_contract_test.go
@@ -277,7 +277,7 @@ func TestContractSchedulerHousekeeping(t *testing.T) {
// its dispatch, and its hold is kept (queued, not running) with Needs you
// and Run now, as for any step.
func TestContractSchedulerResearch(t *testing.T) {
- // The scheduler's facts arrived at 14; Research is placed only at 39
+ // The scheduler's facts arrived at 14; Research is placed only at 40
// (its prompt's quoting, hosted slice 2 Task 26).
r := newToolRigSaying(t, wire.ProtocolHostedRunners, personWords)
r.researchOn()
diff --git a/internal/wire/assistant_files_test.go b/internal/wire/assistant_files_test.go
index 616e10bc..025c47a7 100644
--- a/internal/wire/assistant_files_test.go
+++ b/internal/wire/assistant_files_test.go
@@ -16,7 +16,7 @@ import (
// Assistant message with files is refused, earlier and earlier_more are
// dropped, and the Coordinator's and a job's frames go as they are.
func TestProtocol33AssistantFiles(t *testing.T) {
- if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
+ if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 {
t.Fatalf("assistant files %d, current %d", wire.ProtocolAssistantFiles, wire.ProtocolCurrent)
}
if wire.RunnerKeepFiles != 14*24*time.Hour {
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go
index 7057830c..c050dbf6 100644
--- a/internal/wire/assistant_test.go
+++ b/internal/wire/assistant_test.go
@@ -81,7 +81,7 @@ func TestAssistantCardJSON(t *testing.T) {
// A runner that speaks 24 or more is spoken to at 24, the warm
// protocol; glances came at 23 and jobs at 22.
func TestSpokenIs24(t *testing.T) {
- if wire.Spoken(99) != 39 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 {
+ if wire.Spoken(99) != 40 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 {
t.Fatalf("spoken %d, current %d", wire.Spoken(99), wire.ProtocolCurrent)
}
}
diff --git a/internal/wire/change_diffs_test.go b/internal/wire/change_diffs_test.go
index 3eca1260..9fa96ab9 100644
--- a/internal/wire/change_diffs_test.go
+++ b/internal/wire/change_diffs_test.go
@@ -11,7 +11,7 @@ import (
)
func TestProtocol35ChangeDiffs(t *testing.T) {
- if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 39 {
+ if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 40 {
t.Fatal("protocol")
}
f, err := wire.NewFrame("diff", wire.FrameChangeDiff, wire.ChangeDiffUpload{})
diff --git a/internal/wire/change_files_test.go b/internal/wire/change_files_test.go
index f7240666..4892243a 100644
--- a/internal/wire/change_files_test.go
+++ b/internal/wire/change_files_test.go
@@ -11,7 +11,7 @@ import (
)
func TestProtocol31ChangeFiles(t *testing.T) {
- if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 39 {
+ if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 40 {
t.Fatal("protocol not 31")
}
facts := &wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: strings.Repeat("b", 40), Files: 1, Additions: 1, Entries: []wire.ChangedFile{{Path: "a.txt", Status: "added", Additions: 1}}}
diff --git a/internal/wire/design_test.go b/internal/wire/design_test.go
index 9af068da..61b753f8 100644
--- a/internal/wire/design_test.go
+++ b/internal/wire/design_test.go
@@ -36,7 +36,7 @@ func renderFile() wire.RenderFile {
// TestProtocol38Design: protocol 38 is the Design specialist's and the
// current one.
func TestProtocol38Design(t *testing.T) {
- if wire.Protocol38 != 38 || wire.ProtocolDesign != wire.Protocol38 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.ProtocolMacEngineering != 37 {
+ if wire.Protocol38 != 38 || wire.ProtocolDesign != wire.Protocol38 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 || wire.ProtocolMacEngineering != 37 {
t.Fatalf("design %d, current %d, spoken %d", wire.ProtocolDesign, wire.ProtocolCurrent, wire.Spoken(99))
}
}
diff --git a/internal/wire/hosted_test.go b/internal/wire/hosted_test.go
index fd580573..3d194420 100644
--- a/internal/wire/hosted_test.go
+++ b/internal/wire/hosted_test.go
@@ -12,7 +12,7 @@ import (
)
func TestHostedRunnersProtocol(t *testing.T) {
- if wire.Protocol39 != 39 || wire.ProtocolHostedRunners != wire.Protocol39 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.Spoken(38) != 38 {
+ if wire.Protocol40 != 40 || wire.ProtocolHostedRunners != wire.Protocol40 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 || wire.Spoken(39) != 39 || wire.Spoken(38) != 38 {
t.Fatalf("hosted runners %d, current %d, spoken %d", wire.ProtocolHostedRunners, wire.ProtocolCurrent, wire.Spoken(99))
}
// Release slice 1's hub checks keep their own, older number.
diff --git a/internal/wire/injection_test.go b/internal/wire/injection_test.go
index 292ec62a..5204d2a2 100644
--- a/internal/wire/injection_test.go
+++ b/internal/wire/injection_test.go
@@ -7,10 +7,10 @@ import (
)
func TestInjectionProtocolDowngrade(t *testing.T) {
- if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 39 {
+ if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 40 {
t.Fatal("injection guarantees require protocol 28")
}
- for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 37: 37, 38: 38, 39: 39, 99: 39} {
+ for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 37: 37, 38: 38, 39: 39, 40: 40, 99: 40} {
if got := wire.Spoken(version); got != want {
t.Fatalf("negotiated %d as %d, want %d", version, got, want)
}
diff --git a/internal/wire/lookup_test.go b/internal/wire/lookup_test.go
index 9edd7bca..82dccdcc 100644
--- a/internal/wire/lookup_test.go
+++ b/internal/wire/lookup_test.go
@@ -13,7 +13,7 @@ import (
func TestProtocolLookupIs36(t *testing.T) {
// Lookups stay at 36; Mac Engineering is 37 and Design (38) is the
// current protocol.
- if wire.ProtocolLookup != 36 || wire.ProtocolMacEngineering != 37 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.Spoken(36) != 36 {
+ if wire.ProtocolLookup != 36 || wire.ProtocolMacEngineering != 37 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 || wire.Spoken(36) != 36 {
t.Fatalf("lookup %d current %d", wire.ProtocolLookup, wire.ProtocolCurrent)
}
}
diff --git a/internal/wire/mac_engineering_test.go b/internal/wire/mac_engineering_test.go
index 78247829..d0f0710b 100644
--- a/internal/wire/mac_engineering_test.go
+++ b/internal/wire/mac_engineering_test.go
@@ -21,7 +21,7 @@ func TestProtocol37Constants(t *testing.T) {
if wire.Protocol37 != 37 || wire.ProtocolMacEngineering != wire.Protocol37 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolChangeDiffs != 35 || wire.ProtocolLookup != 36 {
t.Fatalf("mac engineering %d, current %d", wire.ProtocolMacEngineering, wire.ProtocolCurrent)
}
- if wire.Spoken(99) != 39 || wire.Spoken(37) != 37 || wire.Spoken(36) != 36 || wire.Spoken(35) != 35 {
+ if wire.Spoken(99) != 40 || wire.Spoken(37) != 37 || wire.Spoken(36) != 36 || wire.Spoken(35) != 35 {
t.Fatal("spoken protocol")
}
for kind, want := range map[string]bool{wire.FramePrepareBase: true, wire.FrameBase: true} {
diff --git a/internal/wire/places_test.go b/internal/wire/places_test.go
index 54e51ae9..66209f13 100644
--- a/internal/wire/places_test.go
+++ b/internal/wire/places_test.go
@@ -22,7 +22,7 @@ func placesHello() wire.Hello {
// refused: an older runner would deploy to its own fixed account, an
// older instance would decide a check without the destination.
func TestEncodeBelowProtocol31DropsPlaces(t *testing.T) {
- if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
+ if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 {
t.Fatalf("places %d, current %d", wire.ProtocolPlaces, wire.ProtocolCurrent)
}
hello := placesHello()
diff --git a/internal/wire/runners.go b/internal/wire/runners.go
index 2ffc2439..b7994cbf 100644
--- a/internal/wire/runners.go
+++ b/internal/wire/runners.go
@@ -65,6 +65,7 @@ const (
Protocol37 = 37
Protocol38 = 38
Protocol39 = 39
+ Protocol40 = 40
// ProtocolSpend is the first protocol with a fix round's Feedback and
// a usage row's Turns; Encode drops both below it.
ProtocolSpend = Protocol3
@@ -260,7 +261,9 @@ const (
// not ProtocolHostedChecks, release slice 1's hub checks at 5. It
// also marks Research's prompt quoting every untrusted value: the
// instance places Research only at it (ReasonRunnerUpdateNeeded).
- ProtocolHostedRunners = Protocol39
+ // 39 is Design feedback's (branch design-feedback-1, which reaches
+ // main first), so hosted runners take 40.
+ ProtocolHostedRunners = Protocol40
ProtocolCurrent = ProtocolHostedRunners
)
diff --git a/internal/wire/stuck_test.go b/internal/wire/stuck_test.go
index 1b5d3805..2a993de2 100644
--- a/internal/wire/stuck_test.go
+++ b/internal/wire/stuck_test.go
@@ -14,7 +14,7 @@ import (
// Stuck tasks (protocol 30): a hello's tool health is a fixed state per
// pinned tool, never a path, and an older instance never hears it.
func TestProtocol30ToolHealth(t *testing.T) {
- if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
+ if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 {
t.Fatalf("stuck %d, current %d", wire.ProtocolStuckTasks, wire.ProtocolCurrent)
}
caps := func(h *wire.ToolHealth) wire.Capabilities {
diff --git a/internal/wire/warm_test.go b/internal/wire/warm_test.go
index 85776769..e577d9b8 100644
--- a/internal/wire/warm_test.go
+++ b/internal/wire/warm_test.go
@@ -13,7 +13,7 @@ import (
// other (durable, acked), and Encode refuses it below 24: an older
// runner's strict decoder would close the stream on it.
func TestEncodeWarmBelow24(t *testing.T) {
- if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
+ if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 40 {
t.Fatalf("protocols %d %d", wire.ProtocolWarm, wire.ProtocolCurrent)
}
f, err := wire.NewFrame("c1", wire.FrameWarm, wire.WarmCommand{Person: "ana@example.com"})