Repository navigation
Make existing Engine tests fail when the code they run is broken - #1
Open
Laserwolve wants to merge 1 commit into
Open
Laserwolve wants to merge 1 commit into
Laserwolve wants to merge 1 commit into
Conversation
Mutation testing makes one small change to the production code at a time and reports each change that every test still passes. Outside `runvil-vfs`, 89 such changes sit on a line that an existing test runs: the test passes with the code it runs broken. Checks and input cases added to 45 existing tests now make 63 of the 89 fail a test. No test is added, and no production code changes. - `runvil-lua`: 24 of 42, in 19 tests. - `runvil-runtime`: 20 of 23, in 12 tests. - `runvil-prompt`: 13 of 14, in 8 tests. - `runvil-types`: 4 of 7, in 4 tests. - `runvil-plugin` and `runvil-model-client`: 1 each, in one test each. - Of the 26 left, 20 alter no behavior, so no test can tell them apart, and 6 are reached only by tests about something else. The plan names each one. - The Engine has 2,638 tests before and after. - The plan is `vibe/2026-11-12-1-strengthen-engine-tests.md`. `cargo dylint` did not run here, because it is not installed on this machine. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Laserwolve
force-pushed
the
strengthen-engine-tests
branch
from
November 12, 2026 19:55
65b387f to
4a9117a
Compare
[Low impact] The PR appears safe to merge; no actionable issues were found.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces cppalliance/runvil#212, which was opened against the repository the Engine has since left. The test changes are the same, line for line.
Existing tests only. No test is added, and no production code changes.
Why
A test that runs a line does not always fail when the line is wrong. Mutation testing finds those cases: it makes one small change to the production code at a time (a swapped operator, a deleted
matcharm, a function body replaced by a default value) and reports each change that every test still passes. Per-test coverage then names the tests that run the changed line and pass anyway.Outside
runvil-vfs, 89 such changes sit on a line that an existing Engine test runs. For each one, this strengthens the test whose subject is that code: it adds a check on a value the test already produces, or an input case the test did not try.runvil-luarunvil-runtimerunvil-promptrunvil-typesrunvil-pluginrunvil-model-clientWhat changed
45 existing tests gain checks or input cases, in 37 files. The workspace has 3,577 tests before and after, 2,638 of them the Engine's. Three examples:
a_duplicate_role_key_is_rejectedchecked only that an error came back. It now checks that the error names the role, so replacingContractKey::shownwith an empty string fails it.one_exact_fence_is_the_prologue_and_two_can_surround_empty_prosetried twoluafences with a blank line between them. It now also tries them with none, whichopening < posas<=insplit_section_blocksturns into an internal error.the_records_span_the_complete_runtime_lifecyclenow calls every store operation, so a deleted arm invfs_observationsfails it.Hunks worth a closer look
Most hunks are one or two assertions. These change more of a test's setup:
an_end_to_end_run_threads_one_vfs_ref_through_every_sectionnow builds its own watched store, to read the origin line thatfirst_chunk_linegives the walk.a_prelude_write_across_two_arms_ends_the_run_with_determinism_caught_or_notis wrapped in a loop over two parent bodies, which re-indents its existing assertions unchanged.status_reports_a_parked_task_and_then_a_finished_onegains two fixture sections, so that a task at depth 2 exists.a_canceled_tasks_partial_write_is_readable_after_the_joingains a second trace.a_message_to_one_task_does_not_withdraw_another_chains_requestnow ends withdone, to read the unread messages.The 26 left
Vec::new()asvec![],|as^on two values with no bit in common, and the library flags of a temporary VM that only parses a chunk.The plan,
vibe/2026-11-12-1-strengthen-engine-tests.md, names all 26 with the reason for each.Checks run
cargo nextest run --locked --workspace --all-features: 3,577 passed.cargo clippy --locked --workspace --all-targets --all-featureswithCARGO_BUILD_WARNINGS=deny.cargo fmt --all --check,cargo test -p build-xtask, andnode --test tools/docs-claims.mjs.#[test]added or removed, and no line touched outside test code.cargo dylint,cargo deny, the doc builds, the facade surface check, and the Windows tests. CI covers them.Where the numbers come from
The Engine was measured in
cppalliance/runvilwithcargo-mutants27.1.0, atfa9936f64and again at2d40bafa2. This repository atcc51d454holds the same Engine crates, byte for byte, as that second commit.Not in this change
runvil-vfs.runvil-markdown, which is newer than the measurement.🤖 Generated with Claude Code
Summary by CodeRabbit