Skip to content

Status, doctor, the console and the docs show learned kinds with their origin #777

Closed

Description

@V3RON

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) *"]
Loading
  • origin: where a warm pool entry came from: configured (a warmPool.targets entry, merged with a learned kind of the same spec when there is one) or learned (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.ts and policy.ts: WarmTargetFigures and TargetKind gain origin: "configured" | "learned" (from The warm pool learns the kinds it leases and keeps them ready, across restarts #776's report) and imageTag? (F1a); converger.ts figureOf copies 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 #announceMissed adds origin: "configured" to the payload.
  • src/contract/schemas.ts: origin: z.enum(["configured", "learned"]) and imageTag: imageTagSchema.optional() on warmPoolTargetSchema (the one image tag rule, src/contract/schemas.ts:106-110, at most 64 characters); WARM_POOL_ENTRIES_MAX = WARM_POOL_TARGETS_MAX + 64 bounds statusWarmPoolSchema.targets (F1, F1b); src/contract/protocol.ts bumps 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: unreachableTarget over origin === "configured" entries only (F9); overLimit unchanged.
  • src/bus/index.ts: warm-pool.target-missed gains origin: "configured"; both EVENTS.md rows.
  • 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 proves statusWarmPoolSchema), 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 *"]
Loading

Surface and extension points

None added.

Contract and event changes

  • status.get output: warmPool.targets[].origin, an enum of configured and learned, required; warmPool.targets[].imageTag, what imageTagSchema accepts (at most 64 characters, its character set), optional; warmPool.targets holds 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 through workerViewSchema (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 gains origin, always "configured" (additive, events rule 6); count stays the configured count (F10). Both EVENTS.md rows name origin; 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-missed fires for configured targets only", "doctor ... reads configured entries only".
  • Events rule 6 (additive payloads): origin is 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.

  • statusWarmPoolSchema accepts origin: "configured" and "learned", an optional imageTag, and 320 entries, and refuses an entry without origin or with another word, a tag imageTagSchema refuses, and 321 entries (six cases).
  • WarmPool.figures() lists a learned kind with origin: "learned", its count, its image tag and its short (running-limit when the budget stops it), a configured target with origin: "configured", and a kind both configured and learned once, origin: "configured", the larger count; a kind forgotten by a pass is gone from the next figures(); before the first pass and with the pool off, configured targets only (extends the figures tests).
  • simlock status prints the origin word on every warm pool line, learned lines included, the tag in the name, and a learned line's short: (extends F13's status tests; the --json claim is proven by the schema and figures lines, F10a).
  • warm-pool.target-missed carries origin: "configured" and the configured count, and no learned kind emits it however short it is (extends the target-missed test in converger.test.ts).
  • doctor reports warm-pool-target-unreachable for no learned entry, even one short: runtime-missing in a figure, and still for a configured one (extends doctor.test.ts's unreachable test).
  • warmTabOf maps origin and 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:changed passes.
  • pnpm test:console --project=chromium passes (F15).
  • PROTOCOL_VERSION_RANGE in src/contract/protocol.ts is one above the base branch's.
  • docs/CLI.md, docs/HTTP-API.md and docs/CONSOLE.md describe origin and the image tag; both EVENTS.md rows name origin.

Out of scope

  • A warm pool block of the gateway's own (stays empty).
  • Routing on learned kinds.

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    on Oct 20, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Oct 20, 2026
  3. self-assigned this
    on Oct 21, 2026
  4. V3RON commented on Oct 21, 2026

    @V3RON
    ContributorAuthor

    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.ts comment) were both fixed. The ledger is posted. The PR is ready, with every other CI job green.

    Not done: merge. merge-pr.sh 844 refused it: CI not green on PR #844: cancel Console.

    Findings: CI's Console job hits its 15-minute timeout in the Browser lane step 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.

  5. added
    task:blocked
    and removed
    task:ready
    on Oct 21, 2026
  6. removed their assignment
    on Oct 21, 2026
  7. added
    task:ready
    and removed
    task:blocked
    on Oct 21, 2026
  8. self-assigned this
    on Oct 21, 2026
  9. removed their assignment
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    task:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions