Skip to content

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:

GateCovers
fs:healthFile-system health (hollow files, NUL-padded tails, readable git objects)
privacyEmails / phone numbers / absolute paths in tracked files + custom denylist
lintESLint (server / src / scripts), 0 error 0 warning
typecheckFrontend + backend strict types
a11yStatic scan of icon buttons and form-control labels
docs:checkEvery /api/v1/* mentioned in docs must really exist
docs:claimsREADME's claimed page / agent / tool counts = actual source
docs:reviewDoc statements consistent with code; gate count matches the real chain
check:mermaidAll Mermaid diagrams parse
i18n:strictZero missing Chinese literals and JSX text
test:coverageBackend tests + coverage thresholds (lines 75 / branches 60 / functions 65), 272 tests
test:webFrontend unit tests (vitest + jsdom): SSE parsing / auth failure, hash routing, report view
eval30 trajectory invariants (leakage / citations / graph integrity)
buildFrontend 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) ​

VerificationResult
9-question mixed interview, full flow9/9 scored, 0 unavailable; total = mean of per-question; cost $0.104
Anti-padding20k 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 answers5k / 20k / 60k chars all stored verbatim, no truncation
Timeout behaviorA stub provider that "accepts but never responds" → returns 504 answer_timeout at the deadline, session state unpolluted
Multiple tabs, one sessionAfter A answers, B syncs without refresh (SSE); simultaneous submits give one 200 and one 409 question_moved
Extreme input50k chars, emoji, RTL, zero-width, SQL-injection strings, <script>/<img onerror> all stored verbatim; the UI executes no scripts
Old-database upgradeWith 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 ​

bash
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

Local-first · inference egresses on demand · fully traceable