Repository navigation
docs: move the development cycle and verification guide from dotfiles - #20
Merged
Merged
Conversation
Moved from furedea/dotfiles c7c92ca (fix(tests): make git test wrappers exec the real git binary (#310)). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Moved from the command-guard paragraph of furedea/dotfiles ADR-0026 as ADR-0016, and point ADR-0004 at it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add docs/DESIGN.md, the server bootstrap section, and CONTRIBUTING.md, restoring the explanation lost when the source left furedea/dotfiles. Refs #7 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Run the contributor checks inside the devShell, say the guards ask rather than reject, and state the verification limits and LANE-BLOCKED. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
9 tasks
furedea
added a commit
that referenced
this pull request
Nov 15, 2026
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](https://github.com/furedea/template-rust/pull/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 の指摘への対応 - [x] `filesystem.md` の「文字列連結で組まない」は規則が部分的にしか覆わないので残した. - 「template だけで有効な lint は文章を置き換えない」という #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 が覆う文章を削除する方針に沿った変更なので,方針の判断として #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 の文章を残す.昇格するまで行を戻すか,#196 で判断する. - `rs_no_follow_links`: `WalkDir::new(".").into_crawler().follow_links(true)` のように,途中のメソッドが walker を別の型へ変える連鎖.実在の API は確認できていない.walker を返すと分かっているメソッドだけに連鎖を限る案を #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](https://claude.com/claude-code) --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
dotfiles の README にしかなかった開発サイクルと検証の説明を,agent-config に移した.分離のときに消えた説明も戻した.
docs/DESIGN.md(新規):開発サイクル,Constraints,検証(状態の置き場所,verification_session.py verify [--force],7 日の保持期限,300 秒の制限とRUN_RELATED_TESTS_TIMEOUT_SECONDS),hook の deny / ask の方針.dotfiles 固有の 3 か所(マージ後のswitch,switchの注意,「dotfiles で開く」)は除いた.「Run Only Merged Changes」と「Where to Open the Session」は,それぞれ 1 行の注意にした.現状に合わせ,レビューは読み取り専用の Codextask,レーンは Sonnet の medium,設定の置き場所は~/.config/agent-config/とした.README.md:Nix のないサーバーの手順と,bootstrap の詳細を追加.CONTRIBUTING.md(新規):作業ツリーを描画して確かめる手順(PATH上の古いagent-harnessを使わない).docs/adr/0016_*:dotfiles ADR-0026 のコマンドガードの段落を新しい ADR にし,ADR-0004 のリンクを差し替えた.tests/test_git_wrapper.py:dotfiles から移した(real_gitは既にtests/runtime.pyにある)..ls-lint.yml:DESIGN.mdを許可した.確認
uv run --frozen pytest:2694 件すべて成功ls_lint,lefthook の pre-commit(ruff,ty,shfmt,shellcheck):成功残り
dotfiles 側(README をリンクに置き換え,ADR-0026 から段落を外し,
test_git_wrapper.pyとreal_gitを消す)は別レーンで行うため,Refs #7とした.Issue: #7 / 計画: #7 (comment)
🤖 Generated with Claude Code