docs(CLAUDE.md): 検出ルール追加時の必須手順を明文化 - #58
Merged
Merged
Conversation
このリポジトリ固有の最重要ルールとして「自作の合成フィクスチャだけで 動くと判断しない」を proof として明記する。 背景: 合成フィクスチャで誤検知ゼロだったルール群が、実コード 10 リポ 1015 ファイルでは 121 件中の真の指摘が約 2 件(誤検知率 98%)だった。 ミューテーションテストに合格していても、ルールが実世界で妥当かは 一切示さない。この失敗を手順として固定する。 追記内容: - 単体テストは発火例と非発火例の両方 + 公開経路を通す(配線漏れ検出) - 実コーパス計測で誤検知率を数値化し、NET-NEW を全件目視する - 既存ゲート(CodeQL/Dependabot/シークレットスキャナ)との重複を先に測る - 誤検知を生みやすい既知の型 5 つ(SQLキーワードは英単語 / 同名メソッド / 定数実行 / 語の出現≠使用 / モジュール横断は判定不能) - 意図的に脆弱なテストには ignore-file を置く 検証: pytest 153 件パス(ドキュメントのみの変更でコード影響なし)
Code Validation Results
No critical issues found. |
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.
背景
合成フィクスチャで「誤検知ゼロ」だったルール群が、実コード 10リポ 1,015ファイルでは 121件中の真の指摘が約2件(誤検知率98%) だった。ミューテーションテストに合格していても、ルールが実世界で妥当かは一切示さない。
この失敗を、次に同じことをする人(含む将来の自分・エージェント)が踏まないよう proof として固定する。
追記内容
CLAUDE.mdに「検出ルールを追加・変更するときの必須手順(proof)」節を新設。scan_file/check_file)を通す(過去に配線漏れ2件、内部関数テストでは検出不能だった)あわせて誤検知を生みやすい既知の型5つを列挙(SQLキーワードは英単語 / 危険な関数名は同名メソッドを持つ / 定数実行は注入経路でない / 語の出現≠使用 / モジュール横断は行単位スキャナでは判定不能)。
検証
pytest 153件パス(ドキュメントのみの変更でコード影響なし)。