mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 11:10:22 +08:00
release: 1.1.84,尾部锚点与子代理审批接管,红队模式中文化,#194/#188
- 接线 lib/anchor.js:锚点物理追加到 system prompt sections 末尾, identity.js 支持 anchorText(对象/字符串两种入参),已有同名段先滤再追加; 锚点改为跟随操作者语言,删除写死的英文开头句(红队回答变英文的根因) - 接线 lib/subagent-control.js:子会话 approval/policy=never 改回 ask, 并在 approval/request 瀑布放行;anchorMode/subagentControl 提供回滚开关 - index.js:真实 anchorApplied / injectTail 判定、审批策略探针、iso 分支 注册锚点、applyHostHooks 注册锚点与子代理接管并统一释放 - office 技能自愈:core/desktop 增加 healOfficeSkillsRuntimeOnDisk,桌面端触发 - 红队模式中文化:preset 文案、角色名、五阶段、25 项计分规则与 POC 分类、 技能修复说明、环境适配提示、面板报错、成果报告与复现报告 - #194:hung-operator 改按内容变更缓存,加风暴/慢调用熔断;WeakMap 去重 同次 assemble 的重复改写;新增 #91 记录宿主信号退出的持久化日志 - #188(rc.4 专属部分):新增 #89 沙箱策略去品牌、#90 skill-badge 中文描述, 扩展 #32/#53 的 rc.3 变体与 marker,均 optional - 新增锚点接线与红队文案测试,81/81 通过
This commit is contained in:
1 parent
ec4c8b889f
commit
5d0ebdae81
19 files changed
+1521
-847
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { ownServerNote } from "./net-scope.js";
|
||||
import { CAPABILITY_SECTION, capabilityProtocolText } from "./capability-protocol.js";
|
||||
import { ANCHOR_SECTION } from "./anchor.js";
|
||||
export const GLOBAL_PROMPT_ORDER = -100000;
|
||||
export const OBJECTIVE_SECTION = "dshpg-objective";
|
||||
export const REDTEAM_ROLE_SECTION = "dshpg-redteam-role";
|
||||
@@ -737,6 +738,7 @@ function normalizeRewriteOptions(fallbackInject, options) {
|
||||
roleText: typeof fallbackInject.roleText === "string" ? fallbackInject.roleText : "",
|
||||
cardText: typeof fallbackInject.cardText === "string" ? fallbackInject.cardText : "",
|
||||
dropWorkspaceBaseline: fallbackInject.dropWorkspaceBaseline === true,
|
||||
anchorText: typeof fallbackInject.anchorText === "string" ? fallbackInject.anchorText : "",
|
||||
};
|
||||
}
|
||||
return {
|
||||
@@ -748,6 +750,7 @@ function normalizeRewriteOptions(fallbackInject, options) {
|
||||
roleText: typeof options?.roleText === "string" ? options.roleText : "",
|
||||
cardText: typeof options?.cardText === "string" ? options.cardText : "",
|
||||
dropWorkspaceBaseline: options?.dropWorkspaceBaseline === true,
|
||||
anchorText: typeof options?.anchorText === "string" ? options.anchorText : "",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1006,6 +1009,18 @@ export function rewritePromptAssembly(assembled, fallbackInject = "", options =
|
||||
}
|
||||
}
|
||||
outSections = sanitizeCwdTokens(outSections, assembled);
|
||||
// [dsh-purge] 尾部锚点。
|
||||
// waterfall 返回的 sections 数组顺序就是渲染顺序,order 字段不参与排序,
|
||||
// 所以只能物理追加到数组末尾,不能靠 order 值。
|
||||
// 先 filter 再加:registerAnchor 也注册了同名 section,不滤掉就是两份。
|
||||
const anchorText = String(opts.anchorText || "").trim();
|
||||
if (anchorText) {
|
||||
outSections = outSections.filter((section) => String(section?.name || "") !== ANCHOR_SECTION);
|
||||
outSections = [
|
||||
...outSections,
|
||||
{ name: ANCHOR_SECTION, text: anchorText, order: 100000, interpolate: false },
|
||||
];
|
||||
}
|
||||
return {
|
||||
...assembled,
|
||||
sections: outSections,
|
||||
|
||||
Reference in new issue
Block a user