Skip to content

fix(hooks): do not let project rules widen the allowed commands - #28

Closed
furedea-agent[bot] wants to merge 1 commit into
mainfrom
fix/permission-file-locations-and-project-allow
Closed

furedea-agent[bot] wants to merge 1 commit into
mainfrom
fix/permission-file-locations-and-project-allow

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

概要

  • プロジェクトの .agents/hooks/rules/allowed_commands.json を検証だけ行い,allow 規則として取り込まないようにした(プロジェクトは ask と deny を足せるが,allow は広げられない)
  • command_permissions.json と protected_paths.json の既定の場所は agent-harness の描画が補っていることを確認し,Issue にコメントした

レビュー(1 回)

P0/P1 なし.P2 以下は今回は直さない.

  • P2:有効なプロジェクトの allowed_commands.json が黙って無視される.通知も文書化もない
  • P3:test_command_cli.py の parametrize が 1 ケースだけになった
  • P3:新しいテストは stdout の文言だけを見ている(戻り値と ask の判定は見ていない)
  • P3(既存):プロジェクトの forbidden 規則には,グローバル規則にある ^~/ の展開がない

Closes #5

🤖 Generated with Claude Code

@furedea-agent

furedea-agent Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

マージしない.プロジェクトの .agents/hooks/rules/allowed_commands.json を取り込む今の動きは,既知の危険として受け入れて残す(ユーザーの判断).

@furedea-agent furedea-agent Bot closed this 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]>
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.

chore: 取り込み PR のレビューで出た確認事項と後回しの指摘を追う

1 participant