接入虚拟HAL宏加载非主程序证据
This commit is contained in:
@@ -321,6 +321,48 @@ export const VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES = Object.freeze([
|
||||
}),
|
||||
]);
|
||||
|
||||
export const VIRTUAL_HAL_SIM_CONFIG_MACRO_LOAD_FIXTURES = Object.freeze([
|
||||
Object.freeze({
|
||||
id: "rose-engine-rcone-macro-load",
|
||||
label: "Rose engine rcone macro/load",
|
||||
fixturePath: "linuxcnc/configs/sim/axis/rose_engine/rcone.ngc",
|
||||
sourceFiles: Object.freeze([
|
||||
"linuxcnc/configs/sim/axis/rose_engine/rose_engine.ini",
|
||||
"linuxcnc/configs/sim/axis/rose_engine/rcone.ngc",
|
||||
"linuxcnc/configs/sim/axis/rose_engine/rcone_demo.ngc",
|
||||
]),
|
||||
owningIniPath: "linuxcnc/configs/sim/axis/rose_engine/rose_engine.ini",
|
||||
pairedMainProgram: "linuxcnc/configs/sim/axis/rose_engine/rcone_demo.ngc",
|
||||
declarationSource: "NGCGUI_SUBFILE",
|
||||
currentNodeInventoryStatus: "PASS",
|
||||
dependencyClass: "macro-load-non-main",
|
||||
targetBrowserEvidence: "non-main-fixture-diagnostics",
|
||||
blockedKind: "-",
|
||||
nonMainFixture: true,
|
||||
declaredOnly: false,
|
||||
evidence: "LinuxCNC rose_engine.ini declares rcone.ngc through NGCGUI_SUBFILE; the fixture is validated as a non-main macro/load asset paired with rcone_demo.ngc.",
|
||||
}),
|
||||
Object.freeze({
|
||||
id: "external-offsets-queuebuster-macro-load",
|
||||
label: "External offsets queuebuster macro/load declaration",
|
||||
fixturePath: "linuxcnc/configs/sim/axis/external_offsets/queuebuster.ngc",
|
||||
sourceFiles: Object.freeze([
|
||||
"linuxcnc/configs/sim/axis/external_offsets/eoffsets.ini",
|
||||
"linuxcnc/configs/sim/axis/external_offsets/eoffsets.ngc",
|
||||
]),
|
||||
owningIniPath: "linuxcnc/configs/sim/axis/external_offsets/eoffsets.ini",
|
||||
pairedMainProgram: "linuxcnc/configs/sim/axis/external_offsets/eoffsets.ngc",
|
||||
declarationSource: "NGCGUI_SUBFILE",
|
||||
currentNodeInventoryStatus: "NON_MAIN_CLASS",
|
||||
dependencyClass: "macro-load-non-main-declared-only",
|
||||
targetBrowserEvidence: "non-main-fixture-diagnostics",
|
||||
blockedKind: "-",
|
||||
nonMainFixture: true,
|
||||
declaredOnly: true,
|
||||
evidence: "LinuxCNC eoffsets.ini declares queuebuster.ngc through NGCGUI_SUBFILE; the fixture records the owning INI declaration without executing it as a standalone browser main program.",
|
||||
}),
|
||||
]);
|
||||
|
||||
export const VIRTUAL_HAL_COVERAGE_STATES = Object.freeze({
|
||||
simulated: "simulated",
|
||||
bridgeOnly: "bridge-only",
|
||||
@@ -2808,6 +2850,96 @@ export function createVirtualHalSimConfigPromotionCandidateReport(options = {})
|
||||
};
|
||||
}
|
||||
|
||||
export function createVirtualHalSimConfigMacroLoadFixtureReport(options = {}) {
|
||||
const fixtures = options.fixtures ?? VIRTUAL_HAL_SIM_CONFIG_MACRO_LOAD_FIXTURES;
|
||||
const manifestProvided = typeof options.manifestText === "string" || Array.isArray(options.manifestEntries);
|
||||
const manifestSet = new Set([
|
||||
...sourceManifestSetFromText(options.manifestText ?? ""),
|
||||
...(options.manifestEntries ?? []).map(normalizeLinuxCncSourcePath),
|
||||
]);
|
||||
const blockedKinds = new Set(options.blockedKinds ?? [
|
||||
"L4-PYTHON-REMAP",
|
||||
"L4-TOOL-DB",
|
||||
"L4-USER-M-PROCESS",
|
||||
"UPSTREAM-DEMO",
|
||||
]);
|
||||
const allowedStatuses = new Set(options.allowedStatuses ?? ["PASS", "NON_MAIN_CLASS"]);
|
||||
const rows = fixtures.map((fixture) => {
|
||||
const sourceFiles = [...(fixture.sourceFiles ?? [])];
|
||||
const normalizedSourceFiles = sourceFiles.map(normalizeLinuxCncSourcePath);
|
||||
const missingManifestFiles = manifestProvided
|
||||
? sourceFiles.filter((file, index) => !manifestSet.has(normalizedSourceFiles[index]))
|
||||
: [];
|
||||
const blockedKindExcluded = !blockedKinds.has(fixture.blockedKind);
|
||||
const statusReady = allowedStatuses.has(fixture.currentNodeInventoryStatus);
|
||||
const nonMainFixtureReady = fixture.nonMainFixture === true &&
|
||||
fixture.targetBrowserEvidence === "non-main-fixture-diagnostics";
|
||||
const complete = sourceFiles.length > 0 &&
|
||||
missingManifestFiles.length === 0 &&
|
||||
blockedKindExcluded &&
|
||||
statusReady &&
|
||||
nonMainFixtureReady;
|
||||
return {
|
||||
id: fixture.id,
|
||||
label: fixture.label,
|
||||
source: "linuxcnc-configs-sim-source-derived-virtual-hal-macro-load-fixture",
|
||||
fixturePath: fixture.fixturePath,
|
||||
sourceFiles,
|
||||
owningIniPath: fixture.owningIniPath,
|
||||
pairedMainProgram: fixture.pairedMainProgram,
|
||||
declarationSource: fixture.declarationSource,
|
||||
currentNodeInventoryStatus: fixture.currentNodeInventoryStatus,
|
||||
dependencyClass: fixture.dependencyClass,
|
||||
targetBrowserEvidence: fixture.targetBrowserEvidence,
|
||||
blockedKind: fixture.blockedKind,
|
||||
blockedKindExcluded,
|
||||
nonMainFixture: fixture.nonMainFixture === true,
|
||||
declaredOnly: fixture.declaredOnly === true,
|
||||
statusReady,
|
||||
manifestChecked: manifestProvided,
|
||||
missingManifestFiles,
|
||||
evidence: fixture.evidence,
|
||||
complete,
|
||||
};
|
||||
});
|
||||
const missingFixtures = rows.filter((row) => !row.complete).map((row) => row.id);
|
||||
const blockedFixtureIds = rows.filter((row) => !row.blockedKindExcluded).map((row) => row.id);
|
||||
const standaloneMainViolations = rows
|
||||
.filter((row) => row.nonMainFixture !== true || row.targetBrowserEvidence !== "non-main-fixture-diagnostics")
|
||||
.map((row) => row.id);
|
||||
const missingManifestFiles = [...new Set(rows.flatMap((row) => row.missingManifestFiles))];
|
||||
const complete = rows.length > 0 &&
|
||||
missingFixtures.length === 0 &&
|
||||
blockedFixtureIds.length === 0 &&
|
||||
standaloneMainViolations.length === 0 &&
|
||||
missingManifestFiles.length === 0;
|
||||
return {
|
||||
apiName: "linuxcnc-wasm-virtual-hal-sim-config-macro-load-fixture-report",
|
||||
reportVersion: 1,
|
||||
source: "linuxcnc-configs-sim-source-derived-virtual-hal",
|
||||
phase: complete ? "ready" : "blocked",
|
||||
complete,
|
||||
webSimulationSatisfied: complete,
|
||||
inventoryBaselineUnchanged: true,
|
||||
manifestChecked: manifestProvided,
|
||||
fixtureCount: rows.length,
|
||||
sourceFiles: [...new Set(rows.flatMap((row) => row.sourceFiles))],
|
||||
fixturePaths: rows.map((row) => row.fixturePath),
|
||||
missingFixtures,
|
||||
blockedFixtureIds,
|
||||
standaloneMainViolations,
|
||||
missingManifestFiles,
|
||||
rows,
|
||||
summaryRows: [
|
||||
{ id: "fixtures", label: "Macro/load fixtures", value: `${rows.length}` },
|
||||
{ id: "non-main", label: "Non-main fixture gate", value: standaloneMainViolations.length === 0 ? "passed" : `violations ${standaloneMainViolations.length}` },
|
||||
{ id: "blocked-family", label: "Blocked-family exclusion", value: blockedFixtureIds.length === 0 ? "passed" : `blocked ${blockedFixtureIds.length}` },
|
||||
{ id: "manifest", label: "Manifest check", value: manifestProvided ? (missingManifestFiles.length === 0 ? "passed" : "failed") : "not provided" },
|
||||
{ id: "inventory-baseline", label: "Inventory baseline", value: "unchanged" },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createVirtualHalSourceComplianceReport(options = {}) {
|
||||
const halState = options.halState ?? createVirtualHalState();
|
||||
const snapshot = options.snapshot ?? createVirtualHalWasmBridgeSnapshot(halState);
|
||||
@@ -3024,6 +3156,9 @@ export function createLinuxCncVirtualHalRuntime(initialState = createVirtualHalS
|
||||
getSimConfigPromotionCandidateReport(options = {}) {
|
||||
return createVirtualHalSimConfigPromotionCandidateReport(options);
|
||||
},
|
||||
getSimConfigMacroLoadFixtureReport(options = {}) {
|
||||
return createVirtualHalSimConfigMacroLoadFixtureReport(options);
|
||||
},
|
||||
getCommandScriptFixtureReport(options = {}) {
|
||||
return createVirtualHalCommandScriptFixtureReport({ ...options, halState: state });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user