Skip to content

feat(scripts): npm run sync:count — one-command Move-count doc sync - #747

Merged
maxmoneycash merged 1 commit into
mainfrom
agent2/sync-count-tool
Jun 22, 2026
Merged

maxmoneycash merged 1 commit into
mainfrom
agent2/sync-count-tool

Conversation

@maxmoneycash

Copy link
Copy Markdown
Member

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.mjs derives 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. --check exits non-zero if any doc is stale. Both count guards now point their failure message at npm 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

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>
@maxmoneycash
maxmoneycash merged commit a6c0b80 into main Jun 22, 2026
1 of 2 checks passed
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wick-markets Building Building Preview, Comment Jun 22, 2026 9:32pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — c91bdc6b Deployed Jun 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant