fix(rectification): ingest first-turn events without dropping day precision or claiming a unique minute
Independent Staging Quality Gate / validate (push) Successful in 10m5s
Independent Staging Quality Gate / publish (push) Successful in 7m4s

SQL kinds now match the TypeScript ledger so batch ingest can confirm dated events. Confirm no longer burns the opening focus, recap uses server date labels, and the Agent sees indistinguishable width instead of a fake unique minute.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-19 07:44:23 +08:00
parent 2bf7472645
commit f708edf365
32 changed files with 2046 additions and 100 deletions
@@ -346,15 +346,17 @@ test("rectification Agent output stays natural and keeps tool execution silent",
assert.match(strategy, /(?:无需|不要求)结束、暂停或保存进度/);
});
test("clear current-turn events are proposed and confirmed in the same Agent run", () => {
test("clear current-turn events go through the batch evidence service", () => {
const tools = readFileSync(
new URL("../src/mastra/rectification-v9-tools.ts", import.meta.url),
"utf8",
);
assert.match(agent, /分别调用 rectification-propose-evidence 和 rectification-confirm-evidence,同轮完成记录/);
assert.match(agent, /不得要求用户逐条重新发送或再次回答.*确认/);
assert.match(agent, /当前轮新事件一律走 rectification-record-evidence-batch/);
assert.match(agent, /rectification-confirm-evidence 只用于用户对已有 pending 明确说“对\/是”/);
assert.match(agent, /不得要求用户把已说清的事件再发一遍/);
assert.doesNotMatch(agent, /分别调用 rectification-propose-evidence 和 rectification-confirm-evidence/);
assert.doesNotMatch(agent, /“是\/对”只能确认当前 pending draft/);
assert.match(tools, /当前轮主动、明确且无歧义的一件或多件可拆分事件/);
assert.match(tools, /同一轮有两件及以上可拆分事件时必须改用 rectification-record-evidence-batch/);
assert.doesNotMatch(tools, /只有用户明确确认后才进入评分账本/);
});