Skip to content

Virtual tags per platform a lease can require #1900

Done

Description

@V3RON

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, min with max.

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.virtualTags or ios.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: in android.virtualTags; iOS with only Android tagged; bank-network,stream with stream off; one worker tag and one virtual tag; no requires; --physical with the tag only in android.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; --physical with the tag only in A's virtual tags (CAPABILITY_MISSING)

Done when

  • pnpm test:changed and pnpm typecheck pass.
  • The configuration reference describes android.virtualTags and ios.virtualTags; the CLI and errors pages say how --requires and CAPABILITY_MISSING treat 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

  1. added
    task:draft
    on Nov 27, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 27, 2026
  3. self-assigned this
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions