Repository navigation
feat(scripts): npm run sync:count — one-command Move-count doc sync - #747
Conversation
The Move-test count is hard-coded in ~8 spots across 4 files (README badge + body + layout tree + the sui-move-test command comment, move/SAFETY.md, deployments/ADDRESSES.md, the v4.26 runbook). Test PRs that bumped only the README repeatedly left main RED on check:doc-counts / check:meta (#735, #744, ...), each needing a manual multi-file straggler fix. sync-move-count.mjs derives the authoritative count from the #[test] functions in move/ (the exact proxy check-doc-counts.sh already validates == the sui move test total — no slow compile) and rewrites every count phrasing in all four files at once. Only digits inside an unambiguous count context are touched (badge, "N / N tests", "N Move tests", "Total tests: N", "N/N passing", "# N/N"); PR refs like (#694) and 0x ids never match. `--check` mode exits non-zero if any doc is stale (CI-style). Both count guards now point their failure message at it. Verified: no-op + empty diff on the already-synced tree (no PR-ref/id damage); repairs an injected straggler to exactly the committed state; both guards green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c91bdc6b1d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Each rule rewrites only the count digits inside a count-specific context. | ||
| const rules = [ | ||
| { re: /move%20tests-\d{3,4}%2F\d{3,4}/g, to: () => `move%20tests-${N}%2F${N}` }, // shields badge | ||
| { re: /(\d{3,4})(\s*\/\s*)(\d{3,4})(\s+(?:Move\s+)?tests)/g, to: (_m, _a, sep, _b, suf) => `${N}${sep}${N}${suf}` }, // "695 / 695 Move tests" |
There was a problem hiding this comment.
Cover all README count formats before syncing
When the Move count changes, this rule does not match the existing README table row **695 / 695** Move tests because the bold marker sits between the second number and Move; the badge alt text Move tests 695/695 is also outside the current badge-url rule. As a result, the advertised npm run sync:count can leave judge-facing README counts stale while check-doc-counts.sh still passes because it has the same whitespace-only assumption, so the one-shot sync needs to cover these current README formats too.
Useful? React with 👍 / 👎.
The Move-test count is hard-coded in ~8 spots across 4 files (README badge+body+layout+cmd comment, move/SAFETY.md, deployments/ADDRESSES.md, the v4.26 runbook). Test PRs bumping only the README repeatedly left main RED on check:doc-counts/check:meta (#735, #744, …), each needing a manual multi-file fix.
sync-move-count.mjsderives the count from the #[test] functions in move/ (the exact proxy check-doc-counts.sh already validates == the sui move test total — no slow compile) and rewrites every count phrasing in all four files at once. Only digits inside an unambiguous count context are touched; PR refs like (#694) and 0x ids never match.--checkexits non-zero if any doc is stale. Both count guards now point their failure message atnpm run sync:count.Verified: no-op + empty diff on the synced tree (no PR-ref/id damage); repairs an injected straggler to exactly the committed state; both guards green.
🤖 Generated with Claude Code