Testing
Two independent bodies of evidence: unit and integration suites that assert behaviour, and the eval corpus that measures outcomes.
#Running them
bash
cd harness
node --test test/ # every suite
node --test test/connector.test.mjs # one file
node evals/run.mjs # the corpus, with the gate report
cd web
npx tsc --noEmit # the only type authority
npm run build#What the suites cover
| Suite | Asserts |
|---|---|
agent.test.mjs | Tool gating categories, the release gate, autonomy masking. |
tenancy.test.mjs | The config cascade, sealed floors, the four use cases, abstention. |
connector.test.mjs | The EHR port, Veradigm contract, write-back semantics, scheduler, RLS, verification, channels. |
eligibility.test.mjs | The eligibility rail, three-valued answers, network buckets, payer precedence. |
agent-control.test.mjs | Pause, quarantine, fleet switch, eval licence and expiry. |
console-routes.test.mjs | Reads the route files: every handler calls the guard and returns its denial. |
#Tests name the failure, not the function
A test called it treats Veradigm as TWO APIs, because the payer is not in the EHR tells the next reader why it exists. One called testGetEncounter tells them what it calls, which they could already see.
#Some tests read source rather than run code
console-routes.test.mjs enumerates the route files and fails if a handler does not call the guard. That catches the next route at author time rather than when somebody happens to run a probe - and it strips comments before checking, because a test that reads source has to read code, not prose. The first version failed on a comment explaining why a call had been removed.
#Current state
| Suite | Result |
|---|---|
| Unit and integration | 477 tests, 96 suites, all passing |
| Eval corpus | 71 cases, 3 replicates, weighted error 0 |
| Typecheck | Clean |