Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): preserve numeric token boundaries in crate chain check

Steven Enamakeld4fe427cc4d9
diff --git a/scripts/ci/check-crate-chain.mjs b/scripts/ci/check-crate-chain.mjs
index af2c3616d0..7b41c8fa33 100644
--- a/scripts/ci/check-crate-chain.mjs
+++ b/scripts/ci/check-crate-chain.mjs
@@ -138,7 +138,7 @@ export function stripRustComments(text, { preserveLiterals = false, compact = fa
const word = char => /[\p{ID_Continue}]/u.test(char);
// Rust punctuation spacing can distinguish macro arms, including a third
// character completing an operator. Retain all separated punctuation pairs.
- const punctuation = new Set("=<>!~+-*/%^&|@.,;:#$?'" );
+ const punctuation = new Set("=<>!~+-*/%^&|@.,;:#$?'");
const append = chunk => {
if (!chunk) return;
if (compact && preserveTokenBoundaries && pendingBoundary && out) {
@@ -149,9 +149,10 @@ export function stripRustComments(text, { preserveLiterals = false, compact = fa
(word(left) && ['"', "'", '#'].includes(right)) ||
(['"', "'", '#'].includes(left) && word(right)) ||
(left === '#' && right === '"') ||
- (left === '.' && /[0-9]/.test(right)) ||
+ (left === '.' && word(right)) ||
(/[0-9]/.test(left) && right === '.') ||
(/[eE]/.test(left) && ['+', '-'].includes(right)) ||
+ (['+', '-'].includes(left) && /[0-9]/.test(right)) ||
(punctuation.has(left) && punctuation.has(right))) out += ' ';
}
out += chunk;
diff --git a/scripts/ci/process-statics.md b/scripts/ci/process-statics.md
index 87ff5b88d9..533ce9a386 100644
--- a/scripts/ci/process-statics.md
+++ b/scripts/ci/process-statics.md
@@ -33,7 +33,7 @@ Each record has these fields:
Use the type printed by the failure message, with redundant whitespace outside literals
removed. Separators that distinguish identifiers, literal prefixes/suffixes,
-raw identifiers, or joined punctuation remain (as do the `mut ` and `ref ` prefixes). ABI and other literal contents,
+raw identifiers, numeric tokens, or joined punctuation remain (as do the `mut ` and `ref ` prefixes). ABI and other literal contents,
including their whitespace, remain significant. `count` is the exact number of matching
file/module-scope/name/type declarations. `scope` is the inline module path,
such as `outer::user`; an empty or omitted scope denotes the file root.
@@ -66,7 +66,9 @@ Literal declarations inside `macro_rules!` templates are conservatively checked
even when the template is not invoked. Excluding these bodies would allow a new
macro-defined global to bypass ownership review; the gate does not claim that
every source declaration is instantiated at runtime.
-Type-position macro token trees are preserved without expanding them. Named
+Type-position macro token trees are preserved without expanding them.
+Separated punctuation is conservatively significant: harmless formatting can
+require a renewed ownership record even when the effective Rust type is unchanged. Named
inline modules contribute declaration identity; anonymous blocks and function
scopes within one module still share its declaration counts.
Sibling `*_tests.rs` files are excluded; declarations behind `cfg(test)` in