Repository navigation
feat(hooks): add Go and Rust model rules with eval fixtures - #158
Conversation
|
@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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review summaryNo blocking findings (0 × P0/P1). The rules are advisory (warning only, never promoted to a gate) and the hook code is unchanged, so none of these can break the Stop hook. 4 × P2 and 1 × P3 are posted inline:
Not verified: |
|
@codex review |
Review summaryNo blocking findings (0 P0 or P1). One finding, posted inline:
What I checked:
Not verified: I didn't run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1395cd622
ℹ️ 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".
|
@codex review |
Review summaryNo blocking findings (0 × P0/P1). Checked:
The new tests skip when Findings:
🤖 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: b6bfa95f76
ℹ️ 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".
|
@codex review |
Review summaryNo blocking findings, and no inline comments. What I checked:
Two things are untested:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7396789a99
ℹ️ 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".
|
@codex review |
Review summaryNo blocking findings (no P0/P1). The rules are additive and advisory, and the hook code is unchanged. Adding P2
Not verified here: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 995efe3057
ℹ️ 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".
|
@codex review |
Review summaryI reviewed the six new Go/Rust model rules, their fixtures and Blocking findings: 0 (no P0 or P1).
What I checked:
I could not run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38d87d0790
ℹ️ 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".
38d87d0 to
16a6e13
Compare
… the ok_or gap Refs #74, #164 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… several lines Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… fixture Also stop tracking the Rust M-60 last.json. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
de89bf1 to
3daefa8
Compare
|
@codex review |
Review summaryNo blocking findings (P0: 0, P1: 0). No inline comments posted. What I checked:
Limitation: Considered but not raised as findings (known, documented trade-offs that cost only extra subjects, not wrong verdicts): the Go M-60 matcher selects any |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3daefa8a90
ℹ️ 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".
|
@codex review |
Review summaryI found no P0–P3 problems I'd report. Blocking findings: 0. What I checked:
Limitations:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 513d91274f
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
…0 suites (#178) ## 概要 Go の `command-query-naming`(M-05)と `known-defect-marker-names-removal`(M-60)に,違反に近い見た目の「本当に準拠している」境界フィクスチャを足し,`inconclusive:` を外しました.残っていた `inconclusive:` はこの 2 つだけで,これで 3 スイートすべてが外れます(Rust M-21 と Go M-21 は #158 / #175 で対応済み). Closes #164 ## 変更 | スイート | 追加した clean | 理由(ルールの基準に照らして) | | ------------------------------------ | ------------------------- | -------------------------------------------------------------------- | | go/command-query-naming | `FindLargest` | 読み取りの名前で,ソートするのは自分のコピーだけ.引数は変えない | | go/command-query-naming | `(*Review).Refresh` | 効果を示す名前で,ファイルを読むが,効果は自分のフィールドの置き換え | | go/known-defect-marker-names-removal | `TestNeedsNewerToolchain` | 既知の不具合ではなく,ツールチェーンの不足による skip | | go/known-defect-marker-names-removal | `TestUntilRelease` | コメントが,修正を含むリリースを示している | | go/known-defect-marker-names-removal | `TestPinnedTransport` | 削除条件が依存のバージョン更新 | | go/known-defect-marker-names-removal | `TestUpstreamTicket` | 削除条件が外部 issue のクローズ | ルール文(criteria)は変えていません.フィクスチャの `import` を 1 行足したため,既存 clean の行番号を +1 しました. ## 評価(user が実行した eval,`--no-config`) | スイート | tp / fp / fn | cleanTop | fitted | 以前の cleanTop | | ------------------------------------ | ------------ | ------------------------------- | ------ | --------------- | | go/command-query-naming | 4 / 0 / 0 | 0.30 | 0.63 | 0.24 | | go/known-defect-marker-names-removal | 8 / 0 / 0 | 0.27(`conforming_test.go:31`) | 0.56 | 0.24 | - 新しい M-60 の clean は 0.03〜0.20 で,境界には届きませんでした.境界は既存の `conforming_test.go:31` に依存しており,このケースのスコアの揺れ(spread)は 0.16 です.今後 replay が blind と判定する場合は,この揺れが原因として疑われます. - Go の M-05 の境界は,まだ端にあります.最高の clean は約 0.26 で,閾値からの余白は約 0.24 と,blind と判定される 0.25 の線ぎりぎりです.新しい 2 件の clean(`FindLargest`,`Refresh`)は 0.07〜0.12 で境界には届いていません.なお,レビューの指摘を受けて,意図せず 0.40〜0.48 になっていた helper `reload` は `Refresh` に inline しました. - 新しい M-60 の clean を境界に当てるために,ルール文を曲げることはしていません. - baseline の `last.json` は他のスイートと同様にコミットしていません. ## 検証 - `uv run --frozen pytest`:4718 passed,1 skipped - `jev-lint eval --replay --no-config agents/hooks/lint/model-rules/go`:3 スイートすべて「same decisions」 ## #164 の受け入れ条件 - Rust M-21 の `ok_or` / `ok_or_else` / `map_err`,`cfg_attr` の属性ノード照合:PR #175 など,先行 PR で完了 - 3 スイートの境界フィクスチャと `inconclusive:` の削除:この PR で完了 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
🤖 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>
…#191) Refs #74, Refs #196(`agents/AGENTS.md` の言語非依存規則).計画:#74 (comment) ## 概要 `agents/AGENTS.md`(General / Development Workflow / Coding Guidelines)の全規則を棚卸しし,最も安い判定手段に振り分けた. - jev-lint model rule を 5 規則 × 4 言語(python / rust / go / typescript)= 20 件追加(`agents/hooks/lint/model-rules/<language>/<id>/rule.yml`,`threshold: 0.5`,`severity: warning`).ADR-0021 に従い,該当する文章は残す.fixture / eval / baseline は deferred(未追加). - 新しいプロジェクトは furedea/template-* からだけ作られるため,4 つの template(go / python / rust / typescript)の main の `.ls-lint.yml`(ディレクトリは kebab-case,ファイルは snake_case)と `.commitlintrc.yml`(`@commitlint/config-conventional`,lefthook の `commit-msg`)が覆う 3 行を `agents/AGENTS.md` から削除した. - ast-grep 規則は 0 件.言語固有の `rules/<language>/` は各言語レーンの領域のため触らず,候補を「後続」に記載. - 追加テスト:`tests/test_agents_md_model_rules.py`(matcher が選ぶ関数を 4 言語で検証,`--dry-run` でキー・ネットワーク不要). - 共有ファイルの変更(理由): `tests/test_model_rule_files.py` の `subjects_by_rule` を既存 3 規則 ID に絞った.新規則が同じ sample の関数を選ぶため,既存の厳密なカウント比較が壊れるため. ## 文章と規則の対応表 | 規則 ID | 元の場所 | 元の規則(原文) | 判定 | 実装 | 例のテスト | 元の文章の扱い | | -------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | — | `agents/AGENTS.md:3` | Think in English, but generate responses in Japanese | 文章のまま | — | — | 残す(エージェントの思考と応答言語はコードに現れない) | | — | `agents/AGENTS.md:4` | Use "," and "." in Japanese | 文章のまま | — | — | 残す(日本語の文章は対象外の言語.構文で判定できない) | | `ls-lint` dir | `agents/AGENTS.md:5` | Directory names: Use hyphens (-) | 既存 linter(template-go / python / rust / typescript の ls-lint `.dir`) | 各 template の `.ls-lint.yml` | 既存 | 削除 | | `ls-lint` file | `agents/AGENTS.md:6` | File names: Use underscores (\_) | 既存 linter(template-* の ls-lint `.*` / `.md` など) | 各 template の `.ls-lint.yml` | 既存 | 削除 | | — | `agents/AGENTS.md:7` | Write documentation, code comments, and commit messages in English for public repositories… | 文章のまま | — | — | 残す(言語は判定できるが,リポジトリが公開かどうかは文脈) | | `commitlint` | `agents/AGENTS.md:8` | follow Conventional Commits rules | 既存 linter(template-* の commitlint `config-conventional`,lefthook `commit-msg`) | 各 template の `.commitlintrc.yml` | 既存 | 削除 | | — | `agents/AGENTS.md:9` | Implement based on TSDD | 文章のまま | — | — | 残す(開発手順) | | — | `agents/AGENTS.md:10` | Read web pages with web-fetch; `curl` only for local servers… | 文章のまま(コマンドガードが別途強制) | — | — | 残す(hook の領域.規則 registry の対象外) | | — | `agents/AGENTS.md:12-18` | Development Workflow(skill の順序) | 文章のまま | — | — | 残す(手順) | | — | `agents/AGENTS.md:22` | Existing project style takes precedence | 文章のまま | — | — | 残す(優先順位の宣言) | | — | `:24` | Keep files focused: high-level code before lower-level details… | 文章のまま | — | — | 残す(ファイル全体の構成判断で 1 関数から決まらない.言語レーンの `max-lines` 系 linter が長さのみ覆う) | | — | `:25` | Before writing new code, check existing code / stdlib… | 文章のまま | — | — | 残す(書く前の行動.コードに残らない) | | `construction-separate-from-execution` | `:26` | Separate object creation/configuration from execution logic | 動的(jev-lint,0.5) | `model-rules/{python,rust,go,typescript}/construction-separate-from-execution/rule.yml` | matcher: `tests/test_agents_md_model_rules.py`(fixture は deferred) | 残して併記 | | — | `:27` | Keep classes and modules single-purpose, cohesive, loosely coupled, minimally public | 文章のまま | — | — | 残す(モジュール間の依存は 1 関数・1 ファイルで判定できない.`function-single-purpose` が関数単位を一部覆う) | | — | `:28` | Name classes by responsibility; order methods public-to-private; use DTOs at boundaries | 文章のまま(一部 ast-grep 候補) | — | — | 残す(クラス名の責務は意味判断.メソッド順序は ast-grep の `follows` / `precedes` で書けるため後続候補) | | — | `:29` | Keep domain enums and exception classes near their owner; one exception per failure concept | 文章のまま | — | — | 残す(複数ファイルにまたがる配置判断) | | `function-single-purpose` | `:30` | Keep functions single-purpose at one abstraction level, with short variable lifetimes and guard clauses over nested conditionals | 動的(jev-lint,0.5)+既存 linter | `model-rules/*/function-single-purpose/rule.yml`.入れ子は ruff `PLR1702`(max-nested-blocks 2),clippy `excessive_nesting`,revive `max-control-nesting`,oxlint `max-depth` | matcher 4 言語 | 残して併記(変数の生存期間と guard clause は jev-lint 規則が直接問わない.ruff `RET505` などは後続) | | — | `:31` | Extract a function when its name states intent; do not split merely to shorten | 文章のまま | — | — | 残す(抽出すべきかは設計判断で yes/no にできない) | | 既存 linter | `:32` | Treat argument, nesting, and complexity limits as design signals… | 既存 linter(数値上限)+文章のまま(対処方針) | ruff `PLR0913`(max-args 3)・`PLR1702`・`C901`(10),clippy `too_many_arguments`(3)・`excessive_nesting`・`cognitive_complexity`,golangci `revive:argument-limit`・`max-control-nesting`・`gocognit`・`gocyclo`,oxlint `max-params`・`max-depth`・`complexity` | 既存 | 残す(上限は linter が覆うが,「分割する・導出できる引数を落とす・名前付き型にまとめる」という対処と,匿名の dict / tuple / object にまとめない指示は覆わない.後者は 1 関数から判定できる候補だが,dict / tuple は正当な利用が多く selector で絞れないため文章のまま) | | — | `:33` | Split duplicated logic, control structures, mixed responsibilities, command/query behavior | 文章のまま(command/query は既存 `command-query-naming`) | — | — | 残す(重複はファイル横断.command/query は M-05 が覆う) | | `command-query-naming`(既存) | `:34` | Name one concept with one word; name command functions for their side effects and query functions for the value they return | 動的(既存 jev-lint M-05)+文章のまま | `model-rules/*/command-query-naming/rule.yml` | 既存 | 残す(「1 概念 1 語」はリポジトリ横断) | | — | `:35` | Let name length match scope size; units, trust/safety attributes, boolean prefixes | 文章のまま | — | — | 残す(スコープと名前の釣り合いは構文では決まらない.boolean 接頭辞は型推論が必要で selector が絞れない.ruff `N` は命名規約のみ) | | `no-comment-restating-code` | `:36` | Minimize comments and docstrings; use them for public APIs, TODOs, non-obvious constraints, intent | 動的(jev-lint,0.5) | `model-rules/*/no-comment-restating-code/rule.yml` | matcher 4 言語 | 残して併記(public API の docstring は ruff `D` / clippy / revive `exported` が別に覆う) | | `no-reaching-through-collaborators` | `:37`(Law of Demeter) | Prefer DRY, YAGNI, and Law of Demeter | 動的(jev-lint,0.5,Demeter のみ) | `model-rules/*/no-reaching-through-collaborators/rule.yml` | matcher 4 言語 | 残して併記(DRY は複数ファイル,YAGNI は要求との照合が必要で文章のまま) | | — | `:38` | Apply SOLID pragmatically… | 文章のまま | — | — | 残す(設計原則.実用判断を含む) | | — | `:39` | Separate policy from details; delay database / framework decisions | 文章のまま | — | — | 残す(アーキテクチャ判断) | | — | `:40` | Prefer Value Objects over raw primitives… | 文章のまま | — | — | 残す(値の不変条件は使用箇所をまたいで決まる) | | `no-exposed-mutable-collection` | `:41` | Prefer Collection Objects…; do not expose mutable raw collections | 動的(jev-lint,0.5,後半のみ) | `model-rules/*/no-exposed-mutable-collection/rule.yml` | matcher 4 言語 | 残して併記(Collection Object を使う方針は文章のまま) | | — | `:42` | Use Entities only when stable identity matters | 文章のまま | — | — | 残す(ドメイン判断) | | — | `:43` | Use classification objects/enums when categories or state transitions have domain rules | 文章のまま | — | — | 残す(ドメイン判断.clippy `exhaustive` 系は網羅のみ) | | — | `:44` | Parse raw input into constrained types once at the boundary | 文章のまま | — | — | 残す(同じ値の再検証は呼び出し関係をまたぐ) | | — | `:45` | Make invalid states unrepresentable; Result for expected failures; handle sum types exhaustively | 文章のまま+既存 linter(網羅のみ) | golangci `exhaustive`・`gochecksumtype`,rustc の `match` 網羅は既定 | 既存 | 残す(型設計と,テストが要る業務規則の線引きは判断.網羅検査の部分だけ linter が覆う) | ## 規則一覧(jev-lint) 5 規則とも `severity: warning`,`threshold: 0.5`,Stop 時の助言のみ(ADR-0021).selector は各言語の関数 / メソッド宣言(typescript は変数に束ねたアロー関数も含む). | id | selector の絞り込み | | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `function-single-purpose` | 変更された全ての関数(matcher は意図的に広く取る.見逃しは黙って失敗し,無関係な 1 件は読むだけで安い.ユーザー判断で 30 行の絞り込みを削除) | | `construction-separate-from-execution` | オブジェクト生成(python: 大文字始まりの呼び出し.`*Error` などは除外,typescript: `new`.`Map` / `Set` / `*Error` などは除外,go: `NewX`,rust: `::new` など.標準の collection / smart pointer は修飾パス込みで除外)を含む関数 | | `no-reaching-through-collaborators` | `a.b.c.d(...)` 形の呼び出し連鎖を含む関数 | | `no-comment-restating-code` | コメントを含む関数 | | `no-exposed-mutable-collection` | python: `return self.X`,typescript: `return this.X`,go: `return r.X`,rust: 戻り値型に `&mut` を含む関数 | ## 波 2: linter で有効化する規則 この PR の範囲では有効化する linter 規則は 0 件.候補(言語レーン側で扱う): ruff `RET505`(guard clause,`:30`),method 順序の ast-grep(`:28`). ## ast-grep hit 数 ast-grep 規則を追加していないため 0 件(既存規則の scan は変更なし). ## 検証 - `nix develop --command uv run pytest tests/test_ast_grep_rules.py tests/test_model_rule_files.py tests/test_agents_md_model_rules.py`: 通過 - `nix develop --command uv run pytest`(CI と同じ全体): 4873 passed, 1 skipped - `jev-lint rules --no-config -R agents/hooks/lint/model-rules`: 0 error(既存 `command-query-naming` の言語間 drift 警告は変更前から) ## Stop の subject 上限(20 → 250)の測定 `jev-lint review --dry-run --json`(モデル呼び出しなし,ネットワークなし,全 model rule,`--exclude "**/fixtures/**"`)を,この repository の merge 済み PR と本 PR の差分に対して実行した.jev-lint は 1 ファイルを 1 リクエストにまとめ(最大 256 subject),リクエストは並列(既定 32)に走るため,所要時間はリクエスト数で決まる. | 対象 | 差分 | subjects | requests | tokens | 推定 USD | | ----------------------------- | -------------------- | -------- | -------- | ------ | -------- | | #175 | 21 files, +1074/-616 | 3 | 1 | 2,421 | 0.00010 | | #158 | 37 files, +3667/-955 | 14 | 1 | 8,807 | 0.00037 | | #187 | 5 files, +120/-16 | 26 | 4 | 15,760 | 0.00066 | | 本 PR(`origin/main~2` 基準) | 29 files, +1127/-23 | 83 | 8 | 49,513 | 0.00208 | | #170(最大) | 12 files, +242/-103 | 104 | 10 | 58,723 | 0.00247 | - 1 subject あたり約 560 token,約 0.000024 USD. - 所要時間:ネットワーク無しでは測れないため,この環境の記録済み Stop 実行 30 件(`~/.local/state/agent-harness/verification/*/*/results.json` の `model_rules` レシート)を使った.1〜8 リクエストで 2.7〜7.9 秒(subject 数・judged 数にほぼ依存しない).90 秒の Stop 予算(`BUDGET_SECONDS`)に対し十分な余裕がある. - 上限 250 は,測定した最大の session(104)の約 2.4 倍で,上限いっぱいでも約 0.006 USD / Stop.スキップした subject は従来どおり報告する. - 提案(未実装): 上限を単一の数でなく Stop の残り時間に比例させる案.今回は測定上 250 で時間・費用とも余裕があるため,実装しなかった. ## 後続 - fixture / eval / baseline の追加(deferred.ユーザー指示で今回は対象外.`test_every_go_and_rust_rule_ships_an_eval_suite…` は既存 3 規則のみを検査するため,追加分は検査されない) - method 順序の ast-grep 規則(各言語レーン) - 他レーンも `tests/test_model_rule_files.py` を編集する場合,`subjects_by_rule` の変更が競合し得る ## レビュー上限により保留した指摘(#196 で対応) - [x] `no-comment-restating-code` / `no-exposed-mutable-collection` の selector が広い:コメントは TODO / lint・型・ビルドの directive を除き,Python の docstring も選ぶ.公開コレクションは,python は public メソッドが `self._x` を返す場合,typescript と go は戻り値型が配列 / map / slice の場合に絞った. - [x] Go の `no-exposed-mutable-collection` がスカラー getter を選ぶ:go は戻り値型が slice / map の関数だけ選ぶ. - [x] Python の docstring を選ばない:関数先頭の docstring を selector に追加し,テストを追加した. - [x] Stop の `SUBJECT_CAP`(20,ファイル単位)で規則が増えた分が漏れる:eval baseline を持つ規則(調整済み)と持たない規則を 2 つの review(tier)に分け,調整済みの tier が先に cap を使う.未調整の規則が cap を超えても,調整済みの規則の判定は落ちない.`model_rules_gate.rule_tiers`,`Review.rules` を複数の `-R` に対応.テスト:`tests/hooks/test_model_rules_tiers.py`.既存の hook テストは 1 tier に固定(`install_fakes`). ## 追加の対応(#196) - 後段の review が失敗しても先行 tier の指摘を保持し,その run はレシートを保存しない(次の Stop で再試行).`Judgement.failed_reviews`. - レシートの入力フィンガープリントに `baseline.json` の有無を含めた. - Rust の `no-exposed-mutable-collection` は slice / 配列 / 標準 collection への `&mut` に絞った. ## レビュー上限により保留した指摘(follow-up) #196 の再レビューが 3 回に達したため,次は修正せず保留した(`Deferred to a follow-up Issue (review limit).`). - 後段の review が失敗し,先行 tier に指摘がある場合,レシートが無いので入力が同じでも毎ターン同じ指摘で block する(通知済みの状態は保存し,未完了の tier だけ再試行する) - 後段の review の失敗理由(`Prevented.reason`)が捨てられ,`incomplete` としか表示されない.`skipped_files=1` も実際のファイル数でない(理由を `Judgement` に載せる) - `_Changes.reviews` が作る 2 tier の順序(調整済み committed,調整済み uncommitted,未調整 committed,未調整 uncommitted)のテストが無い - Python の `no-exposed-mutable-collection` が公開名のフィールド(`return self.items`)を選ばない(#196 (comment)) - TypeScript の `no-exposed-mutable-collection` が戻り値型を省略したメソッドを選ばない.`Readonly*` 型も選んでしまう(同上) - Go の `no-exposed-mutable-collection` が複数戻り値(`([]string, error)`)を選ばない.Rust の同規則が明示的ライフタイム付き(`&'a mut Vec<T>`)を選ばない(#196 (comment)) - Go の `construction-separate-from-execution` が `package.New(...)` 形を選ばない.Go の `no-exposed-mutable-collection` が名前付き slice / map 戻り値型を選ばない.Go の `no-comment-restating-code` が関数直前の doc comment を選ばない(#196 (comment)) - `no-comment-restating-code` が関数の直前の(兄弟の)コメントを選ばない.Go と TypeScript で指摘され,Python と Rust も同じ構造で同じ穴がある.4 言語まとめて一度に直す(#196 (comment)) - `no-reaching-through-collaborators` が呼び出しで終わらないプロパティ参照の連鎖(`order.customer.address.city`)を選ばない.TypeScript で指摘され,他の 3 言語も同じ穴.4 言語まとめて一度に直す(#196 (comment)) - Rust の `construction-separate-from-execution` が turbofish 付き(`ApiClient::<Config>::new()`)を選ばない ## 文章の扱い(方針変更) 新しいプロジェクトは template-* からだけ作られるため,template の linter が完全に覆う文章は削除する.上の表の 3 行(`:5` `:6` `:8`)がそれに当たる.jev-lint 規則の文章は変更しない. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
概要
Stop で動くモデル判定に Go と Rust を足します(計画 のレーン C).M-05,M-21,M-60 を言語ごとに
agents/hooks/lint/model-rules/{go,rust}/<id>/へ置き,フックのコードは変えていません(ローダーはmodel-rules配下を全部読む).fixtures/に入れ,expect.ymlで行ごとにラベルを付けました(1 ルールあたり違反 4 件,違反ではない例 2〜4 件を明示).jev-lint eval)はユーザーが実行し,結果とベースラインを下の「eval の結果」に書きました.ルールの対応表
agents/AGENTS.mdCoding Guidelinesmodel-rules/{go,rust}/command-query-naming/rule.yml(Go はfunction_declarationとmethod_declaration,Rust はfunction_item.テスト関数は対象外)fixtures/{violating,conforming}.{go,rs}とexpect.ymlgo-style/references/errors.md,rust-style/references/errors.mdmodel-rules/{go,rust}/error-message-names-operation/rule.yml(Go はerrors.New/fmt.Errorfを含む関数,Rust はErr(...)/bail!/anyhow!/ensure!/.context(..)/.with_context(..)を含む関数)python-style/references/testing.md(xfail の規則)model-rules/{go,rust}/known-defect-marker-names-removal/rule.yml(Go はt.Skip/t.Skipf,Rust は#[ignore]/#[ignore = "..."])M-60 は Go と Rust に xfail 相当の印がないため,既知の欠陥で飛ばしたテストをマーカーとみなします.飛ばす理由が欠陥でないとき(
testing.Short(),Docker 不要など)は違反としません.Go と Rust のスタイルスキルに M-60 の文章はなく,元は Python の規則です.決めたこと
criteria."false"は,レーン B が目指す原則の形(はっきり「読むだけ」か「何かを変える」かを示す動詞だけが約束になる)で書きました.レーン B が Python と TypeScript を同じ形にするまで,jev-lint rulesは M-05 の言語間のずれを警告します.divergent:に理由を書いて言語間の警告を消しました.#[test]の後ろに#[ignore]やコメントが続く関数も外しています(jev-lint 同梱のfn-name-promisesは直前の属性しか見ない).確認
jev-lint rules --no-config -R agents/hooks/lint/model-rulesjev-lint review --dry-run --show-subjects(フィクスチャに対して)jev-lint eval --dry-run --no-config <go> <rust>tests/test_model_rule_files.pyに Go と Rust のマッチャーテストと eval スイートの構成テストを追加uv run pytest全体eval の結果
jev-lint eval --no-config <go> <rust>の結果です.6 スイートすべてが fp 0,fn 0 で,保存したベースラインの再採点(jev-lint eval --replay,鍵なし)も 10 スイートすべて合格です.inconclusive:inconclusive:inconclusive:cfg_attrの違反が 0.53〜0.61conforming.rs:34が 0.47 / 0.39 / 0.50 で,開始値 0.5 に当たります.violating.rs:33)が 0.53〜0.61 で,開始値のばらつきの範囲内です.inconclusive::rule.ymlに書きました.baseline.jsonをコミットしました.main のテストtest_every_saved_eval_baseline_still_scores_as_acceptedが全スイートの保存済みベースラインを再採点するためです.リポジトリのルートから相対パスで取り直したので,パスは相対です(main の Python と TypeScript の 4 件も同じ方法で取り直しました.絶対パスが残らないことをtest_no_saved_eval_baseline_records_an_absolute_pathで確かめます).last.jsonはコミットしません.計画からの変更
なし.
Refs #74
🤖 Generated with Claude Code