Worker: an admission command that ranks or refuses local lease requests (ADR 0074 on the worker)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with ADR 0074 and src/leasing/acquisition-admission.ts, then trace how gateway admission commands receive requests and how local worker lease requests are stored. The proposal also points to worker configuration and status reporting as entry points. Done means local requests support operator admission and fail closed if the controller stops, while existing leases and in-flight operations follow the stated use case.
由索引模型根据 Issue 内容生成。
描述
Problem
ADR 0074 lets a gateway run an operator admission command that ranks or refuses each new lease.request. On a host that runs a worker, though, local agents lease from the worker directly. So an operator who must hold the host's simulators for a scheduled workload (a CI train, a measurement run, maintenance) has no supported way to refuse new local provisioning.
Verified against v0.8.0:
- docs
reference/cli.mdx"Which daemon a command reaches": with neither--gatewaynor--local, a command goes to the gateway only when no worker has started on the machine. So on a worker host the default CLI and MCP reach the worker. gateway/joining-workers.mdx: "Agents on the worker machine still lease devices from it directly."gateway/access-control.mdx: on the daemon's own machine the CLI needs no token.- source
src/leasing/acquisition-admission.tsholds only internal checks (requester limit, lease ids). There is no operator hook on the worker. worker drainexists only for gateways. On a standalone worker, capacity limits apply only at daemon start.
Context: the same shared-Mac setup as #1587 / #1737 (one Mac mini, one worker, ~10 concurrent coding agents, plus scheduled CI trains on the same host).
Use case
Before a train starts, the operator needs to:
- refuse new simulator/emulator provisioning (new leases, boots, installs);
- let boots already in flight finish and keep existing leases (no forced release);
- admit only the train's own requests while it runs (by request
metadata); - stop refusing when the train ends.
Hard requirement: fail closed if the controller dies. If the process that holds the reservation is killed or interrupted, new provisioning must stay refused until an operator or the controller clears it. It must never fall back to admitting.
Proposal
Mirror ADR 0074 on the worker:
admission.command(an argv list) andadmission.timeoutMsin the worker config. The command runs once per new locallease.request, after the cheap refusals and before the request is stored. The stdin/stdout contract is the same as the gateway's ({}/{"priority": n}/{"deny": "reason"}), it receives the caller'smetadata, and it fails closed withADMISSION_FAILED.- Requests relayed by a gateway that already ran its own command can skip the worker's command (configurable).
- Optional simpler switch:
worker drainon a standalone worker (refuse new local leases, keep existing ones). - Status exposes in-flight lifecycle operations (booting/creating/installing), so a controller can wait for them to settle before it takes ownership.
Alternatives considered
- A same-host gateway with an admission command: local agents bypass it (see above).
- Running the worker from a separate
SIMLOCK_HOMEso the default CLI resolves to the gateway: possible, but it relocates device state and puts a gateway hop on every localsimctl/adb/install. - Restarting the daemon with lower capacity limits: needs 0 leases and a restart each time.
Environment: Simlock 0.5.0 (planning 0.8.0), macOS 27.2, Xcode 27.2, single-host worker.
- 主要语言
- TypeScript
- 星标
- 705
- 派生
- 40
- 平均合并
- 12 小时 9 分钟
- 30 天内合并 PR
- 376
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/simlock 的其他 Issue
-
request:new
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/simlock#1806 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/simlock#1780 · 1 条评论 ·
维护者通常 1 天内回复
-
task:draft
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/simlock#1441 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 45/100
callstackincubator/simlock#1805 · 1 条评论 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 45/100
callstackincubator/simlock#1804 · 1 条评论 ·
维护者通常 1 天内回复
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
Update project links after the repository renames可能已有人在做 @JonathanTSilva 今天认领。 未关闭ai-generated priority: p2 size: xs type: bug
难度 2/5 1-3 小时 新手友好度 85/100
JonathanTSilva/jts-website#119 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 74/100
promplate/code-review#158 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
[Docs] CONTRIBUTING points the Backend Remake milestone at a branch that does not exist可能已有人在做 @franpts2 今天认领。 未关闭docs
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 3 天内回复