test(corpus): regression coverage for per-line JSONL loading in the auditor#222
Conversation
Locks the merged behavior of commit 4e6fbbb (per-line JSONL loading via _load_jsonl_documents): one CorpusDocument per non-empty valid line, blank/whitespace lines skipped, malformed JSON lines skipped silently, .json still loaded as a single document, and max_documents enforced across JSONL lines. Tests only; no production changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
/oc review pr |
|
Review: test/corpus-jsonl-coverage ✅ LGTM — ship it. Summary7 well-scoped regression tests that lock the merged Verification
Design choices worth noting (none blocking)
Nitpicks
|
|
@Nitjsefnie test_jsonl_skips_malformed_line_silently could more explicitly assert the error didn't propagate with pytest.raises(SomeException) as a negative check (e.g., with pytest.raises(...): ... for the absence of a raise). The current approach (just verifying docs are returned) is fine and consistent with the rest of the test suite. |
|
🎉 Congratulations @Nitjsefnie! Your pull request has been successfully merged into main. 🚀 Thank you for contributing to OpenAgentHQ and helping improve the project. We truly appreciate your contribution and hope to see you back with more amazing PRs! Happy Open Sourcing! ❤️ |

Closes #57 (assigned — thanks!)
As noted on the issue, the production fix already landed in 4e6fbbb (dup of #127), so this is the missing regression coverage: 7 tests in
tests/unit/test_corpus/test_auditor.pylocking the merged_load_jsonl_documentsbehavior, each verified against a live probe of the code before writing —audit()totals)content= stripped line,doc_id={path}:L{n}, metadata extension/filename/line_numberexcept json.JSONDecodeError: continuepolicy — asserted as a skip, no invented logging).jsonfiles still load as a single document (routing regression guard)max_documentscapped across JSONL lines (locked via the single-file path, which exercises the in-loop break)Gates:
uv run pytest tests/unit— 941 passed, 4 skipped; target file 19 passed (+7). Zero new ruff findings (the one import-ordering error in the file header is pre-existing on main, verified by diffing against pristine).Generated by Claude Fable 5 (brief, review), Claude Opus 4.8 (implementation)