fix(rectification): centralize delivery authority
Independent Staging Quality Gate / validate (push) Successful in 13m0s
Independent Staging Quality Gate / publish (push) Successful in 10m58s

This commit is contained in:
Jesse_Chen
2026-09-01 01:13:04 +08:00
parent 9aebd0474a
commit 9f011194f2
23 changed files with 764 additions and 170 deletions
@@ -1,6 +1,8 @@
import assert from "node:assert/strict";
import test from "node:test";
import { OPEN_ENGINE_CAPABILITY_CEILING } from "./rectification-v9-test-support.ts";
import { applyChoiceWithoutEvidence } from "../src/lib/rectification-agentic/v9/inference-adapter.ts";
import { applyHoldoutAnswer, buildInferenceState } from "../src/lib/rectification-agentic/core/build-state.ts";
import { unionStillValidRange } from "../src/lib/rectification-agentic/core/credible-range.ts";
@@ -155,6 +157,7 @@ test("hidden case walks collection through holdout to a range or representative
score: item.posterior_score,
}));
const afterAnswers = decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
candidateScores: scores,
holdoutValidation: "not_started",
@@ -166,6 +169,7 @@ test("hidden case walks collection through holdout to a range or representative
assert.equal(holdoutPassed.holdout_passed, true);
assert.deepEqual(posteriorMap(holdoutPassed.candidates), posteriorMap(answered.state.candidates));
const closed = decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
candidateScores: holdoutPassed.candidates.map((item) => ({
time: item.time,
@@ -223,6 +227,7 @@ test("holdout failure returns to candidate discrimination", () => {
}],
});
const next = decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
candidateScores: failed.candidates.map((item) => ({ time: item.time, score: item.posterior_score })),
discriminatorProbe: selectDiscriminatorProbe(retryPacket),
@@ -277,6 +282,7 @@ test("mutated years and domains do not keep asking exam-quality copy", () => {
test("user stop is an unvalidated range, not a holdout pass", () => {
const stopped = decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
userStopped: true,
candidateScores: [
@@ -293,6 +299,7 @@ test("user stop is an unvalidated range, not a holdout pass", () => {
test("tied candidates without a high-information probe offer a range instead of inventing left/right", () => {
const next = decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
trainingGateOpen: true,
candidateScores: [
@@ -378,6 +385,7 @@ test("case A: two then three events keep collecting; four training events may di
})),
});
return decideRectification({
engineCeiling: OPEN_ENGINE_CAPABILITY_CEILING,
methodCoverageAll: true,
trainingGateOpen: state.events.filter((item) => item.usage === "training").length >= 3
&& new Set(state.events.filter((item) => item.usage === "training").map((item) => item.domain)).size >= 2,