验收口径: --prefix 严格前缀 —— 修正 --only mail- 误匹配 agentmail- 造成的 3 个假失败
第一版验收用 --only mail- 得到「47 可读 / 3 不可读」,但那 3 个根本不是邮件会话: 目录名是普通 UUID,只是父目录 --home-program-agentmail-- 里含子串 mail-。 它们的错因是另一个独立缺陷(subagent/descriptor v2)。 换严格前缀后的真实数字:真 mail-* 会话 43/43 可读,0 不可读。 脚本现在同时提供 --only(子串)与 --prefix(目录名严格前缀)。
This commit is contained in:
@ -27,7 +27,12 @@ const argOf = (flag, dflt) => {
|
||||
return i >= 0 && argv[i + 1] ? argv[i + 1] : dflt;
|
||||
};
|
||||
const ROOT = argOf("--root", "/root/.dsh/sessions");
|
||||
const ONLY = argOf("--only", "mail-");
|
||||
// `--only` 是**子串**匹配(保留原语义,便于按路径片段过滤)。
|
||||
// 但它会把 `--only mail-` 误匹配到 `--home-program-agentmail--/` 下的普通会话
|
||||
// (`agentmail-` 里含 `mail-`),从而把「其他缺陷」报成「邮件会话仍不可读」。
|
||||
// 需要「只统计真 mail-* 会话」时用 `--prefix mail-`(目录名严格前缀)。
|
||||
const ONLY = argOf("--only", "");
|
||||
const PREFIX = argOf("--prefix", "");
|
||||
|
||||
const { Context } = await import(join(NM, "cordis/lib/index.js"));
|
||||
|
||||
@ -52,6 +57,7 @@ const targets = [];
|
||||
for (const p of walk(ROOT)) {
|
||||
if (ONLY && !p.includes(ONLY)) continue;
|
||||
const id = p.split("/").at(-2);
|
||||
if (PREFIX && !id.startsWith(PREFIX)) continue;
|
||||
targets.push({ id, path: p });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user