Move the compatibility tool's inline tests out of its pinned lib.rs - #446
Merged
Merged
Conversation
docs/proposed-rust-module-conventions.md item 2, continuing #440-#442, for the last large inline test block among pinned files: the `tests` module of tools/bridge-tally-compatibility/src/lib.rs -- the tool that validates the compatibility surface -- moves to lib_tests.rs beside it via #[path]. lib.rs goes from 2,853 to 1,686 lines. No production code followed the block. Checked, not asserted: - lib.rs rebuilds byte-identical to HEAD from the new parent plus the re-indented child. - rustfmt's only non-whitespace change is one trailing comma; all 169 string and char literals are identical. - Test lists are identical before and after: 24 lib tests by default, 30 with bills-native-outstandings-probe-receipt. The full crate passes under both, with no warnings. - Before resealing, real_tree_has_complete_migration_and_report_surface_coverage failed with surface_file_changed -- the expected result of changing a pinned file -- and passes after; reseal --verify exits 0 and exactly one pinned hash changed. - clippy -D warnings is clean for CI's tools-workspace step and its probe-receipt feature step. - Text readers: check-tally-live-read-boundary.mjs allowlists this lib.rs for probe identifiers; the moved tests contain none, and it passes. The request-builder hazard scanner now reads lib_tests.rs as production (see #443) and still reports exactly its 10 pinned violations. The other scanning scripts pass, and the frontend suite passes (239 node, 113 vitest, 10 Playwright) on a clean tree -- the merge-driver test refuses to run with uncommitted surface changes. Coverage, stated rather than assumed. lib_tests.rs is unpinned, following #416's rule and #440-#442: tests decide nothing about what Bridge posts or emits. For this file the loss is sharper than before, because real_tree_has_complete_migration_and_report_surface_coverage holds the only executable check of the reserve bound, `MAX_SURFACE_FILES - files.len() <= RESERVED_SURFACE_FILES`. The cap itself stays enforced in the pinned lib.rs. Editing or deleting that assertion no longer changes a pinned hash. The one #[cfg(windows)] test, normalise_surface_path_uses_forward_slashes, could not run on the macOS host that did this move; CI's windows-latest native job runs the tools workspace tests and covers it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
12 tasks
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.
Follows
docs/proposed-rust-module-conventions.mditem 2, as in #440–#442, for thetestsmodule oftools/bridge-tally-compatibility/src/lib.rs, the tool that validates the compatibility surface. It moves tolib_tests.rsbeside it via#[path].lib.rslib_tests.rsNo production code followed the test block.
Checked, not asserted
lib.rsrebuilt byte-identical toHEADfrom the new parent plus the re-indented child. After rustfmt, the child differs from that reconstruction only in layout (below).bills-native-outstandings-probe-receipt. The full crate passes under both, with no warnings.real_tree_has_complete_migration_and_report_surface_coveragefailed withsurface_file_changed, which is expected after changing a pinned file. It passes after the reseal.reseal --verifyexits 0, and exactly one pinned hash changed.-D warningsis clean for CI's tools-workspace step and for its probe-receipt feature step.check-tally-live-read-boundary.mjsallowlists thislib.rsfor probe identifiers. The moved tests contain none, and the check passes.lib_tests.rsas production code (see Skip extracted test modules in the hazard scanner by how they load, not by name #443). It still reports exactly its 10 pinned violations.#[cfg(windows)]test couldn't run on the macOS host that did this move. CI'swindows-latestnative job runs the tools workspace tests.What leaves the seal, and why this file is different
lib_tests.rsis unpinned. That follows #416's rule and #440–#442: tests decide nothing about what Bridge posts or emits.The loss is sharper here than in earlier extractions.
real_tree_has_complete_migration_and_report_surface_coverageholds the only executable check of the reserve bound:The cap itself is still enforced in the pinned
lib.rs. But editing or deleting that assertion no longer changes a pinned hash. If you want it sealed, pinninglib_tests.rstakes one entry, a cap raise with a named reason, and matching changes to the guard.Correction to the remaining-work picture
An earlier version of this description called this the last large inline test block in a pinned file. It isn't. I had ranked files by production lines and truncated the list. Ranked by inline test lines, 70 pinned files still hold 18,384 lines of top-level inline
#[cfg(test)]modules. This one is third, behindsource_draft/catalog.rs(1,779) andtally/connector.rs(1,317).Coordination
#444 also edits this
lib.rs, raising the cap to 251 in the doc comment and constant near the top. The two edits don't overlap in the source. Both regenerate the surface manifest, and #444 adds pins, so whichever lands second must merge the pin list and reseal, not take either side.🤖 Generated with Claude Code