Repository navigation
Closed
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Description
Part of #88.
Scope
On a single host, simlock worker list and GET /v1/workers show that
host as one worker, with the same fields a gateway shows for each of its
workers. The fleet operations that cannot apply to a single host refuse
with their own code instead of UNKNOWN_REQUEST or 404.
Technical spec
Implements ADR 0012 in full.
Modules touched
src/contract: a pure function that turns the results ofstatus.get,
list.get(devices),catalog.getand the config into a worker view's
fields (ADR 0012 §1).GATEWAY_ONLY_OPERATIONSis removed from
operations.ts. The new error code inerrors.ts.src/gateway/worker-link.ts: builds its views with that function.
Behaviour does not change.src/daemon/dispatcher.ts: handlers forworker.list(one view of
itself) and forworker.drain|undrain|remove|install-component(throw
UNSUPPORTED_IN_WORKER_MODE). The dispatcher gains the instance id and
gateway.labelas options.src/daemon/main.ts(or wherever the dispatcher is built): passes the
instance id and label in.src/http/app.ts: the four/v1/workers*routes are registered in both
modes.src/cli/index.ts:worker listprints the one view on a worker, with
no special case.
Contract and event changes
worker.listanswers on a worker. Its output shape does not change.- New error code
UNSUPPORTED_IN_WORKER_MODE: HTTP501, CLI exit2,
details{ operation }. Added toErrorDetailsMap,ERROR_TABLEand the
declared-details table. - No protocol version change. No event changes.
- Docs updated as ADR 0012 Consequences lists:
HTTP-API.md(the worker
routes paragraph, the501row),CLI.md(exit-code table and notes,
every place a worker command answersUNKNOWN_REQUESTon a worker),
CLIENT.md,docs/internal/ARCHITECTURE.md.
Rules in play
architecture.md: one place builds a worker view; the contract module
stays free of engines and I/O.testing.md: the gateway's views must still come out the same; prove it,
don't assume it.documentation.md: end-user docs describe the behaviour with no ADR
links.
Tests
worker.list on a worker returns one view whose id is the instance idworker.list on a worker carries gateway.label as label, and no label when it is unsetworker.list on a worker reports the same capacity, devices, leases, catalog, host and installs as its own readsthe worker view builder gives a gateway the same view it built before this changeworker.drain, worker.undrain, worker.remove and worker.install-component on a worker fail with UNSUPPORTED_IN_WORKER_MODEGET /v1/workers on a worker answers 200 with one worker for an operator tokenGET /v1/workers on a worker answers 403 for an agent tokenPOST /v1/workers/{id}/drain on a worker answers 501 UNSUPPORTED_IN_WORKER_MODEPOST /v1/components/install with workers on a worker answers 501simlock worker list against a worker prints that worker(e2e)simlock worker drain against a worker exits 2 with UNSUPPORTED_IN_WORKER_MODE(e2e)
The existing test in src/http/app.test.ts that expects 404 for the
worker routes on a worker is replaced, not kept.
Done when
simlock worker liston a single host prints one line for that host.curlwith an operator token toGET /v1/workerson a single host
returns one worker, with the same fields a gateway returns.simlock worker drain <id>on a single host exits2and names
UNSUPPORTED_IN_WORKER_MODE.- A gateway's
simlock worker listoutput is unchanged. - The docs named above say the new behaviour.
Out of scope
- The console itself.
- Draining or removing a single host.
Depends on
Approval
- Approved for delivery
Written by an agent.
Metadata
Metadata
Assignees
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Activity
github-actions commentedon Oct 2, 2026
Now
task:ready: approved, technical spec present.test(daemon,http): prove each refusal, the version wiring and the ins…
docs(daemon,gateway,http): make three comments say only what the code…
fix(daemon,contract,gateway,docs): keep worker.list's catalog for the…
fix(daemon,contract,gateway,docs): re-read worker.list's catalog on t…
docs(adr): 0011–0013 — the web console (#277)
feat(contract,daemon,http,docs): a worker answers the fleet operation…
feat(ui,core,daemon,cli): attention view and stalled devices (#295)