Test suites for validating HITL Protocol compliance. Available in Node.js (Vitest) and Python (pytest).
| Category | What It Tests | Node.js | Python |
|---|---|---|---|
| Schema | HITL example suite validates against JSON Schema | schema.test.js |
test_schema.py |
| Discovery | .well-known/hitl.json validates against discovery schema |
schema.test.js |
test_schema.py |
| State Machine | All 6 states, valid/invalid transitions, terminal states | state-machine.test.js |
test_state_machine.py |
cd tests/node
npm install
npm testcd tests/python
pip install -r requirements.txt
pytest -v- Validates all example HITL objects against
hitl-object.schema.json - Validates all poll responses against
poll-response.schema.json - Validates inline submit request bodies against
submit-request.schema.json - Validates
.well-known/hitl.jsonresponses againstdiscovery-response.schema.json - Covers v0.8 verification payloads (
verification_policy,verification_evidence,submission_context,verification_result) - Tests for rejection of invalid payloads (missing fields, wrong types, invalid enums)
- Tests custom review types with
x-prefix - Tests minimal valid objects
- Validates all 10 valid transitions
- Rejects all 15+ invalid transitions
- Verifies terminal states have no outgoing transitions
- Tests 4 happy path flows (simple, multi-step, expired, cancelled)
- Verifies exactly 6 states exist
Use these tests as a reference. To validate your own HITL implementation:
- Schema tests — Validate your HITL objects and poll responses against the schemas in
schemas/ - State machine tests — Verify your status transitions match the spec
- HTTP tests — Test your endpoints return correct status codes (202, 304, 409, 429)
- Security tests — Verify token generation, hashing, and timing-safe comparison