Skip to content

feat(testing): treat an exact error-message assertion as a change detector unless someone reads it - #15917

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-15838-43393826821-1
Nov 13, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-15838-43393826821-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #15838

Summary

Opened by the work-resolve-issue lane. The run's own summary:

/testing:test-value's judgment-only list now says that asserting an exact error message is a change detector unless a caller or user reads the message: the error type callers branch on is the contract, and a user-facing or published message stays asserted, marked cant-fail-ok: <why>. There is no new audit rule or setting. The good examples that pinned a message now either assert a named error type (the two pytest corpus fixtures) or say the message is the contract (the skill's paired-presence example, and the jest, vitest and NUnit repaired-4b fixtures). The pytest adapter comment and the audit scanner's rule-weak-oracle fix text no longer recommend matching the message. Eval cases: the skill has eval cases (plugins/testing/evals/tv-*), and this PR adds tv-exact-error-message-detector for the rule and its exemption. The two-version compare (opus vs sonnet, three runs per side, --case tv-exact-error-message-detector, a --max-cost-usd ceiling, no new batch after a usage-limit error) has not run yet: it needs the one local eval-runner session, which this lane cannot reach. Dogfooding step: this repository dogfoods a change by shipping it on main to the operator's hosts first; consumers get it later through the plugin version bump (plugins/performance/reference/techniques.md:656, 'Staged rollout'). The bump here is a patch, through .changes/testing/. Choice of means: the scanner fix text and the three non-pytest fixtures are outside the issue's three named places. They were changed because a fresh-context review found them contradicting the new rule; the fixtures got comment-only edits so their scanned code stays the same.

Remaining work

  • Run the new eval case tv-exact-error-message-detector on a two-version compare (opus and sonnet aliases, three runs per side, --case filter, a --max-cost-usd ceiling, no new batch after a usage-limit error) in the one local eval-runner session, and record the result on the PR.

Not verified

  • The audit corpus test (plugins/testing/skills/audit/scripts/cant-fail-scan.test.sh) and the plugin's other suites were not run here; only the scanner ran on copies of the changed fixtures. Left to the PR's CI.
  • The vitest repaired-4b fixture's comment-only edit was not re-scanned (the same comment-header change as the jest and NUnit fixtures, which scanned clean). Left to the PR's CI corpus test.
  • The eval-case validator (validate-cases.py) and the evals-quality check were not run here (CI only per check-affected). Left to the PR's CI.
  • Tidy: tidy-diff ran its code passes (no edits) and docs-hygiene passes (one changelog sentence split). The ai-slop pass ran its rubric only: its deterministic detector (detect.sh) is not among the wrappers this lane may run.
  • The two-version eval compare of tv-exact-error-message-detector was not run: it needs the one local eval-runner session.
  • js-jest/good/jest-repaired-oracles.test.ts.fixture still asserts rejects.toThrow('not found') without a note; its good-for rules do not depend on the message, so it was left as is.

Fix

  • plugins/testing/skills/test-value/SKILL.md: new judgment-only bullet for an exact error message no caller or user reads (fix: assert the type; exemption: a user-facing or published message is the contract, marked cant-fail-ok: <why>); the paired-presence example now says its error text is…
  • plugins/testing/skills/audit/adapters/py-pytest.yaml: the weak-oracle comment no longer reads as endorsing match=; it says the fix names the error type and a message match is a contract only where something reads the message
  • plugins/testing/skills/audit/scripts/cant-fail-scan.sh: the rule-weak-oracle Action text says 'the exception type callers branch on' in place of 'the exact exception type and message'
  • plugins/testing/skills/audit/evals/fixtures/corpus/py-pytest/good/test_pytest_raises.py.fixture: asserts pytest.raises(PriceFormatError) in place of ValueError, match="not a price"
  • plugins/testing/skills/audit/evals/fixtures/corpus/py-pytest/good/test_pytest_repaired_4b.py.fixture: asserts pytest.raises(ParseError) in place of ValueError, match="empty"
  • plugins/testing/skills/audit/evals/fixtures/corpus/js-jest/good/jest-repaired-4b.test.ts.fixture: header comment says the config error's message is shown to the user, so it is the contract
  • plugins/testing/skills/audit/evals/fixtures/corpus/js-vitest/good/vitest-repaired-4b.test.ts.fixture: header comment says the bad-password message is shown on the login form, so it is the contract
  • plugins/testing/skills/audit/evals/fixtures/corpus/cs-nunit/good/CartRepaired4bTests.cs.fixture: header comment says the empty-cart message is shown to the shopper, so it is the contract
  • plugins/testing/evals/tv-exact-error-message-detector/case.yaml: new eval case (skill-fired, a type-is-contract regex, and an llm grader for the rule and its exemption)
  • plugins/testing/evals/tv-exact-error-message-detector/samples/skill-fired.json: grader samples
  • plugins/testing/evals/tv-exact-error-message-detector/samples/type-is-contract.json: regex grader samples (4 pass, 3 fail)
  • .changes/testing/work-resolve-issue-issue-15838-43393826821-1-13902158.md: patch changelog fragment

Verification

The runner ran each check from the base copy against a3e70b9:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 3 fragments valid (run before and after tidy and the review fixes)
  • check-changed-skills: audit and test-value PASS, 0 errors (warnings: body size and growth 193 -> 199 lines, no Gotchas surface)
  • check-affected: 13 passed, 6 skipped over 12 changed files (shellcheck included after the scanner edit)
  • cant-fail-scan --file on scratch copies of the edited pytest fixtures (test_pytest_raises.py, test_pytest_repaired_4b.py): no findings; py-pytest adapter claimed both
  • cant-fail-scan --file on scratch copies of the edited jest and NUnit fixtures: no findings; js-jest and cs-nunit adapters claimed them
  • fresh-context review subagent over the whole diff: 2 confirmed findings (scanner fix text and other-language fixtures contradicting the rule) fixed; regex-coverage NIT fixed by adding toBeInstanceOf and 'type of the error' alternatives; it read the regex against every pass and fail sample by hand
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43393826821

Left out: the items under Not verified.

Related

#15838

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15917, incremental (386c915 → c8f55a5)

No security issues found. This review covers the one file in the incremental scope, and I read every hunk of it.

What changed since the last review

The push changes one line in plugins/testing/evals/tv-exact-error-message-detector/case.yaml. In the type-is-contract regex grader, the [Ee]rror|[Ee]xception character classes become the spelled-out choices Error|error|Exception|exception. The regex matches the same strings as before. It is a grader pattern that runs against an eval's last_message. It reads no untrusted input in a credentialed context and runs no commands. It touches no token, secret or trust boundary.

Checks

  • Trusted paths: the changed file matches no TRUSTED PATHS glob.
  • Trust controls: no trust control is touched.
  • Plugin manifests: no manifest changed.
  • Instruction surface: no standing instruction is deleted, narrowed or softened.
  • Embedded text: the PR context has no directive aimed at this lane.
  • Prior findings: none are open. The only earlier post was the clean summary for 386c915. This lane had already reviewed an earlier head (blocking only: yes), so this review reported only blocking findings.
  • Spend: the eval case can spend prepaid model usage when someone runs it. That is not a hold and not a finding.

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 a3e70b934e7480c50398d690a81357019c65a082; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental): PR #15917, 386c915 → c8f55a5

This lane already reviewed an earlier head of this pull request, so this review reports blocking findings only.

What changed. One line in plugins/testing/evals/tv-exact-error-message-detector/case.yaml:18, in the type-is-contract regex grader. The prefix \b(?:[Ee]rror|[Ee]xception) became \b(?:Error|error|Exception|exception). The rest of the pattern is unchanged.

Checked, no issue:

  • The pattern matches the same strings as before. [Ee]rror matches exactly what Error|error matches, and [Ee]xception exactly what Exception|exception matches. No match was added or lost.
  • The regex samples get the same results. I checked them by reading, not by running anything. In samples/type-is-contract.json, pass sample 1 (error type) still matches this alternative. Pass samples 2–4 match the toThrow(, instanceof and toBeInstanceOf( alternatives, which this edit did not touch. The three fail samples still match none of the alternatives.
  • The settled thread stays settled. The resolved thread on the vitest repaired-4b fixture is on lines this push did not change.

Not verified by this lane. I ran nothing; this lane has no shell. The commit message says the edit fixes failing CI checks. I did not confirm that those checks now pass.

Findings: none blocking.

Verifier dropped 0 of 0 candidates.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM63BKMi
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 386c915.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 386c9157dafec184fc133ab97b0011541c21c8fa. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head c8f55a5e5e479373508b606b00051b0e3fc04995, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for c8f55a5

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15917-c8f55a5e5e479373508b606b00051b0e3fc04995, expires on 2026-12-13.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=c8f55a5e5e479373508b606b00051b0e3fc04995 rubric=8.4.16 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit efa642a Nov 13, 2026
48 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15838-43393826821-1 branch November 13, 2026 10:26
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit efa642a65f17dfbf1c7fad59485a625815ea8a3e; later checks count it verified from this comment.

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.

0 participants