# Stage 6:安全、测试和 DeepSeek Pro 审核 Stage 6 是本文件定义的安全验证阶段。它不增加新的业务面板、Runtime 类型或 发布动作,目标是把 Stage 0–5 已交付的 public safe-core、Runtime Adapter 和 DSH Bundle 变成可重复审计、可恢复和可交接的验证闭环。 ## DSH 契约基线 本阶段复核本地安装的 DSH `0.1.0-rc.8`、Cordis `4.0.1`、 `dsh-api-remotes` `0.1.0-rc.8` 和 `dsh-typert-protocol` `0.1.0-rc.8`。 当前 Bundle 使用 `TypertRemoteService`、严格 Host/Remote result schema、 `ctx.remote.$mount()` 和 additive `settings.plugins.tab` Slot。版本变化时, 必须重新读取安装包契约,不能把本阶段的观察当成永久兼容承诺。 ## 安全范围 - public safe-core 扫描源文件、fixture、生成 Bundle 和候选文件;拒绝 symlink、`.env`/本地配置文件、绝对本机路径、凭据形态和过大的本地产物; - 扫描 Git 历史,避免已经删除的凭据或私有路径在公开历史中残留; - Runtime Adapter 的公开 invocation 只返回固定参数和 `shell: false`, executable、cwd、`DSH_HOME` 和继承环境只保留在内部 spawn 路径; - 所有 Host/Client 数据继续经过有界 JSON-safe projection;不传 Context、 Service、Session、函数、凭据、原始日志或正文; - 保留每个可选 Client surface 的错误边界、effect disposer、unload、reload、 disable 和 recovery 验证。 ## 新增验证工具 - `scripts/check-public-history.mjs`:使用 Git 只读检查全部可见历史,不输出 命中内容; - `scripts/smoke-dsh-profile.mjs`:使用直接进程调用执行 `dsh --dump-config`, 只检查隔离 Profile 中是否存在目标 Bundle,不打印完整配置; - `npm run check:security`:串联 working-tree public scan 和 Git history scan。 机器参数只能从调用者提供的环境变量或命令行进入 smoke 工具,例如 `${DSH_BIN}`、`${ISOLATED_DSH_HOME}` 和 `${PROFILE_PATCH}`;这些值不写入 仓库、fixture、Review Pack 或报告。 ## 验收命令 ```sh npm run build:dsh npm run check npm run check:security node /path/to/preflight-dsh-extension.mjs . npm pack --dry-run node scripts/smoke-dsh-profile.mjs \ --dsh "${DSH_BIN}" \ --home "${ISOLATED_DSH_HOME}" \ --profile web \ --patch "${PROFILE_PATCH}" node scripts/smoke-dsh-profile.mjs \ --dsh "${DSH_BIN}" \ --home "${ISOLATED_DSH_HOME}" \ --profile web \ --patch "${PROFILE_PATCH}" # A clean baseline Profile exercises the negative Loader-row assertion. node scripts/smoke-dsh-profile.mjs \ --dsh "${DSH_BIN}" \ --home "${ISOLATED_DSH_HOME}" \ --profile baseline \ --expect absent # After restarting with only the new Loader row disabled: # `--dump-config` retains disabled rows for composition inspection, so the # runtime recovery assertion is made against the still-running Web root. curl -fsS "${DSH_URL}/" | grep -q 'DeepSeek Harness' ! curl -fsS "${DSH_URL}/" | grep -q 'dsh-control-plane' ``` 之后必须在隔离 DSH Web Profile 中完成冷启动、浅色/深色或相关 UI 检查、 浏览器控制台检查、Scenario/Plan 等新增面板显示、unload/reload 和仅禁用 新增 Loader 行的恢复检查。最后用 `.reviews/stage-6/REVIEW-PACK.md` 请求 本地 DeepSeek Pro 审核,并由父 Agent 对照真实 diff、输出和运行时证据复核。 ## 非目标 - 不推送 GitHub、不创建 Release、不生成 Tag、不提交 `awesome-dsh-plugin` PR; - 不接入真实知识库、真实 Session、生产 Profile 或真实 `DSH_HOME`; - 不增加新的 Runtime Adapter、自动同步、上传、任意 Shell 或远程控制能力; - 不把 DeepSeek Pro 审核结论当成测试、发布授权或安全证明的替代品。 ## 状态 本阶段已完成:静态扫描、历史扫描、测试、Bundle 门禁、隔离 Profile、UI/控制台、 卸载/恢复、禁用恢复和脱敏 DeepSeek Pro 结果均已记录并由父 Agent 复核。Stage 7 的 Release Candidate 工作、GitHub 发布和 awesome 收录仍未开始。