Skip to content

test(opencode-v2): cover 22 untested fast-read cases (#52) - #53

Merged
ualtinok merged 1 commit into
cortexkit:masterfrom
iceteaSA:test/opencode-v2-tail-gaps
Dec 4, 2026
Merged

ualtinok merged 1 commit into
cortexkit:masterfrom
iceteaSA:test/opencode-v2-tail-gaps

Conversation

@iceteaSA

@iceteaSA iceteaSA commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Which issue gave this a go?

#52, the go of 2026-12-04 17:57Z.

Closes #52

What changed

This PR adds 14 tests in crates/astrocyte-module/src/opencode_v2_source.rs, in the tests module. It changes only test code: one hunk of 461 added lines and no removed lines.

What proves it

  • Test: the 14 tests that OpenCode 2 fast read: 22 code changes that no test finds (tests ready) #52 names, from v2_idle_fast_polls_keep_the_rewind_boundary to v2_fast_tail_leaves_both_evicted_calls_for_the_full_sweep.
  • Failed without the fix: this PR has no production change. For each of the 22 mutants in OpenCode 2 fast read: 22 code changes that no test finds (tests ready) #52, 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 (22 of 22 pairs). No test can be satisfactory without its case: each test compares the accurate record count, key, rowid position or coverage value.
  • 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,079 satisfactory with 20 ignored in astrocyte-module).

AI helped write this draft.


Summary by cubic

Adds 14 tests covering the 22 mutation-testing gaps in the OpenCode 2 fast-read path, with no production code changes.

The tests target edge cases around rewind boundaries, pending coverage, and evicted calls in crates/astrocyte-module/src/opencode_v2_source.rs. Each test passes against current code and fails against its corresponding mutant from cargo-mutants run of 193 mutants.

Written for commit 35a4cbe. Summary will update on new commits.

View guided diff

Mutation testing of the OpenCode 2 fast-read path (cargo-mutants, 193 mutants) found 22 changes that no test detected. Each new or extended test passes on the current code and fails with its mutant.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/astrocyte-module/src/opencode_v2_source.rs">

<violation number="1" location="crates/astrocyte-module/src/opencode_v2_source.rs:4661">
P3: This replay test does not verify which message was returned. Assert the message ID is `boundary`, otherwise an incorrect replay row can still satisfy the length-only check.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

.unwrap()
.unwrap();

assert_eq!(page.messages.len(), 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This replay test does not verify which message was returned. Assert the message ID is boundary, otherwise an incorrect replay row can still satisfy the length-only check.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At crates/astrocyte-module/src/opencode_v2_source.rs, line 4661:

<comment>This replay test does not verify which message was returned. Assert the message ID is `boundary`, otherwise an incorrect replay row can still satisfy the length-only check.</comment>

<file context>
@@ -4503,6 +4503,467 @@ pub(crate) mod tests {
+            .unwrap()
+            .unwrap();
+
+        assert_eq!(page.messages.len(), 1);
+    }
+
</file context>
Suggested change
assert_eq!(page.messages.len(), 1);
assert_eq!(page.messages.len(), 1);
assert_eq!(page.messages[0].id, "boundary");

@ualtinok
ualtinok merged commit 35a4cbe into cortexkit:master Dec 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCode 2 fast read: 22 code changes that no test finds (tests ready)

2 participants