test(analyses): scan the whole file for the bot-filter collapse - #274
Merged
Conversation
F305 taught this guard that SQL is case-insensitive and whitespace- tolerant, then normalised each line on its own. A call wrapped across lines is never assembled, so its argument is never seen — confirmed by planting `BOOL_OR(` with `a.is_bot` on the next line, which the guard passed. Not a hypothetical layout. `analyses/ownership.rs` already writes `SUM(` with its argument and closing paren on their own lines, in the very directory this scans. A `BOOL_OR(` whose argument grew that long would be written the same way by the same convention. The file is normalised once and matches map back to a file line by counting newlines in the prefix — the technique `spa_escaping_test` already uses to report a file line from a statement offset. The first implementation of that mapping had the same defect one level down: it indexed its offset table per character while `match_indices` returns byte offsets, so the table drifted on any file containing a multi-byte char, and these contain them in their prose. It detected the right thing and named the wrong line. Fixed by sizing the table in bytes. Caught only because the regression test read the reported location rather than the pass/fail — a guard that names the wrong line is one people stop trusting. Also records that the Trusted Publishing deferral's stated reason was wrong. Only `cargo publish`'s verification step builds, and `--no-verify` switches it off — reproduced here on cargo 1.97.1 with a control. The architecture is compatible; the real blockers are that trusted publishing must be configured per-crate on crates.io, outside this repository, and that switching before it exists breaks the next release. Sequencing, not incompatibility.
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.
Validating the cycle-13 audit confirmed its new finding, and fixing it reproduced the same defect one level down.
F307 — the matcher read one line at a time
F305 taught this guard that SQL is case-insensitive and whitespace-tolerant, then normalised each line independently. A call wrapped across lines is never assembled, so its argument is never seen.
Confirmed by planting
BOOL_OR(witha.is_boton the next line inside a SQL string literal — the guard passed.Not a hypothetical layout.
analyses/ownership.rsalready writesSUM(with its argument and closing paren on their own lines, in the very directory this scans. ABOOL_OR(whose argument grew that long would be written the same way by the same convention.Fix: normalise the file once, map matches back to a file line by counting newlines in the prefix — the technique
spa_escaping_testalready uses.The bug inside the fix, recorded because it is the same class
My first mapping indexed its offset table per character while
match_indicesreturns byte offsets. On any file containing a multi-byte char — and these contain them in their prose — the table drifts. The guard detected the right thing and named the wrong line:Caught only because the regression test read the reported location, not just pass/fail. A guard that names the wrong line is one people stop trusting.
Verification
Also: the Trusted Publishing deferral's reason was wrong
I deferred it claiming
cargo publishexecutesbuild.rsand so cannot holdid-tokenunder SLSA L3. Only the verification step builds, and--no-verifyswitches it off. Reproduced independently on cargo 1.97.1 (the audit used 1.95.0), with a control:build.rsexecutedcargo package --no-verifycargo packageThe architecture is compatible. The deferral stands on sequencing instead: Trusted Publishing must be configured per-crate on crates.io — outside this repository — and switching the workflow before that exists breaks the next release. Recorded so the next cycle doesn't re-derive a resolved argument.
clippyandfmtverified by exit status.