Repository navigation
Description
Part of #771.
Scope
simlock status, status.get, the console's worker page and simlock doctor show each learned kind beside the configured targets, each line saying where it came from, and the user docs describe the learned pool. A learned kind an operator sees short knows why; a configured target keeps its doctor finding and its event.
In short
Today the warm pool block lists configured targets only. After this PR every entry carries origin, configured or learned, and its image tag when the kind has one; a learned kind is a line like a target's, with what it wants, how many are ready, how many are booting, and why it is short when it is. A kind both configured and learned is one line, origin configured, wanted the larger count. A kind #776 forgot leaves the block on the next pass. The block holds at most 320 entries: 256 configured plus 32 learned per platform, so it can never overflow. warm-pool.target-missed fires for configured targets only, as before, judged by the configured count, and its payload says origin: "configured". doctor keeps its warm-pool-target-unreachable finding for configured targets and reads no learned entry.
flowchart LR
F["warm pool figures: configured + learned (changed) *"] --> S["status.get: targets[].origin (changed) *"]
S --> CLI["simlock status line (changed) *"]
S --> UI["console warm pool table: Origin column (changed) *"]
S --> GW[gateway worker view, passed through]
F --> D["doctor: configured entries only (changed) *"]
- origin: where a warm pool entry came from:
configured(awarmPool.targetsentry, merged with a learned kind of the same spec when there is one) orlearned(a kind this worker leased).
User's session, simlock status on a worker with one configured target and three learned kinds, printed with no column padding, three spaces before the origin word and three after it as today's line has before wanted, and the image tag after the mode when there is one:
# today
warm pool: enabled, reserve ios 0 android 0
iPhone 17 / 26.0 / full wanted 1 ready 1 booting 0
# after
warm pool: enabled, reserve ios 0 android 0
iPhone 17 / 26.0 / full configured wanted 1 ready 1 booting 0
iPhone 16 / 18.4 / full learned wanted 2 ready 1 booting 1
Pixel 8 / 35 / full learned wanted 1 ready 0 booting 0 short: running-limit
Pixel 8 / 35 / full / google_apis_playstore learned wanted 1 ready 1 booting 0
In --json, each entry of warmPool.targets gains "origin": "configured" or "learned" and, when the kind names one, "imageTag". The console's Warm pool table gains an Origin column with the same words, shows the tag in the model cell, and keys rows by the tag too.
| Entry | Today | After |
|---|---|---|
| configured target, no learned kind of that spec | listed, no origin | listed, origin: configured |
| learned kind, not configured | not listed | listed, origin: learned, wanted = its count |
| configured 1, learned 2, same spec | listed, wanted 1 | one line, origin: configured, wanted 2 |
| pool off | every configured target short: disabled |
the same; learned kinds not listed (nothing is learned, #776) |
| two learned Android kinds differing by image tag only | — | two lines, told apart by the tag |
| a learned kind #776 forgot | — | gone from the block after the next pass |
| before the first pass | configured targets from config, ready 0 | the same, no learned entries yet |
| gateway's own block | empty, off | unchanged; each worker's block in workers[] carries origins |
If this goes wrong, a user would notice a status block that hides what holds the worker's RAM, or a doctor finding for a kind the pool already forgot.
Technical spec
Facts
Commit 97bc8eaf.
| # | Fact | Source |
|---|---|---|
| F1 | warmPoolTargetSchema: platform, model, osVersion?, mode, count, ready, booting, short?, no image tag; statusWarmPoolSchema bounds targets to WARM_POOL_TARGETS_MAX (256), the same constant the config load caps warmPool.targets with; the dispatcher parses every status.get answer through the output schema |
src/contract/schemas.ts:522, :539-557; src/core/warm-pool/config.ts:98-99; src/daemon/dispatcher.ts:862 |
| F1a | TargetKind carries platform, model, osVersion?, mode, no image tag; a kind's identity includes imageTag |
src/core/warm-pool/policy.ts:61-66; src/core/domain.ts:93-102 |
| F1b | #776 keeps at most 32 learned kinds per platform and gives reports origin and configuredCount |
#776 "The tables", "Modules touched" |
| F2 | PROTOCOL_VERSION_RANGE is { min: 51, max: 51 }; a shape change bumps it in the same PR |
src/contract/protocol.ts:13; src/contract/AGENTS.md "Protocol version" |
| F3 | formatWarmPool prints one line per target: name, wanted, ready, booting, short: |
src/cli/format.ts:255-266 |
| F4 | figures() builds targets from #reports via figureOf (kind, booting, count, ready, short) |
src/core/warm-pool/converger.ts:225-247, :665-673 |
| F5 | WarmTargetFigures extends TargetKind with count, ready, booting, short? |
src/core/warm-pool/figures.ts:1-17 |
| F6 | The dispatcher answers status.get with warmPool: this.options.warmPool.figures(); the output schema strips fields it does not declare |
src/daemon/dispatcher.ts:414; src/contract/AGENTS.md "Rules" |
| F7 | The worker view passes status.warmPool through; the gateway keeps it per worker and drops it only for an incompatible view; the gateway's own block is a fixed empty one |
src/contract/worker-view.ts:93; src/gateway/worker-registry.ts:300; src/gateway/aggregate.ts:86 |
| F8 | The console: warmPoolRows keys rows by platform, model, OS and mode; warmRow maps to booting, key, mode, model, ready, runtime, short, wanted; the Workers screen draws the table |
ui/src/model/workers.ts:71-79; ui/src/model/worker-page.ts:436-447; ui/src/screens/workers/index.tsx:447-468 |
| F8a | #766 (task:ready) renames ui/src/screens/workers/ to fleet/ and rewrites the worker page and its Warm pool tab; #764 (task:ready) bumps PROTOCOL_VERSION_RANGE |
#766 "Modules touched"; #764 "This PR bumps the protocol by one" |
| F9 | doctor reads warmPool.figures().targets for unreachableTarget and sums config.warmPool.targets per platform for overLimit |
src/core/doctor.ts:608-640, :1103-1167 |
| F10 | warm-pool.target-missed payload: platform, model, osVersion?, mode, count, ready, reason; emitted per configured target index; after #776 judged and reported by configuredCount |
src/core/warm-pool/converger.ts:391-432; docs/EVENTS.md:35; docs/internal/EVENTS.md:73; #776 "Contract and event changes" |
| F10a | The --json status test echoes the fake client's block; the catalogs test compares event names only |
src/cli/index.test.ts "carries the block as the daemon sent it"; src/bus/index.test.ts:66-71 |
| F11 | Docs of the block: docs/CLI.md:1506-1535 (status), docs/HTTP-API.md:202-214, docs/CONSOLE.md:299-310, docs/CONFIGURATION.md:21 (warmPool.targets) |
as cited |
| F12 | Learned kinds, their counts and the merge rule come from #776: view.learned, a kind in both is one entry with the larger count in the configured position |
#776 "Modules touched", ADR 0038 §3 |
| F13 | CLI status tests: "simlock status prints no warm pool line for an answer without the block", "... for a gateway, whose own block is empty"; doctor's "prints one stderr line per unreachable warm pool target" | src/cli/index.test.ts:4231, :4249, :4318 |
| F14 | The events test fails when either catalog's names differ from EVENT_NAMES; payload rows are text |
src/bus/AGENTS.md "Adding an event" |
| F15 | The console lane runs in Chromium when the diff touches ui/ or src/contract/ |
docs/internal/agent-rules/toolchain.md "Tests agents run" (1) |
Modules touched
Searches: warmPoolTargetSchema, WarmTargetFigures, figureOf, formatWarmPool, warmPoolRows, warmRow, unreachableTarget, target-missed over src/, ui/, docs/.
src/core/warm-pool/figures.tsandpolicy.ts:WarmTargetFiguresandTargetKindgainorigin: "configured" | "learned"(from The warm pool learns the kinds it leases and keeps them ready, across restarts #776's report) andimageTag?(F1a);converger.tsfigureOfcopies them,figures()lists every report, learned ones included (lifting The warm pool learns the kinds it leases and keeps them ready, across restarts #776's filter), and#announceMissedaddsorigin: "configured"to the payload.src/contract/schemas.ts:origin: z.enum(["configured", "learned"])andimageTag: imageTagSchema.optional()onwarmPoolTargetSchema(the one image tag rule,src/contract/schemas.ts:106-110, at most 64 characters);WARM_POOL_ENTRIES_MAX = WARM_POOL_TARGETS_MAX + 64boundsstatusWarmPoolSchema.targets(F1, F1b);src/contract/protocol.tsbumps by one.src/cli/format.ts: the tag after the mode in the name, the origin word after the name (the In short layout).src/core/doctor.ts:unreachableTargetoverorigin === "configured"entries only (F9);overLimitunchanged.src/bus/index.ts:warm-pool.target-missedgainsorigin: "configured"; bothEVENTS.mdrows.ui/src/model/workers.ts(WarmPoolRow.origin, the key includes the tag),ui/src/model/worker-page.ts(WarmRow.origin, the tag in the model cell), the Workers screen as Console: Fleet table and a page per worker #766 leaves it (ui/src/screens/fleet/, F8a): the column.- Tests:
src/contract/schemas.test.ts(or the file that provesstatusWarmPoolSchema),src/cli/index.test.ts,src/core/doctor.test.ts,src/core/warm-pool/converger.test.ts,ui/src/model/worker-page.test.ts, the events catalogs test. - Docs: F11 and
docs/EVENTS.md:35,docs/internal/EVENTS.md:73.
flowchart LR
WP["warm-pool figures *"] --> DP[daemon dispatcher]
DP --> CT["contract schemas *"]
CT --> CLI["cli format *"]
CT --> UI["ui model + screen *"]
CT --> GW[gateway worker view]
WP --> DR["core doctor *"]
WP --> BUS["bus target-missed payload *"]
Surface and extension points
None added.
Contract and event changes
status.getoutput:warmPool.targets[].origin, an enum ofconfiguredandlearned, required;warmPool.targets[].imageTag, whatimageTagSchemaaccepts (at most 64 characters, its character set), optional;warmPool.targetsholds at most 320 entries (WARM_POOL_ENTRIES_MAX), which The warm pool learns the kinds it leases and keeps them ready, across restarts #776's caps keep it under. This PR bumps the protocol by one. Read from the wire by a gateway throughworkerViewSchema(F7): bounded by the enum and the length; a value outside them fails the view's parse as any bad field does today.warm-pool.target-missed: payload gainsorigin, always"configured"(additive, events rule 6);countstays the configured count (F10). BothEVENTS.mdrows nameorigin; they are prose, so no test reads them (F10a).config.get: unchanged.
Other code on the same state
Searched warmPool over src/gateway, src/http, src/mcp: the gateway passes the block through (F7) and routes on ready devices, not on the block (src/gateway/routing/stages/warm-hit.ts); HTTP and MCP serve status.get unchanged. No writer but the pool.
Failure modes
| Call | Outcome | What happens | Limit, counted from |
|---|---|---|---|
status.get on a worker |
ok | each entry with origin |
— |
a gateway parsing an older worker's view without origin |
parse fails | the worker's view is dropped as incompatible, as any schema mismatch is today (F7); the protocol bump already refuses such a worker at hello |
— |
No state written. No restart or concurrency concern.
Rules in play
- ADR 0038 §8, "each entry ... gains
origin", "warm-pool.target-missedfires for configured targets only", "doctor... reads configured entries only". - Events rule 6 (additive payloads):
originis added, nothing removed. - Documentation rule 2 (end-user docs updated in the same change): F11.
- Contract rule "every change to a contract shape bumps it by one in the same PR" (F2).
Tests
Seams: statusWarmPoolSchema in the contract tests; formatStatus through runCli in src/cli/index.test.ts (model: F13); WarmPool.figures() in converger.test.ts; Doctor in doctor.test.ts; warmTabOf in ui/src/model/worker-page.test.ts.
statusWarmPoolSchemaacceptsorigin: "configured"and"learned", an optionalimageTag, and 320 entries, and refuses an entry withoutoriginor with another word, a tagimageTagSchemarefuses, and 321 entries (six cases).WarmPool.figures()lists a learned kind withorigin: "learned", its count, its image tag and itsshort(running-limitwhen the budget stops it), a configured target withorigin: "configured", and a kind both configured and learned once,origin: "configured", the larger count; a kind forgotten by a pass is gone from the nextfigures(); before the first pass and with the pool off, configured targets only (extends the figures tests).simlock statusprints the origin word on every warm pool line, learned lines included, the tag in the name, and a learned line'sshort:(extends F13's status tests; the--jsonclaim is proven by the schema and figures lines, F10a).warm-pool.target-missedcarriesorigin: "configured"and the configured count, and no learned kind emits it however short it is (extends the target-missed test inconverger.test.ts).doctorreportswarm-pool-target-unreachablefor no learned entry, even oneshort: runtime-missingin a figure, and still for a configured one (extendsdoctor.test.ts's unreachable test).warmTabOfmapsoriginand the tag onto each row, two kinds differing by tag get two keys, and the worker screen renders the Origin column (renderToStaticMarkup).
Done when
pnpm test:changedpasses.pnpm test:console --project=chromiumpasses (F15).PROTOCOL_VERSION_RANGEinsrc/contract/protocol.tsis one above the base branch's.docs/CLI.md,docs/HTTP-API.mdanddocs/CONSOLE.mddescribeoriginand the image tag; bothEVENTS.mdrows nameorigin.
Out of scope
- A warm pool block of the gateway's own (stays empty).
- Routing on learned kinds.
Depends on
- The warm pool learns the kinds it leases and keeps them ready, across restarts #776
- Console: Fleet table and a page per worker #766 (rewrites the worker page and its Warm pool tab this task edits)
- Events history pages backwards: GET /v1/events with before and limit #764 (bumps the protocol on the same line)
Written by an agent.
Activity
test: simlock status prints the origin word, the tag and a learned li…
feat(cli): simlock status shows each warm pool entry's origin and tag (…
test: warm-pool.target-missed carries origin configured and no learne…
feat(warm-pool): warm-pool.target-missed names origin configured (#777)
test: doctor reports warm-pool-target-unreachable for no learned entry (
feat(doctor): warm-pool-target-unreachable reads configured entries o…
test: the worker page maps origin and the tag onto each warm row and …
feat(console): the Warm pool table shows each entry's origin and tag (#…
docs(warm-pool): describe origin, image tag and the learned pool in s…
refactor(contract): keep WARM_POOL_ENTRIES_MAX private to the schema (#…
test: the worker page's rows keep the image tag in their key (#777)
test: no learned kind announces target-missed, with a short learned k…
V3RON commentedon Oct 21, 2026
Handoff
Done: PR #844 is built (6/6 Tests lines) and audited. It passed review in 2 rounds: R1 (a test that could not fail) and R2 (a stale
schemas.tscomment) were both fixed. The ledger is posted. The PR is ready, with every other CI job green.Not done: merge.
merge-pr.sh 844refused it:CI not green on PR #844: cancel Console.Findings: CI's
Consolejob hits its 15-minute timeout in theBrowser lanestep on main too: it was cancelled on main's last four runs, 7b5b4d9 among them, and #834 was merged with it cancelled. Locally, three Chromium console specs failed (actions.spec.ts:166,activity.spec.ts:371,queue.spec.ts:163). Nobody checked them on main.Blocked on: #852, or a maintainer who merges #844 knowing the Console job is cancelled.
Written by an agent.
merge: origin/main into task/777 (keep main's test removals) (#777)