test(opencode-v2): cover 10 untested full-read and sweep coverage cases (#55)

Merged
IC
5m ago
+240-0

Which issue gave this a go?

#55, the go of 2026-12-06 00:38Z for the 7 tests. The go of 2026-12-06 10:51Z added the 3 more tests to the same pull request.

Closes #55

What changed

This PR adds 10 tests in crates/astrocyte-module/src/opencode_v2_source_tests.rs. That file is included only in the tests module of opencode_v2_source.rs. It changes only test code: 240 added lines and no removed lines.

What proves it

  • Test: the 7 tests that #55 names, from v2_one_page_sweep_finishes_when_payload_spends_its_budget to v2_rowid_window_two_rows_stops_before_the_third_timestamp. Also the 3 tests in the #55 comment of 10:51Z, from v2_sweep_does_not_reach_high_water_after_user_top_is_deleted to v2_unfinished_first_sweep_has_no_previous_coverage.
  • Failed without the fix: this PR has no production change. For each of the 10 mutants in #55, I applied that one code change and ran its test. Each test stopped on an equality assertion. The same test is satisfactory on the unchanged code (10 of 10 pairs). No test can be satisfactory without its case: each test compares the accurate count, cutoff, coverage value or rowid position.
  • At this branch on Linux, these commands are satisfactory: scripts/fmt-check.sh, cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --all-targets --locked (0 unsatisfactory, and 1,116 satisfactory with 20 ignored in astrocyte-module).

AI helped write this draft.


Summary by cubic

Adds 10 tests for untested full-read and sweep coverage cases in the OpenCode 2 source, closing #55.

The tests were derived from mutation testing: each passes on the current code and fails with its corresponding mutant. Coverage includes sweep budget boundaries, rowid window advancement, deleted high-water rows, open-call coverage, and unfinished sweep state.

  • Test-only change to crates/astrocyte-module/src/opencode_v2_source_tests.rs (240 added lines, no production code changed).