52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { audit } from "./audit-protocol-execution-bindings.mjs";
|
|
|
|
test("classifies registered-only control protocols separately from native evidence", () => {
|
|
const result = audit(
|
|
{
|
|
registry_id: "TEST",
|
|
status: "CURRENT",
|
|
registered_draft_protocols: [
|
|
{
|
|
id: "GLS-0130",
|
|
acronym: "GLC",
|
|
source: "glc.hdlp",
|
|
implementation: "NOT_STARTED"
|
|
},
|
|
{
|
|
id: "GLS-0841",
|
|
acronym: "GHAL",
|
|
source: "ghal.hdlp",
|
|
implementation: "IMPLEMENTED_ON_LAB"
|
|
}
|
|
]
|
|
},
|
|
() => true
|
|
);
|
|
|
|
assert.equal(result.registered_only_count, 1);
|
|
assert.equal(result.registry_implementation_claim_count, 1);
|
|
assert.equal(result.production_control_registered_only_count, 1);
|
|
assert.equal(result.production_control_ready_count, 0);
|
|
assert.equal(result.aggregate_production_control_state, "FAIL_0");
|
|
assert.equal(result.entries[0].lane, "PRODUCTION_COGNITIVE_CONTROL");
|
|
assert.equal(result.entries[1].lane, "BARE_METAL_RESEARCH_AND_RECOVERY");
|
|
});
|
|
|
|
test("rejects duplicate protocol ids", () => {
|
|
assert.throws(
|
|
() =>
|
|
audit(
|
|
{
|
|
registered_draft_protocols: [
|
|
{ id: "GLS-0130", source: "a", implementation: "NOT_STARTED" },
|
|
{ id: "GLS-0130", source: "b", implementation: "NOT_STARTED" }
|
|
]
|
|
},
|
|
() => true
|
|
),
|
|
/duplicate protocol id/
|
|
);
|
|
});
|