Files
cs249r_book/interviews/vault-cli/tests/test_audit_batching.py
Vijay Janapa Reddi 03031dc38e test(vault-cli): smoke tests for audit_corpus_batched batching
7 tests covering pack_batches:
  - empty input → no batches
  - single small item → one batch
  - no items lost across batches (50 items, 10/batch → all 50 round-trip)
  - max_items_per_batch caps batch size (33 items, 10/batch → 10/10/10/3)
  - max_chars triggers a flush before items overflow the budget
  - input order preserved within and across batches
  - oversized single item still lands in a batch (we don't drop, the
    caller is expected to detect overflow downstream)

The audit script itself can't easily be unit-tested in CI (it
subprocess-shells the gemini CLI); the batching helper is the main
piece of pure logic, so this is where the value is.

  84 / 84 pytest pass (was 77; added 7)

CORPUS_HARDENING_PLAN.md Phase 3.
2026-05-03 08:23:08 -04:00

3.3 KiB