Skip to content

feat(lint): 一時ファイルの弱い一意性を検知する rule を追加する (nightly-todo 順位 455) - #502

Open
nightly-todo-aloekun[bot] wants to merge 2 commits into
masterfrom
claude/nightly-455
Open

nightly-todo-aloekun[bot] wants to merge 2 commits into
masterfrom
claude/nightly-455

Conversation

@nightly-todo-aloekun

@nightly-todo-aloekun nightly-todo-aloekun Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

台帳 (docs/claude-code-web-tasks.md) の無人可タスク 順位 455
夜間ループ (nightly-todo workflow) が無人で実装した PR です。

  • 内容: 一時ファイルの弱い一意性(PID や ms を含まない固定名)を検知する custom lint rule を追加
  • 事前フィルタ: 夜間 workflow が ubuntu 上で cargo test --workspace +
    cargo clippy --workspace --all-targets -- -D warnings を回して green を確認済み
    (agent の自己申告ではなく workflow が回し直した結果)。これはコストフィルタで
    品質の保証ではありません — 単一 OS で --ignored も hooks smoke も含みません
  • 品質の保証: 本 PR に紐づく ci.yml (windows-latest + ubuntu-latest) のチェックを見てください
  • ゲート: cli-autonomy-gate --operation autonomous-pr (kill-switch + 背圧) を通過

マージ判断は人間が行います (ADR-052 の commitment 点)。CI が緑で内容が台帳の
意図に沿っていればマージしてください。ずれている場合はクローズを —
採用率は WP-18 の受け入れ基準の測定対象です。

close する場合の lane 操作 (ADR-072 決定 20): 人間が引き取るなら台帳の
無人可 へ変更してください。 のまま close すると、
決着済み PR のブランチ掃除の後にこの順位が再び選択されます (= 再投入の意思表示)。

run: https://github.com/aloekun/claude-code-hook-test/actions/runs/35005682427

Summary by CodeRabbit

  • 新機能

    • 一時ディレクトリに固定名を結合することで、ファイル名の一意性が不十分になるコードを検出するRust向けカスタムLintルールを追加しました。
    • 動的なファイル名生成は検出対象外です。
  • テスト

    • 固定名、動的生成、対象外拡張子などの検証ケースを追加しました。
    • インシデント評価用の不備あり・修正版フィクスチャを追加しました。
  • ドキュメント

    • 対応済みの関連タスク項目を各タスク一覧から削除しました。

nightly-todo and others added 2 commits September 15, 2026 18:15
実装完了は cli-ledger-cleanup が台帳の宣言と PR の変更を突き合わせて判定済み。マージと後始末を原子的にするため PR へ同梱する。
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cdcd4242-926c-4deb-bb41-76d38da97310

📥 Commits

Reviewing files that changed from the base of the PR and between e5bf94c and 82cf5fc.

📒 Files selected for processing (8)
  • config/custom-lint-rules.toml
  • docs/claude-code-web-tasks.md
  • docs/todo-summary3.md
  • docs/todo23.md
  • src/hooks-post-tool-linter/src/custom_rules/rule_tests_extras.rs
  • src/hooks-post-tool-linter/tests/incident_eval.rs
  • tests/fixtures/incidents/bad/no-weak-temp-uniqueness.rs
  • tests/fixtures/incidents/good/no-weak-temp-uniqueness.rs
💤 Files with no reviewable changes (3)
  • docs/todo23.md
  • docs/todo-summary3.md
  • docs/claude-code-web-tasks.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

no-weak-temp-uniqueness ルールを追加しました。Rustコード内の固定名による一時パス結合を検出します。直接テストとインシデント評価用フィクスチャを追加し、関連するタスク記録を削除しました。

Changes

一時ファイル一意性Lint

Layer / File(s) Summary
Lintルール定義
config/custom-lint-rules.toml
temp_dir().join("固定名") をRustファイル内で検出する、severityがerrorのルールを追加しました。
Lintルールの直接テスト
src/hooks-post-tool-linter/src/custom_rules/rule_tests_extras.rs
固定名結合の検出、動的なformat!による結合の除外、通常のjoinの除外、.rs拡張子限定を検証します。
インシデント評価と記録更新
src/hooks-post-tool-linter/tests/incident_eval.rs, tests/fixtures/incidents/{bad,good}/no-weak-temp-uniqueness.rs, docs/claude-code-web-tasks.md, docs/todo-summary3.md, docs/todo23.md
bad/goodフィクスチャをE2E評価に追加しました。順位455の関連タスク記録を削除しました。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Suggested reviewers: aloekun

Merge Risk: ⚪ Minimal · up to 82cf5

The lint rule and its tests align with the documented usage contract, with no confirmed merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、一時ファイルの弱い一意性を検知するlint ruleの追加という変更の主要目的を正確かつ簡潔に示しています。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/nightly-455

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aloekun

aloekun commented Sep 15, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Monitor 分析 (GitHub Actions バックストップ)

  • トリガー: issue_comment (created) / 実行 run
  • CI: 実行中・未確定 — rust (ubuntu-latest) pending、rust (windows-latest) pending、request pending、CodeRabbit pending(いずれも失敗なし、結果待ち)
  • レビュー状況: 未実施 (陽性証拠なし) — pulls/502/reviews は空配列、pulls/502/comments (インライン) も空配列。会話コメントは CodeRabbit の "Currently processing... please wait" (walkthrough 未生成) と、owner による @coderabbitai review コマンド、それへの "Action performed / Review triggered" 応答のみで、いずれも実際のレビュー内容ではない。head (82cf5fc7) に対する完了済みレビューの陽性証拠は現時点で存在しない
  • Verdict: user_decision

Applicable Findings (Critical / High / Major)

(該当なし — レビュー未完了のため findings 自体が存在しない)

Applicable Findings (Medium 以下)

(該当なし)

Filtered (not applicable)

(該当なし)

差分概要 (軽量サマリー)

8 ファイル変更、順位 455「一時ファイルの弱い一意性検知 lint」の実装:

  • config/custom-lint-rules.toml: 新規 rule no-weak-temp-uniqueness を追加 (regex 層、+58 行)。temp_dir().join("<literal>") の固定名 join を検出し、fix strategy として process::id() + 用途名または tempfile crate を提示
  • src/hooks-post-tool-linter/src/custom_rules/rule_tests_extras.rs: 新 rule に対する単体テスト 5 件 (+58 行)
  • src/hooks-post-tool-linter/tests/incident_eval.rs: incident-eval ケースを 1 件追加
  • tests/fixtures/incidents/{bad,good}/no-weak-temp-uniqueness.rs: bad/good fixture を新規追加
  • docs/todo23.md, docs/todo-summary3.md, docs/claude-code-web-tasks.md: 完了した順位 455 の記述を削除 (todo 側は台帳規約通り、実装完了に伴うクリーンアップ)

rule 定義・rule test・fixture の 3 点セット (台帳が要求する完了条件) は揃っている。

次のアクション

  • CI (rust ubuntu/windows, request) と CodeRabbit のレビュー完了を待ち、結果が出た時点で本 workflow の後続実行による再分析を確認する
  • CodeRabbit の実レビューが投稿された後、findings があれば次回分析でプロジェクト適合性フィルタを適用する

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