Repository navigation
Description
Part of #1894.
Scope
An operator writes android.virtualTags or ios.virtualTags in a worker's config. A lease with --requires <tag> is then granted an emulator or simulator of that platform on that worker, directly or through a gateway, and fails CAPABILITY_MISSING where no worker's platform carries the tag. Phones get tags in the next task.
If it goes wrong, a closed-network test lands on a worker or platform without the tag, or a lease that should be granted fails CAPABILITY_MISSING.
Technical spec
Commit 4b39322.
Rows
- Behaviours: B1, B2, B3, B4
- Stored state: S1
- Interfaces: I1, I2, I3, I4
- Existing code: X1, X2, X3, X4, X5, X16
Facts
| # | Fact | Source |
|---|---|---|
| F1 | The worker tags validator, with the messages I1 reuses, takes the module list to refuse module names |
src/core/config-validators.ts:331-356 |
| F2 | A gateway reads a worker's catalog entries with catalog.get, apart from status.get |
src/gateway/dispatcher.ts:239 |
| F3 | The catalog entry's optional fields are bounded in the contract (e.g. modes) |
src/contract/status-schemas.ts:310 |
| F4 | assessFleet runs the capability row last, over the workers hasCapabilities passes, and waits while a view is unread |
src/gateway/routing/serviceability.ts:111-131 |
Modules touched
core (config, the I3 helper), contract (catalog entry, protocol), daemon (catalog defaults, capability check), gateway routing (has-capabilities). Searches: rg tagsValidator, rg "#withDefaults", rg requireCapabilities, rg hasCapabilities.
Rules in play
- ADR 0092 §2 and §3: virtual tags per platform; a name is met by the worker or by the platform's virtual tags.
- ADR 0091 §1: the same name rules; the key is read at start; a gateway ignores it with a warning.
- Contract manual, protocol version: the catalog entry field bumps the protocol by one,
minwithmax.
Tests
Seam: config load and config set, the worker Dispatcher with a fake driver, and gateway routing over views; model on src/core/config-capabilities.test.ts, src/daemon/worker-capabilities.e2e.test.ts and src/gateway/routing/stages/has-capabilities.test.ts.
- B1: an operator writes
android.virtualTagsorios.virtualTags: absent;[]; one name; two names in order;Bank;1st-floor; 33 characters; nine names; listed twice;stream; a string; on a gateway (warning, ignored) - B2: a reader of a worker's catalog sees each platform's virtual tags: Android set and iOS empty; both empty
- B3: a virtual lease on a worker with
requires: inandroid.virtualTags; iOS with only Android tagged;bank-network,streamwithstreamoff; one worker tag and one virtual tag; norequires;--physicalwith the tag only inandroid.virtualTags(CAPABILITY_MISSING) - B4: a virtual lease through a gateway with
requires: A tagged, B untagged; only B connected; A tagged on iOS only; A busy, B untagged; A's view unread;--physicalwith the tag only in A's virtual tags (CAPABILITY_MISSING)
Done when
pnpm test:changedandpnpm typecheckpass.- The configuration reference describes
android.virtualTagsandios.virtualTags; the CLI and errors pages say how--requiresandCAPABILITY_MISSINGtreat them; the workers concept page says which devices a virtual tag covers.
Out of scope
Tags on enrolled phones, device add --tags, device tag: the next task.
Depends on
Written by an agent.
Activity