priorauth.indocs

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

SuiteAsserts
agent.test.mjsTool gating categories, the release gate, autonomy masking.
tenancy.test.mjsThe config cascade, sealed floors, the four use cases, abstention.
connector.test.mjsThe EHR port, Veradigm contract, write-back semantics, scheduler, RLS, verification, channels.
eligibility.test.mjsThe eligibility rail, three-valued answers, network buckets, payer precedence.
agent-control.test.mjsPause, quarantine, fleet switch, eval licence and expiry.
console-routes.test.mjsReads 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

SuiteResult
Unit and integration477 tests, 96 suites, all passing
Eval corpus71 cases, 3 replicates, weighted error 0
TypecheckClean