fix(ci): unbreak main's clippy, and let the tmux audit test the exemption - #117
Merged
Merged
Conversation
…tion (AEAB-23) TWO things, and the first is urgent: main is RED and it is my fault. 1. clippy (deny warnings) fails on main as of f0be7a4 (my #107 merge). `should_warn_undelivered(&[o.clone()])` trips `cloned_ref_to_slice_refs`. One line: `std::slice::from_ref(&o)`. Why it got through: I verified with `cargo clippy -p amux-server --lib`. CI runs `cargo clippy --workspace --all-targets -- -D warnings`. The lint is in a TEST, which `--lib` does not compile. I checked a narrower surface than the gate does and read the green as if it meant the same thing. Verified here with CI's exact command, not a convenient shorthand — exit 0. 2. AEAB-23: the tmux audit's planted-offender test re-implemented the scanner. `offenders()` and `the_audit_detects_a_planted_non_exact_target` held two copies of the same ~30-line loop, so the test could not observe a change to the real scanner. Extracted `scan(src) -> Vec<(usize, String)>`, used by both. The exemption logic and its comment are 8db4326's, moved verbatim — this is a test-only refactor with no behaviour change. THE CARD OVERSTATED THE PROBLEM AND I AM CORRECTING IT: I wrote that "NOTHING tests" the exemption. Not quite. `every_tmux_target_uses_the_exact_match_helpers` covers the narrow direction INCIDENTALLY — remove the exemption and it fails, because email.rs really does contain a `touch -t`. That coverage is accidental (it evaporates the moment that unrelated file changes) but it is not nothing. The real hole is the other direction, and it is the one that matters. Measured, not argued — widen the exemption so it swallows tmux too (`if matches!(name, Some(_n))`): against main's tests 2 passed, 0 failed <- guard fully disabled, CI green against these tests 1 failed <- caught An exemption a shade too broad silences the guard while leaving main green, which is indistinguishable from the guard working. That is the expensive direction and main could not see it. So `the_non_tmux_exemption_silences_touch_but_never_tmux` asserts all three: `touch -t` exempt; a literal `Command::new("tmux")` still flagged; and a helper-invoked tmux target (api/metrics.rs's real `cmd_output("tmux", ...)` shape, where there is no literal program to attribute) still audited. That last is the fail-safe case a broader exemption loses first. CI's exact commands, all three: cargo check --workspace --all-targets clean, clippy --workspace --all-targets -D warnings exit 0, test --workspace 39 result lines 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4vuEScunv4K6RMwQoT9xx Amux-Session: amux-errors-and-bugs
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.
Two things, and the first is urgent: main is red and it's my fault.
1.
clippy (deny warnings)fails on main as off0be7a46(my #107 merge)One line:
&[o.clone()]→std::slice::from_ref(&o).Why it got through: I verified with
cargo clippy -p amux-server --lib. CI runscargo clippy --workspace --all-targets -- -D warnings. The lint is in a test, which--libnever compiles. I checked a narrower surface than the gate does and read the green as if it meant the same thing.Verified here with CI's exact command rather than a convenient shorthand.
2. AEAB-23 — the planted-offender test re-implemented the scanner
offenders()andthe_audit_detects_a_planted_non_exact_targetheld two copies of the same ~30-line loop, so the test could not observe a change to the real scanner.Extracted
scan(src) -> Vec<(usize, String)>, used by both. The exemption logic and its comment are 8db4326's, moved verbatim — a test-only refactor with no behaviour change.The card overstated this, and I'm correcting it
I wrote that "NOTHING tests" the exemption. Not quite.
every_tmux_target_uses_the_exact_match_helperscovers the narrow direction incidentally — remove the exemption and it fails, becauseemail.rsreally does contain atouch -t. That coverage is accidental (it evaporates the moment that unrelated file changes) but it isn't nothing.The real hole is the other direction, and it's the one that matters. Measured, not argued — widen the exemption so it swallows tmux too (
if matches!(name, Some(_n))):2 passed, 0 failed— guard fully disabled, CI green1 failed— caughtAn exemption a shade too broad silences the guard while leaving main green, which is indistinguishable from the guard working. That's the expensive direction, and main could not see it.
So
the_non_tmux_exemption_silences_touch_but_never_tmuxasserts all three:touch -tis exempt — the false positive that failed CICommand::new("tmux")is still flagged — or the fix deleted the guardapi/metrics.rs's realcmd_output("tmux", …)shape, where there's no literal program to attribute. This is the fail-safe case a broader exemption loses first.Verification — CI's exact commands, all three
🤖 Generated with Claude Code
https://claude.ai/code/session_01B4vuEScunv4K6RMwQoT9xx