DSHA: Instructions file for Codex

AGENTS.md

DSHA AGENTS.md is an instructions file for Codex, OpenCode from qiannianhuanxiang/DSHA. It costs 1,576 tokens per session, scanned A, original, MIT.

A repository instruction file for an Android launcher that runs the DeepSeek Harness web interface on standard, non-rooted arm64 Android phones. It tells coding agents what to read, how the app is built, and which technical limits and startup rules to preserve.

In plain words
What is it for?
Use it when building, debugging, or changing the DSHA Android app, especially its Java UI, Gradle setup, bundled Ubuntu environment, or install and start flow.
Why use it?
It gives an agent the project context and fixed constraints before it changes code, reducing the risk of breaking the app’s startup process or supported devices.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is qiannianhuanxiang/DSHA's own configuration. It tells Codex and OpenCode how to work on DSHA itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything DSHA configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/qiannianhuanxiang/DSHA/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/qiannianhuanxiang/DSHA

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for DSHA AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/qiannianhuanxiang/dsha/agents-md/github.svg)](https://agentmods.dev/instructions/qiannianhuanxiang/dsha/agents-md)
Your own site
<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.

agentmods 80×15 button for DSHA AGENTS.md

Your own site · 80×15
<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>
Per session 1,576 This file is loaded in full into every session.
When invoked 1,576 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash 40908f1d2a43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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.

AGENTS.md · 86 lines

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/dsh0.1.2-alpha.3)的 Web UI(:3080)。原生层是纯 Java 17、 Material3、单 Gradle 模块 :app

技术约束(围绕这些设计)

  • Java 17,无 Kotlin,单模块 :app
  • applicationId com.dsh.client;Java 包 com.deepseekharness.appminSdk 26compileSdk/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 == falseWelcomeActivity → 点开始 → 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-*(否则老版本当全量恢复会清掉配置与插件); dshPathsmergeSubdirs 一一对应。
  • WebProcSel:认得出 dsh 进程、绝不误杀 proot/proroot(杀到容器启动器 = 环境连 App 一起带走)。

已知 trap(搬自原版,骨架已按此设计)

  • 停止靠 pid 文件,不靠端口反查/proc/net/tcp 非 root 读不到(静默空),/proc 有 hidepid。 启动时 echo $$ > /root/.dsha-web.pidexec node(exec 不换 pid)。
  • 停止先写哨兵 /root/.dsha-stopped:看门狗/重启脚本见到就退出,否则「秒复活」。
  • app 私有目录禁 link(2)(SELinux),proot 必须带 --link2symlink
  • 两把签名钥匙各管一件事:线上 APK 用 debug keystore(历史原因),增量更新清单用 DSHA-release.keystore,绝不混用。

Read the full file on GitHub · 86 lines

Changes

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.

  1. 5d ago Changed · -197 lines · -6,344 tokens per session 40908f1d2a43
  2. 9d ago First seen · 283 lines · 7,920 tokens per session scan A d9ab2da3f2d4

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens

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.

deepseek-ai/deepseek-harness · 3,735 tokens