fix(rectification): share datedPrecision for quarter and range events
Training already counted quarter/range as dated, while the inference ledger mapped them to unknown and left the events unused. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -196,6 +196,24 @@ test("a corrupted receipt range outside the window still fail-closes", () => {
|
||||
assert.equal(projection.credibleRange, null);
|
||||
});
|
||||
|
||||
test("quarter-precision evidence stays dated in the inference ledger", () => {
|
||||
const state = buildCaseInferenceState({
|
||||
range: { start_time: "05:00", end_time: "05:10" },
|
||||
candidates: [
|
||||
{ candidateId: "05:00", time: "05:00", relativeSupport: 50 },
|
||||
{ candidateId: "05:10", time: "05:10", relativeSupport: 50 },
|
||||
],
|
||||
evidence: [
|
||||
{ id: "q-career", domain: "career", occurredFrom: "2018-04-01", datePrecision: "quarter" },
|
||||
{ id: "y-edu", domain: "education", occurredFrom: "2016-01-01", datePrecision: "year" },
|
||||
],
|
||||
probes: [],
|
||||
});
|
||||
const quarter = state.events.find((item) => item.id === "q-career");
|
||||
assert.equal(quarter?.precision, "year");
|
||||
assert.notEqual(quarter?.usage, "unused");
|
||||
});
|
||||
|
||||
test("buildCaseInferenceState receipt is the producer of the projected range", () => {
|
||||
const state = buildCaseInferenceState({
|
||||
range: { start_time: "04:55", end_time: "05:02" },
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
isEvidenceDomain,
|
||||
isEvidenceKind,
|
||||
isEvidenceStatus,
|
||||
datedPrecision,
|
||||
normalizeQuote,
|
||||
quoteIsGroundedInMessage,
|
||||
} from "../src/lib/rectification-agentic/v9/evidence-model.ts";
|
||||
@@ -130,6 +131,10 @@ test("evidence model exposes the full kind/domain/precision/status sets", () =>
|
||||
assert.equal(isDatePrecision(precision), true);
|
||||
}
|
||||
assert.equal(isDatePrecision("exact_minute"), false);
|
||||
assert.equal(datedPrecision("quarter"), "year");
|
||||
assert.equal(datedPrecision("range"), "year");
|
||||
assert.equal(datedPrecision("day"), "day");
|
||||
assert.equal(datedPrecision("unknown"), "unknown");
|
||||
for (const status of ["draft", "pending_confirmation", "confirmed", "superseded", "rejected"]) {
|
||||
assert.equal(isEvidenceStatus(status), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user