Borrowing it
Nothing to install: this file belongs to qiannianhuanxiang/DSHA. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/qiannianhuanxiang/DSHA/main/AGENTS.mdgit clone --depth 1 https://github.com/qiannianhuanxiang/DSHAWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/qiannianhuanxiang/dsha/agents-md)<a href="https://agentmods.dev/instructions/qiannianhuanxiang/dsha/agents-md"><img src="https://agentmods.dev/badge/instructions/qiannianhuanxiang/dsha/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/qiannianhuanxiang/dsha/agents-md"><img src="https://agentmods.dev/badge/instructions/qiannianhuanxiang/dsha/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01576 | $0.01576 |
| Opus 5 | $0.00788 | $0.00788 |
| Sonnet 5 | $0.00315 | $0.00315 |
| Haiku 4.5 | $0.00158 | $0.00158 |
Grade A, and why
DSHA AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
DSHA 重构骨架。本文让你不扫全库就能上手 —— 读它之前先读 README.md。
一句话
APK 用 proot/proroot 把完整 Ubuntu rootfs 搬进 app 私有目录,在里面跑 Node 24 +
pnpm + @deepseek-ai/dsh(0.1.2-alpha.3)的 Web UI(:3080)。原生层是纯 Java 17、
Material3、单 Gradle 模块 :app。
技术约束(围绕这些设计)
- Java 17,无 Kotlin,单模块
:app。 applicationId com.dsh.client;Java 包com.deepseekharness.app;minSdk 26、compileSdk/targetSdk 34、NDK 26、arm64-v8a only。- 离线 rootfs(
assets/offline-rootfs.bin)不提交,CI 生成;本地骨架默认走精简包。
分层与归属(改代码前先看这里)
| 层 | 类 | 职责 |
|---|---|---|
ui/ |
MainActivity / WelcomeActivity / Launch·Settings·TerminalFragment | 界面与启动门禁 |
core/ |
HarnessController | 编排:把启动/停止 dsh 组合起来,不再装 8 类活 |
core/ |
ConfigStore | 配置唯一读写入口(端口/模型/workdir/API key) |
runtime/ |
ProotBootstrap | proot 命令组装与执行 |
runtime/ |
ContainerRuntime | 运行时选择 + BINDS 挂载清单 |
runtime/ |
WebProcessManager | 停止 Web(写哨兵 + 按 pid 文件杀) |
data/ |
KeyVault | Keystore AES/GCM 加密 API key |
bridge/ |
AppBridge | 3090 桥接缝(契约,待实现) |
util/ |
Constants / ShellQuote / Query / WebProcSel / BackupScope | 纯逻辑,无 Android 依赖,必须配单测 |
启动契约(不可破坏)
welcomed == false→WelcomeActivity→ 点开始 →MainActivity。MainActivity进入前校验welcomed,否则永远回 Welcome。- 完整版的「解压门禁」(
ExtractActivity、.offline-extracted标记)待回填, 契约沿用原版:进主 UI 只看.offline-extracted。
安全网:纯逻辑必须能单测
util/ 下的类不得 import Android API。任何新增纯逻辑都要在
app/src/test/java/com/deepseekharness/app/util/ 下配 JUnit 断言,跑:
./build.sh :app:testDebugUnitTest
当前 4 个测试类锁定的不变式(重构时绝不能改坏):
ShellQuote:POSIX 单引号转义,恶意值不能逃逸。Query:逐参数名匹配(indexOf(key+"=")会被后缀劫持,已修);「参数为空」≠「参数不存在」。BackupScope:部分备份绝不叫DSHA-backup-*(否则老版本当全量恢复会清掉配置与插件);dshPaths与mergeSubdirs一一对应。WebProcSel:认得出 dsh 进程、绝不误杀 proot/proroot(杀到容器启动器 = 环境连 App 一起带走)。
已知 trap(搬自原版,骨架已按此设计)
- 停止靠 pid 文件,不靠端口反查:
/proc/net/tcp非 root 读不到(静默空),/proc有 hidepid。 启动时echo $$ > /root/.dsha-web.pid再exec node(exec 不换 pid)。 - 停止先写哨兵
/root/.dsha-stopped:看门狗/重启脚本见到就退出,否则「秒复活」。 - app 私有目录禁
link(2)(SELinux),proot 必须带--link2symlink。 - 两把签名钥匙各管一件事:线上 APK 用 debug keystore(历史原因),增量更新清单用
DSHA-release.keystore,绝不混用。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago Changed · -197 lines · -6,344 tokens per session 40908f1d2a43
- 9d ago First seen · 283 lines · 7,920 tokens per session scan A d9ab2da3f2d4
DSHA AGENTS.md is an instructions file published in the GitHub repository qiannianhuanxiang/DSHA (392 stars, last pushed 5d ago), licensed MIT. It adds 1,576 tokens to every session, about $0.0079 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.