- lock the three-column height chain on workbench/PartDesign pages so each side panel scrolls independently and the centre stage keeps its size - dock module task panels above the layout with their own scrollbar instead of letting them push the stage out of the viewport - add tools/layout-probe.mjs (page scroll, aside bounds, pane scrolling, stage stability) and CLI mode for tools/static-host.mjs with relative --root support - add the P0-P4 browser functional suite, manual scenarios and capture tooling; document it under docs/current/web-functional-suite Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
62 lines
2.6 KiB
JavaScript
62 lines
2.6 KiB
JavaScript
// Failure classification for the functional suite.
|
|
// Precondition failures become `blocked`; product failures become `failed`.
|
|
// The ledger keeps them separate so a blocked preflight never masks a regression.
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { UiParityPreflightError } from "../ui-parity-preflight.mjs";
|
|
|
|
const PRECONDITION_CLASSES = new Set([
|
|
"preview/port", "entry", "fixture", "viewport", "host/iframe", "command-state", "tool-observation",
|
|
]);
|
|
|
|
export function classifyFailure(error) {
|
|
if (error?.blocked === true) {
|
|
return { status: "blocked", classification: "precondition", failureClass: error.failureClass ?? "fixture", message: String(error.message ?? error) };
|
|
}
|
|
if (error instanceof UiParityPreflightError) {
|
|
const failureClass = error.failureClass;
|
|
if (PRECONDITION_CLASSES.has(failureClass)) {
|
|
return { status: "blocked", classification: "precondition", failureClass, message: error.message };
|
|
}
|
|
return { status: "failed", classification: "product-regression", failureClass, message: error.message };
|
|
}
|
|
// Plain assertion errors come from product steps; cases may mark a known
|
|
// unimplemented capability as a product gap instead of a regression.
|
|
if (error?.productGap === true) {
|
|
return { status: "failed", classification: "product-gap", failureClass: "product-gap", message: String(error.message ?? error) };
|
|
}
|
|
return { status: "failed", classification: "product-regression", failureClass: "product-regression", message: String(error?.message ?? error) };
|
|
}
|
|
|
|
export function blockedPrecondition(failureClass, message) {
|
|
const error = new Error(message);
|
|
error.blocked = true;
|
|
error.failureClass = failureClass;
|
|
return error;
|
|
}
|
|
|
|
export function createGapLedger(file) {
|
|
const entries = [];
|
|
return {
|
|
record(entry) {
|
|
const row = { at: new Date().toISOString(), status: "open", ...entry };
|
|
entries.push(row);
|
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
fs.appendFileSync(file, `${JSON.stringify(row)}\n`);
|
|
return row;
|
|
},
|
|
entries,
|
|
};
|
|
}
|
|
|
|
export function renderGapSections(entries) {
|
|
const blocked = entries.filter(item => item.classification === "precondition");
|
|
const product = entries.filter(item => item.classification !== "precondition");
|
|
const line = item => `- \`${item.caseId}\` ${item.failureClass}: ${item.message.slice(0, 240)}${item.evidence ? ` — ${item.evidence}` : ""}`;
|
|
return {
|
|
blocked: blocked.length ? blocked.map(line).join("\n") : "- none",
|
|
product: product.length ? product.map(line).join("\n") : "- none",
|
|
counts: { blocked: blocked.length, product: product.length },
|
|
};
|
|
}
|