rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:hluica/dsh-parent-instructions
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
最后实质性修改于Harness版本:0.2.2-rc.3
让子工作区(尤其是自身带 .git 的嵌套工作区)在保留自身指导文本的同时,额外获得父工作区链中的 AGENTS.md 家族指导。
内置的 @deepseek-ai/dsh-agent-instructions 在会话工作目录下向上找最近的 .git,从该根加载到 cwd 为止。子工作区一旦自己是一个 Git 仓库,项目根就停在子工作区,父级的 AGENTS.md 不会被加载。本插件是补充式的:不修改内置插件,只在运行时上下文中追加“内置项目根之上”的父级目录,并允许在设置中定义父工作区根的标记。
.dsh-parent-root。.git)中新建会话。会话会在内置基线之外,额外收到从父根到子工作区之上这一段的 AGENTS.md 家族文件。示例:
proj/ .dsh-parent-root
AGENTS.md ← 父级规则,会补充给子工作区
local-plugins/
dsh-foo/ .git
AGENTS.md ← 内置插件自己的项目链,仍由内置插件加载
在 dsh-foo 中工作时:
dsh-foo/AGENTS.md;proj/AGENTS.md 与 local-plugins/AGENTS.md(若存在);| 值 | 行为 |
|---|---|
.dsh-parent-root(默认) |
在父目录链中找最近的同名文件或目录 |
| 其他合法名 | 改用该名字;名字按文件系统规则匹配(通常区分大小写),不能含 /、\、控制字符,不能是 . 或 ..,最多 128 字符 |
| 空值 | 关闭补充(保留内置行为) |
| 恢复默认 | 清除 profile 覆盖,回到 schema 默认值 |
修改后对下一次请求生效,不需要重启 Host。标记本身必须放在内置项目根之上;放在子工作区内部不会生效,因为那一段已由内置插件负责。
cwd → 最近的 .git 祖先 = builtinRoot (与内置默认规则一致)
→ 从 dirname(builtinRoot) 向上找最近的 parentRootMarker
→ 读 parentRoot 到 dirname(builtinRoot) 每一层的
AGENTS.md / CLAUDE.md / AGENTS.local.md / CLAUDE.local.md
→ 去重、限 32 KiB、渲染为一段 runtime context
ctx.systemPrompt.context():它被运行时物化为持久 user 角色快照,和 working directory、时间、技能目录等一起被包在 <system-reminder> 中;不进入 system prompt。agent-instructions 消息,也不改动内置插件的收件箱;因此不会与内置插件的 source-kind 过滤互相移除。Parent workspace instructions (from .dsh-parent-root at /path/to/proj; broader than the current workspace, so closer instructions take precedence):
From: /path/to/proj/AGENTS.md
...父级内容...
外层由运行时上下文统一包裹 <system-reminder>;插件本身不添加框架。
| 文件 | 作用 |
|---|---|
index.js |
Host 半:Config、发现、去重、预算、缓存、systemPrompt.context |
client.js |
Client 半:设置 → 通用的一行、configForms 读写、校验与状态 |
cordis.patch.yml |
bundle 挂载声明(行 id dsh-parent-instructions) |
locale/zh.json、locale/en.json |
插件页显示名与描述 |
icon.svg |
插件页面图标 |
test/lifecycle.test.mjs |
Client 生命周期与校验测试 |
scripts/host-contract.mjs |
Host 契约探针(发现/去重/预算/注册参数) |
scripts/、node_modules/、.cache/、deps.lock.json |
构建系统与依赖物化产物 |
Host 半 import z from '@deepseek-ai/schemastery',而 profile 不提供这个包,所以插件自带一份真实文件(不是符号连接)。node_modules/ 是产物,由 npm run build 从 deps.lock.json 生成。
| 命令 | 作用 |
|---|---|
npm run build |
物化依赖,然后自动跑 verify |
npm run verify |
布局/依赖/清单/解析 + Client 测试 + Host 契约探针 |
npm run rebuild |
即 build --force |
npm run clean |
删除 node_modules/ 与 .cache/ |
npm test |
只跑 Client 生命周期测试 |
构建系统来自工作区参考副本 build-system/。scripts/build.mjs、scripts/verify.mjs、scripts/lib/* 与参考副本逐字节一致;scripts/host-contract.mjs 是本插件自己的文件,不随同步覆盖。修改构建系统时应改参考副本并运行 node build-system/sync.mjs,不要直接改这里。
Host 契约探针会在临时目录里构造“父根标记 + 中间层 + 带 .git 的子工作区”,断言:
required: true、interpolate: false,且不拥有 <system-reminder> 框架。通过插件管理器安装本目录(link: 就地安装,不复制):
plugin_manager: action=install_bundle, target=<local-plugins/dsh-parent-instructions 绝对路径>
安装后:
dsh-parent-instructions 为运行中。Settings → General 应出现「父工作区标记」行;若页面未刷新,刷新一次 Web 页面。.dsh-parent-root,在带 .git 的子工作区新建会话;新会话的 runtime context 应包含 Parent workspace instructions。npm run verify 应全部通过。npm run verify,确认 Client 测试与槽位参数通过。.git,标记要放在该 .git 目录的父级或更高;AGENTS.md / CLAUDE.md / AGENTS.local.md / CLAUDE.local.md;minimal,内置插件本身不加载项目链;本插件仍只补充父级,不会补子工作区自身。设置表单可能被更高层(profile patch / home patch / 命令行 overlay)覆盖;表单会显示「保存失败:设置可能被更高层覆盖」,此时需要检查 ~/.dsh/profiles/<profile>/cordis.patch.yml 中 dsh-parent-instructions 的配置。
本插件按随发行版 preset 的默认 .git 计算内置项目根。如果你通过覆盖 preset 改了内置的 projectRootMarkers,补充链可能重叠或漏读;README 会随该契约变化更新。
AGENTS.md 仍由内置插件加载;minimal preset 没有内置项目链,本插件不会补。parentRootMarker 是 profile 级设置,不是每个 Workspace 一份。read/write touch。peerDependencies 声明 @deepseek-ai/dsh: ^0.2.2-rc.3。DSH 的版本闸门使用 semver.satisfies(runtime, range, { includePrerelease: true });不满足时会跳过该 bundle。未来大版本变化时按插件页提示处理版本豁免。
MIT License,详见 LICENSE。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness、deepseek-harness-plugin。