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>
22 lines
842 B
TypeScript
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}`]));
|
|
}
|