The gate's widget-descriptor CONSTRUCTION, extracted into pure testable functions. Each builder turns plain params into a ui_request descriptor (spec §4.1 taxonomy): buildSelectRequest, buildMultiselectRequest, buildArtifactGate, buildInfoRequest, buildFreetextRequest, withChildLinkage. No Pi context, no I/O -- the part of the gate fully testable in L1 (in JS, in-language, no Python mirror). Validation in the builders (not just happy-path): select requires title + array options; multiselect allow_empty:false with zero options throws (a broken widget); artifact-gate requires an artifact with a kind + a valid action.kind (confirm/approve_reject/view_only); info level must be info/warning/error. The Altro escape hatch with freetext linkage is always injected on blocking pick widgets (no-limbo invariant). L1: 14 node:test cases -- 3 golden files (select_F1, multiselect_F4, artifact_gate_F5) pin the exact descriptor shape; fuzzy tests assert bad params throw clearly rather than silently producing a broken widget. package.json wires 'npm test' -> node --test (runs alongside pytest). The gate GLUE (emission, anti-bypass, no-limbo loop) is C2, verified at L2.
10 lines
270 B
JSON
10 lines
270 B
JSON
{
|
|
"name": "thothii-harness-gate",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "Pi gate extension for the ThothII NL->SQL harness (widget-descriptor builders + glue)",
|
|
"scripts": {
|
|
"test": "node --test .pi/extensions/gate/__tests__/*.test.js"
|
|
}
|
|
}
|