import assert from "node:assert/strict"; import test from "node:test"; import { segmentReplayOracleAnswer } from "../scripts/rectification-segment-oracle.ts"; import type { ConflictProbe } from "../src/lib/rectification-agentic/core/types.ts"; // Fictional inheritance/style controls, never engine calibration goldens. const probe: ConflictProbe = { id: "offline-probe", semantic_key: "career.2018.dasha_activation", candidate_split_hash: "offline-split", domain: "career", year: 2018, question: "2018 年换工作了吗?", candidate_ids: ["09:00", "09:04", "09:08"], source: "dasha_activation", information_gain: 0.3, expected_outcomes: [ { answer_class: "yes", supports: ["09:00", "09:04"], conflicts: ["09:08"] }, { answer_class: "weak_yes", supports: ["09:00", "09:04"], conflicts: ["09:08"] }, { answer_class: "no", supports: ["09:08"], conflicts: ["09:00", "09:04"] }] }; test("offline oracle inherits truth inside a same-side multi-member interval", () => { assert.equal(segmentReplayOracleAnswer(probe, "09:02"), "yes"); assert.equal(segmentReplayOracleAnswer(probe, "09:08"), "no"); assert.equal(segmentReplayOracleAnswer(probe, "09:06"), "unsure"); assert.equal(segmentReplayOracleAnswer(probe, "08:59"), "unsure"); }); test("offline oracle keeps varga style answer classes and transition-based inheritance", () => { const style: ConflictProbe = { ...probe, semantic_key: "varga.d9.synthetic", choice_kind: "varga_style", source: "varga_contrast", style_options: [{ sign: "金牛座", label: "虚构类型甲", answer_class: "yes" }, { sign: "双子座", label: "虚构类型乙", answer_class: "weak_yes" }], expected_outcomes: [{ answer_class: "yes", supports: ["09:00"], conflicts: ["09:08"] }, { answer_class: "weak_yes", supports: ["09:08"], conflicts: ["09:00"] }] }; assert.equal(segmentReplayOracleAnswer(style, "09:08"), "weak_yes"); assert.equal(segmentReplayOracleAnswer(style, "09:06", [ { layer: "d9", at: "09:04", from_sign: "金牛座", to_sign: "双子座" }]), "weak_yes"); assert.equal(style.choice_kind, "varga_style"); assert.equal(style.source, "varga_contrast"); });