Skip to content

前年比較・要約保存・追加分析の全体要約を改善 - #37

Merged
ivgtr merged 2 commits into
mainfrom
fix/summary-persistence-overview
Oct 10, 2026
Merged

ivgtr merged 2 commits into
mainfrom
fix/summary-persistence-overview

Conversation

@ivgtr

@ivgtr ivgtr commented Oct 10, 2026

Copy link
Copy Markdown
Owner

変更内容

  1. 前年の値が原資料にある場合の比較を補完
    • 選択済み実績と同じ表・指標軸の前年値を、通常の候補検証に通して取得します。
    • 安川電機の原PDFと固定応答の再現で、税引前利益25,963百万円/前年25,204百万円、約+3.0%を確認しました。期間・主体・範囲・会計基準・条件・一意性の照合は維持しています。
  2. 保存失敗への対応
    • 大きい要約を可逆圧縮し、復元後も原文・表示・結果IDを再検証します。再現結果では約969KBから193KBになりました。
    • 容量不足とその他の保存エラーを区別します。既存キャッシュや診断は自動削除しません。
    • 最終診断の保存に失敗しても、同じ実行・結果・入力・PDFに対応する記録だけを上限付きメモリから取得できます。未保存であることと安全な失敗分類を付け、古い途中記録で代用しません。
  3. 補足要約の未整理部分をコンパクトに表示
    • 短い未整理の注意を残し、詳細と原文を一つの閉じた開閉欄にまとめます。原文・ページリンクは保持します。
  4. 追加分析の全体要約を先頭に追加
    • 個別論点を横断する全体要約を同じ1回の応答で生成し、論点群の前に表示します。
    • 全体要約の根拠を独立して検証し、不正な全体要約だけを除外できます。新たな有料要求は増やしません。

分析指紋をv124へ更新しています。拡張機能のバージョン変更・リリースは含みません。

検証

  • 全60ファイル・1,673テスト成功
  • 型チェック、lint、ビルド成功
  • 固定応答の拡張スモーク事前検証: 通常成功・補足失敗・最終失敗の3ケース成功
  • 保存失敗、圧縮中の削除・置換、破損キャッシュ、設定変更後の遅い診断応答、旧保存形式の復元を確認
  • 外部モデルAPI呼出し: 0回

未確認・制約

  • 利用環境の保存失敗が実際に容量不足だったかは未確認です。圧縮は新しい保存の容量負担を減らしますが、既に満杯の保存領域が自動的に解消する保証はありません。
  • 未保存診断の一時記録は現在のService Workerが終了・再起動するか、保持上限を超えると失われます。過去に失われた最終診断を後から復元する機能ではありません。
  • 実Chromiumの画面検証は、一時プロファイルのソケット作成が実行環境に拒否され、描画前に停止しました。実ブラウザーでの成功やスクリーンショット取得は確認できていません。
  • 新しい全体要約の実モデル出力品質は未評価です。固定応答・原PDFの再現検証と区別しています。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:41:56.914374Z a84ac8a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b64effe5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/content/hooks/useSummarize.ts Outdated
} catch {
} catch (error) {
if (run === runRef.current) {
setHasCached(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the previous cache after a replacement write fails

When a cached summary is opened and the user selects 「再要約」, the existing entry remains in chrome.storage.local if the replacement set() fails (for example because the quota is full), but this line unconditionally marks it unavailable. Closing the displayed result therefore changes the button to 「要約」, and the next click makes another paid LLM request instead of reopening the still-valid older cache; this can repeat indefinitely while storage remains full. Retain or re-check the prior cache state on a failed replacement write.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a84ac8a で対応しました。

原因は、新しい結果の保存失敗を「使える保存結果がない」と扱っていたことでした。同じキーの既存キャッシュを、展開・原文・表示・結果IDまで再検証して再表示可能性を維持します。画面に出ている新しい結果は置き換えず、閉じて再度「表示」したときに保存済みの結果を開きます。

同じ傾向の経路も見直しました。

  • 一時的な読込失敗や古くなった読込を「保存なし」と扱わない
  • 「表示」を押した時点で保存が消えていても、その操作から有料生成へ進めない
  • 「要約」でも毎回保存を確認し、現在のキーで正常に「保存なし」と確認できた場合だけ生成する
  • 設定変更・削除・置換後に返った遅い保存再確認を反映しない

旧形式・圧縮形式の上書き失敗→閉じる→再表示、初回の存在確認失敗、設定/削除/置換との競合、表示中の新しい実行を旧結果で置き換えないことを追加検証しました。全1,680テスト、型チェック、lint、ビルド、固定応答の事前検証が成功しています。提供された応答の再現要約も変更前と一致し、実モデルAPIは呼んでいません。

ivgtr commented Oct 10, 2026

Copy link
Copy Markdown
Owner Author

@codex review

a84ac8a の再レビューをお願いします。
前回の3b64effからの差分は、保存失敗時の既存キャッシュ再検証と、読込不明・消失・競合による意図しない有料再生成の防止です。4ファイルを変更し、関連する回帰テストを7件追加しました。指摘スレッドに原因と対応内容を返信済みです。

全1,680テスト、型チェック、lint、ビルド、固定応答の事前検証が成功。実Chromiumの画面検証は環境制約で未確認、実モデルAPI呼出しは0回です。

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a84ac8a330

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ivgtr
ivgtr merged commit b8e5b4b into main Oct 10, 2026
@ivgtr
ivgtr deleted the fix/summary-persistence-overview branch October 10, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant