Repository navigation
fix(hooks): remove model-rule false positives with principles and eval fixtures - #163
Conversation
Add fixtures and expect.yml for command-query-naming and error-message-names-operation: the false positives found in agent-config (check_paths, Review.judge, a message built by a helper) as clean cases, and real violations as defects. Exclude the planted fixtures from ruff, ty and vulture. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…wider state command-query-naming: rewrite criteria "false" as one principle: only a verb that unambiguously promises a pure read or an effect makes a promise; any other verb promises neither. No verb list is added. error-message-names-operation: send the whole file (state located). The message is often built by a helper beside the raise, which the local state did not show; located had no false positive on the eval fixtures and graph still had one. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The principle-only rewrite regressed the eval: a memoizing query and a command that returns its own result were flagged again. State both as part of what a promise means, not as examples. Add a clean fixture for a raise that the same function catches and wraps. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Four more clearly violating and two more conforming cases per language (8 violations and 8 conforming in total), so the fitted cutoff does not rest on four defects. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…lines On the 8 violating and 8 conforming fixtures per language, the highest conforming case scored 0.58 (Python) and 0.66 (TypeScript) and every violation scored above it. Set the cutoffs to the midpoints of those gaps (0.76, 0.79) and say so in the rule headers. Accept the last eval runs as baselines so that `jev-lint eval --replay` can check the rules without requests. The TypeScript error-message rule declares why its corpus is blind at the boundary. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review summaryNo blocking findings (P0: 0, P1: 0). Checked:
Not verified: I could not fetch jev-lint 0.7.0 here, so two things are untested: that Findings:
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
… range The headers quoted means without saying so. Give the means and the worst single pass, and record that no fixture lies between the conforming and the violating cases, so the eval cannot place the cutoff within that range. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
レビューのまとめ止める必要のある指摘(P0 / P1)はありません. 確認したこと
指摘
確認できなかったこと
🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…ssage suite Mirror the Python projectTargets case: a throw inside a try that the same function catches and wraps, so a regression on that pattern shows in the TypeScript eval too. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ror fixture The projectTargets fixture scored 0.50 on average and flipped across the 0.5 cutoff, while every violation scored 0.95 or more. Fit the cutoff to 0.75 and accept the new baseline. The corpus is no longer blind at the boundary, so the inconclusive note is dropped. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryNo blocking findings (0 × P0/P1). One P2 is posted inline. What I checked:
Finding:
Minor and not posted: the header of 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dff26bd0a7
ℹ️ 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".
Add a test that runs `jev-lint eval --replay` over the model rules, so a moved fixture line, an edited cutoff or criteria, or a stale exemption fails CI without a key. Match the vulture fixture exclusion against absolute paths: the relative pattern did not exclude the fixtures when vulture saw absolute paths. Update the cutoff comments and the test docstring that still called the cutoffs unfitted. Refs #74 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryNo blocking findings (P0: 0, P1: 0, P2: 0, P3: 0). What I checked:
A non-blocking risk the PR already records: M-05 has no fixture between the clean and bad scores, so a violation scoring about 0.6–0.75 would now be dropped silently. The plan to add a borderline fixture and refit is the right follow-up. 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🤖 I have created a release *beep* *boop* --- ## [0.1.2](v0.1.1...v0.1.2) (2026-11-12) ### Features * **hooks:** add Go and Rust model rules with eval fixtures ([#158](#158)) ([9731488](9731488)) * **hooks:** show model-rule timing and skip rule fixtures ([#157](#157)) ([d0c32ae](d0c32ae)) * **hooks:** show the model rules as one result line with cost ([#170](#170)) ([41b9033](41b9033)) ### Bug Fixes * **hooks:** allow a jq filter after read-only GraphQL queries ([#180](#180)) ([cfb80d8](cfb80d8)) * **hooks:** keep model-rule eval fixtures out of Stop test verification ([#160](#160)) ([a4f1c6c](a4f1c6c)) * **hooks:** read paths literally in every jev-lint child process ([#173](#173)) ([0d2c683](0d2c683)) * **hooks:** remove model-rule false positives with principles and eval fixtures ([#163](#163)) ([b07fc4e](b07fc4e)) * **hooks:** report one count per runner in the Stop test lines ([#177](#177)) ([0f36b82](0f36b82)) * **hooks:** take the model-rule cached count from the dry-run plan ([#167](#167)) ([c87fdfd](c87fdfd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
Stop で動くモデル判定(M-05,M-21)の誤検知を,原因ごとに 1 か所ずつ直しました.直し方は,例を eval の fixtures に入れ,ルールの文章には原則だけを書く形です.
expect.ymlを Python / TypeScript の M-05,M-21 に追加しました.実際に出た誤検知を「違反ではない例」に,本当の違反を「違反の例」に入れています.criteria."false"を原則に書き直しました(はっきり「読むだけ」か「何かを変える」かを示す動詞だけが約束になり,それ以外の動詞は何も約束しません).動詞の例は増やしていません.state)をlocalからlocatedに変えました.jev-lint eval --replayはモデルへの問い合わせなしで確認できます.この replay を pytest(tests/test_model_rule_files.py)で実行し,fixtures の行の移動やカットオフの変更で CI が失敗するようにしました.Refs #74
計画:#74 (comment)
原因の分類と直し方
provider_adapter.py付近(別関数が組んだメッセージ)state: located(Python / TypeScript)project_targets(内側の raise を同じ関数で捕捉して包み直す)_check_paths,Review.judgecriteria."false"を原則に書き直しthresholdを当てはめ値にload_portM-21 の
stateの比較(Python の fixtures 8 件,3 回)--dry-run)located は 1 ケースあたり約 $0.0004 で,費用の差はわずかです.
eval の記録(ラウンド 1〜4)
thresholdで採点し直したものです(jev-lint eval --accept-lastと--replay.モデルへの問い合わせなし).projectTargets(内側の throw を捕捉して包み直す)の fixture を足したところ,平均 0.50(3 回で 0.51 / 0.55 / 0.43)とカットオフ 0.5 に重なり,判定が揺れました.これはカットオフの問題として扱い,当てはめ値 0.75 にしました(違反 4 件は 0.95 以上).--replayで揺れ 0,4 スイートとも baseline どおりです.inconclusiveは不要になり(--replayが stale として指摘),外しました.M-21 TypeScript の違反側の余裕は 0.20,違反ではない側は 0.25 で,まだ小さい部分は残ります.規則の対応表(#74)
agents/AGENTS.mdagents/hooks/lint/model-rules/{python,typescript}/command-query-naming/rule.ymlfixtures/とexpect.yml(各 16〜17 件)agents/skills/python-styleほかagents/hooks/lint/model-rules/{python,typescript}/error-message-names-operation/rule.ymlfixtures/とexpect.yml(各 8〜9 件)指摘は助言として返すだけで,止めません(ADR-0021 のまま).
検証
uv run pytest -n auto tests:4738 件通過,1 件スキップ(リベース後)ruff check,ruff format --check,ty check:通過(fixtures は除外)jev-lint rules -R agents/hooks/lint/model-rules:6 件読み込み,エラー 0jev-lint eval --replay agents/hooks/lint/model-rules:4 スイートとも保存した baseline のとおり計画との差分
state,M-05 は原則とカットオフで満たしました.projectTargetsの fixture を追加した結果).🤖 Generated with Claude Code