Repository navigation
fix: コミット生成の根拠を表示された差分に限定する - #8
Merged
Merged
Conversation
エージェントの最後の応答を優先していたため、未実施の修正案まで変更として書かせていた。 文脈は差分で裏付けられる理由と言葉選びに限定し、提案や省略部分から変更を補わせない。 変更行が見えない場合はパス・行数・メタデータの範囲に限定する通知を加え、Appleの縮約後にも適用する。 本文の最低項目数を廃止し、共通ルールと通常・combined差分、Apple向けプロンプトを検証する。
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.
概要
フックから渡るエージェントの応答に未実施の修正案があると、その案を実装済みの変更としてコミットメッセージに書かせていました。表示された差分を変更事実の根拠とし、文脈は差分で裏付けられる理由と言葉選びの補助に限定します。
変更内容
build_prompt()の文脈優先の指示を置き換え、提案・予定・質問・未検証の主張や、省略された内容から変更を補わないルールを追加しました。本文の最低2項目という条件も外し、根拠のある変更ごとに1項目、最大5項目とします。実際の追加・削除行が見えない場合は、その制約を明示し、パス・行数・表示されたメタデータから言える範囲に限定します。通常/combined hunkを判定し、ファイルヘッダーや要約の行数は本文と数えません。Apple Intelligence の system instructions も同じルールを使い、縮約後の再構築でも本文の有無を判定します。
Claude と Codex の設計相談を踏まえ、根拠の優先順位を共通化する案を採用しました。ファイル単位の省略表示は既存の一覧で維持します。文脈の長さ上限や縮約順序は別の方針変更になるため、今回は変更していません。
Codex の差分レビューでは指摘はありませんでした。
検証
make ci: format・clippy(Apple Intelligence 有効/無効)・全テストcargo test --locked --features apple-ai ai::apple::tests: Apple向けの共通ルールと、本文が消えた縮約後の通知astro-sight review/impact: API変更・未解決の呼び出し元なしプロンプトの内容を検証しており、すべてのモデルが常に指示に従うことを保証するものではありません。
Closes #6