Skip to content

Mutation patches can apply cleanly and still not compile under -D warnings #756

Description

@leynos

Summary

Three tracked mutation patches in docs/verification/mutations/ still apply
cleanly and still pass the repository's contract test, but the tree they produce
cannot compile. They therefore contribute zero mutation evidence while
appearing healthy.

Mechanism

make kani-full gained RUSTFLAGS="… -D warnings" on 2026-09-18 (commit
2c030fd1, PR #714). Each of these patches seeds its fault by leaving a binding
or helper unused — a warning when written, and a hard compile error under
-D warnings. The mutation no longer runs at all.

This is the same mechanism that silently disabled two of roadmap 4.2.3's five
patches, repaired in PR #755 (commit 3a282018). Those two were in scope for
that plan; the three below are not, and were deliberately left alone.

Evidence (reproduced at adce1949, 2026-09-20)

Each patch was applied to a clean tree, then RUSTFLAGS="-D warnings" cargo check --lib --all-features was run:

Patch Error
ir__from_manifest__verification__empty_rule_shape_is_rejected error: function empty_rule_error is never used; error: function empty_rule_message is never used
ir__from_manifest__verification__multiple_rule_shape_is_rejected error: function sort_strings is never used; error: function string_cmp is never used; error: variable does not need to be mutable
ir__cycle__verification__canonicalize_two_node_cycle_is_canonical error: variable does not need to be mutablesrc/ir/cycle_support.rs:28:9

All three: cargo check exits non-zero with could not compile netsuke-build (lib), while git apply --check exits zero.

Why the contract test misses it

tests/kani_mutation_evidence_tests.rs::every_patch_applies_cleanly only runs
git apply --check over each patch. That proves a patch applies; it does not
prove the patched tree compiles. A patch can be textually valid, apply
cleanly, and still be dead evidence.

Suggested fix

Widen every_patch_applies_cleanly to also compile each patched tree under
-D warnings. Note the cost: this runs a cargo check per patch (~18 patches
today), which is a meaningful increase in test time and interacts with build
caching, so it may deserve its own #[ignore]-gated or CI-only target rather
than the default nextest profile.

The patches themselves also need regeneration so they seed the same production
fault without introducing dead code — e.g. rebinding to _name, or moving the
"unused" helper to a #[cfg(test)]-visible position.

Impact

Three harnesses in roadmap items 4.2.1 and 4.2.2 currently have mutation
evidence that cannot be trusted. The OBL-PATCHES obligation in the
command-interpolation ExecPlan exists to stop mutation evidence rotting
silently; this is that failure mode one level deeper.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmediumRoadmap items to schedule within the current quarter. Clear scope, normal review cycles.testingTest coverage, test infrastructure, and verification tooling work.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions