fix(rectification): stop a stale candidate-set prefix from hiding the choice card
Independent Staging Quality Gate / validate (push) Successful in 11m31s
Independent Staging Quality Gate / publish (push) Successful in 14m41s

Scoring scoped the contrast packet to the previous round's candidate set while
minting probes for the new one, so every later read re-prefixed the stored hash
and the persisted focus schema could never match. Mint one prefix per set and
compare splits by probe identity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
This commit is contained in:
Jesse_Chen
2026-08-29 08:51:19 +00:00
co-authored by Claude Opus 5
parent 0044d4f358
commit 3cecb25f42
6 changed files with 276 additions and 8 deletions
+10 -2
View File
@@ -105,6 +105,7 @@ import {
inspectDiscriminatorProbes,
mentionedVargaKeysFromLedgerEvidence,
} from "@/lib/rectification-agentic/core/candidate-contrast-packet";
import { candidateSetId } from "@/lib/rectification-agentic/core/build-state";
import { offerSessionKinds } from "@/lib/rectification-agentic/core/decide-next-action";
import {
candidateSnapshotSource,
@@ -882,9 +883,16 @@ export function createRectificationV9Tools(ctx: RectificationV9Context) {
});
const refinement = refinementFromDecisionReceipt(receipt);
const windowScan = windowScanFromDecisionReceipt(receipt);
// The packet must be scoped to the candidate set this round produced. Using
// the previous round's set id mints split hashes that no later read can
// match, which silently suppresses the persisted choice card.
const scoredCandidateSetId = candidateSetId(
parsed.case.candidateRange.start_time,
parsed.case.candidateRange.end_time,
score.candidates.map((item) => item.time),
);
const contrastPacket = buildCandidateContrastPacket({
candidateSetVersion: previousInferenceFromReceipt(dossier.latestResult?.decisionReceipt ?? null)?.candidate_set_id
?? score.engineResultId,
candidateSetVersion: scoredCandidateSetId,
calculationResultId: score.engineResultId,
engineProbes: refinement.discriminating_event_probes,
vargaDifferences: [