Test suite: 4 files, unit + real end-to-end
tests/test_parser.py, test_scope_gate.py,
test_classifier.py (mocked, no Ollama needed), and
test_e2e.py — the last one hitting live Ollama on
purpose, no mocking, because that's the only test that proves the
wired pipeline actually works end to end. README.md
updated with the run command and a Windows PATH gotcha
(python -m pytest, not bare pytest).
Discrepancy caught
TO_DO_LIST.md logged the "no git repo" item as
resolved on 27 Aug. It wasn't — git status still
returns not a git repository. Flagged rather than
trusted; see Open gaps below.
Test bug, found and fixed
The out-of-scope e2e fixture used a blank pypdf page with no
/Contents stream at all, which crashes layout-mode
extraction (KeyError: '/Contents') — a real pypdf
edge case, but not the one under test. Fixed with an explicit
empty content stream instead.
Timeout fixed, not just changed
Live-Ollama runs intermittently timed out at 60s — not cold-start
only, failure count varied run to run (1/4, 3/4, 3/4). Bumped
classifier.py's requests.post timeout to
180s, then re-ran the full e2e suite to confirm rather than
assuming: 5/5 passed, ~2m37s, no timeouts.
Failure log built
failure_log.py — log_failure() appends
JSON Lines to failure_log.jsonl, field names matching
2_ARCHITECTURE.md's SQLite failure_log
table so it drops in later without a schema change. No review UI
exists yet to capture human corrections, so
tests/test_e2e.py is the current caller — it already
has a real prediction and a hand-labelled correct answer for
every sample. Unit-tested separately in
test_failure_log.py.
Frontend redesigned
static/index.html restyled around the PRD's own
review vocabulary: confidence as a tiered meter (high / medium /
needs review), matched_signals surfaced as an
explicit "Why" list, "Proposed classification — confirm before
filing" stated up front rather than implied. app.py
now resolves doc types to their full names via
knowledge_base.json instead of the frontend
hardcoding them. Verified live in-browser against a real sample,
not just visually reviewed.
Track decision made
Live app track has explicit priority. harness.py's
fate — kept as an offline validator, or replaced — is deliberately
deferred until the live track's results make that call obvious.