Skip to content

docs(agents): treat lint limits as design signals - #255

Merged
furedea merged 1 commit into
mainfrom
docs/lint-limits-as-design-signals
Oct 21, 2026
Merged

furedea merged 1 commit into
mainfrom
docs/lint-limits-as-design-signals

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

概要

  • 引数・ネスト・複雑度の上限は「責務が大きすぎないか」「データを適切にオブジェクト化できているか」の合図なのに,引数を名前のない入れ物に詰めて数だけ減らすリファクタリングが起きていた(refactor: apply the template's numeric lint rules reflex-state#23 など).
  • agents/AGENTS.md の関数の指針に 1 行だけ足し,直し方の順番と,まとめてよい条件をはっきりさせる.
項目 変更前 変更後
上限を超えたときの直し方 決まりなし 責務を分ける → 導ける引数をなくす → データを持つ側に処理を移す
引数をまとめる型 決まりなし 本当のドメインの概念を表す名前付きの型だけ
禁止 なし 名前のないオブジェクト,タプル,dict,関数の引数を写しただけの型

受け入れ条件

  • 加筆は 1 行だけで,既存の指針と重複しない
  • CI が通る
背景

🤖 Generated with Claude Code

An argument limit exists to keep functions focused and data modeled, so
packing arguments into an anonymous object only hides the signal. State
the fixes to prefer and allow grouping only into a named domain type.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@furedea
furedea merged commit 00c3d44 into main Oct 21, 2026
11 checks passed
@furedea
furedea deleted the docs/lint-limits-as-design-signals branch October 21, 2026 07:17
furedea added a commit that referenced this pull request Oct 21, 2026
…256)

## 概要

lint の引数上限を避けるためだけに作られていたグルーピングを,PR #255
の方針(上限は設計シグナルとして扱う)に沿って直します.振る舞いは変えていません.

Refs #247

## 変更内容

| グルーピング | 対応 | 理由 |
| --- | --- | --- |
| `guard_command.py` の `Attempt(kind, command, payload)` | derive(削除) |
`command` は一度も読まれておらず,`record(verdict, kind, payload)` で足ります.`decide` 内の
`command` 取り出しも記録専用だったので削除しました(`command_verdict` が同じ try
内で同じ値を取り出すため挙動は同じです). |
| `lint_engine.py` の `tuple[tuple[str, Path], ...]` | real concept |
関数境界を越える (language, path) の組を `LintTarget(language, path)`
と命名しました.`checker` の引数形は変えていません. |
| `session_gate.py` の `VerificationRun` | move |
引数を渡すためだけに組み立てていたので,`current_receipt` と `configuration_failure` を
`VerificationRun` のメソッドにしました. |
| `session_store.session_directory` の 3 引数 | real concept(既存型の再利用) | 既存の
`SessionKey` を受け取るようにし,呼び出し元とテストを更新しました. |
| `verify_page.py` の `_RenderOptions(width, wait_ms, timeout_seconds)` |
move | `_render_page` の引数を写しただけの型でした.プロセス実行とヘッドレス用フラグを持つ `_Browser(path,
wait_ms, timeout_seconds)` に置き換えました.`wait_ms`(仮想時間予算)と `timeout_seconds`
はどちらもブラウザ起動ごとの時間予算です.width と組む viewport
型は実在の概念にならないので作っていません.`_render_page(html_path, browser, width)` は 3
引数になります. |

## 確認

- `uv run --frozen ruff format --check` / `ruff check` / `ty check`: 成功
- `uv run --frozen pytest -q`: 1877 passed
- `lefthook run pre-commit --all-files`: 成功
- 数値系 lint の無効化は追加していません.ブラウザを使うテストはサンドボックスで実行できないため,CI の結果で確認します.

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

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 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.

1 participant