fix(rectification): stop re-asking covered domains after adopt (BUG-590, BUG-591)
Independent Staging Quality Gate / validate (push) Successful in 11m33s
Independent Staging Quality Gate / publish (push) Successful in 7m49s

Yearless-to-collect now skips domains already confirmed, declined, or asked; adopt-exhausted turns skip leftover collect persist. Collect focus collisions only retry with :next when collect_retry is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-08 12:27:40 +08:00
co-authored by Cursor
parent 43fd8875ce
commit 7ca6ade244
11 changed files with 613 additions and 36 deletions
@@ -784,8 +784,10 @@ test("collect persist maps occupation to other and health_pressure to health", a
assert.equal(healthWrite?.args.p_target_domain, "health");
});
test("collect focus unique conflict retries with a :next question id", async () => {
const followup = collectFollowup();
test("collect focus unique conflict is duplicate_focus unless collect_retry", async () => {
// 原值: 任何撞 id 都 :next
// 新值: 仅 collect_retry 才 :next;否则 duplicate_focus、RPC 一次
// 原因: BUG-591 决策 3;撞 id 本身就是这题问过了
let writes = 0;
const accounting = fakeAccounting({
set_agentic_rectification_conversation_focus: (_fn, args) => {
@@ -800,7 +802,29 @@ test("collect focus unique conflict retries with a :next question id", async ()
caseId: CASE_ID,
activeFocus: null,
decisionReceipt: null,
followup,
followup: collectFollowup(),
});
assert.equal(persisted.status, "duplicate_focus");
assert.equal(writes, 1);
assert.equal(persisted.questionId, "collect:relationship:collect_method_evidence");
});
test("collect_retry unique conflict still retries with a :next question id", async () => {
let writes = 0;
const accounting = fakeAccounting({
set_agentic_rectification_conversation_focus: (_fn, args) => {
writes += 1;
if (writes === 1) throw new Error("agentic_rectification_focus_idempotency_conflict");
return focusRowFromArgs(args);
},
});
const persisted = await persistServerOwnedFocus({
accounting: accounting.client,
userId: USER_ID,
caseId: CASE_ID,
activeFocus: null,
decisionReceipt: null,
followup: collectFollowup({ collect_retry: true }),
});
assert.equal(persisted.status, "created");
assert.equal(writes, 2);