test(safety): guard that every test named in SAFETY.md actually exists - #754
test(safety): guard that every test named in SAFETY.md actually exists#754maxmoneycash wants to merge 1 commit into
Conversation
move/SAFETY.md is the judge-facing 'safety property → test' traceability map, and its intro tells judges to 'Run one property: sui move test <test_name>'. If a test is renamed/removed but its SAFETY.md reference isn't updated, that command finds 0 tests — a broken honesty claim. The fleet edits SAFETY.md frequently (mapping new properties #739/#743/#745), so a stale ref is plausible, and nothing caught it. Add a cold-gate test that parses SAFETY.md's middle table column (the test names) and asserts each exists as a Move fun. Verified: 155 referenced tests, all present. Mirrors test:doc-links + test:doc-counts. Wired into test:offline; cold-gate-coverage accepts it. 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: 1670bc06ba
ℹ️ 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".
| for (const line of md.split("\n")) { | ||
| if (!line.startsWith("|") || line.includes("---")) continue; // data rows only | ||
| const testsCol = line.split("|")[2] ?? ""; // index 2 = the middle (tests) column | ||
| for (const m of testsCol.matchAll(/`([a-z_][a-z0-9_]{6,})`/g)) { |
There was a problem hiding this comment.
Validate abbreviated SAFETY test refs
When SAFETY.md contains a backtick ref that is not a pure identifier, this regex silently skips it instead of failing. The current table already has move/SAFETY.md:84 advertising close_upper_touch_wins… and close_lower_touch_wins…; a judge running those exact sui move test <name> commands would get zero tests, but this new guard still passes because the ellipsis prevents either ref from being parsed. Please make skipped middle-column refs explicit failures or normalize these abbreviations to the real test names.
Useful? React with 👍 / 👎.
move/SAFETY.md is the judge-facing 'safety property → test' traceability map, and its intro tells judges to 'Run one property:
sui move test <test_name>'. If a test is renamed/removed but its SAFETY.md reference isn't updated, that command finds 0 tests — a broken honesty claim ('every fund-safety property maps to a named test you can run').The fleet edits SAFETY.md frequently (mapping new properties #739/#743/#745), so a stale ref is plausible, and nothing caught it.
Adds a cold-gate test that parses SAFETY.md's middle table column (the test names) and asserts each exists as a Move fun. Verified: 155 referenced tests, all present. Mirrors test:doc-links + test:doc-counts. Wired into test:offline; cold-gate-coverage accepts it.
🤖 Generated with Claude Code