Merge pull request #182 from pikasTech/fix/m3-trusted-loop-execution-path-64-clean

test: harden M3 patch-panel preflight
This commit is contained in:
Lyon
2026-05-23 07:13:07 +08:00
committed by GitHub
5 changed files with 260 additions and 45 deletions
+18
View File
@@ -1722,6 +1722,9 @@ async function validateDevM3Report(report, label) {
if (Object.hasOwn(report.safetyGates, "dryRunCallsLiveEndpoints")) {
assert.equal(report.safetyGates.dryRunCallsLiveEndpoints, false, `${label}.safetyGates.dryRunCallsLiveEndpoints`);
}
if (Object.hasOwn(report.safetyGates, "defaultSourceReadOnly")) {
assert.equal(report.safetyGates.defaultSourceReadOnly, true, `${label}.safetyGates.defaultSourceReadOnly`);
}
assertArray(report.liveChecks, `${label}.liveChecks`);
assert.ok(report.liveChecks.length >= 8, `${label}.liveChecks must include DEV M3 checks`);
@@ -1835,6 +1838,21 @@ async function validateDevM3Report(report, label) {
assert.equal(plan.route, "res_boxsimu_1:DO1 -> hwlab-patch-panel -> res_boxsimu_2:DI1", `${label}.dryRunPlan.route`);
assert.equal(plan.dryRunCallsLiveEndpoints, false, `${label}.dryRunPlan.dryRunCallsLiveEndpoints`);
assert.equal(plan.liveWriteWillRun, false, `${label}.dryRunPlan.liveWriteWillRun`);
if (Object.hasOwn(plan, "failureClassifications")) {
assertStringArray(plan.failureClassifications, `${label}.dryRunPlan.failureClassifications`, { minLength: 5 });
for (const classification of [
"target_missing",
"identity_not_distinct",
"patch_panel_wiring_missing",
"operation_failed",
"evidence_missing"
]) {
assert.ok(
plan.failureClassifications.includes(classification),
`${label}.dryRunPlan.failureClassifications missing ${classification}`
);
}
}
assertStringArray(plan.liveWritePreconditions, `${label}.dryRunPlan.liveWritePreconditions`, { minLength: 4 });
assertStringArray(plan.evidenceFields, `${label}.dryRunPlan.evidenceFields`, { minLength: 4 });
assertArray(plan.endpointPlan, `${label}.dryRunPlan.endpointPlan`);