Add `simlock instructions`: the rules an agent must follow, printable and served over MCP
Maintainer thường phản hồi trong vòng 1 ngày
@V3RON đang làm issue này rồi.
Từ ngày 27/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Standalone task opened by the maintainer; no parent feature.
Scope
Simlock is advisory: it only works when every agent never calls simctl, adb, avdmanager, or emulator directly and only drives devices it leased. Today those rules live in the docs, and each team rewrites them into every agent's system prompt by hand.
After this PR an operator runs simlock instructions and gets one self-contained text block to paste into an agent's system prompt or AGENTS.md, and an MCP client can read the same text as a resource. The block tells an agent, in plain words:
- Never call the platform tools directly; use
simlock simctl/simlock adb, which inject the device set or adb port. - How to lease: set a stable
SIMLOCK_AGENT_ID, runsimlock catalogfirst, thensimlock lease --platform … --device …in the background (or--detachplussimlock lease renewbeforettlDeadline), read the one JSON line on stdout, and read progress from stderr. - One lease per agent,
--allandnukeare operator commands, release withsimlock release <lease-id>or by exiting the holder. - Never pass
--allow-downloadunless told to. - What exit codes 10, 11, 13, and 14 mean and what to do on each.
- How to reach a leased device: the
environmentblock,simlock simctl/simlock adb, and that the refused verbs (simctl create/erase/delete,adb kill-server,emu kill) are refused on purpose. - Over MCP: the four tools and that
lease_statusis the thing to call after a context compaction.
Technical spec
Modules touched
src/instructions/index.ts(new): one exportedAGENT_INSTRUCTIONS: string(Markdown) andrenderInstructions(format: "text" | "json"). The only source of the text; nothing is duplicated in the CLI or MCP.src/cli/index.ts: newinstructionscommand. Prints the Markdown on stdout by default;--jsonprints{"instructions": "<markdown>"}. Any other flag isUSAGE(exit 2). Never connects to, or auto-starts, the daemon. Listed insimlock --help.src/mcp/server.ts: register a resourcesimlock://instructions(text/markdown) returningAGENT_INSTRUCTIONS; declare theresourcescapability. No new tools.docs/CLI.md: a## simlock instructionssection, and add the command to the "human-oriented view … accept--json" exception list in the intro.README.md: one sentence under "Getting started" and one under "MCP integration".
Contract and event changes
None. No daemon operation, no event, no config key.
Rules in play
docs/internal/agent-rules/documentation.mdrule 3: the printed text must name no file path in this repo. Point at the package'shomepageURL if a pointer is needed.docs/internal/agent-rules/testing.md: every test title below is a claim.docs/internal/agent-rules/architecture.mdrule 8: the text is static and frontend-owned; the daemon does not learn about it.
Tests
simlock instructionsprints the agent instructions on stdout and exits 0 without starting a daemon (e2e, fast lane: assert no socket appears underSIMLOCK_HOME).simlock instructions --jsonprints one JSON object whoseinstructionsfield equals the text output.simlock instructions --bogusfails withUSAGEand exit 2.- The agent instructions name no path inside this repository (unit: the text matches neither
docs/nor.md). - The agent instructions name every refused passthrough verb the drivers refuse (unit: derive the expected list from the drivers' refusal constants, not a copy).
- The MCP server lists
simlock://instructionsand reading it returns the same text the CLI prints (e2e, MCP session flow).
Done when
simlock instructionsandsimlock instructions --jsonbehave as specified above, verified by the e2e tests.simlock --helplists the command.- An MCP client can read
simlock://instructions. docs/CLI.mdandREADME.mddescribe the command;pnpm checkis green.
Out of scope
- Generating the text from the live catalog or config; it is static.
- A prompt-typed MCP primitive; a resource is enough for v1.
- Any new MCP tool.
Depends on
Approval
- Approved for delivery
Written by an agent.
- Ngôn ngữ chính
- TypeScript
- Star
- 14
- Fork
- 0
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 49
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/simlock
-
bug:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
callstackincubator/simlock#79 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature:spec
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
callstackincubator/simlock#162 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature:spec
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
callstackincubator/simlock#161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature:spec
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
callstackincubator/simlock#160 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature:spec
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
callstackincubator/simlock#159 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstackincubator/simlock
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
inu-appcenter/memorIN-frontend#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 7 ngày
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: CopyFilters ignores tabĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
CSCfi/sd-search-ui#145 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Cbeebies pl SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày