Repository navigation
Description
Part of #1633.
Scope
A @simlock/e2e run on GitHub Actions tags every device it leases with the GitHub run id (or SIMLOCK_RUN, or its new runId option), so the cleanup step simlock release --run <id> frees them after a cancelled job. The provider sends the run id as agent-device's own runId, and the agent-device address copies that runId onto the simlock lease, on a worker and on a gateway. Outside CI the provider sends the runner's run id as today. agent-device itself does not change.
A user would notice: a cancelled e2e job whose devices the cleanup step does not free, a provider that throws on a run id that was fine, or an allocate refused because of its runId.
Technical spec
Commit c9d82e3.
Rows
Behaviours: B9, B10
Interfaces: I6, I7
Existing code: X20, X21, X22, X23 (the provider's runId option and its default)
Facts
| # | Fact | Source |
|---|---|---|
| F1 | Every option the provider takes is listed in KNOWN, and an unknown one throws at config load |
packages/e2e/src/options.ts:31-44 |
| F2 | The provider's errors start with simlockDevices: |
packages/e2e/src/options.ts:55-57 |
| F3 | Allocate, heartbeat and release all send the provider's scope, whose runId is request.runId today |
packages/e2e/src/provider.ts:46-56, :86-93, :114, :182 |
| F4 | The agent-device front builds the lease.request input in leaseInput; the gateway front uses the same code |
src/agent-device/front/allocate.ts:194-204, src/agent-device/AGENTS.md (Flow: through a gateway, step 1) |
Modules touched
src/agent-device/front/allocate.ts (and the Plan it builds, :48-61), packages/e2e/src/ (options.ts, provider.ts, index.test.ts, provider.test.ts), and the website pages using-devices/ci.mdx (the runId option row and the default) and using-devices/agent-device.mdx (an allocate's runId becomes the lease's run id). Searches: runId in src/agent-device/front and packages/e2e/src, leaseInput, KNOWN, ProviderOptions.
Rules in play
src/agent-device/AGENTS.md:checkRequestruns first and is unchanged; the front never refuses on arunId.- ADR 0077:
@simlock/e2eis its own workspace package; it imports no simlock code, so it keeps its own copy of the run id rule. - Documentation rule 9: the two website pages.
Tests
Seam: the agent-device front with the fake agent-device (models: src/agent-device/edge-allocate.test.ts, src/agent-device/gateway-front-lease.test.ts) and createProvider / simlockDevices with a fake agent-device client (models: packages/e2e/src/provider.test.ts, packages/e2e/src/index.test.ts).
- B9: an allocate's
runIdonto the lease:123-1;simlock-local; one outside the rule (lease has none); a run release then ends it on a worker and on a gateway - B10: the provider's run id: each row of the first Examples table with
runIdfor--run, except the rows the@simlock/e2etable replaces; each row of that table; allocate, heartbeat and release send the samerunId
Done when
pnpm test:changedpasses, with every Tests line above as a test, and the existing provider and agent-device front tests pass unchanged.pnpm checkpasses.- The website build passes:
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs.
Out of scope
- Any change to agent-device.
Depends on
Written by an agent.
Activity
test: through a gateway, an allocate's runId is the fleet lease's run…
test: allocate, heartbeat and release all send the runId option (#1668)
feat(e2e): the runId option is the run id allocate, heartbeat and rel…
test: the e2e provider picks its run id like simlock lease does, and …
feat(e2e): the run id comes from runId, SIMLOCK_RUN or GitHub Actions…
docs: the runId option and an allocate's runId becoming the lease's r…
docs: the agent-device manual does not restate leaseInput's run id (#…
feat(agent-device): an e2e run's run id reaches the simlock lease (#1668