Skip to content

test(safety): guard that every test named in SAFETY.md actually exists - #754

Open
maxmoneycash wants to merge 1 commit into
mainfrom
a7/guard-safety-test-refs
Open

test(safety): guard that every test named in SAFETY.md actually exists#754
maxmoneycash wants to merge 1 commit into
mainfrom
a7/guard-safety-test-refs

Conversation

@maxmoneycash

Copy link
Copy Markdown
Member

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

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>
@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 Ready Ready Preview, Comment Jun 22, 2026 10:46pm

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: 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)) {

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

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