Repository navigation
fix(hooks): do not let project rules widen the allowed commands - #28
Closed
furedea-agent[bot] wants to merge 1 commit into
Closed
furedea-agent[bot] wants to merge 1 commit into
furedea-agent[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
Author
|
マージしない.プロジェクトの .agents/hooks/rules/allowed_commands.json を取り込む今の動きは,既知の危険として受け入れて残す(ユーザーの判断). |
This was referenced Oct 24, 2026
furedea
added a commit
that referenced
this pull request
Nov 15, 2026
#205) ## 概要 ガード節に関する散文の指針を2か所から削除しました.各言語のテンプレートリンターが `return`/`raise`/`continue`/`break` の後の `else` を拒否するようになったため,散文での指示は不要になりました. Refs #74 ## 変更内容 | ファイル | Before | After | | --- | --- | --- | | `agents/AGENTS.md:30` | `- Keep functions single-purpose at one abstraction level, with short variable lifetimes and guard clauses over nested conditionals.` | `- Keep functions single-purpose at one abstraction level, with short variable lifetimes.` | | `agents/skills/rust-style/references/types.md:73` | `- Prefer early returns for guard clauses.` | 行を削除(前後は独立した箇条書きのため,文の調整は不要) | ## 言語ごとのカバー状況 | 言語 | else-after-return | ネストの深さ | 根拠 | | --- | --- | --- | --- | | Python | ruff `RET505`-`RET508` | `PLR1702` | template-python #28 | | TypeScript | oxlint `no-else-return` | `max-control-nesting` | template-typescript #43 | | Go | revive `indent-error-flow` / `superfluous-else` / `early-return` | `max-depth` | template-go #11 | | Rust | clippy pedantic `redundant_else` | `excessive_nesting` | template-rust(既存) | `agents/skills/*` を `rg` で調べた結果,同系統の記述は上記の rust-style の1件だけでした. ## 検証 - `rg -i "guard clause"` で,削除した2行以外にこの文言を固定するテストやレンダリング済みスナップショットがないことを確認しました. - 変更は Markdown のみです.各コミットで pre-commit(shfmt / ls-lint / shellcheck)と commit-msg(commitlint)がパスしました. - CI の結果は push 後に確認します. ## レビュー指摘への対応 `codex-review` が P2 の指摘を1件出しました(`agents/AGENTS.md:30`).内容は,「テンプレート外のプロジェクトや else を伴わないネストはリンターの対象外なので,文言を残すべき」というものです. ユーザーが次の理由で方針判断として受け入れ,スレッドに返信して resolve しました. - 新規プロジェクトはテンプレートからのみ作られるため,テンプレート外は対象外です. - else を伴わないネストの深さも,上表のルールが検査します. 🤖 Generated with [Claude Code](https://claude.ai/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.
概要
.agents/hooks/rules/allowed_commands.jsonを検証だけ行い,allow 規則として取り込まないようにした(プロジェクトは ask と deny を足せるが,allow は広げられない)command_permissions.jsonとprotected_paths.jsonの既定の場所は agent-harness の描画が補っていることを確認し,Issue にコメントしたレビュー(1 回)
P0/P1 なし.P2 以下は今回は直さない.
allowed_commands.jsonが黙って無視される.通知も文書化もないtest_command_cli.pyの parametrize が 1 ケースだけになった^~/の展開がないCloses #5
🤖 Generated with Claude Code