fix(rectification): stop unwritten-evidence claims and same-cluster dasha false conflicts (BUG-635–640)
Host only says 记下了 after a real write; Mastra schema rejections fail closed. Ledger year keys no longer drop quality probes, dual-dasha agreement is per cluster, width uses cluster span, and public house tables follow the inference minute. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,7 +10,10 @@ import {
|
||||
type CandidateSnapshotSource,
|
||||
} from "../src/lib/rectification-agentic/core/snapshot-source.ts";
|
||||
import type { ConflictProbe } from "../src/lib/rectification-agentic/core/types.ts";
|
||||
import { askedEventProbeKeysFromLedgerEvidence, inspectDiscriminatorProbes } from "../src/lib/rectification-agentic/core/candidate-contrast-packet.ts";
|
||||
import { contrastPacketFromLatestResult } from "../src/lib/rectification-agentic/v9/decision-from-dossier.ts";
|
||||
import { remainingReverseVerifyProbes } from "../src/lib/rectification-agentic/v9/method-followup.ts";
|
||||
import { QUALITY_STYLE_OPTIONS } from "../src/lib/rectification-agentic/v9/probe-question-contract.ts";
|
||||
import {
|
||||
cachedEngineScoreIsReusable,
|
||||
liveEngineScoringIdentityFromEnv,
|
||||
@@ -163,6 +166,62 @@ test("anchored known_event_quality distinguish probes stay in the public packet"
|
||||
);
|
||||
});
|
||||
|
||||
test("ledger domain.year keys do not same-year-drop known_event_quality", () => {
|
||||
const probe = qualityProbe({ information_gain: 0.8 });
|
||||
const evidence = [{
|
||||
status: "confirmed",
|
||||
domain: "education",
|
||||
occurredFrom: "2016-09-01",
|
||||
occurredTo: null,
|
||||
}];
|
||||
const ledgerKeys = askedEventProbeKeysFromLedgerEvidence(evidence);
|
||||
assert.deepEqual(ledgerKeys, ["education.2016"]);
|
||||
|
||||
const remaining = remainingReverseVerifyProbes(
|
||||
[probe as never],
|
||||
[{
|
||||
id: "00000000-0000-4000-8000-000000000001",
|
||||
status: "confirmed",
|
||||
domain: "education",
|
||||
datePrecision: "month",
|
||||
occurredFrom: "2016-09-01",
|
||||
occurredTo: null,
|
||||
eventKind: "education_start",
|
||||
}],
|
||||
new Set(),
|
||||
new Set(ledgerKeys),
|
||||
"1997-08-08",
|
||||
);
|
||||
assert.equal(remaining[0]?.semantic_key, "education.2016.known_event_quality");
|
||||
|
||||
const inspected = inspectDiscriminatorProbes({
|
||||
candidateSetVersion: "set-a",
|
||||
vargaDifferences: [],
|
||||
probes: [{
|
||||
probeId: "probe:education.2016.known_event_quality",
|
||||
candidateSetVersion: "set-a",
|
||||
question: "2016 年 9 月那次上大学,更接近哪一种实际体验。",
|
||||
expectedOutcomes: [
|
||||
{ outcomeId: "yes", supportsCandidateIds: ["05:00"], conflictsCandidateIds: ["05:07"] },
|
||||
{ outcomeId: "no", supportsCandidateIds: ["05:07"], conflictsCandidateIds: ["05:00"] },
|
||||
],
|
||||
candidateSplitHash: "quality-split",
|
||||
informationGain: 0.8,
|
||||
sourceFeatures: [{ technique: "known_event_quality", calculationResultId: null }],
|
||||
domain: "education",
|
||||
year: 2016,
|
||||
semanticKey: "education.2016.known_event_quality",
|
||||
choiceKind: "event_quality",
|
||||
styleOptions: QUALITY_STYLE_OPTIONS.map((item) => ({
|
||||
label: item.label,
|
||||
answerClass: item.answer_class,
|
||||
})),
|
||||
}],
|
||||
}, { askedKeys: ledgerKeys, topCandidateTimes: ["05:00", "05:07"] });
|
||||
assert.equal(inspected.selected?.semanticKey, "education.2016.known_event_quality");
|
||||
assert.equal(inspected.selected?.choiceKind, "event_quality");
|
||||
});
|
||||
|
||||
test("quality answers are not inferred from event existence alone", () => {
|
||||
const probe: ConflictProbe = {
|
||||
id: "probe-quality",
|
||||
|
||||
Reference in New Issue
Block a user