Repository navigation
Drop dead weight, stop one silent mis-score, and correct three stale claims - #74
Merged
Merged
Conversation
…claims
Cleanup pass over the engine, the docs, and the lockfile.
Two dead items removed. `heuristic::evaluate` was a five-argument wrapper
around `evaluate_with_policy` with `Policy::default()` baked in: production
never called it, only its own tests did, so the default-policy path existed
in two places. The tests now call `evaluate_with_policy` directly. In the
PyPI `/simple/` model, `SimpleFile::size` and `SimpleFile::provenance` were
`#[serde(default)]` members nothing read, which is the exact defect
`SimpleMeta`'s own doc comment refuses to carry for `api-version`. Both are
gone, along with the struct's `#[allow(dead_code)]`.
One coercion to a wrong answer is now a refusal. `diff_single_file` ran
`from_utf8(...).unwrap_or("")` on both sides, so a file stamped text whose
bytes do not decode diffed as everything-deleted or everything-added and
scored accordingly. Unreachable through `compute_delta`, since `classify_bytes`
routes non-UTF-8 to `Binary` and the early return covers it, which is what
made it safe to leave: the only state that reaches it is the classification
disagreeing with the bytes, and a coercion cannot answer that state
correctly. Both sides are refused with an error naming the path and side.
Verified by restoring the coercion and watching the new test fail.
Three doc claims corrected, each against the thing they describe:
- CHANGELOG 0.3.1 said "all six managers are reviewed through one grammar".
`--help`, `ARCHITECTURE.md`, and `SHIM_MANAGERS` all say eleven and are
right; the entry says eleven now.
- CHANGELOG 0.3.0 claimed crate-name `-`/`_` canonicalization. Checked against
the live registry: the index stores only the folded file (`se/rd/serde_json`
200, `se/rd/serde-json` 404; `static.crates.io/crates/rocket_db_pools/`
200, the hyphen 403), so a hyphen spelling fails closed at the fetch. The
distinctness is deliberate anyway — a configured index or mirror may serve
both spellings, and answering one with the other's bytes is worse than
refusing — and the ci lane pins that invariant. The claim is removed; drift
entry 4 records the evidence and the stance. A first attempt to fold the
names was reverted after `lockfile_diff_keeps_pypi_alias_off_cargo_pins`
caught it.
- CHANGELOG 0.3.0 said `blueline install` shipped "sandboxed extraction". It
never did; the entry now says what shipped and points at drift entry 1,
which stays High and unfixed because the fix is code.
Dependencies: clap 4.6.7, flate2 1.1.10 (miniz_oxide 0.9.1, zlib-rs 0.6.8),
serde_json 1.0.152, thiserror 2.0.21. All four are caret-compatible bumps
whose declared MSRVs (1.85/1.67/1.71/1.77, miniz_oxide and zlib-rs declare
none) sit under the pinned 1.97.1 toolchain. actionlint 1.7.7 to 1.7.12 in
CI; the new binary lints this repo's workflows clean before the bump.
proptest stays at 1.11.0 on purpose: 1.12 wants rand 0.10, which reshuffles
a dev-only dependency tree for no security-relevant gain.
Gate: ./scripts/verify.sh passes (fmt, clippy, test, references). The test
stage ran with CARGO_PROFILE_{DEV,TEST}_DEBUG=0 because this box was holding
~6.8 of 7.7 GB in other sessions and the debuginfo-heavy link got OOM-killed
twice; the assertions are unchanged, but that run is one environment flag
away from CI's exact command.
Commit made by Step 5 Preview Free in OpenCode on behalf of Kriday.
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.
Cleanup pass over the engine, the docs, and the lockfile.
Dead code
heuristic::evaluatewas a five-argument wrapper aroundevaluate_with_policywithPolicy::default()baked in. Production never called it; only its tests did, so the default-policy path existed in two places. The wrapper is gone and the 14 test callers now nameevaluate_with_policydirectly, so the default policy is pinned at its one real call site.SimpleFile::sizeandSimpleFile::provenancein the PyPI/simple/response model were#[serde(default)]members nothing read, the exact defectSimpleMeta's own doc comment refuses to carry forapi-version. Both are gone, along with the struct's#[allow(dead_code)].Bug
diff_single_filecoerced invalid UTF-8 to""on either side, so a file stamped text whose bytes do not decode diffed as everything-deleted or everything-added and scored accordingly. Both sides are refused now with an error naming the path and the side (drift entry 10). The path is unreachable throughcompute_deltabecauseclassify_bytesroutes non-UTF-8 toBinaryand the early return covers it, which is what made it safe to leave as long as it was: the only state that reaches it is the classification disagreeing with the bytes, and a coercion cannot answer that state correctly. Verified by restoring the coercion and watching the new test (a_text_classified_file_that_does_not_decode_is_refused_not_coerced) fail.Doc claims corrected
--help,ARCHITECTURE.md§5, andSHIM_MANAGERSall say eleven (npm npx pnpm yarn bun bunx pip pip3 cargo yay paru) and are right. The entry says eleven now (drift entry 6).-/_canonicalization (serde_json→serde-json). Checked against the live registry instead of the code: the sparse index stores only the folded file (index.crates.io/se/rd/serde_json200,se/rd/serde-json404) and the download host 403s the hyphen path whererocket_db_poolsis 200, so a hyphen-spelled review fails closed at the fetch today. The distinctness is deliberate anyway: a configured index or mirror may genuinely serve both spellings, and answering one spelling with the other's bytes is worse than refusing (the ci lane pins that invariant inlockfile_diff_keeps_pypi_alias_off_cargo_pins). The claim is removed; drift entry 4 records the evidence and the stance (drift entry 4).blueline installshipped "sandboxed extraction." It never did. The entry now says fail-closed script execution and points at drift entry 1, which stays High and unfixed because the fix is code.One attempt was made and reverted inside this branch before the first commit: folding
-to_incanonical_crate_nameto make the 0.3.0 claim true.lockfile_diff_keeps_pypi_alias_off_cargo_pinscaught it, because the fold makes a hyphen-spelled request fetch the underscore spelling's bytes, which is precisely the invariant the test exists to hold. That is what settled the direction of entry 4 toward the doc correction.Dependencies
actions/checkoutv4 → v7,actions/setup-nodev4 → v7). Those are real upgrades but not ones to take blind in a cleanup PR; say the word and they get their own branch.Gate
./scripts/verify.shpasses (fmt, clippy, test, references) on this branch. One environment note: the test stage ran withCARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0because this box holds ~6.8 of 7.7 GB in other agent sessions and the debuginfo-heavy link was OOM-killed twice. Same assertions, one environment flag away from CI's exact command.Out of scope (open, tracked in
references/drift.md)Err+ exit 1 rather thanVerdict::Block. A behavior-contract decision, not something to flip silently.