Testing & Gates
The system's correctness is guarded by automated gates and real-model verification together. All "real model" verification runs in an isolated data directory (IFG_DATA_DIR=/tmp/...), never touching the day-to-day profile.
The 14 gates
pnpm verify chains 14 gates; CI uses exactly it:
| Gate | Covers |
|---|---|
fs:health | File-system health (hollow files, NUL-padded tails, readable git objects) |
privacy | Emails / phone numbers / absolute paths in tracked files + custom denylist |
lint | ESLint (server / src / scripts), 0 error 0 warning |
typecheck | Frontend + backend strict types |
a11y | Static scan of icon buttons and form-control labels |
docs:check | Every /api/v1/* mentioned in docs must really exist |
docs:claims | README's claimed page / agent / tool counts = actual source |
docs:review | Doc statements consistent with code; gate count matches the real chain |
check:mermaid | All Mermaid diagrams parse |
i18n:strict | Zero missing Chinese literals and JSX text |
test:coverage | Backend tests + coverage thresholds (lines 75 / branches 60 / functions 65), 272 tests |
test:web | Frontend unit tests (vitest + jsdom): SSE parsing / auth failure, hash routing, report view |
eval | 30 trajectory invariants (leakage / citations / graph integrity) |
build | Frontend build |
Browser checks
pnpm smoke (temporary Host + real browser, 5 checks): health & version, PIN unlock, unauthenticated rejected, create session & generate question, built UI error-free in a real browser.
pnpm e2e (scripts/e2e.mjs, run in CI, 10 checks): first-run setup creates an admin, 13 pages opened one by one (any page error / 4xx / blank page fails), enter the interview room, settings persist after refresh, theme switch, Skill list from the real loaded directory, MCP add/remove, TTS toggle persists, export really downloads a >1 KB backup, report page shows a score after answering.
This set ensures UI and server stay consistent: every button has a real endpoint, every setting is read back, and there is no hardcoded demo copy.
Real-model verification (excerpt)
| Verification | Result |
|---|---|
| 9-question mixed interview, full flow | 9/9 scored, 0 unavailable; total = mean of per-question; cost $0.104 |
| Anti-padding | 20k chars of pure filler 0 points; empty talk 3; same-length real content 34; repeating the same correct paragraph → 21 with the repetition noted |
| Over-long answers | 5k / 20k / 60k chars all stored verbatim, no truncation |
| Timeout behavior | A stub provider that "accepts but never responds" → returns 504 answer_timeout at the deadline, session state unpolluted |
| Multiple tabs, one session | After A answers, B syncs without refresh (SSE); simultaneous submits give one 200 and one 409 question_moved |
| Extreme input | 50k chars, emoji, RTL, zero-width, SQL-injection strings, <script>/<img onerror> all stored verbatim; the UI executes no scripts |
| Old-database upgrade | With columns / tables missing, startup repairs automatically: columns re-added, tables rebuilt, sessions and scores preserved |
Verification environment
Verification runs on local macOS over localhost; performance figures are local baselines (see Operations & Data). The real provider is validated against DeepSeek; other compatible protocols are verified for protocol adaptation through a mock adapter.
Running verification
pnpm verify # all 14 gates
pnpm smoke # temporary Host + real browser, 5 checks
pnpm e2e # browser, 10 checks
# Real model (isolated data, ~$0.1 per 9-question session)
IFG_DATA_DIR=/tmp/ifg-check pnpm server
# Performance baseline (compare before/after)
pnpm build && pnpm server && pnpm perf