Repository navigation
原資料を保持する台帳と目印を追加し、追加分析を要約の選択から分離 - #35
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca00f0fe15
ℹ️ 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".
| (value.sourceLedger !== undefined && | ||
| canonicalJSON(value.sourceLedger) !== canonicalJSON(expected.sourceLedger)) |
There was a problem hiding this comment.
Ignore extraction selection when revalidating the ledger
When a smart-mode summary successfully omits only blank or administrative pages, its saved ledger records those pages as omitted; handleFollowup then re-extracts the same PDF in full mode, where every page is selected, so this whole-ledger comparison rejects the unchanged PDF before either scoring or additional analysis can run. Selection is an extraction-policy marker rather than source integrity, so it must be normalized or excluded when comparing the smart summary with the full re-extraction. CLAUDE.mdL175-L175
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
ba40752 で修正しました。
原資料の比較を共通の sameSourceLedgerContent にまとめ、ページの selection だけを比較対象から外しました。revalidatePresentation と buildAnalysisInput の両方で使っています。保存済み台帳の完全なチェックサムは先に検査し、文字・配置・抽出状態・目印の変更は引き続き拒否します。元の選択状態と結果IDも書き換えません。
空ページだけを省いた smart 要約から full 再抽出後の追加分析・採点へ進む Background 結合テストを追加しました。選択だけ異なる正常例、本文・座標・状態の変更、チェックサム不一致の拒否も確認しています。
|
|
||
| /** Every source block survives. Recognition adds hints only; it never gates retention. */ | ||
| export function buildSourceLedger(pages: ExtractedPage[]): SourceLedger { | ||
| const hints = new Map(sourceInventory(pages).map((e) => [e.blockId, e])); |
There was a problem hiding this comment.
Pass the document type when deriving ledger role hints
For every document type other than other, this call silently uses sourceInventory's default type and stores incorrect role hints in the model input. For example, an earnings heading such as 経営成績 and its rows are marked content instead of performance, while earnings-revision forecast headings can be marked outlook instead of content; these misleading hints can steer the new full-source analysis into the wrong section even though buildPresentation already knows facts.documentType. CLAUDE.mdL175-L175
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
ba40752 で修正しました。
buildSourceLedger に documentType を渡し、sourceInventory の分類へ反映しました。表示構成の作成と分析時の再抽出照合の両方で facts.documentType を渡しています。
決算の経営成績が performance になること、業績修正を含む文書種別ごとの分類が sourceInventory と一致することを確認しました。名前による原行の除外や、目印から検証済み事実への昇格は追加していません。
| rows: rows.map((r) => [r.id, r.text, r.spanIds.map((id) => position(spans.get(id)!))]), | ||
| marks: [...marks.values()], | ||
| looseSpans: p.spans.filter((s) => !used.has(s.id)).map(position), |
There was a problem hiding this comment.
Include source items that were not converted to spans
For PDFs containing rotated text, extractPageLayout retains the text in page.text and sourceItems but deliberately excludes it from spans; this projection builds both rows and looseSpans only from spans, so that text silently disappears from sourceDocument, has no raw citation ID, and cannot be considered by the promised full-source analysis. Include otherwise-unrepresented source items or the retained page text in the model projection. CLAUDE.mdL175-L175
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
ba40752 で修正しました。
spans に十分対応していない元の sourceItems を、原IDと文字の対応で判定して originalItems に残します。rawitem: の引用、保存復元、診断コピーまで接続しました。同文でも別の原IDなら除外せず、部分的な文字対応や結合・分割された文字も検査します。
同じ傾向の問題として、回転文字だけのページが「文字を取得できない空ページ」と表示される点も修正しました。抽出状態と validatePages を揃え、文字は保持したが行・表への対応は未対応という警告に分けています。水平文字の欠落や抽出失敗の拒否は維持しました。
回転のみ/混在/空白、同文の別ID、部分対応、引用・保存復元、診断の余分なフィールド除去をテストしました。安川と26ページ資料では通常文字の重複追加は0です。これらの原文字は意味未点検のままで、検算済み数量としては扱いません。
|
@codex review ba40752 の再レビューをお願いします。3件それぞれに対応内容と検査を返信しました。 共通原因を「原資料・処理方針・派生表現の混同」と整理し、選択方針だけを除く同一性比較、文書種別の受渡し、未対応の元文字の保持・引用を修正しました。関連する回転文字のみのページの空判定と警告も修正しています。 全1,636テスト/58ファイル、type-check、lint、build、CMap同梱照合が成功。4資料の固定再生で保持と予算を再確認し、26ページ資料は約17.1万文字/236KBで既存の入力予算内です。リモートtreeは検証したローカルtreeと一致しています。 このheadのCI statusとPR workflow runは取得時点で0件のため、CI成功とは扱っていません。有料API・実モデル品質・実Chromeは未検証です。 |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
変更内容
原資料の保持と、要約に載せる項目の選択を分離します。
確認したこと
入力・保存の予算
追加分析の要求は従来どおり1回です。全文を読むため入力トークンと費用は増える可能性があります。
全メッセージ合計25万文字/512KiBを実行上限とし、超過時は原文を黙って削らず停止します。実サイズと上限は診断に残します。26ページ資料は約17.0万文字/235KBでした。各モデルの文脈長に収まることまで保証する上限ではありません。
診断の1記録上限は256KiB、ストア全体は従来の1MiBです。大きい診断の省略を明示します。ブラウザーの保存容量が不足した場合は警告し、現在の表示結果は維持します。
検証の限界
詳しい契約と検証範囲は docs/additional-analysis.md に記載しています。