1
0

docs: 优化审查提示词,禁止 subagent 读取文件,明确 apply 阶段不动主规范

config.yaml: subagent 限定为计算密集/多步骤任务,文件读取用 Read 工具
prompt-proposal-review.md: 收集阶段加入读取约束和分步策略,复核补全待澄清清单
prompt-apply-review.md: 禁止同步主规范,新增 Spec 覆盖完整性扫描与补充流程
This commit is contained in:
2026-05-20 17:08:12 +08:00
parent 60a54b483f
commit f3df3a203b
10 changed files with 161 additions and 71 deletions

View File

@@ -421,29 +421,35 @@ describe("API 路由", () => {
});
test("损坏的 failure JSON 返回 null 而不崩溃", async () => {
const targets = store.getTargets();
const t1Id = targets[0]!.id;
const originalWarn = console.warn;
console.warn = () => undefined;
try {
const targets = store.getTargets();
const t1Id = targets[0]!.id;
store.insertCheckResult({
durationMs: 100,
failure: { kind: "error", message: "test", path: "$", phase: "body" },
matched: false,
observation: null,
targetId: t1Id,
timestamp: "2025-06-01T00:00:00.000Z",
});
store.insertCheckResult({
durationMs: 100,
failure: { kind: "error", message: "test", path: "$", phase: "body" },
matched: false,
observation: null,
targetId: t1Id,
timestamp: "2025-06-01T00:00:00.000Z",
});
(store as unknown as { db: { prepare: (sql: string) => { run: (...args: unknown[]) => void } } }).db
.prepare("UPDATE check_results SET failure = ? WHERE target_id = ? AND timestamp = ?")
.run("{invalid json!!!", t1Id, "2025-06-01T00:00:00.000Z");
(store as unknown as { db: { prepare: (sql: string) => { run: (...args: unknown[]) => void } } }).db
.prepare("UPDATE check_results SET failure = ? WHERE target_id = ? AND timestamp = ?")
.run("{invalid json!!!", t1Id, "2025-06-01T00:00:00.000Z");
const from = "2025-06-01T00:00:00.000Z";
const to = "2025-06-01T23:59:59.999Z";
const response = await fetch(`${baseUrl}/api/targets/${t1Id}/history?from=${from}&to=${to}`);
const body = (await response.json()) as HistoryResponse;
const from = "2025-06-01T00:00:00.000Z";
const to = "2025-06-01T23:59:59.999Z";
const response = await fetch(`${baseUrl}/api/targets/${t1Id}/history?from=${from}&to=${to}`);
const body = (await response.json()) as HistoryResponse;
expect(response.status).toBe(200);
expect(body.items).toHaveLength(1);
expect(body.items[0]!.failure).toBeNull();
expect(response.status).toBe(200);
expect(body.items).toHaveLength(1);
expect(body.items[0]!.failure).toBeNull();
} finally {
console.warn = originalWarn;
}
});
});