Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
概要
ブックマークの要約とチャットの回答を「Web で確かめる」機能を足します。文章から事実の主張を取り出し、主張ごとに Web(#100 の Brave Search)で探して、見つかったページと照らし合わせ、主張ごとに 裏付けあり / 食い違いあり / 見つからず を、ページの一節とリンク付きで出します。判定ではなく手がかりとして出し、要約・回答は書き換えません。
使い方
仕組み(
data/factcheck/FactChecker){"claims": [...]})で出させ、形が崩れていれば理由を添えて1回作り直させます(要約・タグ・カテゴリの出力を JSON スキーマで縛り、形が崩れたら直す指示を付けて作り直させる (#7) #43 のStructuredOutput.generateWithRepair)。端末内 AI は3つ、クラウドは5つまで。AI を使えない・それでも崩れたときは、数字・英字(名前)を含む文から選びますWebSourceProviderで上位のページを読みます(端末内 AI はページ2件・抜粋 450 文字、クラウドは3件・1,200 文字)。回数の制限・オフラインモード・ローカルネットワークへの接続の禁止は、そちらの仕組みをそのまま使います{"verdict", "sources", "quote"})で判定させます。AI の引用は、本当にページの抜粋の中にあるときだけ使い(空白・全角半角の違いは無視)、無ければEvidenceFinderで見つけた一節を出します。AI を使えなければEvidenceFinderだけで判定し、その場合「食い違いあり」は出しません保存(DB v31)
fact_checksテーブル(MIGRATION_30_31)。対象(要約・回答)ごとに1行で、確かめ直すと置き換えます。開き直したときは保存した結果を出し、検索し直しませんBackupCoverageに理由): 確かめた時点の手がかりで、もう一度確かめられること、回答のメッセージの ID は読み込む端末で振り直されて対象に結び付かないこと制限
complete)が既存の仕組みで記録されます。Brave Search の回数は Brave の管理画面で見るものなので、アプリでは数えていません(今はクラウド AI が無効のため、AI は端末内で動きます)確かめたこと
./gradlew :app:assembleDebug :app:testDebugUnitTest :app:lintDebugがすべて成功(単体テスト 2,637 件、失敗 0。develop の bookmarks に処理の状態・最後に開いた日時・保存した日時のインデックスを足し、よく読み直す問い合わせで全件を読まずに済むようにする(DB v30) #104 を取り込んだ後)FactCheckPromptsTest(指示・解析・引用の確認・JSON)、FactCheckerTest(裏付け・食い違い・見つからず・作られた引用を使わない・AI なし・作り直し・クラウドの量・検索の失敗)、FactCheckRepositoryImplTest(Room のメモリ上の DB で保存・置き換え・片付け)、FactCheckViewModelTest、MigrationTest.migrate30To31。検索・AI はすべて Fake で、本物の API には接続しませんFactCheckScreenshotTest(結果・途中・キーが無い・オフラインモード・古い結果と失敗)を記録して見た目を確かめました端末か本物のキーが無いと確かめられないこと
DB の版
v31 を使います。#104(bookmarks のインデックス、v30)を取り込んだ後に版を上げ直しました。v30 のスキーマ JSON は develop のまま変えていません。出す前に開いている PR を確かめ、
AppDatabase.VERSIONを上げているものはありませんでした。🤖 Generated with Claude Code