Skip to content

feat(evals): fail dangling skill, agent, path and tag references in validate - #18267

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/evals-validate-stale-refs
Nov 23, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/evals-validate-stale-refs

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: Phase 4 of the eval-run-policy plan (stale-reference checks in validate); the plan is tracked outside the issue tracker.

Draft: the orchestrating session marks it ready after its phase review.

Summary

/evals:validate now fails four kinds of dangling reference, so a skill or agent rename cannot leave an eval case testing something that no longer exists. The eval-cases step of pr-require-checks.yml validates every suite on every PR instead of only changed plugins.

Fix

  • validate-cases.py FAILs:
    • a prompt whose leading /<plugin>:<skill> resolves to no plugins/<plugin>/skills/<skill>/SKILL.md;
    • a context.scaffold_script, context.history_file or context.add_dirs entry missing from the case directory;
    • a tool_used grader on tool: Skill (or tool: Agent) whose input_match names, as a literal token, a <plugin>:<skill> (or plugins/<plugin>/agents/<agent>.md) that does not exist. Character classes, lookarounds and tokens joined to another regex part are skipped; a /<plugin>:<skill> token in an Agent input is checked as a skill; a token left open on the right (end, |, )) matches as a substring, so a prefix of a real name passes;
    • a tag in <plugin>:<skill> form that names no skill.
  • Names resolve under the nearest plugins/ directory above the suite; a suite under none skips the name checks.
  • pr-require-checks.yml: the eval-cases step drops the changed-plugin narrowing.
  • validate/SKILL.md documents the four FAILs; changelog fragment under .changes/evals/.

Verification

  • pytest plugins/evals/skills/validate/scripts/test_validate_cases.py: 118 passed, including the new StaleReferences class (four failing fixtures, one per check, plus a pass fixture covering discovery:explorer, a lookahead, a character class, an optional prefix group and a substring prefix).
  • Every-suite sweep (the step's own loop over plugins/*/) exits 0. Its first run found 4 FAILs, all false positives of the first draft of check (c), so the check was fixed rather than the cases: /discipline:scrutinize-dont-coast inside an Agent input_match is a skill reference, and the unanchored discovery:research matches discovery:researcher as a substring. After the fix the checks resolved 2,164 references with no FAIL.
  • Plan Phase 4 Sanity Checks:
    • python3 -m pytest plugins/evals/skills/validate/scripts/test_validate_cases.py exits 0, with four new failing-fixture tests.
    • On this PR, the eval_cases step of pr-require-checks.yml passes over every suite in under 60 s (gh run view --json jobs). Not yet measured: the local sweep took about 2 minutes on this machine with node and bun grading samples.

Related

  • Plan decision Q59 (run the stale-reference check across every suite, tags included) and Q21 (repair dangling references in the same PR; none were found).

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 22, 2026 19:26
…alidate

validate-cases.py now FAILs a leading /plugin:skill with no SKILL.md, a
context.scaffold_script, history_file or add_dirs entry missing from the
case directory, a literal plugin:skill or plugin:agent token in a Skill or
Agent tool_used input_match that names nothing, and a plugin:skill tag that
names no skill. Names resolve under the nearest plugins/ directory above the
suite. The eval-cases step validates every suite on every PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 23, 2026 00:54
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T00:57:42.749301Z 05482c2 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: 05482c2cfc

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

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 94992c4fb6b7003e691db4b96e1376d24bddad49: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental): PR #18267, /evals:validate runs JavaScript checks once per suite

I found no security issues.

This review was blocking only, because the lane already reviewed an earlier head (aafe3199). It covers only the push since then. I read every hunk of both files in the incremental diff: .changes/evals/feat-evals-validate-stale-refs-4c1e9a27.md and plugins/evals/skills/validate/scripts/validate-cases.py.

plugins/evals/skills/validate/scripts/validate-cases.py

  • What changed: analyze_case now adds each case's JavaScript jobs to a list for the whole suite. validate then calls check_js_engine(jobs, findings) once, so each engine starts one process per suite instead of one per case. When an engine fails, it now adds the warning to every case that has a job, de-duplicated in order with dict.fromkeys.
  • How the engine is run: I read the code the change calls. run_node_probe (L1651-L1677) is unchanged. It runs the fixed NODE_PROBE script with an argument list, not a shell, and sends the jobs as JSON on stdin. Case data never reaches the command line, so making the batch bigger opens no injection path. The output checks (the result count must equal the job count, and each result must have the right shape) still run on the combined batch.
  • No new capability: the push adds no new reads, writes, kinds of process, network access or credential handling. The patterns and samples still come from eval cases committed to the repository.
  • Not a security issue: one timeout now covers the whole suite instead of one case. If that timeout is hit, the validator warns for every case instead of one. That is a correctness and coverage trade-off for the code-review lane, not a security issue.

.changes/...md adds a changelog entry only.

Other checks:

  • The push touches no trusted path, trust control, plugin manifest or standing instruction.
  • The settled threads concern the reference-matching regex, which this push does not touch.

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: 1 inline finding(s) on 05482c2cfcecb8a3c2bdc6817aec42998069b12e; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 94992c4fb6b7003e691db4b96e1376d24bddad49: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #18267, JavaScript checks graded once per suite

Scope. I read every hunk of both files listed in .claude-lane/incremental-files.txt, using .claude-lane/incremental.diff. For context I read validate-cases.py lines 1640–1907 at head, which cover run_node_probe, js_jobs, run_js_jobs, judge_js_jobs, judge_js_engines and check_js_engine. This lane already reviewed an earlier head, so this review reports blocking findings only.

What changed

  • analyze_case used to call check_js_engine once per case. It now adds the case's js_jobs to a list that validate() owns.
  • validate() then calls check_js_engine(jobs, findings) once for the whole suite, so there is one process per engine instead of two per case.
  • When an engine fails, the WARN now goes to each distinct case that has jobs.
  • analyze_case's optional parameters became required positional ones.
  • A changelog fragment adds a ### Changed entry under the existing bump: minor.

Traced (no defect found)

  • Findings keep their case. Every job already carries its own "case" key (validate-cases.py L1746). judge_js_jobs and judge_js_engines read it per job, so a finding still names the right case and sample path when the jobs are batched.
  • Results stay in order. Results are matched to jobs by index (zip / enumerate). run_node_probe checks that the result count matches the job count and checks each result's shape, so a mismatch becomes an engine-level problem rather than a finding pinned on the wrong case.
  • Empty and failed runs. A suite with no jobs returns [], None and emits no WARN, the same as before. When an engine fails, only cases that have jobs get the WARN, which is also the same set as before (a case with no jobs never got one).
  • Signature changes. I grepped under plugins/ and found no remaining caller that uses the old check_js_engine(case, graders, samples, findings) signature or relies on analyze_case's removed defaults. check-matchers.py calls only js_jobs, run_js_jobs and judge_js_jobs, and those signatures did not change.
  • Not blocking. NODE_TIMEOUT_SECONDS = 30 now covers a whole suite in one process instead of one case. So one grader with catastrophic backtracking, or a very large suite, can now turn every case's JavaScript check into a WARN, not just its own case's. I left this out of the findings because this is a blocking-only review.

Prior findings. The single earlier inline thread (the hyphenated-name backtrack) is resolved and settled, and this increment does not touch it. I am not raising it again.

Blocking findings. None.

Verification. I ran nothing: this lane has no shell. Everything above comes from reading and tracing the code at head. The PR's pytest and sweep results are the author's own and I have not verified them.

Spend. None in this increment. Fewer node and bun processes per validate run lowers CI time slightly.

Loosened checks. None found in this increment. Loosened checks would be marked: fail. That is the default, because the prompt has no loosened_check_verdict: or loosened_check_patterns: line. The prompt also has no loosened_check_decision_record: line, so I did not check the citation requirement.

Closing issue. The PR closes no issue (it is Phase 4 of a plan tracked outside the issue tracker), so I report nothing against issue criteria.

Verifier dropped 0 of 0 candidates.

…group

A plugin:skill token directly inside a group, as in "(?:demo:gone)", was
missed because the group's own colon read as a literal before it, and a
token ending at a group close was taken as a prefix even when a literal
followed the group. Group parentheses are now regex syntax, and whether a
token is open on the right is read from the source pattern past each group
close and alternative.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kyle-sexton and others added 2 commits November 22, 2026 20:06
A hyphenated name followed by a regex part, such as review:security-.* or
review:code-review(er)?, let the name group backtrack to the last hyphen and
check review:security or review:code, a false FAIL. A name may no longer end
right before a hyphen, so such a token is skipped as not literal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
review:(code|security)-reviewer was checked as the exact name review:code, a
false FAIL. A token that crosses a group holding alternatives, or ends in one
that more of a name follows, is no longer read as a literal name and is
skipped; a group whose alternatives are each a whole name is still checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

The review summary's finding at validate-cases.py ~1256 is fixed in aafe319: review:(code|security)-reviewer was checked as the exact name review:code. A token is now skipped as not literal when it crosses a group that holds a top-level |, or ends in such a group and more name follows the group's close. A group whose alternatives are whole names, followed by a terminator, is still checked ((?:demo:real|demo:gone) still fails on demo:gone). Pass fixture demo:(code|security)-reviewer (Agent) reproduced the false FAIL before the fix. 119 tests pass, and the every-suite sweep exits 0.

The eval-cases sweep spent 93% of its time starting node and bun twice
per case (474 processes for work-items alone). One process per engine
per suite cuts the local full sweep from about 2 minutes to 22 s with
byte-identical findings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 3ae269a Nov 23, 2026
71 checks passed
@kyle-sexton
kyle-sexton deleted the feat/evals-validate-stale-refs branch November 23, 2026 02:07
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant