Skip to content

feat(lint): migrate rust-style prose rules to checks - #193

Merged
furedea merged 28 commits into
mainfrom
feat/migrate-rust-style-rules
Nov 15, 2026
Merged

furedea merged 28 commits into
mainfrom
feat/migrate-rust-style-rules

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Refs #74(Rust の style 規則の移行)
Refs #196

計画: #74 (comment)

概要

agents/skills/rust-style/ の規則を,ADR-0021 の優先順(既存 linter → ast-grep → jev-lint → 文章のまま)で分類し直した(全 193 規則).

  • ast-grep: 2 規則を agents/hooks/lint/rules/rust/ に追加(severity: error.静的な規則は linter と同じくブロックする.ユーザー判断).rule-tests/ に各 2 件以上の valid / invalid.
  • jev-lint: 助言のみの 6 規則を agents/hooks/lint/model-rules/rust/<id>/rule.yml に追加.fixture・eval の当てはめ・baseline は延期(ユーザー判断).既存の model rule は変更していない.
  • 既存 linter: template-rust の Cargo.toml で有効な lint が覆う文章を削除.
  • 文章: ast-grep 規則か,template-rust の main の Cargo.toml(確認済み)で有効な lint が完全に覆う文章を削除した.新規プロジェクトは template から作るので,template の設定が規則を実行する(ユーザー方針の変更).lint が覆わない部分(例外,理由,直し方)は残した.jev-lint の規則の文章は ADR-0021 に従い残した.
  • 共有ファイル(sgconfig.yml,tests/,hook のコード)は変更していない.sgconfig.yml は ruleDirs: [rules] で rules/rust/ を拾い,tests/test_model_rule_files.py は fixture を持たない規則を要求しない.

追加した ast-grep 規則(2,すべて severity: error)

rs_no_follow_links,rs_no_mocking_library.

rs_no_follow_links は,note に「必要なら理由つきの // ast-grep-ignore: rs_no_follow_links で例外にする」と書いた.呼び出しの連鎖(receiver chain)が WalkDir::new / walkdir::WalkDir::new / WalkBuilder::new / ignore::WalkBuilder::new から始まるときだけ指摘する(receiver が変数や不明な型なら指摘しない.walker が別の receiver の引数にあるだけの場合も指摘しない).filesystem 以外の follow_links(true) を valid fixture に足した.

rs_no_mocking_library は mockall::mock! だけを指摘し,import なしの mock!(自前のマクロ)は指摘しない.

ブロックする 2 規則すべてに,失敗の理由を書いた message と,そのまま適用できる直し方の note を付けた.

ast-grep から外した規則と理由

ブロックする規則は安定していなければならない.次の規則は review のたびに新しい指摘が出て収束しなかったので,既存の tool に任せるか,文章に戻すことをユーザーが決めた.この基準は ADR-0021 に記録する.

規則 行き先 review の指摘数 不安定の型 例
rs_unit_test_in_test_module clippy tests_outside_test_module(restriction,template-rust の別 PR で有効化.PR はまだ開いていない.入るまで testing.md の文章を残す) 21 1, 3, 4 cfg(testing) を cfg(test) と取り違える.#[cfg(test)] と mod のあいだの /* */ で判定が切れる.mod tests; が読み込む src/tests.rs は,ファイル名だけでは test 専用か分からない
rs_no_path_from_format jev-lint(paths-are-joined-not-formatted,助言のみ) 8 3, 4 文字列の中身を正規表現で解析していて,{} の引数に入れ子で書いた name.replace("/", "_") や,raw string・エスケープしたバックスラッシュ(r"{dir}\\child")の区切りを取り違える.format! / std::format! / alloc::format! と + で同じ意味の書き方が多い
rs_no_get_prefix 文章(types.md,C-GETTER) 7 4 get_or_insert_with や get_mut のような正当な名前,FFI の C シンボル
rs_fs_call_needs_context 文章(errors.md,filesystem.md) 6 2, 4 use で取り込んだ関数名の呼び出しが,同名のローカル関数と区別できない.io::Result を返す薄い wrapper は正当
rs_no_io_in_constructor 文章(types.md) 5 1, 2 Config::parse(path) のように読み込みを役割とする関数.I/O を呼ぶ別の関数に包まれた場合は追えない
rs_no_bool_constructor_arg 文章(types.md,C-CUSTOM-TYPE) 1 1, 4 bool 1 個の with_* や builder の setter は正当
rs_pub_fn_before_private_fn 削除(agents/AGENTS.md に同じ規則がある) 1 2 impl 内の並びは見えない.関連する関数を近くに置くほうが読みやすい場合がある
rs_literal_to_owned clippy str_to_string(template-rust の #20,未マージ.入るまで文章は足さない) 1 4 "x".to_string() と to_owned() と String::from が同じ意味

不安定の型(番号):1 = ファイルの外の情報が要る,2 = データの流れや実行の順番を追う必要がある,3 = 論理式や文法を正規表現で解析している,4 = 同じ意味の書き方が多い.

削除した ast-grep 規則(精度が足りないものはブロックできないため)

以前に追加していた次の規則と rule-tests を削除した.文章は,ast-grep で正確に判定できない推奨なので rust-style に残した(下表).

  • rs_unit_test_in_test_module: ast-grep は cfg の展開とファイルの読み込み関係を判定できず,レビューが収束しなかったため削除した.clippy の tests_outside_test_module(restriction)に置き換える.template-rust への有効化は別の PR(まだ開いていない).入るまで testing.md の文章を残す.
  • rs_no_get_prefix(C-GETTER),rs_no_bool_constructor_arg(C-CUSTOM-TYPE),rs_no_io_in_constructor,rs_fs_call_needs_context: 文章を残す.
  • rs_pub_fn_before_private_fn: 規則と文章を削除(agents/AGENTS.md に同じ規則がある).tooling.md の同趣旨の 1 行も削除した.
  • rs_literal_to_owned: 規則と文章を削除.clippy::str_to_string を template-rust で有効にする別 PR に移す.String::from の形も clippy が扱うため,rust-style に文章は足さない.
  • rs_no_vague_name: 先に削除済み(ユーザー判断).

追加した jev-lint 規則(5)

domain-states-are-enums,public-types-protect-invariants,filesystem-code-keeps-paths-and-symlinks-safe,conversion-and-query-names-follow-rust-convention,serde-types-follow-config-conventions.

jev-lint review --dry-run で,5 規則とも想定した関数・型を subject に選ぶことを確かめた.jev-lint の conversion-and-query-names-follow-rust-convention は parse 自体も選ぶ.tests/test_model_rule_files.py の Rust の件数(既存 3 規則の subject 数)は変わらない.

波 2: linter で有効化する規則

なし.以前に挙げた 7 件(missing_debug_implementations,unreachable_pub,missing_docs,mod_module_files,wildcard_enum_match_arm,iter_over_hash_type,allow_attributes)は template-rust #19 で main に入っており,Cargo.toml を読んで確認した.

文章と規則の対応表(全 193 規則)

「元の場所」は agents/skills/rust-style/references/ からの相対パス(origin/main の行番号).SKILL.md は規則ではなく参照の索引なので表に含めない.コード例のブロックも含めない.ast-grep の「例のテスト」は rule-tests/<id>.yml の(良 / 悪)件数.

元の場所 元の規則(原文) 判定 実装 例のテスト 元の文章
cli.md#L3 Use typed structs and enums for CLI input. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L4 Keep argument parsing separate from execution. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L5 Do not perform filesystem or network work while parsing CLI arguments. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L6 Human-readable command results go to stdout. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L7 Progress, warnings, and diagnostics go to stderr. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L8 Machine-readable output must not be mixed with human logs. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
cli.md#L9 Keep exit codes coarse but meaningful enough for CI. 文章のまま — — 残す(CLI の設計方針.構文から判別できない)
code_style.md#L5 Short-lived CLI tools may use eprintln! for warnings and progress. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L6 Libraries must not initialize global logging. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L7 Use tracing only when the project needs structured logs, spans, or long-running diagnostics. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L8 Keep human diagnostics on stderr and machine-readable command output on stdout. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L9 Include paths, command names, and config keys in diagnostics when they explain the failure. 動的(jev-lint 既存 error-message-names-operation) agents/hooks/lint/model-rules/rust/error-message-names-operation/rule.yml 既存 fixture 残す(診断メッセージの内容の一部)
code_style.md#L13 Avoid manager, helper, util, and common unless the name is already established locally. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L17 Name modules after the domain or action they contain. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L18 Prefer render.rs over renderer.rs for module names. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L19 Prefer install.rs over installer.rs for module names. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L20 Prefer config.rs over config_manager.rs for module names. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L21 Use Renderer or Installer as type names only when the type owns behavior. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L25 Group imports as standard library, third-party crates, then local crate modules. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L26 Let rustfmt sort and format imports when the project enables that behavior. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L27 Prefer explicit imports over glob imports. 既存 linter(template-rust の wildcard_imports) template-rust の Cargo.toml(main で有効を確認) — 削除
code_style.md#L28 Use glob imports only in tests or prelude-style modules where the scope is obvious. 既存 linter(template-rust の wildcard_imports(テストと prelude は既定で許可)) template-rust の Cargo.toml(main で有効を確認) — 削除
code_style.md#L29 Avoid as aliases unless they remove ambiguity or follow a local convention. 文章のまま — — 残す(曖昧さの除去か局所慣習かの判断が要る(as _ など正当な形がある))
code_style.md#L30 Prefer crate:: for crate-local imports and super:: for parent-module test imports. 文章のまま — — 残す(位置の好み.use super::* と crate:: の使い分けは構文から判別できない)
code_style.md#L31 Keep trait imports close to the code that needs method resolution. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L35 Let rustfmt make final whitespace and wrapping decisions. 文章のまま — — 残す(手順.cargo fmt --check が品質ゲートで確認する)
code_style.md#L36 Use trailing commas in multi-line structs, enums, arrays, match arms, and function calls. 既存 linter(rustfmt,cargo fmt --check) 品質ゲートの cargo fmt --check — 削除
code_style.md#L37 Break long method chains at semantic boundaries. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L38 Do not fight rustfmt with manual alignment. 文章のまま — — 残す(手順.cargo fmt --check が品質ゲートで確認する)
code_style.md#L39 Keep one blank line between groups of related items when it improves scanning. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L43 Comments explain why, not what. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L44 Prefer clear types, function names, and module boundaries over explanatory comments. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L45 Public APIs should have doc comments when they are consumed outside the crate. 既存 linter(template-rust の rustc missing_docs) template-rust の Cargo.toml(main で有効を確認) — 削除
code_style.md#L46 Include examples in doc comments only when they should compile as doc tests. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L47 Use //! for module-level documentation. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L48 Use /// for item documentation. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L49 Public fallible functions should document # Errors when the error cases are not obvious. 既存 linter(template-rust の missing_errors_doc) template-rust の Cargo.toml(main で有効を確認) — 削除
code_style.md#L50 Public functions that can panic should document # Panics. 既存 linter(template-rust の missing_panics_doc) template-rust の Cargo.toml(main で有効を確認) — 削除
code_style.md#L51 Architectural choices, dependency decisions, and external-tool boundary rules belong in ADRs. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
code_style.md#L52 Do not write prose specifications that duplicate tests. 文章のまま — — 残す(好み・文脈(命名,コメントの質,空行).構文では判別できない)
config_serialization.md#L3 Use typed structs for project-owned config. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L4 Use serde(deny_unknown_fields) where unknown input keys should be rejected. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/serde-types-follow-config-conventions/rule.yml なし(fixture は延期) 残す(同上)
config_serialization.md#L5 Do not reject unknown keys in external-tool-owned config files. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L6 Use #[serde(rename_all = "...")] to keep serialized field naming consistent. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/serde-types-follow-config-conventions/rule.yml なし(fixture は延期) 残す(同上)
config_serialization.md#L7 Use #[serde(default)] for optional input fields that have stable defaults. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/serde-types-follow-config-conventions/rule.yml なし(fixture は延期) 残す(同上)
config_serialization.md#L8 Use #[serde(skip_serializing_if = "Option::is_none")] when absent values should not appear in output. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/serde-types-follow-config-conventions/rule.yml なし(fixture は延期) 残す(同上)
config_serialization.md#L9 Use #[serde(flatten)] sparingly because it makes schemas less explicit. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L10 Separate fully generated files from user-owned files that receive managed updates. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L11 Do not overwrite user-owned or external-tool-owned config files wholesale. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L12 For managed config sync, update only the keys owned by the project and preserve unknown keys. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L13 Use stable ordering for generated output when review diffs or tests depend on order. 文章のまま — — 残す(設計方針.構文から判別できない)
config_serialization.md#L14 Use a format-preserving edit strategy when comments, ordering, and unknown future keys must be preserved. 文章のまま — — 残す(設計方針.構文から判別できない)
errors.md#L3 Use anyhow::Result at application and CLI orchestration boundaries where errors are reported to humans an… 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L4 Use concrete error types when callers or tests need to distinguish failure categories. 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L5 thiserror is appropriate for deriving concrete error types. Do not introduce it just to wrap every possib… 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L6 Add context at I/O, external command, parse, and config boundaries. 文章のまま — — 残す(静的規則は正当な例外(io::Result の薄い wrapper など)が多く置かない)
errors.md#L7 A low-level error such as "No such file or directory" must include the operation and path. 動的(jev-lint 既存 error-message-names-operation) agents/hooks/lint/model-rules/rust/error-message-names-operation/rule.yml 既存 fixture 残す(同上)
errors.md#L8 Use ? for propagation. 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L9 Do not use unwrap or expect in production code except for impossible states justified by a nearby invar… 既存 linter(template-rust の unwrap_used / expect_used) template-rust の Cargo.toml(main で有効を確認) — 削除
errors.md#L13 Use Result for expected failures. 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L14 Reserve panic! for logic bugs and impossible states. 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
errors.md#L15 Avoid direct indexing when missing data is a normal possibility; use get() or explicit validation. 既存 linter(template-rust の indexing_slicing) template-rust の Cargo.toml(main で有効を確認) — 削除
errors.md#L16 Public APIs that can panic must document # Panics. 既存 linter(template-rust の missing_panics_doc) template-rust の Cargo.toml(main で有効を確認) — 削除
errors.md#L17 Do not leave todo!, unimplemented!, or debugging panic! calls in production code. 既存 linter(template-rust の todo / unimplemented / dbg_macro) template-rust の Cargo.toml(main で有効を確認) — 一部削除(debugging panic! だけ残す.panic! の意図は構文から判別できない)
errors.md#L18 Use unreachable! only when the type system or previous validation makes the branch impossible. 文章のまま — — 残す(設計判断(エラー型の選択,panic の意味).関数単位の yes/no では判定できない)
filesystem.md#L3 Use Path and PathBuf for paths. Do not build paths with string concatenation. jev-lint(paths-are-joined-not-formatted,助言のみ) agents/hooks/lint/model-rules/rust/paths-are-joined-not-formatted/rule.yml - 残す(ADR-0021:jev-lint の規則の文章は残す)
filesystem.md#L4 Treat source tree traversal and symlink creation as separate behaviors. 文章のまま — — 残す(設計方針(所有,テストしやすさ).構文から判別できない)
filesystem.md#L5 Do not follow symlinks while traversing source trees unless the behavior is explicitly required and tested. 静的(ast-grep) agents/hooks/lint/rules/rust/rs_no_follow_links.yml agents/hooks/lint/rule-tests/rs_no_follow_links.yml(良 2 / 悪 2) 残す(規則は follow_links(true) だけ.jev-lint filesystem-code-keeps-paths-and-symlinks-safe も併用.文章は残す)
filesystem.md#L6 Use DirEntry::file_type() instead of Path::is_dir() when symlink behavior matters. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/filesystem-code-keeps-paths-and-symlinks-safe/rule.yml なし(fixture は延期) 残す(同上)
filesystem.md#L7 Keep file-writing operations behind small functions that are easy to test with temporary directories. 文章のまま — — 残す(設計方針(所有,テストしやすさ).構文から判別できない)
filesystem.md#L8 Distinguish files fully owned by the project from files also modified by users or external tools. 文章のまま — — 残す(設計方針(所有,テストしやすさ).構文から判別できない)
filesystem.md#L9 Prefer writing to a temporary file and replacing the target when partial writes would be harmful. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/filesystem-code-keeps-paths-and-symlinks-safe/rule.yml なし(fixture は延期) 残す(同上)
package_design.md#L5 Keep feature flags additive. Enabling a feature should not remove behavior. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L6 Avoid growing default features unless the behavior is truly the default user expectation. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L7 Keep optional dependency features named clearly after the capability they enable. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L8 Test important feature combinations explicitly. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L9 Consider cargo test --all-features when features affect compiled code paths. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L10 Do not use features as a runtime configuration substitute. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L14 Reserve pub for APIs intended to be consumed outside the crate. 既存 linter(template-rust の rustc unreachable_pub) template-rust の Cargo.toml(main で有効を確認) — 削除
package_design.md#L15 Use pub(crate) for items shared across internal modules, including inside private modules when it clarifi… 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L16 Keep items private when they are only used inside the current module. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L17 Keep public APIs smaller than internal APIs. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L18 Avoid exposing third-party types in public APIs unless that dependency is part of the intended API. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L19 Use #[non_exhaustive] for public enums or structs that may need new variants or fields. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L20 Seal traits that downstream crates should not implement. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L21 Treat new public trait implementations as semver-relevant changes. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L22 Do not expose mutable internal collections directly. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/public-types-protect-invariants/rule.yml なし(fixture は延期) 残す(同上)
package_design.md#L26 Prefer functions, traits, and generics before macros. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L27 Add a macro only when it removes repetition that ordinary Rust abstractions cannot express clearly. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L28 Avoid procedural macros unless the project has a strong reason for compile-time code generation. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L29 Keep test helper macros small and obvious. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L30 Do not add build.rs until native linking, environment probing, or code generation is actually required. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
package_design.md#L31 Generated code should have tests or snapshots that make the generated output reviewable. 文章のまま — — 残す(公開 API・feature の設計判断.Cargo.toml や crate 全体の文脈が要る)
testing.md#L6 Use cargo test as the default test command. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L7 Write unit tests in the target source file or module with #[cfg(test)] mod tests. 既存 linter(clippy tests_outside_test_module,template-rust の別 PR で有効化) - - 残す(clippy が template に入るまで文章を残す.規則は削除済み)
testing.md#L8 Use tests/*.rs for integration tests that exercise public APIs or CLI behavior. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L9 Integration tests compile as a separate crate and should use only public APIs. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L10 Use doc tests for public examples that should stay compilable. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L11 Use temporary directories for filesystem tests. Do not touch the real home directory. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L12 Snapshot generated artifacts only when exact output is part of the behavior. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L13 Keep snapshots small and focused. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L14 Prefer fake implementations behind traits over broad mocking libraries. 静的(ast-grep) agents/hooks/lint/rules/rust/rs_no_mocking_library.yml agents/hooks/lint/rule-tests/rs_no_mocking_library.yml(良 3 / 悪 7) 残す(規則は mockall などの使用だけ.fake を優先する指示は残す)
testing.md#L15 Use table-driven tests for the same behavior across multiple inputs. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L16 Use async tests only when the project already has an async runtime requirement. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L22 Scope a run to the changed file with cargo mutants --file <path>; repeat --file for more files. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L23 Read survivors in mutants.out/missed.txt; caught.txt, timeout.txt, and unviable.txt list the other … 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L25 Keep mutants.out/ out of version control. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L29 Unit test: place next to the implementation in the same file or module. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L30 Integration test: place under tests/ when testing public API, CLI behavior, or crate-level wiring. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L31 Helper function: prefer local helper functions when setup is lightweight or argument-driven. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L32 Shared fixture: keep it in the test module first; move to tests/common/ only when multiple integratio… 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
testing.md#L33 Fake implementation: prefer explicit fake types over global mocks. 静的(ast-grep) agents/hooks/lint/rules/rust/rs_no_mocking_library.yml agents/hooks/lint/rule-tests/rs_no_mocking_library.yml(良 3 / 悪 7) 残す(同上)
testing.md#L34 Parameterized cases: use a table of cases and loop over it when one behavior has many inputs. 文章のまま — — 残す(手順・設計方針(コマンド,配置,粒度))
tooling.md#L5 Use Cargo for Rust package operations. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L6 Add dependencies with cargo add <crate> when cargo add is available. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L7 Add development dependencies with cargo add --dev <crate>. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L8 Use cargo check for a fast compile/type-check pass when tests are not needed yet. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L9 Use cargo test for the default verification pass. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L10 Use cargo clippy --all-targets -- -D warnings for linting. 文章のまま — — 残す(手順(コマンド))
tooling.md#L11 Do not edit Cargo.lock manually. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L12 Commit Cargo.lock for applications, CLI tools, and internal tools. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L13 For library crates, follow the repository's existing Cargo.lock policy. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L14 Do not use @latest-style version shortcuts in documentation or committed commands. 文章のまま — — 残す(文書・コミット対象の文字列.Rust の構文ではない)
tooling.md#L15 Do not add a dependency only because it is common. Add it when it removes real boundary complexity or preve… 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L19 Follow Cargo's standard layout. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L20 Store production code in src/. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L21 Keep src/main.rs thin for binary crates. It should parse CLI arguments and call library code. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L22 Put reusable execution logic in src/lib.rs and focused modules under src/. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L23 Store integration tests in tests/. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L24 Keep unit tests near the module when they need private access. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L25 Use examples/ only for runnable examples that should compile. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L26 Avoid utils.rs and helpers.rs; name modules by domain or action. 文章のまま — — 残す(ファイル名の規則(ls-lint の領域だが,template-rust の .ls-lint.yml は utils.rs を禁止していない))
tooling.md#L44 Let rustfmt define formatting. Do not hand-format around rustfmt. 文章のまま — — 残す(手順.cargo fmt --check が品質ゲートで確認する)
tooling.md#L45 Keep files focused and cohesive. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L46 Keep public items before private helpers when it improves scanning. 文章のまま — — 削除(同上)
tooling.md#L47 Use mod.rs only when the existing project already uses that style; otherwise prefer module_name.rs plus… 既存 linter(template-rust の mod_module_files) template-rust の Cargo.toml(main で有効を確認) — 一部削除(「既存プロジェクトが mod.rs を使う場合は例外」だけ残す)
tooling.md#L48 Put one top-level concept per file when the concept has real behavior. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L49 Keep generated code out of hand-written modules unless the project has a clear generated-code convention. 文章のまま — — 残す(手順・プロジェクト方針(コマンド,依存,レイアウト))
tooling.md#L63 Forbid unsafe by default. 既存 linter(template-rust の rustc unsafe_code = "forbid") template-rust の Cargo.toml(main で有効を確認) — 削除
tooling.md#L64 Enable clippy::pedantic as warn, with priority = -1 so that per-lint entries in the same table overri… 既存 linter(template-rust の pedantic) template-rust の Cargo.toml(main で有効を確認) — 削除
tooling.md#L65 Allow an individual lint only with a reason: #[expect(..., reason = "...")] at the site, or a `Cargo.toml… 既存 linter(template-rust の allow_attributes / allow_attributes_without_reason) template-rust の Cargo.toml(main で有効を確認) — 一部削除(サイト単位の指示を削除.Cargo.toml の allow に理由コメントを付ける指示と承認の指示は残す)
types.md#L5 Put module-level constants before types when they configure the following code. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L6 Prefer type aliases and enums before structs that use them. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L7 Put public structs, enums, and traits before their implementations. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L8 Put public functions before private helper functions. 文章のまま — — 削除(規則も削除.公開を先にする規則は agents/AGENTS.md に既にある)
types.md#L9 Keep #[cfg(test)] mod tests at the bottom of the file. 既存 linter(clippy items_after_test_module) clippy の既定(style,all に含まれる) — 削除
types.md#L10 Keep related types and their impl blocks close together. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L14 Derive Debug for most domain structs. 既存 linter(template-rust の rustc missing_debug_implementations) template-rust の Cargo.toml(main で有効を確認) — 残す(lint は公開型だけ.「most domain structs」の非公開型は覆わない)
types.md#L15 Derive Clone, PartialEq, Eq, Ord, or Hash only when the type actually needs that capability. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L16 Keep fields private when the type has invariants. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/public-types-protect-invariants/rule.yml なし(fixture は延期) 残す(ADR-0021: 動的規則は昇格まで文章を残す)
types.md#L17 Use constructors for types with validation or normalization. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L18 Use tuple structs for narrow newtypes and named-field structs when field names improve clarity. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L19 Avoid boolean constructor arguments; prefer an enum or options struct. 文章のまま — — 残す(API Guidelines C-CUSTOM-TYPE.名前から constructor を推測する静的規則は誤検出するため置かない)
types.md#L50 Use enums for fixed states, providers, modes, and policy decisions. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/domain-states-are-enums/rule.yml なし(fixture は延期) 残す(同上)
types.md#L51 Convert user input strings into enums at the boundary. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/domain-states-are-enums/rule.yml なし(fixture は延期) 残す(同上)
types.md#L52 Avoid passing raw string modes through the codebase. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/domain-states-are-enums/rule.yml なし(fixture は延期) 残す(同上)
types.md#L53 Prefer exhaustive match statements for domain control flow. 既存 linter(template-rust の wildcard_enum_match_arm) template-rust の Cargo.toml(main で有効を確認) — 削除
types.md#L54 Implement Display when the enum has a stable user-facing representation. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L55 Implement FromStr or TryFrom<&str> when parsing user input. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L67 Keep functions focused and small. 文章のまま — — 残す(Keep functions focused(関数の責務は agents lane の言語非依存の規則.clippy too_many_lines / too_many_arguments / cognitive_complexity も部分的に覆う))
types.md#L68 Prefer borrowing in parameters: &str, &Path, &[T]. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L69 Return owned values when the function creates or transforms ownership. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L70 Use associated functions for pure construction. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L71 Keep I/O in module-level functions or dedicated service structs, not inside Value Object constructors. 文章のまま — — 残す(静的規則は名前で「値オブジェクトの constructor」を推測するため置かない)
types.md#L72 Prefer Result<T, E> for expected failures. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L73 Prefer early returns for guard clauses. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L74 Avoid async unless the project has real concurrency or nonblocking I/O requirements. 文章のまま — — 残す(プロジェクトの並行性要件.構文から判別できない)
types.md#L78 Borrowed views use as_*: as_str, as_path, as_slice. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/conversion-and-query-names-follow-rust-convention/rule.yml なし(fixture は延期) 残す(同上)
types.md#L79 Consuming conversions use into_*: into_inner, into_path_buf. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/conversion-and-query-names-follow-rust-convention/rule.yml なし(fixture は延期) 残す(同上)
types.md#L80 Cheap copies can use the value name directly: len, status, provider. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L81 Avoid Java-style get_* unless following an existing local convention. 文章のまま — — 残す(API Guidelines C-GETTER.get_or_insert_with や FFI など例外が多く,静的規則は置かない)
types.md#L82 Boolean queries use is_*, has_*, can_*, or should_*. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/conversion-and-query-names-follow-rust-convention/rule.yml なし(fixture は延期) 残す(同上)
types.md#L83 Fallible parsing uses parse, try_from, or from_str. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/conversion-and-query-names-follow-rust-convention/rule.yml なし(fixture は延期) 残す(同上)
types.md#L87 Accept impl AsRef<Path> only at outer convenience boundaries. Inside the codebase, pass &Path. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L88 Accept impl Into<String> for constructors that store owned strings. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L89 Do not clone to satisfy the borrow checker until the ownership model is understood. 文章のまま — — 残す(借用の理解が要る.clippy redundant_clone は nursery)
types.md#L90 Use Cow only when profiling or API shape shows it is worthwhile. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L91 Prefer slices over &Vec<T> in function parameters. 既存 linter(clippy ptr_arg) clippy の既定(style,all に含まれる) — 削除
types.md#L95 Use Vec<T> for ordered sequences. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L96 Use BTreeMap or sorted vectors when deterministic output order matters. 既存 linter(template-rust の iter_over_hash_type)は反復だけを覆う template-rust の Cargo.toml(main で有効を確認) - 一部を残す(出力の順序の部分は lint が覆わないので,「serialize や出力で順序が要るとき」の文を残した)
types.md#L97 Use HashMap when order is irrelevant and lookup dominates. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L98 Do not expose mutable collections directly from domain types. 動的(jev-lint,0.5) agents/hooks/lint/model-rules/rust/public-types-protect-invariants/rule.yml なし(fixture は延期) 残す(同上)
types.md#L102 Use &str for borrowed string input and String for owned string storage. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L103 Use format! when constructing a new owned string from values. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L104 Use captured identifiers in formatting when it improves readability: format!("{name}"). 既存 linter(template-rust の uninlined_format_args) template-rust の Cargo.toml(main で有効を確認) — 削除
types.md#L105 Prefer to_owned() or String::from when converting a string literal to String. 文章のまま — — 削除(規則も削除.clippy::str_to_string へ移す(template-rust に別 PR で有効化))
types.md#L106 Avoid unnecessary to_string() in hot or repeated code. 文章のまま — — 残す(hot path かは構文から判別できない(clippy inefficient_to_string が一部を覆う))
types.md#L107 Keep user-facing text separate from machine-readable output. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L111 Use usize for indexing and collection lengths. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L112 Do not use as for narrowing integer conversions. 既存 linter(template-rust の cast_possible_truncation / cast_possible_wrap / cast_sign_loss) template-rust の Cargo.toml(main で有効を確認) — 削除
types.md#L113 Use TryFrom or try_into when a conversion can fail. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L114 Use newtypes when a number has a domain unit or invariant. 文章のまま — — 残す(設計判断・好み.構文では判別できない)
types.md#L115 Make lossy conversions explicit in the function or variable name. 文章のまま — — 残す(設計判断・好み.構文では判別できない)

#196 の指摘への対応

  • filesystem.md の「文字列連結で組まない」は規則が部分的にしか覆わないので残した.
  • 「template だけで有効な lint は文章を置き換えない」という fix(lint): address review findings deferred from the #74 migration PRs #196 の方針は,その後の方針変更(template から作ったプロジェクトだけが対象)で置き換わった.下記.

template lint の方針変更への対応

template-rust の main の Cargo.toml を読み,有効な lint が覆う文章を再び削除した(unsafe_code,unwrap_used / expect_used / indexing_slicing,todo / unimplemented,missing_panics_doc / missing_errors_doc / missing_docs,wildcard_imports(pedantic),uninlined_format_args,cast_*,wildcard_enum_match_arm,iter_over_hash_type,unreachable_pub,mod_module_files,pedantic,allow_attributes).tooling.md の「Recommended package-level guard」は template の設定の複製なので削除した.agent-config の ast-grep 規則に,有効な template lint と重複するものはない.

現在の hit(修正はこの PR に含めない)

ast-grep scan --config agents/hooks/lint/sgconfig.yml <repo> を読み取りのみで実行した.残した 2 規則(Rust)の hit はすべて 0 件.

repo hit
agent-config 0
agent-harness 0
dotfiles 0

既知の限界

  • jev-lint の規則は fixture と cutoff の当てはめがない(既定の 0.5).昇格するまで助言のみ.

後続の作業(レビュー上限で見送り)

3 回目の再レビューで新たに出た指摘.この PR では直さず,後続の Issue(#196)で扱う.

  • tooling.md の推奨 package-level guard(unsafe_code,dbg_macro,todo,unimplemented)の削除: 既定で allow の lint が残るという指摘.template-rust の lint が覆う文章を削除する方針に沿った変更なので,方針の判断として fix(lint): address review findings deferred from the #74 migration PRs #196 に残す.

  • rs_no_mocking_library: use {mockall::automock}; と pub use mockall::automock;(グループ化・公開された import).

  • conversion-and-query-names-follow-rust-convention(助言のみ): trait のメソッド宣言(function_signature_item)を subject に含める.

  • types.md: to_owned() / String::from の行を削除したが,template-rust に clippy::str_to_string はまだ入っていない.

  • package_design.md: unreachable_pub は crate root から到達できる pub fn を覆わないので,「pub は意図した公開 API だけ」の指針に検査がない.

  • types.md: exhaustive match の行を削除した.template-rust は clippy::wildcard_enum_match_arm を有効にしているが,関連する jev-lint 規則 domain-states-are-enums は助言のみで fixture がなく,ADR-0021 は未昇格の model rule の文章を残す.昇格するまで行を戻すか,fix(lint): address review findings deferred from the #74 migration PRs #196 で判断する.

  • rs_no_follow_links: WalkDir::new(".").into_crawler().follow_links(true) のように,途中のメソッドが walker を別の型へ変える連鎖.実在の API は確認できていない.walker を返すと分かっているメソッドだけに連鎖を限る案を fix(lint): address review findings deferred from the #74 migration PRs #196 で判断する.

  • errors.md: # Panics の行を削除した.clippy::missing_panics_doc は呼び出し先の panic を追わないので,間接的に panic する公開 API は覆われない.

  • serde-types-follow-config-conventions(助言のみ): #[derive(Deserialize)] と struct のあいだのブロックコメントで follows の探索が止まり,subject に選ばれない.

  • rs_no_follow_links: use walkdir::WalkDir as DirWalker; のような import alias の walker は,constructor の名前が固定のため一致しない(見逃し).

検証

  • nix develop --command ast-grep test --config agents/hooks/lint/sgconfig.yml --skip-snapshot-tests: 20 件通過(Rust 2 規則を含む)
  • nix develop --command uv run pytest tests/test_ast_grep_rules.py tests/test_model_rule_files.py: 44 件通過
  • nix develop --command uv run pytest(CI と同じ全体): 4878 件通過,1 件 skip
  • jev-lint rules --no-config -R agents/hooks/lint/model-rules: 18 規則,0 エラー

🤖 Generated with Claude Code

…clippy

Add 11 ast-grep rules and 5 advisory jev-lint model rules for Rust, and
delete the prose they or the enabled clippy lints replace.

Refs #74

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-15T14:17:55.556775Z 709394f Manual request
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

Review summary (read-only)

No P0 or P1 findings. Nothing here blocks the merge. All new ast-grep rules are warning-only. Each rule has valid and invalid cases. The shared config and the hook code are unchanged.

Findings, posted inline:

  • P2 rs_no_get_prefix: flags get_mut and get_unchecked, which the Rust API guidelines recommend, and trait-mandated method names. The "unless local convention" exception from the deleted prose is gone.
  • P2 rs_no_bool_constructor_arg: the with_* pattern catches idiomatic builder setters such as with_color(mut self, bool).
  • P3 rs_pub_fn_before_private_fn only checks top-level free functions, and rs_no_io_in_constructor only checks direct std I/O calls. The prose lines they replace were deleted entirely, which goes further than the PR's own "only fully replaced prose is deleted" policy.

I couldn't run ast-grep test locally because ast-grep isn't installed here. CI should confirm the rule cases pass.

@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: cf49845156

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

…artly cover

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

レビュー結果

ブロッカー(P0/P1)はありません.P3 の改善提案が 3 件あり,インラインコメントに書きました.

  • rs_fs_call_needs_context: fs::File::open(p)? を検出しません.OpenOptions::new の分岐はコンパイルが通るコードには一致しません.
  • rs_no_path_from_format: Path::new(&$A + $B) は実際のコードに一致しません.この分岐にはテストもありません.
  • rs_no_io_in_constructor: net:: の接頭辞が I/O をしない SocketAddr::new なども検出します(誤検出).

ast-grep 規則 11 件,jev-lint 規則 5 件,文章の削除はすべて読みました.新しい規則にはすべて valid / invalid のテストがあります.この環境では ast-grep を実行できなかったため,ast-grep test が通ることは確かめていません.文章の削除のうち template-rust の Cargo.toml で有効にする lint に頼るもの(unwrap_used,indexing_slicing,todo,unsafe_code など)は,template 側を確認していません.

🤖 Generated with Claude Code

@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: bf5c61f678

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

…public-field struct

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings (0 × P0/P1). Two non-blocking findings are posted inline:

  • P2 agents/skills/rust-style/references/tooling.md:64: the instruction to use #[expect(..., reason)] instead of #[allow] was deleted. allow_attributes_without_reason doesn't enforce that; clippy::allow_attributes would, but this PR lists it as wave 2 (not yet enabled) and says that text was kept.
  • P3 agents/hooks/lint/rules/rust/rs_no_io_in_constructor.yml:27: Command::new only builds a command and does no I/O, so a constructor that wraps a Command gets a false warning. The invalid test case builds in the same false positive.

I read the other 10 ast-grep rules, their rule-tests, the 5 jev-lint rules, and the other prose deletions, and found no correctness problems. Every new ast-grep rule has valid and invalid cases. The jev-lint rules have no fixtures; the PR says that was deliberately deferred and the rules are advisory only.

Note: I could not run ast-grep test or pytest in this environment (ast-grep is not installed and running commands needed approval). This review is from reading the code only.

🤖 Generated with Claude Code

@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: 47d4fa7253

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

…sentence

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

Blocking findings (P0/P1): 0

  • P2 agents/skills/rust-style/references/errors.md: this PR deletes the prose against unwrap/expect and direct indexing because template-rust enables unwrap_used/expect_used/indexing_slicing. Those are restriction lints, and the skill's recommended [lints] guard in tooling.md does not include them. Projects that did not start from template-rust lose this guidance with no lint to replace it. Keep the bullets or add the lints to the guard.

Other prose deletions look covered. The lints they rely on are default-on or in pedantic, which the guard enables, or the rest of the bullet survives (unsafe_code = \"forbid\" is still in the guard snippet).

I read the 11 new ast-grep rules and the 5 jev-lint rules statically. I found no correctness bugs beyond the limits the PR body already lists, and every new ast-grep rule has valid and invalid rule-tests. I could not run ast-grep here (it is not installed), so the rule-test results are the author's.

🤖 Generated with Claude Code

@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: bc376f9318

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

…h I/O methods

Refs #196

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@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: cd5f4b7bf2

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

… tests_outside_test_module

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary (read-only)

No blocking findings (0 × P0, 0 × P1). No P2/P3 findings posted.

What I checked:

  • New ast-grep rules (rs_no_follow_links, rs_no_path_from_format, rs_no_mocking_library): I traced how each matcher works against the tree-sitter-rust node shapes, including chained receivers and the not: has: arguments exclusion, separator literals nested in token trees vs. direct format-string literals, and the cfg_attr / scoped attribute regexes. I found no false positives or false negatives beyond the gaps the PR already defers to fix(lint): address review findings deferred from the #74 migration PRs #196 (qualified std::format!, pub use / grouped imports). Each blocking rule has a note and valid/invalid cases, as tests/test_ast_grep_rules.py requires. I couldn't run ast-grep here, so I'm relying on the reported ast-grep test result for the fixtures.
  • Advisory jev-lint rules: the matcher regexes are fine (e.g. the &'a str / String parameter types, the bool return type). The prose they cite (types.md getter naming, package_design.md, config_serialization.md, filesystem.md) is still there. They have no fixtures or fitting, which follows the user's decision recorded in the PR.
  • Prose deletions: each deleted line maps to a template-rust or clippy lint listed in the classification table. The remaining gaps (dbg_macro, str_to_string, unreachable_pub coverage, the exhaustive-match line vs. ADR-0021) are already listed under follow-up work for fix(lint): address review findings deferred from the #74 migration PRs #196, so I didn't repeat them as findings.

🤖 Generated with Claude Code

@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: 225858e193

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

…ports

History: rs_unit_test_in_test_module drew 21 review threads over many rounds and
never converged, because ast-grep cannot expand cfg or follow module files.
It was removed in favor of clippy tests_outside_test_module (template-rust,
separate PR). Prose stays until that lands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings (P0: 0, P1: 0). Two P2 comments are inline:

  • P2 rs_no_follow_links: the blocking rule has no documented exception. filesystem.md allows following symlinks when it is required and tested.
  • P2 types.md: the deleted BTreeMap / deterministic-order line is only partly covered by iter_over_hash_type. That lint misses serde serialization and Debug output of a HashMap.

What I checked by reading the code:

  • rs_no_mocking_library: the attribute regex handles nested cfg_attr conditions. The \b boundaries avoid false matches on names such as automock_x and fauxpas.
  • rs_no_path_from_format: the separator check looks only at direct token-tree / binary-operand literals, so name.replace("/", "_") is not flagged. The YAML escaping gives [/\\].
  • The 5 new jev-lint rules select nothing in RUST_SOURCE (no bool returns, no as_/into_/parse names, no _ arms, no structs, none of the listed fs calls). So the subject counts in test_rust_rules_select_the_functions_they_ask_about should not change.
  • Each new ast-grep rule has a rule-tests file with valid and invalid cases and a note, which test_ast_grep_rules.py requires.

What I could not check here:

  • I did not run ast-grep test or jev-lint; neither tool is installed in this environment.
  • I could not read template-rust's Cargo.toml or this PR's CI checks; both commands needed approval in this session. So the claim that template lints cover the deleted prose is taken from the PR description.

@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: b47b7e47cb

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

…clarify follow_links note

History: rs_no_path_from_format drew 8 review threads because it parses string
contents with a regex (escapes, raw strings, nested calls), so it never
converged as a blocking rule. It is now the advisory jev-lint rule
paths-are-joined-not-formatted. The follow_links note now points to a reviewed
ast-grep-ignore comment for the rare required case. types.md keeps the
output-order sentence that clippy iter_over_hash_type does not cover.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings (0 × P0/P1). No inline comments.

What I checked:

  • ast-grep rules (rs_no_follow_links, rs_no_mocking_library): I traced the receiver-chain has/not has arguments logic and the attribute/use regexes (including cfg_attr wrapped across lines and the mockall vs mockall_double alternation) against the valid and invalid fixtures. I found no false positive that should block. The remaining gaps (pub use, grouped imports, a walker held in a variable) are false negatives that the PR already lists.
  • jev-lint model rules: they use the same kind/subject/state/axis schema as the existing rules. I checked RUST_SOURCE in tests/test_model_rule_files.py by hand. None of the six new rules should select anything there, so the exact-count assertion in test_rust_rules_select_the_functions_they_ask_about should still pass. I could not run jev-lint or ast-grep here.
  • Prose deletions: each deleted line matches a lint that the PR says is enabled in template-rust. The places where nothing enforces the rule yet (str_to_string, the indirect-panic part of missing_panics_doc, the default-allow guard lints) are already listed as follow-ups in fix(lint): address review findings deferred from the #74 migration PRs #196.

Non-blocking note: none of the six new model rules has a fixture or a test that checks which functions it selects. The PR defers this on purpose, so I did not post it as a finding. It should be fixed before any of these rules is promoted from advisory.

@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: 66d1f1f5ea

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

@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@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: 66d1f1f5ea

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

… and expect

Verified with a throwaway crate: allow_attributes_without_reason fires on #[allow] and
#[expect] without a reason, and allow_attributes flags #[allow].

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No P0–P3 findings.

What I checked:

  • rs_no_follow_links: Only flags a chain that starts with a known walker (WalkDir or WalkBuilder, bare or path-qualified). The not has arguments clause skips a walker that only appears as an argument of another receiver. The .min_depth(1) and .hidden(false) chains still match, because their argument lists contain no walker constructor. The fixtures cover the false-positive cases in the PR description.
  • rs_no_mocking_library: The use, attribute and cfg_attr regexes cover mockall, mockall_double, unimock and faux. The \\b anchors avoid matching identifiers like automock_x. A local mock! macro without the import is correctly left alone. Known gaps are pub use mockall::… and leading ::mockall paths. They are rare, so I'm not reporting them.
  • jev-lint model rules: These six are advisory (severity: warning, unfitted 0.5 threshold) and use the same schema as the existing command-query-naming rule. I found no structural problems.
  • Prose deletions: Each one maps to a template-rust lint according to the PR's classification table. The trade-offs the PR already lists (removed package-level guard, unreachable_pub gap, exhaustive-match line) are policy questions tracked in fix(lint): address review findings deferred from the #74 migration PRs #196, not defects in this diff.

Limitation: ast-grep wasn't available in this environment, so I checked the rule fixtures by reading them, not by running them. Please confirm ast-grep test passes in CI.

@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: 709394fa74

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

@furedea
furedea merged commit e184682 into main Nov 15, 2026
25 of 27 checks passed
@furedea
furedea deleted the feat/migrate-rust-style-rules branch November 15, 2026 14:19
furedea added a commit that referenced this pull request Nov 15, 2026
Refs #74
Refs #196

## 概要

ADR-0021 に「Which rules ast-grep may block」の節を追加し,blocking な ast-grep
規則に求める基準を記録した.

- blocking な ast-grep 規則は,1
つの構文要素を局所的に,信頼できる形で判定しなければならない.次のどれかが必要な規則は,言語自身の linter / compiler /
test runner(あれば),なければ jev-lint に任せる.
  1. ファイル外の情報(設定,`conftest.py`,他のモジュール)
  2. データの流れや実行の順番(代入,スコープ,クラス階層)
  3. 文法や式を正規表現で解析すること(`cfg(...)`,文字列の中身)
  4. 同じ意味の書き方が多いこと(YAML の引用符・flow / block 形式,import の別名)
- 根拠として,#192〜#195 のマージ済み PR 本文の「ast-grep から外した規則と理由」の表から,指摘 8 件以上の 12
規則を表にした(規則,指摘数,型,行き先).
- `agents/hooks/lint/sgconfig.yml` の先頭に,この節への 1 行の案内をコメントで追加した.
- `tests/test_workflow_skill_layout.py`: 追跡されていない
`agents/skills/.claude/` が skill として読まれ,環境によって失敗する問題を直した.`.` で始まる名前を
`SKILL_NAMES` から除外する(`skill_names()`,先にテストを追加して失敗を確認).

## 補足

- #194 は作成時点で未マージのため,ADR の #194 の 3 行は暫定と明記した(レビュー指摘).
- 依頼文では「外した規則は 11〜34 件」とあったが,PR 本文の表には 1〜8 件の規則もある(#193 の Rust など).表には 8
件以上のものだけを載せ,それ未満は「同じ PR 本文に載っており,同じ型に当てはまる」と ADR に書いた.ブロックのまま残った規則は 3
件以下(#194 の Bash / GitHub Actions は 3〜7 件で,見逃しは #196 に送った)と書いている.
- 指摘数は各 PR 本文の記載値をそのまま使った(再集計していない).

## 検証

- `uv run pytest tests/test_workflow_skill_layout.py`: 61
件成功(新規テストは,実装前に `NameError` で失敗することを確認).
- pre-commit(ruff,ty,shellcheck,commitlint ほか)通過.`dprint fmt` 済み.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <132188853+furedea@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
furedea added a commit that referenced this pull request Nov 16, 2026
## 概要

#196 に溜まった指摘を,main に残っている blocking(`severity: error`)の ast-grep
規則に絞って整理し,規則内の局所的な 1 構文の確認で直せるものを直した.#74 の一部.

分類は次のとおり.

- **a**:blocking 規則の見逃し・誤検出(規則が main に残っている)
- **b**:jev-lint model rule の指摘(保留中の検証用に残す.変更しない)
- **c**:obsolete(規則が削除・置換済み)
- **d**:hook・文章・インフラ

ADR-0021 に入れる基準(#214)は未マージのため,指示された基準をそのまま適用した.局所的な 1
構文(固定名,文字列の接頭辞,ノード種別 1
つの追加)なら規則を直す.ファイル外の情報,データフロー・スコープ,入れ子の文法の正規表現,同義の書き方を追い続ける修正が必要なものは,規則を継ぎ足さない.

## a.blocking 規則(fixture を先に足して修正)

| 項目 | 分類 | 対応 |
|
---------------------------------------------------------------------------------------------
| -------- |
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| `go_no_generated_mocks`:`// Code generated by ...` ヘッダーだけの生成 mock | a
修正 | ヘッダーの接頭辞(MockGen / mockery / counterfeiter / moq / minimock)を検出 |
| `go_no_context_in_struct`:`*context.Context` のフィールド | a 修正 |
`pointer_type` を 1 種類追加 |
| `go_use_slog`:receiver・名前付き戻り値による `log` のシャドー | a 修正 | 引数と同じ判定を
receiver・result にも適用 |
| `rs_no_mocking_library`:`automock` クレート,`pub use`,`use
{mockall::automock};` | a 修正 | クレート一覧と `use` の接頭辞を拡張 |
| `rs_no_mocking_library`:`cfg_attr` 分岐が入れ子の属性を正規表現で読む(#196 最後のコメント) | a
修正 | 正規表現をやめ,`cfg_attr` の引数トークン(カンマの直後の識別子)をノードで判定 |
| `bash_readonly_constant_name`:`declare -r` を検査しない | a 修正 | スクリプト直下の
`declare -r` / `typeset -r` と,関数内の `declare -gr` を追加 |
| `bash_readonly_constant_name`:関数内の `readonly` を一律に除外 | a Limits | 既存の
`local` を固定するだけの `readonly` と区別するにはスコープ解析が要るため,除外のまま規則の Scope
に記録した(レビュー指摘で一度検査に変えたが戻した) |
| `py_pydantic_base_model_only_in_frozen_base`:`pydantic.v1` 経由の回避 | a
修正 | `pydantic.v1` の素の書き方を追加 |
| `go_use_slog`:関数内のローカル変数による `log` のシャドー | a Limits |
スコープ解析が要る.規則の本体は精度が高く,demote すると `log.Printf` を止められなくなるため,blocking
のまま規則の Limits に記録した |
| `go_iota_enum_typed`:`iota + 1` などの式 | a Limits | `1 << (10 * iota)` と
`iota + 1` は型なし定数の標準的な書き方で,構文だけでは enum と区別できない.既存の valid fixture
のとおり対象外のまま,理由を規則に記録した |
| `rs_no_follow_links`:import 別名,途中で別の型に変換するチェーン | a Limits |
別名はバインド解析が要る.変換するチェーンは該当する API を確認できていない.規則の Limits に記録した |
| `py_no_pytest_asyncio`:別名 `pytest` 経由 | a Limits | バインド解析が要る.規則の
Limits に記録した |
| `gha_job_timeout_minutes`:`jobs` 自体が flow mapping | a Limits | 実在の
workflow では使われない書き方.規則の Scope に記録した |
| `gha_workflow_permissions_deny_all`:ルート全体が flow mapping | a Limits |
同上 |
| `gha_pinned_uses_version_comment`:`action.yml` 内の tag 参照 | c | 規則は
`action.yml` を対象に含んでいる.tag 参照は対象外と Scope に書いてある設計どおり |
| `go_context_param_named_ctx` / `go_no_context_in_struct`:import
path・エイリアスの確認 | c | 規則が標準 `context` を別名なしで import したファイルに限定済み |
| `go_no_generated_mocks`:`//go:generate` 経由の mock | c | 規則が検出済み |

「a Limits」は,構文だけでは判定できない見逃しの端のケースで,規則は demote せず,規則ファイルの `Limits:`(または
`Scope:`)に記録した.精度の高い規則は,見逃しを記録して残す.誤検出が繰り返し出る規則だけを demote する.この方針は
ADR-0021 の「Which rules ast-grep may block」に 1 行足した.

## c.obsolete(規則が削除・置換済み)

main に該当の規則が無いため,対応不要.

-
TypeScript:`ts_no_unvalidated_json_cast`,`ts_catch_rethrow_requires_cause`,`ts_no_other_test_framework`,`ts_no_vague_name`,`ts_no_home_dir_in_tests`
と各 `tsx_` 版(oxlint・jev-lint へ移行)
-
Python:`py_async_test_anyio_marker`(削除),`py_pydantic_validate_json`,`py_plain_class_slots`(jev-lint
へ降格),`py_frozen_base_model_config`,`py_frozen_base_model_no_override`,`py_definition_order`,`string-literal-is-named-constant`
の `parent:` の件
-
Go:`go_sealed_interface_sumtype_decl`,`go_error_no_capitalized_message`
- Rust:`rs_unit_test_in_test_module`(clippy
へ置換),`rs_no_path_from_format`(jev-lint
へ降格),`rs_fs_call_needs_context`,`rs_no_get_prefix`
- Bash /
Actions:`gha_workflow_concurrency`,`gha_workflow_default_shell`,`bash_strict_mode_header`(jev-lint
へ降格)

## b.jev-lint model rule の指摘(変更しない)

保留中の fixtures・eval・しきい値の当てはめで扱う.#196 のコメントに記録済みで,この PR では触れない.

-
`no-exposed-mutable-collection`,`no-comment-restating-code`,`no-reaching-through-collaborators`,`construction-separate-from-execution`,`function-single-purpose`(#191,4
言語)
-
`error-handled-once`(#190),`fixture-justified`,`frozen-model-subclass-keeps-locked-settings`,`json-parse-uses-model-validate-json`(#192)
- Rust の advisory
規則:`conversion-and-query-names-follow-rust-convention`,`serde-types-follow-config-conventions`,`public-types-protect-invariants`,`domain-states-are-enums`,`paths-are-joined-not-formatted`(#193)
- Bash / Actions の advisory 規則(#194),TypeScript の advisory 規則(#195)
- `test_main_is_thin_selects_func_main_of_package_main` が
`command-query-naming` に指摘される件(誤検出と見ている.model rule の判定の話)

## d.hook・文章・インフラ

| 項目 | 分類 | 対応 |
|---|---|---|
| worktree の未追跡 `agents/skills/.claude/` を skill
と読み,`tests/test_workflow_skill_layout.py` が失敗する | d 解決済み | main
に同じ修正が入っていた(#216 の rebase で採用) |
| Stop の `SUBJECT_CAP`(20)で判定が漏れないようにする | d 解決済み | 現在は 250
で,実測の上限を下回らないことをテストが保証している |
| 後段の review が失敗すると,同じ指摘で毎ターン Stop を block する | d 修正 | 完了した前段の結果をレシートの
`resume` に保存し,失敗した tier だけを再実行する.通知済みの件数(`shown`)も保存し,同じ指摘では二度 block しない
|
| 後段の review の失敗理由が捨てられ,`incomplete` としか出ない.`skipped_files=1` が実数でない | d
修正 | `Judgement.failure_reason` を結果の行に出し,`skipped_files` は失敗した review
のファイル数にした |
| 2 tier の review の順序(調整済み committed,調整済み uncommitted,未調整 committed,未調整
uncommitted)のテストが無い | d 修正 | `test_model_rules_resume.py` に順序のテストを追加 |
| `scripts/bootstrap_server.sh` が ast-grep を入れない | d 修正 | ast-grep
0.42.1 を sha256 付きで固定し,dprint と同じ zip の経路で入れる(`install_zip_tool`).bats の
fixture,Renovate の確認,README を更新 |
| `.bats` を ast-grep で Bash として読めるか | d 対応しない | `languageGlobs`(`bash:
["*.bats"]`)で読めることは確認したが,Bash の規則は `.bats` に有効化しない.`@test` ブロックは Bash
の文法ではなく,読めても `readonly` や関数名の規則が意図しない形で当たる.hook の `EXTENSIONS`
と整形の対象も広がる |
| `severity: error` を hook の block 判定に結びつける | d 範囲外 | #203 の範囲 |
| Rust `tooling.md` の package-level guard,Go の `t.Parallel()` の文章 | d
対応しない | テンプレートの linter が既に覆っているため,文章は戻さない |
| `types.md` の `to_owned()` / `String::from`,`package_design.md` の
`pub`,`types.md` の exhaustive match,`errors.md` の `# Panics` の文章 | d
対応しない | 同上(テンプレートの linter が覆う分は戻さない) |

## 検証

- ast-grep の規則テスト:28 件通過,bats:81 件通過(ast-grep の固定を追加)
- `uv run pytest`:5198 件通過,4 件失敗.失敗はいずれも model rule の subject
選択テスト(`test_main_is_thin_selects_func_main_of_package_main` など)で,この PR
を外した main でも同じく失敗する(この環境での既存の失敗.CI の `test` job は通る)
- `ruff check` / `ruff format --check` / `ty`:通過

Refs #74, #196

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <132188853+furedea@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
furedea pushed a commit that referenced this pull request Nov 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.2.0](v0.1.4...v0.2.0)
(2026-11-18)


### Features

* add adr-check command for MADR ADRs
([#225](#225))
([138c542](138c542))
* **adr:** adopt the shared ADR checks
([#226](#226))
([5c94a78](5c94a78))
* **hooks:** block edits on static rule errors and guard ast-grep-ignore
([#203](#203))
([f5b3317](f5b3317))
* **hooks:** judge gh calls by effect through a policy table
([#201](#201))
([db7226d](db7226d))
* **hooks:** keep ask prefixes only for widening authority and promotion
([#199](#199))
([c3985f6](c3985f6))
* **hooks:** migrate TypeScript style rules to ast-grep and jev-lint
checks ([#195](#195))
([24d1a3e](24d1a3e))
* **lint:** flag Go packages under util and common with an error rule
([#202](#202))
([de25e1d](de25e1d))
* **lint:** judge ADR rationale with Jev
([#228](#228))
([cf1c0a3](cf1c0a3))
* **lint:** migrate agents/AGENTS.md rules to model rules and linters
([#191](#191))
([9e3e37d](9e3e37d))
* **lint:** migrate bash-style and github-actions-style rules to checks
([#194](#194))
([4e473ba](4e473ba))
* **lint:** migrate go-style rules to ast-grep and jev-lint rules
([#190](#190))
([296ad84](296ad84))
* **lint:** migrate rust-style prose rules to checks
([#193](#193))
([e184682](e184682))


### Bug Fixes

* **ci:** run the jev-lint model-rule tests in CI
([#218](#218))
([1919b06](1919b06))
* **deps:** pin dependencies
([#221](#221))
([5d083e4](5d083e4))
* **hooks:** deny git options that skip repository hooks
([#212](#212))
([e10e5b6](e10e5b6))
* **hooks:** judge a cell turned into code from scratch and ignore
attribute reasons
([#224](#224))
([96fb561](96fb561))
* **lint:** close blocking ast-grep rule gaps recorded in
[#196](#196)
([#216](#216))
([fa31947](fa31947))
* **skills:** drop the agent-run verify step that protected records
block ([#213](#213))
([700244d](700244d))

---
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>
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