Skip to content

fix: 要約の意味保持・部分失敗・設定と保存の競合を修正する - #30

Merged
ivgtr merged 4 commits into
mainfrom
fix/partial-summary-recovery
Oct 8, 2026
Merged

ivgtr merged 4 commits into
mainfrom
fix/partial-summary-recovery

Conversation

@ivgtr

@ivgtr ivgtr commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

変更

  • 生成応答の既知 sourceIds の重複だけを正規化。不正な文脈・指標・説明を項目単位で除外し、正常項目を独立した意味点検へ渡す。未知参照・不正数量・保存形式の検証は維持する
  • 確認済みの内容を先に表示し、未整理部分は区分・ページ別の案内1か所に集約。原文444断片は末尾の閉じた欄に全件保持する
  • 確定値の1株当たり・株式分割前後/調整済みの根拠を、現在値と比較値それぞれの表示・注記に保持。保存復元後も同じ意味を表示する
  • 同一原数量の統合時に点検済みの損失/利益区分を保持。期間の同義表現は共通規則で対応し、矛盾する区分・比較は未整理にする。本文・追加分析・計算・不足範囲で同じ採否を使う
  • 診断・要約・追加分析・採点の保存失敗を生成結果から切り離し、完成結果と簡潔な保存警告を表示する
  • キャッシュ削除を一覧へ反映し、古い読込/保存完了との競合を防ぐ。「表示」時の消失・読込失敗は再要約へ回復できる
  • Offscreenの初期化を共有Promiseにまとめ、同時初回要求の競合と失敗後の再試行を扱う
  • ContentのReact root・結果行・監視処理を明示的に所有/破棄。OFF中の遅い応答、反復ON/OFF、行変更/削除、iframe遷移/置換、戻る操作を扱う
  • APIの実効URLを要求・キャッシュ指紋で共通化し、URLだけの変更でも要約・採点・追加分析と遅い応答を分離。パス・クエリの違いを維持し、指紋にはURLのSHA-256だけを保存する
  • 補足の意味より先に原数量の物理IDを照合。同じ確認済み実績を予想として扱う等の明確な矛盾を、現在値・比較値とも共通経路で除外。既知の実績・比較、別名、曖昧な文脈、別セルは保持する
  • 分析指紋をv104へ更新。個社/PDF専用分岐、OCR、API上限変更、新しいCI・評価基盤は追加しない

再レビュー対応(4907919からの差分)

  • 原文増減率も物理所有者・文脈・既知の比較軸と数量IDで照合する。比較元の未抽出や補足専用の数量も同じ経路で検査する
  • 指標・範囲・会計基準の既知の別名を統合・比較・重複除外で共通化。未知の自由記述と既知キーを区別する
  • 追加分析で統合済み観測を確定事実への補足として渡し、同じ現在値を数値根拠として再掲しない。観測ID・区分・比較・条件は保持する
  • 後続キャッシュ読込失敗・保存スコア検証失敗では自動採点を止め、本文と明示再試行を保持。遅い読込失敗で開始済み分析を消さない
  • Reactの購読完了を待つライフサイクル検査へ統一。独立差分レビューで見つかった同種の抜けも修正済み

検証

  • 最終差分の通常の npm test(設定済み2並列): 40ファイル / 1,254件成功
  • type-check / lint / build / git diff --check 成功
  • 前段では既存2件のタイムアウトとReact購読完了前の検査失敗があった。再レビューでiframe置換・再読込・行変更・再有効化の待機を統一。検査内容・タイムアウトを緩めず、最終2並列で全件成功
  • 既存の実PDF由来6資料の候補→確定→保存契約、複数の表構造、分割調整・比較基準の表示/復元、実Reactの保存失敗・削除競合・中断/再開を確認
  • 問題の実応答を無加工で最終コードへ再生し、19確定事実を保持したまま24指標・11説明が形式・数量検証を通り、意味点検へ到達することを確認
  • URLだけの切替、同一URL表記の保持、遅い応答、旧設定での採点/分析拒否を確認。意味点検の固定した誤承認から保存復元・本文/冒頭・追加分析・計算・未整理範囲まで同じ採否を確認
  • 固定応答smokeの事前検査は成功・部分失敗・最終失敗の3ケース成功。独立コードレビューの指摘を修正・再確認済み
  • 公開commit af196f1 のtreeはローカル検証済みtree 841b7d0ab320d224bba79109e4b41c6549ed1591 と一致。PR向けworkflow/statusは登録なし

未確認の範囲

実APIは呼び出していないため、実応答の意味点検通過や未知資料の生成品質は未確認。表示用の固定点検応答を使った再生はモデル品質の証明に数えない。実Chromeでの容量不足・拡張通信・画面は未確認。前回の実拡張smokeはChromium起動時に環境のsocket権限制限で停止し、今回その制限を回避していない。元の診断ログ・PDF・再生スクリプトはコミットしていない。PRは作業開始時からopen/non-draftで、状態は変更していない。マージ・リリースは行っていない。

@ivgtr ivgtr changed the title fix: 補足要約の部分失敗を隔離し、未整理表示を集約する fix: 要約の意味保持・部分失敗・保存と画面の競合を修正する Oct 7, 2026
@ivgtr ivgtr changed the title fix: 要約の意味保持・部分失敗・保存と画面の競合を修正する fix: 要約の意味保持・部分失敗・設定と保存の競合を修正する Oct 7, 2026
@ivgtr
ivgtr marked this pull request as ready for review October 7, 2026 15:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-08T00:21:05.891964Z af196f1 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.

ivgtr commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

前回のレビューは Running 表示のままで結果が出ていないため、現在の head 49079196471d7e81512ed61d3843baf6a2cb9dc0 を再レビューしてください。キャッシュの実効 API URL による分離と、原数量の物理 ID・文脈照合を含む共通パイプラインの修正を確認してください。

@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: 4907919647

ℹ️ 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 on lines +599 to +602
if (
contradicted(observation) ||
(observation.comparison && contradicted({ ...observation, ...observation.comparison }))
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate rateId against its physical owner

When an otherwise valid comparison supplies a rateId belonging to a different confirmed percentage row, and the confirmed current fact has no paired rate of its own, this check validates only the current and comparison amount IDs. The later rateIds.size check sees a single ID and accepts it, after which observationChange displays that unrelated percentage as the source-reported change. The rate quantity needs an ownership/context check against the current metric and comparison axis, not just a % unit check.

Useful? React with 👍 / 👎.

@ivgtr ivgtr Oct 8, 2026 •

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.

修正しました(af196f1)。

rateIdも物理IDへ解決して確定所有者の指標・期間・範囲・会計基準・状態を照合し、原数量を別の増減率として使う観測を除外します。金額と率の対応が確定していれば現在値の物理IDを、比較も確定していれば比較軸・比較値IDも照合します。前期金額が未抽出の場合や補足側だけの現在値にも同じ検査を適用します。未知の文脈と未対応の補足率は独立点検に残します。

修正前に無関係な確定%が受理されるケースを再現し、事実ID/原数量ID、比較軸の取り違え、前期金額なしの所有者、正常な率と未知の比較文脈を回帰検査しました。保存復元後も無関係な「原文%」が表示・追加分析へ入らないことを確認済みです。

Comment thread src/lib/disclosure-observation.ts Outdated
Comment on lines 608 to 614
native(p.valueId) === native(observation.valueId) &&
(observation.entity === null || observation.entity === p.entity) &&
observation.metric === p.metric &&
observation.state === p.state &&
(observation.period === null || periodKey(observation.period) === periodKey(p.period)) &&
(observation.scope === null || observation.scope === p.scope) &&
(observation.basis === null || observation.basis === p.basis)

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 Match known context aliases before treating values as supplemental

For a reviewed observation that references the same physical quantity but uses a recognized equivalent spelling—such as 国際会計基準 versus IFRS, 非連結 versus 個別, or two labels sharing a reportingMetricKey—the contradiction check correctly considers the contexts compatible, but these raw equality checks still fail. The observation is therefore placed in supplement and rendered and passed to analysis alongside the confirmed primary value, duplicating one physical quantity instead of merging it; use the same canonical context keys here for known aliases.

Useful? React with 👍 / 👎.

@ivgtr ivgtr Oct 8, 2026 •

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.

修正しました(af196f1)。

指標・範囲・会計基準の既知の別名を共通キーで照合し、統合・比較基準・比較値の重複除外へ適用しました。IFRS/国際会計基準、個別/単体/非連結、reportingMetricKeyの別名は同じ原数量へ統合します。未知の自由記述には別のキーを使い、曖昧な文脈や同額の別セルを誤って統合しません。

消費側も確認し、追加分析で統合済み観測が現在値をもう一度数値根拠として列挙していた経路も修正しました。確定事実への補足として渡し、観測ID・点検済み区分・比較・条件・原文対応を保持します。別名が補足へ重複しないこと、比較基準の対応、未知期間の保持、分析根拠での重複除去を検査しました。

.filter(Boolean)
.join(' / ')
);
setStagesReady(true);

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 Do not auto-score when cached stages could not be read

When chrome.storage.local.get rejects while restoring a cached summary and experimental scoring is enabled, setting stagesReady to true leaves an empty score stage, so SummaryButton immediately calls startScore() and issues a new paid scoring request. Reopening the summary during a persistent storage failure repeats this request even though the warning says the user can retry; keep automatic scoring blocked on this failure path or expose an explicit retry state.

Useful? React with 👍 / 👎.

@ivgtr ivgtr Oct 8, 2026 •

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.

修正しました(af196f1)。

後続キャッシュの読込失敗をキャッシュなしとして扱わず、段階別の再試行可能なエラーに変更しました。採点エラーがある間は自動開始を止め、ボタンによる明示再試行を維持します。同じ原因で自動採点されていた保存スコアの検証失敗にも対応しました。

実Reactの固定応答テストで、読込失敗・開き直し・採点OFF→ONでは通信0回、明示再試行で初めて通信することを確認しました。本文を保持し、遅い読込失敗で開始済みの追加分析を置き換えないことも確認済みです。実APIは呼び出していません。

Comment thread src/content/hooks/useSummarize.test.ts Outdated
});
expect(doc.querySelector('.tdnet-digest-header')).toBeNull();
expect(replacement.doc.querySelectorAll('.tdnet-digest-button-cell')).toHaveLength(1);
expect(listeners.size).toBe(subscriptions);

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 Wait for replacement root effects before asserting subscriptions

This assertion runs immediately after the replacement iframe and React root are created, but the root's passive effects have not necessarily installed all storage listeners yet. A normal parallel npm test run intermittently reaches this line with listeners.size === 2 instead of 3, while a retry passes; use the same waitFor synchronization used by the neighboring lifecycle assertions so the default test command is not flaky.

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.

修正しました(af196f1ca31cc875e4c0f2d42f75a9d31b76d0f7)。rootのDOM挿入と非同期設定読込後の購読完了を区別し、waitForで購読数が戻るまで待つようにしました。iframe置換に加え、再読込・行のPDF変更・再有効化も同じ待機方法に揃えました。

検査内容やタイムアウトを緩めず、最終差分で通常のnpm test(設定済み2並列)が40ファイル/1,254件成功しました。type-check・lint・build・git diff --checkも成功しています。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

4件の指摘と周辺の同種問題を修正し、それぞれのスレッドへ対応内容を返信しました。現在のhead af196f1 を再レビューしてください。

今回の差分は8ファイル、+409/-108です。

  • rateIdの物理所有者と、既知の現在値・比較軸・比較値を照合。前期金額が未抽出でも所有者を確認し、未知の比較文脈は独立点検へ残す
  • 指標・範囲・会計基準の別名照合を共通化。表示の重複を除き、追加分析では確定値への補足として同じ現在値の再掲を避ける
  • キャッシュ読込失敗と保存スコアの検証失敗を明示再試行へ分け、開き直しや設定切替で自動採点しない
  • rootのDOM挿入後、購読完了まで待つ。iframe置換・再読込・行変更・再有効化へ同じ対策を適用
  • 分析指紋をv104へ更新

最終の通常npm test(2並列)は40ファイル/1,254件成功。type-check、lint、build、diff checkも成功しました。公開treeは検証済みtreeと一致しています。元の診断応答の固定再生では19確定事実を保持し、24指標/11説明が意味点検へ到達し、表示と保存復元が一致しました。

実API・実Chrome画面は追加検証していません。固定点検応答をモデル品質の証明には数えていません。マージ・リリースは行っていません。

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: af196f1ca3

ℹ️ 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 7915d8a into main Oct 8, 2026
@ivgtr
ivgtr deleted the fix/partial-summary-recovery branch October 8, 2026 08:06
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