feat(lab): publish E39 refinement result

This commit is contained in:
DCCONSTRUCTIONS
2026-07-28 10:06:57 +03:00
parent 6e5124bd9c
commit 1f20e0d7d9
9 changed files with 770 additions and 9 deletions
@@ -432,6 +432,100 @@ function e38() {
};
}
function e39DevelopmentDimension({
accuracy,
correct,
incorrect,
}) {
return {
correct,
incorrect,
total: 340,
accuracy,
target: 0.9,
passed: true,
};
}
function e39() {
return {
result_id: `e39-perception-refinement-${"9".repeat(64)}`,
created_at_utc: "2026-07-28T06:29:42.847Z",
source_session_id: "20260720T065719Z_viewer_live",
source_display_name: "RAVNOVES00",
status: "measured-r1-source-scoped-refinement",
profile_id: "e39-ravnoves00-r1-development-knn/v1",
worker_node: "DESKTOP-OPJ8J04",
quality_gate_passed: false,
development_cross_validation: {
strategy: "deterministic-item-hash-five-fold",
seed: "e39-dev-cv",
folds: 5,
items: 340,
validation_labels_used: false,
passed: true,
dimensions: {
presence: e39DevelopmentDimension({
accuracy: 0.902941,
correct: 307,
incorrect: 33,
}),
geometry_association: e39DevelopmentDimension({
accuracy: 0.905882,
correct: 308,
incorrect: 32,
}),
freshness: e39DevelopmentDimension({
accuracy: 0.964706,
correct: 328,
incorrect: 12,
}),
},
},
metrics: {
development_items: 340,
validation_items: 146,
terminal_outcomes: 146,
accounting_fraction: 1,
false_free_claims: 0,
high_severity_failures: 8,
dimensions: {
presence: e38Dimension({
accuracy: 0.849315,
correct: 124,
incorrect: 22,
passed: false,
}),
geometry_association: e38Dimension({
accuracy: 0.849315,
correct: 124,
incorrect: 22,
passed: false,
}),
freshness: e38Dimension({
accuracy: 0.931507,
correct: 136,
incorrect: 10,
passed: true,
}),
},
},
blocking_checks: [
"presence_target_reached",
"geometry_association_target_reached",
"high_severity_failures_zero",
],
method: {
summary: "robust-scaled 3-neighbour presence classification",
selection: "development-only deterministic five-fold cross-validation",
dimension_projection: "derived from predicted presence and immutable stratum",
},
limitations: ["source-scoped"],
authority,
access: "read-only",
};
}
before(async () => {
server = await createServer({
appType: "custom",
@@ -448,9 +542,9 @@ after(async () => {
await server?.close();
});
test("decodes E31–E38 from separate read-only catalogs", async () => {
test("decodes E31–E39 from separate read-only catalogs", async () => {
const requests = [];
const items = [e31(), e32(), e33(), e34(), e35(), e37(), e38()];
const items = [e31(), e32(), e33(), e34(), e35(), e37(), e38(), e39()];
const decoded = await fetchAdvancedLaboratoryResults({
fetcher: async (input, init) => {
requests.push({ input: String(input), method: init?.method });
@@ -476,6 +570,14 @@ test("decodes E31–E38 from separate read-only catalogs", async () => {
assert.equal(decoded.e38.metrics.dimensions.presence.accuracy, 0.821918);
assert.equal(decoded.e38.metrics.dimensions.freshness.passed, true);
assert.equal(decoded.e38.qualityGatePassed, false);
assert.equal(
decoded.e39.developmentCrossValidation.dimensions.presence.accuracy,
0.902941,
);
assert.equal(decoded.e39.developmentCrossValidation.validationLabelsUsed, false);
assert.equal(decoded.e39.metrics.dimensions.presence.accuracy, 0.849315);
assert.equal(decoded.e39.metrics.highSeverityFailures, 8);
assert.equal(decoded.e39.qualityGatePassed, false);
assert.deepEqual(requests, [
{ input: "/api/v1/laboratory/e31/results?limit=1", method: "GET" },
{ input: "/api/v1/laboratory/e32/results?limit=1", method: "GET" },
@@ -484,6 +586,7 @@ test("decodes E31–E38 from separate read-only catalogs", async () => {
{ input: "/api/v1/laboratory/e35/results?limit=1", method: "GET" },
{ input: "/api/v1/laboratory/e37/results?limit=1", method: "GET" },
{ input: "/api/v1/laboratory/e38/results?limit=1", method: "GET" },
{ input: "/api/v1/laboratory/e39/results?limit=1", method: "GET" },
]);
});
@@ -500,7 +603,8 @@ test("rejects authority escalation in an accepted-looking result", async () => {
: String(input).includes("/e33/") ? e33()
: String(input).includes("/e34/") ? e34()
: String(input).includes("/e35/") ? e35()
: String(input).includes("/e37/") ? e37() : e38(),
: String(input).includes("/e37/") ? e37()
: String(input).includes("/e38/") ? e38() : e39(),
)), { status: 200 }),
}),
AdvancedLaboratoryContractError,
@@ -34,6 +34,10 @@ const e38ResultUrl = new URL(
"../src/workspaces/laboratory/E38Result.tsx",
import.meta.url,
);
const e39ResultUrl = new URL(
"../src/workspaces/laboratory/E39Result.tsx",
import.meta.url,
);
const e35StylesUrl = new URL(
"../src/styles/e35-degradation-recovery.css",
import.meta.url,
@@ -239,6 +243,24 @@ test("E38 reports the frozen R1 baseline through the canonical LAB anatomy", asy
assert.match(advancedSource, /<E38Result/);
});
test("E39 reports refinement and the CV-to-validation gap through the canonical LAB anatomy", async () => {
const [e39Source, advancedSource] = await Promise.all([
readFile(e39ResultUrl, "utf8"),
readFile(advancedLaboratoryResultUrl, "utf8"),
]);
assert.match(e39Source, /<LaboratoryWorkTemplate/);
assert.match(e39Source, /<LaboratoryEvidence/);
assert.match(e39Source, /<LaboratoryResultSummary/);
assert.match(e39Source, /validation labels при выборе не использовались/);
assert.match(e39Source, /Разрыв CV → validation/);
assert.match(e39Source, /не принимать R1/);
assert.match(e39Source, /не подбирая параметры по sealed validation/);
assert.doesNotMatch(e39Source, /className="laboratory-(?:summary|result-summary)"/);
assert.match(advancedSource, /id: "e39-perception-refinement"/);
assert.match(advancedSource, /<E39Result/);
});
test("the primary point-cloud viewer restores from fullscreen on Escape", async () => {
const workspacesSource = await readFile(workspacesUrl, "utf8");