Repository navigation
build(deps): apply round-4 §13.7 entry-length sort to dep blocks - #37
Merged
Merged
Conversation
verify_dep_order.py was too tolerant: it trimmed trailing blanks from both actual and expected sequences, so a missing blank at the local/third-party boundary was silently accepted. Tighten the trim guard (only trim actual_seq blanks past expected_seq length) so the boundary blank is enforced. fix_dep_order.py now parses blocks the same way the verifier does (per-entry followed_by_blank flag), so verifier and fixer agree on what 'correct' means (audit-pitfalls §48).
verify_dep_order.py now sorts entries by total whitespace-agnostic character count (primary) and dep key (secondary), per round-4 §13.7 stated in the skill (SKILL.md scripts table §13.7 round 4). The previous round-3 implementation only sorted lexicographically, which let several blocks drift: hyperlane's [workspace.dependencies] and the sub-crate [dependencies] blocks had not been round-4 sorted. fix_dep_order.py reuses verify_dep_order.entry_sort_key so the two scripts agree on the canonical order. Tightens the verifier so missing boundary blanks are no longer hidden by the trim guard (audit-pitfalls §70) and so the /tmp/test_* crate-cli fixtures are skipped from the violation count. 6 Cargo.toml files affected in this workspace.
…r 13.8
rust-standards 13.8 (2026-09-27 user directive): "Cargo.toml different
configuration fields need a blank line between". Every top-level
[section] header in any Cargo.toml MUST be preceded by exactly one
blank line if it follows non-section content.
5 Cargo.toml files affected in this workspace (root + 4 sub-crates):
- Cargo.toml: [dependencies] was directly after the closing ] } of
tokio-rustls = { ... ] } in [workspace.dependencies].
- core/Cargo.toml: [dev-dependencies] directly after
lombok-macros = { workspace = true }.
- macros/Cargo.toml: [dev-dependencies] directly after
proc-macro2 = { workspace = true }.
- request/Cargo.toml: [dev-dependencies] directly after
tokio-tungstenite = { workspace = true }.
- type/Cargo.toml: [dev-dependencies] directly after
serde_urlencoded = { workspace = true }.
Inserted one blank line before each affected section header. No entry
text / no block-internal ordering changes. 13.7 round-4 dep-block
order (already applied) is unaffected.
Verification:
- verify_section_blanks.py: 8 files, 0 violations
- verify_dep_order.py: 35 files, 0 violations
- cargo check --workspace --offline: 0 errors
- audit check 40 (13.8): PASS
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.
Summary
Apply
rust-standards §13.7round-4 ordering: dep entries are sorted bytotal whitespace-agnostic character count (primary), then by dep
key (secondary). The previous verifier only sorted lexicographically,
which let several blocks drift out of the canonical round-4 order.
This branch ships the updated
verify_dep_order.py+fix_dep_order.pyand applies
fix_dep_order.py --writeto all in-repoCargo.tomlfiles.Both scripts share
verify_dep_order.entry_sort_keyso the canonicalorder is defined in one place (audit-pitfalls §48).
Infra changes (skill/scripts)
verify_dep_order.py: sort key now(entry_length, dep_key)insteadof just
dep_key. Tightened the trim guard so a missing boundaryblank is no longer hidden by trailing-blank trimming (audit-pitfalls
§70). Skip
*/tmp/test_*/Cargo.tomlcrate-cli fixtures from theviolation count.
fix_dep_order.py: importsentry_sort_keyfrom verifier; serializesblocks with the same
followed_by_blanksemantic.Workspace changes
[workspace.dependencies]+ 5 sub-crates'[dependencies]Verification
verify_dep_order.py: 0 violations in tracked files (both repos)cargo check --workspace --offline: 0 errorscargo clippy --workspace --all-targets --offline: 0 warningscargo test --workspace --offline: all greencrate fmttwice: idempotentNotes
found while wiring the round-4 sort: hidden middle-blank violation,
double-blank serializer output, parse/sort/serialize contract.
tmp/test_*/Cargo.tomlfixtures are skipped fromverify_dep_order.pyviolation counts; they remain in the file scan output but report 0
violations.