Skip to content

test(docs-hygiene): grade wfh-grounding-readme grounding with a deterministic regex - #12941

Merged
kyle-sexton merged 6 commits into
mainfrom
test/12085-grounding-grader
Nov 3, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
test/12085-grounding-grader

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #12085

Summary

Replaces the noisy LLM judge on wfh-grounding-readme's terms-grounded grader with a deterministic regex that applies write-for-humans's own grounding rule to the case's three planted terms, so the measurement behind #12085's done-when 2 stops depending on split judge votes. This measures the rule; it does not meet done-when 2 (the measured result is on the issue).

Fix

  • graders/terms-grounded.md: type: regex (flags: i, arm: both). For each of collector, checkpoint and tail set, the first prose sentence that uses the term must gloss it (colon, parenthesis, dash, apposition, "is/are a/the", "means"), label it, or define or assume it earlier in that sentence; a term the README never uses passes. Headings are not sentences. Matching is linear-time (one reply grades in about 1 ms).
  • samples/terms-grounded.json: 9 must-pass and 15 must-fail answers, including the openings lane 1 saw the judge split on.
  • case.yaml: expected_outcome says "in or before the first sentence that uses each", matching SKILL.md's rule ("Its definition goes in that sentence or an earlier one, never the next"); the description records the 10-run probe.
  • Changelog fragment, bump: none.

Verification

  • validate-cases.py: exit 0, no finding on this case; a deliberately broken label check confirmed the samples are graded.
  • Preregistered 10-run measurement, claude-opus-5-5 subject and judge, --ablation with-without, VALID: README with plugin 1/10, without 0/10; how-to 10/10 both arms. An earlier run was voided because the first regex backtracked under the CLI's engine; the linear-time fix re-grades its kept replies to the same result.
  • check-affected.sh --tests: 13 passed, 3 skipped. gitleaks: no leaks.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN

kyle-sexton and others added 4 commits November 3, 2026 15:30
The LLM judge on wfh-grounding-readme split its votes on 5 of 20 runs in
lane 1's 10-run measurement (#12085, 2026-11-02 19:30Z): it passed runs 3
and 4 and failed run 6, which open with the same one-sentence-late
collector definition. terms-grounded is now a deterministic regex that
states the skill's own test (SKILL.md: the definition goes in the first
sentence that uses the term or an earlier one, never the next) for the
three planted terms: the first prose sentence using each, headings
excluded, must gloss, label or assume it.

Samples cover the earlier probes' openings, the late-definition and
never-defined shapes, near misses (a clause comma, a non-defining "is"),
and paraphrased passes; validate-cases.py sorts all 20 under Python and
JavaScript.

Refs: #12085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
The first regex let a heading match end mid-line, so its prefix could
split in many ways. Under the CLI's JavaScriptCore engine it hit the
backtrack limit and returned no match: a README that grounds all three
terms took 3.5 s in Bun and was graded FAIL in the 2026-11-03 run, while
V8 passed it. The prefix is now an atomic run of whole headings and
whole sentences, so every reply grades in about 1 ms in Bun and in node,
and both engines agree on all 20 kept replies.

The spot-read of that run also showed that "This file is the checkpoint."
defines the term in its first sentence and was failed; "is/are the
<term>" now counts. Samples add both shapes and the late-definition
openings from that run.

Refs: #12085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
…g-readme

With main's rule loaded, the regex terms-grounded grader passed 1 of 10
with-plugin runs and 0 of 10 without (Claude Code 2.1.317,
claude-opus-5-5, run-validity VALID). Nine with-plugin READMEs define
collector one sentence after first using it.

Refs: #12085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
…rounding regex

typos rejects the bare stem in the pattern. The listed forms grade all 24
samples and the 40 kept replies from both runs as before.

Refs: #12085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 3, 2026 20:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T20:35:00.165969Z 8459d63 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 8459d6347f

ℹ️ 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".

…s as spaces

The terms-grounded regex accepted a naming or assumption word anywhere
earlier in the sentence, so "files, called sources, and ships every line
to your collector" graded collector as grounded. Naming cues (called,
named, known as, makes up, forms) now must lead straight into the term,
with an optional determiner; an assumption cue must sit in one clause
addressed to the reader ("assumes you ... collector"); ", called" joins
the after-term appositions.

A single newline inside a paragraph is now whitespace, so a hard-wrapped
"are called its\ntail set" passes. A blank line, a heading, a list item,
a fence or a table row still ends a sentence.

Sentence scanning steps over whole words rather than single characters:
under Bun the per-character scan returned a different verdict from Node
on soft-wrapped inputs from 10 KB; the word scan matches Node up to 20 KB. Two samples cover the unrelated naming cue and the wrapped
paragraph; the 20 replies of the 10-run measurement grade the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 39a789629fa16d93c375abf74ef5482d5ada763e: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12941 (incremental since 8459d63)

I found no security issues. This was an incremental review. I read every hunk of all 3 files listed in its scope: case.yaml, graders/terms-grounded.md and samples/terms-grounded.json under plugins/docs-hygiene/evals/wfh-grounding-readme/.

What changed since the last review:

  • The regex grader now treats a single newline inside a paragraph as a space.
  • Naming cues (called, named, known as, makes up, forms) now count only when they lead straight into the term. The assumed-knowledge cue now counts only in a clause addressed to the reader.
  • Each term's scan now stops at the README's closing ```` fence.
  • The case description was updated to match.
  • Three samples were added: two must-pass and one must-fail.

These changes close the review threads the owner resolved. I did not raise any of those points again.

Security surface checked:

  • Trusted paths and trust controls: none of the changed files match a TRUSTED PATHS: glob. The trusted-trigger check, the lane token, the kill switch, the token broker, merge holds and the other actions under .github/actions/ are all unchanged.
  • Plugin manifests: no plugin.json or marketplace.json file changed, so there are no manifest lines to report.
  • Removed instructions: the only text that changed is this eval case's description and its grader pattern. Neither is a standing instruction (CLAUDE.md, a rules file, a skill or agent body, or a hook's block list or allowlist), and no protected class is affected.
  • Regex grader: it runs only when evals are graded, over model replies and the committed samples. It runs in no credentialed or trusted lane. At worst, a slow match on a crafted reply would slow one eval run. That is not a leak, a compromise or a charge.
  • Embedded text: the PR context and the settled threads contain no text telling this lane to pass the PR, skip a check, drop a finding or post elsewhere.

Prior findings: this lane has posted no inline findings on this PR (0 rounds against a cap of 3), so nothing is repeated and the round cap did not apply.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 2 inline finding(s) on 8459d6347f056c5dae74e55a79dfa0c8be4a9619; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 39a789629fa16d93c375abf74ef5482d5ada763e: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #12941 (incremental, 8459d634 → 39a78962)

Scope. I read every hunk of the 3 files the push changed: case.yaml, graders/terms-grounded.md and samples/terms-grounded.json. I used the full diff and the PR context for background only.

What changed. The push answers both findings this lane raised last round. It also covers two points that the owner settled on other threads. Changes in the terms-grounded regex:

  • Fence stop. Each term's scan carries a (?!````) guard at the start of each sentence or heading unit. Reaching the closing fence counts as "term not used".
  • Soft line breaks. A single newline inside a paragraph counts as a space. A blank line, a heading, a list item, a ``` or ~~~ fence, or a table row still ends a sentence.
  • Naming cues. called, named, known as, make(s) up and forms count only when the term comes straight after them, with at most an optional article or possessive in between.
  • Assumption cue. It now needs assum(e|es|ed|ing) [that] you|your|reader(s) followed by at most six unpunctuated words before the term.
  • Sample changes. Two pass samples were added: a sentence wrapped by a soft break, and prose after the fence. One fail sample was added: a naming cue on another noun.
  • Case description. The case.yaml description now states these rules.

Checks. I traced the new branches against the samples by hand:

  • Fence stop. A newline followed by is always a hard break. So the closing fence can only start a unit, where the `(?!````)` guard catches it. That holds whether the README's last line is a sentence, a heading or an inner code block.
  • New samples. The soft-wrapped a\ncollector, which and called its\ntail set both pass. The post-fence collector mention passes. files, called sources, … your collector. fails.
  • Existing samples. The assumed-knowledge pass sample (assumes you already run a log collector, four words between) still passes. So do the glossary list items (- **Checkpoint**:), because the list marker makes the newline before them a hard break.

I could not run the regex, because this lane has no shell. The author's results are author-claimed and I did not reproduce them: 27 samples grade correctly under Node, Bun and the validator, and no verdicts change on the 20 replies of record.

Prior findings. Both earlier advisory findings were resolved by owner replies marked VALID (fix now), and the fixes are in this push. Both threads are marked lines changed since resolution: no in the settled-threads file. Nothing is re-raised. Round 2 of 3; the cap does not apply.

Rules. .claude/rules/eval-case-transcripts.md covers these paths. The new samples are synthetic loglet READMEs with no machine-specific paths and no identifying details, so the rule is met.

Other.

  • No plugin manifest changes.
  • No closing issue: the PR says Refs: #12085.
  • No embedded instructions in the PR context or the thread files.
  • Spend: none beyond the eval runs this case already makes.

… fence

Each term's sentence scan ran to the end of the reply, so a README that
omits a term was graded on prose written after the fence. The scan now
stops at the closing ```` fence: a term the README never uses passes,
and a must-pass sample covers post-fence prose that uses one ungrounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Cqhc6ANUKyPoYQrPgN
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit cf382f3 Nov 3, 2026
67 of 68 checks passed
@kyle-sexton
kyle-sexton deleted the test/12085-grounding-grader branch November 3, 2026 21:33
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