Files
Jyotisha/frontend/src/lib/rectification-agentic/core/duplicate-probes.ts
T
Jesse_ChenandCursor 29750d3835
Independent Staging Quality Gate / validate (push) Failing after 9m53s
Independent Staging Quality Gate / publish (push) Has been skipped
fix(web): persist C/D rectification answers without waiting for rescore
Choice C/D without new evidence never changed the candidate posterior until the next dated-event rescore, and persist-v2 would cache-hit on the same evidence fingerprint. Patch the latest decision_receipt.inference_state in place so the next follow-up sees the asked split immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-23 22:41:01 +08:00

22 lines
842 B
TypeScript

import type { ConflictProbe, ProbeAnswer } from "./types.ts";
export function probeIdentity(probe: Pick<ConflictProbe, "semantic_key" | "candidate_split_hash">): string {
return `${probe.semantic_key}|${probe.candidate_split_hash}`;
}
export function isDuplicateProbe(
probe: Pick<ConflictProbe, "semantic_key" | "candidate_split_hash">,
asked: readonly Pick<ProbeAnswer, "semantic_key" | "candidate_split_hash">[],
): boolean {
return asked.some((item) =>
item.semantic_key === probe.semantic_key
|| item.candidate_split_hash === probe.candidate_split_hash,
);
}
export function askedIdentities(
asked: readonly Pick<ProbeAnswer, "semantic_key" | "candidate_split_hash">[],
): ReadonlySet<string> {
return new Set(asked.flatMap((item) => [item.semantic_key, `${item.semantic_key}|${item.candidate_split_hash}`]));
}