diff --git a/docs/tickets/ticket-000039-sqlite-vec-optional-backend.md b/docs/tickets/ticket-000039-sqlite-vec-optional-backend.md index d2ad2dc..54e410b 100644 --- a/docs/tickets/ticket-000039-sqlite-vec-optional-backend.md +++ b/docs/tickets/ticket-000039-sqlite-vec-optional-backend.md @@ -735,6 +735,31 @@ Unit tests: fields fold into `governance_policy_hash`; flipping any one invalidates prior cached records. +CLI surface tests (per +``docs/calculator-test-patterns.md`` §6 — subprocess invocation +catches argparse + main() drift the import-only tests miss; this +hazard surfaced three times during the 2026-05-10 substrate +rename refactor in yesterday's commit chain, so we pin the +pattern): + +- `tests/test_cli_vec_rebuild.py` — subprocess invocation of + ``arborist vec rebuild --db --batch 4`` + against a 12-chunk synthetic shard; assert exit 0, JSON + status output if any, row-count parity in + ``chunk_vecs``. Skipped via ``pytest.importorskip`` when + ``[vec]`` extras absent. +- `tests/test_cli_ingest_embed_flag.py` — subprocess invocation + of ``arborist ingest --source html --embed --author X`` + against a tmp shard; assert ``--embed`` flag wires through + to the embedder; row count after ingest matches; vec rows + match chunk rows 1:1. +- `tests/test_cli_query_retrieval_flag.py` — subprocess + invocation of ``arborist query --retrieval=vec`` and + ``--retrieval=hybrid`` and ``--retrieval=fts5`` against a + pre-embedded shard fixture; assert all three exit 0 and + produce structurally-distinct retrieval candidate sets + (vec ≠ fts5 on at least one query). + Integration tests (gated on `[vec]` extras installed; skipped otherwise): - `tests/test_vec_smoke_integration.py` — runs the §13.2 smoke on @@ -754,14 +779,18 @@ otherwise): - New files: 2 (embed.py, search/vec.py) ~ 200 LOC. - Patches: 4 (store.py, query.py, cli.py, Makefile) ~ 100 LOC. -- Tests: 4 files ~ 250 LOC + fixtures. +- Tests: 7 files ~ 400 LOC + fixtures (4 unit + 3 CLI subprocess + per the §13.5 amendment 2026-05-10 + 1 integration). The CLI + subprocess tests are ~30-40 LOC each — boilerplate + tmp_path + + subprocess.run + JSON parse. - Phase-1 doc append in `docs/`: this §13 + a journey-note bench result file. - pyproject.toml: 1 stanza. -Total: ~550 LOC + ~250 test LOC. Single substantial commit if all +Total: ~550 LOC + ~400 test LOC. Single substantial commit if all tests pass + smoke succeeds; otherwise broken into the natural -gates (smoke → embed.py → vec.py → integration tests → bench). +gates (smoke → embed.py → vec.py → CLI subprocess tests → +integration tests → bench). ### 13.8 Decisions fox needs to make to unblock Phase 1