Skip to content

fix: 決算数値のセル境界・対象期表示・結果別診断を整合 - #32

Merged
ivgtr merged 14 commits into
mainfrom
fix/earnings-result-consistency
Oct 9, 2026
Merged

ivgtr merged 14 commits into
mainfrom
fix/earnings-result-consistency

Conversation

@ivgtr

@ivgtr ivgtr commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

変更

  • 隣り合う別の物理セルの数量を結合しない。原文字、数量、段落の再結合、表示用数量、保存原文の再検証で同じ所有境界を使い、同セルの分割桁・符号・小数・範囲は保持する。近い別セルの独立数量も表示・説明への対応付けまで残す。元数量IDを表示値に持たせ、同じ原数量の別名同士による自己比較を拒否する。別原文の同額は統合しない。
  • 決算短信の冒頭を、原文が宣言する対象期・会社・範囲・会計基準に揃える。当期の主要指標は固定順に並べ、前年や別の報告対象で欠損を埋めない。比較値からの当期未確認警告は直前年度の同じ期間形に限り、古い履歴・将来期は本文に保持する。修正後予想は独立した予想宣言に照合する。対象期と報告属性は冒頭と必須判定で共通に選択し、会社・範囲・会計基準が揃った対象だけを充足扱いにする。属性不足は予想の未定/非開示や修復根拠の扱いでも未解決とし、確認済み本文を保持する。年なし表題・先頭の会社属性に直結する正式な実績見出しから年を得て、元の表題属性を保持する。番号なし四半期・競合する期間や属性は未特定とし、年なし表題の明示四半期も別の見出しで上書きしない。
  • 表題・日付・管理欄・会社/属性を完全な記録として読み、表紙の開始位置も文脈・冒頭・必須判定・表紙実績で共有する。英数字・句読点・連続イニシャルを含む一般的な会社ワードマークの後の完全な表紙を保持し、任意の未知本文は飛ばさない。電話・URL・コード等の管理値を型ごとに検査し、全セルの完全性を証明してから投影記録ごとに除外する。会社欄と同じ行や隣接セルにある管理値にも同じ検査を使う。代表者名のように外側のラベルが氏名を宣言する欄は、追加の氏名ラベルなしで既存の名前文法へ照合する。会社根拠・日付/配当日程・本文や未知セルの混在は残す。候補・確定事実・必須判定・冒頭・保存再検証で同じ意味文脈を使う。隣のURL等を期や状態へ混ぜず、原文と根拠IDを保持する。表紙と後段の参照を区別し、同じ物理ブロックにまとまっても参照先の会社/属性を発行会社へ昇格させない。属性不足・競合・主要項目の未確認を上部に示し、確認済み本文は残す。
  • 決算の確定表と補足表を同じ期間階層で表示し、同じ話題・期間・状態の見出しを一度にまとめる。範囲・基準・条件・対象会社・比較値・原文注記は各表に保持する。見出しには既存の所属節/明示された補足話題の名前を使い、配当予想を業績予想と呼ばない。原期間の全角/半角表記や同じ表示名を持つ補足表でも途中に別期を挟まない。
  • 診断を実行ID/結果IDに紐付け、最大12実行・2MiB・1実行192KiBで保持する。別PDFや同PDFの後続失敗で成功結果の診断を置き換えない。保存失敗でも成功本文を維持する。
  • 旧診断は厳密一致で上限内へ移行し、設定一式・APIキー・ヘッダーは保存しない。診断取得や復元によるAPI再実行は行わない。分析指紋をv118、表示保存形式をv7へ更新。事実と生成応答の形式は維持する。

検証

  • npm test: 1,523件 / 49ファイル成功。type-check / lint / build成功、168 packed CMaps + LICENSE一致。
  • 対象PDF全26頁の固定再生: 独立固定23数量、根拠付き13必須枠、候補修復なし、表示と保存再検証の一致。
  • 罫線付き表紙全体、表題/日付の順序、長い管理ブロック、部分参照、属性不足/競合、未知セル・本文混在、近接数量、入力順反転、保存改変を正負で確認。
  • 参照短信が混在するお知らせ、年なし/番号なし四半期、複数表題の競合、硬いセル区切り、空白入り単位、事実ID/原数量IDの自己比較を確認。旧表示v6・欠損/不正な数量所有者・PDFと異なる保存値を拒否し、正常な本文/比較/JSON復元を維持。
  • 先行会社ワードマークの後の実績(節あり/節なし)を候補→入力必須枠→冒頭/本文→JSON/PDF再検証まで確認。表紙基準の予想継承、別の一般名称、参照語・本文・数量・混在セル・遅い会社欄の正負境界も確認。
  • 管理行の投影・完全性の正負と、補足生成の原文/数量→未分類表示→保存復元を確認。会社名のカンマ・略語ピリオドは部品で網羅し、節なし実績のストーリーをその代表例へ置換。
  • コード/URL/電話/取引所/役職・連絡先の型と、会社欄・隣接セルを通る不正値の拒否を確認。年なし/表題なしの先頭実績、属性衝突、参照/本文/予想/別ページの境界を共通選択の部品と候補→必須枠→表示/保存の代表例で確認。
  • 決算短信の対象属性が欠けた実績/予想6枠を、未解決・修復根拠なしとして保持。属性が揃った正例、未定/非開示の免除、生成1回/修復0回、本文と保存復元を確認。代表者名欄と直前比較期の警告も正負で確認。
  • 英数字社名、数字/数量/番号付き参照語の境界、節なし実績の必須枠/表示/保存を確認。条件・範囲・基準・会社・別期・状態・原表記の見出しを9行と逆順で検査し、確定/補足の同じ話題・別話題、配当の原文照合済み実績/予想、HTMLとJSON/PDF再検証を確認。
  • A成功→B開始→A再表示/再読込、逆順完了、同PDFの次回失敗、容量/保存失敗を確認。
  • 再解析の重複を削減し、完全な修復・実PDF・利用ストーリーの統合ケースだけ上限30秒を設定。検査内容、通常の全体5秒設定とworker数は維持。

実API呼出し0。固定応答の成功を実モデル品質の保証にしない。実Chrome拡張は本環境のsocket権限で起動できず、実画面・拡張通信は未確認。

詳細: 操作ストーリー、保持契約、検証記録

@ivgtr
ivgtr marked this pull request as ready for review October 8, 2026 15:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-09T06:21:19.006762Z db11f13 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: 7675aead36

ℹ️ 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/lib/summary-earnings-policy.ts Outdated
...normalized.matchAll(
/〔(日本基準|IFRS|国際会計基準|米国基準)〕|\[(日本基準|IFRS|国際会計基準|米国基準)\]/gi
),
].map((match) => match[1].replace(/^ifrs$/i, 'IFRS'))

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 Read either accounting-standard capture

For an earnings title using the supported ASCII bracket form, such as 2026年3月期 決算短信[IFRS](連結), the standard is stored in capture group 2, so match[1] is undefined and .replace() throws. Because earningsTarget() runs while building and rendering every earnings presentation, these documents cannot produce a summary; select match[1] ?? match[2] before normalizing the value.

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.

再現して修正しました(940e5aab119d1cb8a812a89fa7fa8b507d96213f)。ASCIIの [IFRS] では2番目のcaptureに値が入り、1番目へのreplaceで例外になっていました。

括弧付き会計基準の抽出を bracketedReportingBases にまとめ、match[1] ?? match[2] を原文宣言と冒頭対象の両方で使用します。ASCII・全角角括弧を含む表題から対象属性が得られ、別基準・別範囲・別期間の事実は採用しない回帰を追加しました。

Comment thread src/lib/summary-earnings-policy.ts Outdated
Comment on lines +44 to +46
...normalized.matchAll(
/〔(日本基準|IFRS|国際会計基準|米国基準)〕|\[(日本基準|IFRS|国際会計基準|米国基準)\]/gi
),

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 Recognize IFRS会計基準 as the report basis

For the standard TDnet title form 〔IFRS会計基準〕—including the checked-in earnings cover fixture—NFKC normalization produces 〔IFRS会計基準〕, which this expression does not match. The target therefore gets basis: null, and matchesEarningsTarget() skips its basis check, allowing a same-period/scope fact from another accounting basis to be promoted into the headline; accept and canonicalize the IFRS会計基準 spelling.

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.

再現して修正しました(940e5aab119d1cb8a812a89fa7fa8b507d96213f)。冒頭だけでなく原文宣言側にも同じ語彙欠落があり、実PDFの固定応答までbasis:nullになっていた点も修正しました。

IFRS / IFRS会計基準 / 国際会計基準の比較キーを共有し、原文・確定事実の表記は保持します。必須判定、補足との照合、前年比較、金額と印字率の対応、分析計算にも同じ意味を適用しました。別基準の補足が未特定扱いで残る経路と、同義表記だけで比較・計算が消える経路も回帰で確認しています。

原表紙と実PDF全26頁の固定再生では、連結範囲・原文のIFRS会計基準・冒頭対象のIFRSを独立した期待値として確認し、23数量と13必須枠、保存再検証が通っています。

Comment thread src/lib/summary-earnings-policy.ts Outdated
Comment on lines +52 to +54
const quarter = shapes[0]?.match(/第([1-4])四半期/)?.[1];
if (!quarter)
return { fiscal, periodKind: 'fullYear', label: fiscal, scope, subject: null, 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 Treat 中間決算短信 as a second-quarter report

For the supported title 2026年3月期 中間決算短信〔日本基準〕(個別), reportingPeriodShapes() finds no shape because it recognizes 中間期 but not 中間決算, so this branch declares the target to be fullYear. Facts extracted from the report's intermediate-period headings are marked cumulativeQ2 and consequently fail matchesEarningsTarget(), removing the current results from the headline; map this title form to the second-quarter cumulative period before taking the full-year fallback.

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.

再現して修正しました(940e5aab119d1cb8a812a89fa7fa8b507d96213f)。共通の期間解釈で中間決算短信を中間期の表記として扱い、冒頭と必須判定の両方を第2四半期累計に揃えました。通期や単独期の事実で代用できないことも確認しています。

同原因の監査で、四半期タイトルの累計/単独の限定によって範囲・会計基準が消える経路と、必須判定で単独が落ちる経路も修正しました。第2・第4四半期単独を候補検証→必須判定で確認し、累計/通期への置換と矛盾した限定は拒否します。

Comment thread src/lib/summary-earnings-policy.ts Outdated
Comment on lines +32 to +36
const scopes = [
...new Set(
(normalized.match(/非連結|個別|連結/g) ?? []).map((scope) =>
scope === '個別' ? '非連結' : scope
)

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 Normalize 単体 as a non-consolidated scope

For a supported title such as 2026年3月期 第3四半期決算短信〔日本基準〕(単体), the scope matcher ignores 単体, leaving target.scope null. Rendering then reports that the scope is unknown and suppresses every actual fact from the headline; include 単体 in this normalization and canonicalize it consistently with 個別 in matchesEarningsTarget().

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.

再現して修正しました(940e5aab119d1cb8a812a89fa7fa8b507d96213f)。単体 / 個別 / 非連結を共通の範囲比較キーに揃え、表題・独立した表紙欄・事実照合で使用します。原文の範囲名は保持します。

同原因で、局所の個別表記が正しく検証されても非連結表紙の必須値を満たせない経路があったため、coverage側も同じ比較に統一しました。同義範囲は充足し、連結など異なる範囲の値は当期主要値に混ざらない正負の回帰を追加しました。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

4件とも再現・修正し、各スレッドへ対応内容を返信しました。最新コミットは 940e5aa です。

共通原因は、原文宣言・必須判定・冒頭表示が同じ期間/範囲/基準を別々の語彙で解釈していたことでした。括弧抽出と既知属性の比較キーを共有し、中間決算短信・単体・IFRS会計基準を揃えました。さらに単独四半期、同義範囲のcoverage、補足の異基準拒否、前年比較・印字率対応・分析計算まで同原因を確認して修正しています。原文の表記・根拠ID、異なる期間/範囲/基準/条件の拒否は維持しています。

差分は17ファイル、+321/-61です。テストは語彙の小さいmatrixと候補→coverageの接点を追加し、既存の比較・補足・計算テストを拡張しました。実表紙の会計基準をnullとしていた固定期待も改めています。

最終ツリーで1,334テスト/44ファイル、type-check、lint、buildが成功。実PDF全26頁の固定再生で23数量、13/13必須枠、会計基準・範囲・冒頭・保存再検証が一致し、168 packed CMapsとLICENSEも確認済みです。公開ツリーは検証済みツリーと一致しています。実APIは0回、実拡張ブラウザー検証は本環境のsocket権限により未確認です。現時点でこのheadのstatus check/PR起動Actionsはありません。

今回の差分
原因・テスト責務・再現手順

最新headの再レビューをお願いします。

@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: 940e5aab11

ℹ️ 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/lib/summary-earnings-policy.ts Outdated
/[0-9][0-9,.]*(?:千|百万|億)?円/.test(reportingPeriodText(excerpt.text))
)
break;
for (const line of excerpt.text.split(/[\n||]/)) {

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 Split structural cell separators before reading cover fields

When a ruled cover lays out 会計基準/範囲 and their values in adjacent cells, buildBlocks() now emits text such as 会計基準 │ 日本基準, but this split excludes │; the field matcher consequently records the value as │日本基準 (and likewise │連結). earningsTarget() then either builds an unusable target that rejects every correctly attributed fact, or marks the cover ambiguous when the title already declares the real value, suppressing current-period figures from the headline. document-context.ts uses the same incomplete delimiter set, so the separator should be handled consistently in both cover-field parsers.

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.

実際の罫線付き文字入力から再現し、93171d759cabe14d595484996508a39b3432ae41 で修正しました。

会社名・範囲・会計基準・株式種類の欄を同じメタデータ投影で読みます。同じ行の明示ラベルと値を対応させ、別ラベルや空欄、改行先の値は補完しません。会社名と属性が同じ行にある場合に、行全体を管理情報として消す経路も修正しました。

単に区切りを除去すると、空の「当社」セルを飛ばして「参考会社」の名前を借りる反例が成立したため、隣接の証拠も追加しました。一意な閉セルの共有辺・上下範囲が一致する関係だけを │、空欄を飛ばす/所属不明/所属重複は ││ として保ち、後者から属性を借りません。どちらも数値の結合を止める境界です。元の数量・符号・単位の結合条件は緩めていません。

また、配当表の列見出し「(連結)」が独立した範囲宣言になる経路を実PDFで検出し、構造セルの裸の語句を属性へ昇格させないよう修正しました。折返された見出しも同様です。

分離・混在・折返しの実罫線を候補→冒頭→保存再検証まで確認し、空欄・別会社列・所属不明・重複所属の負例を追加しました。最終版で1,345テスト/45ファイル、type-check/lint/build、実PDF全26頁の23数量・13必須枠・修復なし・保存再検証が成功しています。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

再レビューの罫線セルP1を修正し、スレッドへ再現・対応・検証内容を返信しました。最新headは 93171d7 です。

欄の読み方を共通化し、会社名を含む混在行を保持しました。隣接セルの幾何的な裏付けも確認し、空の自社セルを越えた参考会社の借用や、配当表の裸の「(連結)」列の属性化を拒否します。数値境界は維持しています。配当支払日の明示欄と株式種類も同原因を確認しました。

今回の差分は11ファイル、+317/-20。最終版で1,345テスト/45ファイル、type-check、lint、buildが成功。実PDF全26頁の23数量・13/13必須枠、修復なし、冒頭・保存再検証が一致し、公開treeと検証済みtreeも一致しています。実APIは0回、実拡張ブラウザーは未検証です。

今回の差分
セル属性と欠損境界の検証記録

最新headの再レビューをお願いします。

@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

if (facts.documentType === 'earnings')
for (const f of primary.filter(
(f) => f.semantics.state === 'forecastAfter' && f.semantics.metricKind === 'amount'
))
take(f);

P2 Badge Filter revised forecasts by the earnings reporting unit

When an earnings PDF contains a verified forecastAfter value from an individual appendix, subsidiary, or another accounting basis, this loop adds it to the headline because primary target-filters only actual facts. The result can place off-target forecast amounts in 開示の要点 even though current results from those same reporting units are correctly excluded; restrict these forecasts by the declared forecast subject, scope, basis, and period before calling take().

ℹ️ 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/lib/reporting-attributes.ts Outdated
parts.push(`${cells[i]} ${cells[++i]}`);
else {
// Bare table-column atoms are not independent metadata declarations.
if (fieldStart(cells[i]) || !line.includes('│')) parts.push(cells[i]);

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 Reject bare atoms after ASCII pipe separators

Fresh evidence in the latest head shows the prior bare-cell issue remains for | and |: NFKC turns both into |, and this condition then appends every nonempty cell because the line lacks │. Thus a row such as 第1四半期末 | 合計 || (連結) still returns (連結), which reportingAttributes() promotes to a scope declaration and can misattribute or reject subsequent table facts. Apply the bare-atom rejection consistently to all supported separators, not only the generated │ form.

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.

再現して修正しました(3a9b69a799187871151cc0a4c01c95a20d4c6fb8)。NFKC後の | と構造区切りの │ を同じ条件で判定し、全角|も含めて裸のセル語句を属性宣言にしません。

3種類それぞれについて、配当表の列見出し・折返し見出し・参考会社名が範囲/主体へ昇格しないことを文脈宣言まで確認しました。明示ラベル付きの正常な欄と、区切りのない単独宣言は保持しています。

Comment on lines +201 to +205
assert.ok(
slots
.filter((slot) => slot.requirement.startsWith('COVERAGE:当年決算実績'))
.every((slot) => slot.sourceIds.length > 0)
);

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 Require the expected coverage slots before using every

If a regression makes coverageReport() produce no current-results slots, the filtered array is empty and .every(...) succeeds vacuously, so this 26-page replay still passes despite no longer proving the documented 13 mandatory slots. The supplied candidates can all validate independently, so the later empty-unverified assertion does not close this gap; assert the expected slot count or exact requirement set before checking their source IDs.

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.

指摘どおり、空の集合ではeveryが通る検査になっていました。3a9b69a799187871151cc0a4c01c95a20d4c6fb8 で、原資料に対応する独立固定13件のrequirement一覧と完全一致させてから検査します。

生成前は13枠すべての根拠ID、生成後は13枠すべての充足を確認します。空配列・当期枠の全欠落・1枠欠落・重複・根拠なし・未充足で失敗する負例も追加しました。23件の確定事実も実際の件数を照合し、返却する数量数を期待配列の長さだけから作らないようにしています。

Comment thread src/lib/document-structure.ts Outdated
Comment on lines +351 to +354
const previousOwner = owners.get(previous.id),
nextOwner = owners.get(next.id);
if (previousOwner === null || nextOwner === null) ambiguous = true;
else if (!canJoinWithinCells(owners, previous.id, next.id)) {

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 Stop ambiguous cells from consuming independent quantities

When one numeric span has ambiguous overlapping-cell ownership but the adjacent span is an independently valid quantity in a unique cell, this branch marks the combined run ambiguous yet continues appending the neighbor. The later i = end then discards both values, so a malformed or overlapping rectangle around one column can erase a valid amount from the next column; break before an independently parseable neighbor rather than consuming it into the ambiguous run.

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.

実際の重複矩形で再現して修正しました(3a9b69a799187871151cc0a4c01c95a20d4c6fb8)。曖昧な100に隣接する一意なセルの20.5が、前後どちらの順序でも消えるケースを確認しました。

完結した独立数量では曖昧なrunをそこで止めます。隣の数量の最初のPDF断片が20.、1,、100~のように未完でも、同じ一意なセル内の続きを限定的に確認するため、分割の仕方だけで値が消えません。

真の分割負号・小数・桁区切り・範囲、壊れた同一セルの数量、曖昧なセルと所属不明の組合せは短い値へ読み替えず拒否します。抽出・原文再検証と既存の数量/数値根拠/表示数量テストを確認しました。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

今回の4件を再現し、3a9b69a799187871151cc0a4c01c95a20d4c6fb8 で修正しました。3件は各インラインスレッドへ返信しています。

レビュー本文の修正後予想の指摘への対応:

  • 必須判定と同じ原文の予想宣言を使い、主体・範囲・会計基準・予想期・期間形状・根拠の所属を照合してから冒頭へ載せます。
  • 個別付録、子会社、別基準、別年度/四半期の確定値は本文に残し、対象外の修正後予想を冒頭へ追加した保存値はPDF付き再検証で拒否します。
  • 当期の期間解釈と予想宣言は独立させました。当期表題が曖昧でも、明示された予想宣言を壊しません。未宣言・属性不明・競合時は生存値から対象を作りません。
  • 正しい同年度通期/次期予想、別単位、順序反転、正しい値の除去、HTML/JSON復元/改変の境界を確認しました。原文なしの保存検査は従来どおり整合性検査です。

あわせて、全区切り表記の裸セル拒否、曖昧なセルの隣の独立数量保持、固定13必須枠と空/欠落/重複などの負例を修正・追加しました。今回11ファイル、+547/-42です。

最終版で1,373テスト/45ファイル、type-check・lint・build成功。実PDF全26頁で実際の23確定事実、固定13/13必須枠、候補修復なし、冒頭・保存再検証が一致。168 packed CMapsとLICENSE、公開treeと検証済みtreeの一致も確認しました。実APIは0回、実拡張ブラウザーは未検証です。

今回の差分
原因と検証記録

最新headの再レビューをお願いします。

@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: 3a9b69a799

ℹ️ 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/lib/summary-earnings-policy.ts Outdated
Comment on lines +159 to +162
(target.basis === null ||
reportingAttributeKey('basis', fact.semantics.basis ?? '') === target.basis) &&
(target.subject === null ||
reportingPeriodText(fact.semantics.subject ?? '') === target.subject)

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 Require target attributes before selecting actuals

When the cover’s 会社名 ... is a standalone metadata block, sourceInventory() removes it as administrative (src/lib/summary-source-inventory.ts:66), so earningsTarget() produces subject: null; these conditions then treat that missing subject—and similarly a missing basis—as a wildcard. If the retained facts include a subsidiary appendix or another accounting basis for the same period and scope, its actual can consequently be promoted into the issuer headline. Treat an unavailable subject/basis as an unresolved target, as is already done for scope, rather than skipping the comparison.

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.

再現を確認し、63e71e2で修正しました。

  • 独立した会社名欄を宣言根拠として原文一覧に保持し、会社・範囲・会計基準が揃わない対象は未特定として扱います。実績と予想で同じ完全性条件を使い、本文の確認済み事実は残します。
  • 同原因の経路も確認し、原文の文脈・必須判定・冒頭選択で表紙の所有境界を共有しました。本文開始後の会社/基準、投影で落ちたセル、連絡欄に混在した金額・株数・外貨を飛び越して後の会社名を借りません。正しい日付・分割予定欄・英数字の証券コードは保持します。
  • PDF付き保存再検証でも対象外の実績を冒頭に追加した保存値を拒否します。会社名中の「2Q」等は期間へ変換しません。

新しい対象契約6件は修正前に全件失敗を確認しました。発行会社・子会社・別基準・個別の4件が実際に原文照合できることを正例にし、順序反転、対象値の除去、属性不足/衝突、保存改変を確認しています。最終コードで1,385テスト(47ファイル)、型チェック・lint・buildが成功。実PDF26頁の固定再生でも23数量・根拠付き13必須枠・表示/保存再検証が一致しました。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

63e71e2で最新P2と同原因の経路を修正しました。今回の差分は14ファイル、+830/-83です。

  • 会社・範囲・会計基準の欠落を任意一致にせず、独立した会社名欄を根拠として保持。
  • 表紙の連続した所有境界を、文脈・必須判定・冒頭選択で共有。未知の本文・混在セル・管理欄内の数量を越えて属性を借りない。
  • 実績/予想の完全性とPDF付き保存再検証を揃え、対象外の確認済み事実は本文に残す。標準の日付/分割予定欄、URL、英数字の証券コードも正例で維持。
  • 対象契約と境界の回帰を追加。正の件数、正しい対象値の除去、属性不足/衝突、順序反転、保存改変を確認。

最終コードで1,385テスト(47ファイル)、type-check・lint・buildが成功。実PDF26頁の固定再生で23数量・根拠付き13必須枠・候補修復なし・表示/保存再検証の一致、168 CMaps+LICENSEを確認しました。公開treeはテストしたtreeと一致しています。実APIと実Chrome画面の検証範囲は従来のままです。

検証記録と差分の説明

@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: 63e71e2fed

ℹ️ 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/lib/reporting-attributes.ts Outdated
Comment on lines +52 to +57
if (fieldName(cells[i]) && next && !fieldStart(next))
parts.push(`${cells[i]} ${cells[++i]}`);
else {
// Bare table-column atoms are not independent metadata declarations.
if (fieldStart(cells[i]) || !/[|│]/.test(line)) parts.push(cells[i]);
else complete = 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 Keep adjacent administrative fields inside the cover

When a ruled cover emits an administrative pair such as コード番号 | 464A, URL | https://…, or 上場取引所 | 東, the label is recognized by fieldStart but not by fieldName, so the adjacent value is treated as a discarded bare atom and complete becomes false. reportingCoverBlocks() then ends the cover at that row, causing valid company, scope, or accounting-basis fields appearing afterward to be ignored and suppressing otherwise valid earnings headlines. Pair these supported administrative labels with their immediately adjacent cells just as the reporting fields are paired.

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.

c62048eで対応しました。

再現を確認して修正しました。既存の管理ラベル12種を共通の語彙にまとめ、完全な管理欄の認識と、同じ行の直隣セルの組合せで共有しています。コード番号・URL・上場取引所が会社/基準より先に並ぶ実罫線の入力でも、原文字→文脈→候補→冒頭→保存再検証を通ります。空欄・別ラベル・改行・未証明のセル境界や、追加された本文/数量は引き続き拒否します。特定会社やPDFへの分岐はありません。

最終コードで1,402テスト(47ファイル)、type-check・lint・build、実PDF26頁の固定再生(23数量・根拠付き13必須枠・表示/保存再検証)が成功しました。

Comment thread src/lib/summary-renderer.ts Outdated
Comment on lines +387 to +389
missingAttributes.length
? `**要確認:報告対象の${missingAttributes.join('・')}が未特定です。**`
: '**要確認:報告対象期が未特定です。**',

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 Distinguish attribute conflicts from a missing period

When explicit cover declarations conflict—for example, two different company names, scopes, or accounting bases—earningsTarget() returns { target: null, issue: 'ambiguous' }. Because missingAttributes is then empty, this branch tells the user that the reporting period is unidentified even when the fiscal period is perfectly clear; the actual problem is the conflicting reporting unit. Handle ambiguous separately, or use a generic reporting-target ambiguity warning instead of directing the user to verify the period.

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.

c62048eで対応しました。

会社・範囲・会計基準の競合でも「対象期が未特定」と表示されることを再現しました。ambiguous は「報告対象を一意に特定できません」と案内するように変更しました。実際に期がない場合、会社/範囲/基準のいずれかが欠ける場合の表示は区別したままです。既存の3属性の衝突matrixに表示の検査を加え、同義属性では警告せず、確認済みの本文・保存復元・HTMLは保持することを確認しました。

最終コードで1,402テスト(47ファイル)、type-check・lint・build、実PDF26頁の固定再生(23数量・根拠付き13必須枠・表示/保存再検証)が成功しました。

Comment on lines +150 to +152
const owners = physicalCellOwners(
buildTableCells(page.drawingLines, page.spans, page.pageNumber)
);

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 close quantities in separate cells

When two complete numeric spans occupy neighboring closed cells and their glyphs are within the proximity threshold—for example, 100 and 20 in adjacent columns—quantityCells() now correctly retains both, but narrativeValues() still applies its generic neighboring-glyph rejection without consulting this owners map. Each quantity sees the other cell's number as a nearby non-unit and is skipped, so neither source quantity is available for narrative binding or display. Apply the same canJoinWithinCells() ownership check to the neighboring-glyph rejection so only glyphs from the quantity's own cell can invalidate it.

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.

c62048eで対応しました。

近接する別の閉セルの100と20が抽出後の表示用数量から両方消えることを再現しました。隣接文字による除外も物理セル所有へ照合し、一意な別セルに属すると証明できる場合は独立数量を保持します。同セル・所属不明・曖昧な所属では従来の未完断片の除外を維持します。2数量の正の件数とIDを確認し、表示用参照・説明への対応付けまで検証しました。10020の合成や別セルからの単位借用は引き続き拒否します。

最終コードで1,402テスト(47ファイル)、type-check・lint・build、実PDF26頁の固定再生(23数量・根拠付き13必須枠・表示/保存再検証)が成功しました。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

c62048eで最新3件を再現して対応しました。差分は9ファイル、+222/-60です。

  • 対応済み管理ラベル12種を、隣接セルの組合せと完全な管理欄の認識で共有。コード番号/URL/上場取引所の後の会社・範囲・基準を保持。
  • 属性等の競合は「報告対象を一意に特定できません」と案内し、期の欠落や特定属性の不足と区別。
  • 近接した別の閉セルの数量を、本文の表示・説明への対応付けまで保持。両方の所有が一意な場合だけ独立とし、同セル・未所属・曖昧な境界の未完断片は除外。

原文字からの正例、実際の数量件数/ID、保存復元、10020の合成・単位借用・未知セルの負例を確認しました。最終コードで1,402テスト(47ファイル)、type-check・lint・build、全26頁再生(23数量・根拠付き13必須枠・修復なし・表示/保存再検証)が成功。公開treeはテストしたtreeと一致し、独立レビューにも残る指摘はありません。分析指紋はv110です。

実API・実Chrome画面の検証範囲は従来のままです。差分と検証記録

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

ℹ️ 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".

}
);

it('隣接率のある原表紙→生成入力→当期優先表示→保存再検証で、当期・前年・次期の値を保つ', async () => {

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 Raise the timeout for the full earnings replay

When this test runs alongside the other 46 files under the repository's npm test command, replayEarningsStory() can exceed Vitest's default 5-second timeout; the full suite failed here after 5.132 seconds even though the test passed in isolation. This makes the otherwise passing 1,402-test suite nondeterministic on slower or contended CI workers, so give this integration-style replay an explicit longer timeout or move it to a suitably configured suite.

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.

5e21714で対応しました。

設定を確認すると、この統合replayには個別指定がなく、Nodeテストの既定5秒が適用されていました。こちらの変更前の単独実行は2.503秒で成功し、タイムアウト自体は再現していません。レビュー環境の5.132秒という結果を踏まえ、このケースだけ上限を15秒にしました。13必須枠と負例を含む検査内容、全体のtimeout、worker数、実行回数は変えていません。

最終コードで通常1,411テスト(47ファイル)、type-check・lint・build、実PDF26頁の固定再生(23数量・根拠付き13必須枠・表示/保存再検証)が成功しています。

Comment on lines +81 to +83
// Bare table-column atoms are not independent metadata declarations.
if (fieldStart.test(fieldLabelText(cells[i])) || !/[|│]/.test(line)) parts.push(cells[i]);
else complete = 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 Keep multi-cell representative rows inside the cover

Fresh evidence in the current head shows that a ruled administrative row with more than one value cell, such as 代表者 │ 代表取締役社長 │ 山田太郎, is still marked incomplete: the first value is paired at line 79, but the second bare cell reaches this branch and sets complete = false. reportingCoverBlocks() consequently stops at that row, so company, scope, or accounting-basis fields appearing below a standard representative/contact row are ignored and the earnings target remains incomplete; recognize the representative row's additional role/name cells as part of the same administrative record without allowing arbitrary bare cells generally.

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.

5e21714で対応しました。

代表者と連絡先の両方で、氏名セルが捨てられて表紙の後続属性が消えることを再現しました。共通投影に役職/氏名の2枠からなる管理記録を追加しました。役職・氏名・担当の明示サブフィールドを読み、ラベルのない役職には役職として識別できる表記を要求します。最大5個の同一行の隣接セルに限定し、空欄・改行・別フィールド・不完全ラベル・数量・本文・追加セルを越えません。氏名欄は自由記述として扱い、会社名や人名の辞書は使いません。

同じ追加テストで修正前は10件失敗、修正後の対象3ファイルは72/72、実PDFコーパスは42/42成功しました。実罫線の代表例では、後続の会社・範囲・基準、候補の原文照合、冒頭選択、保存再検証まで確認しています。

最終コードで通常1,411テスト(47ファイル)、type-check・lint・build、実PDF26頁の固定再生(23数量・根拠付き13必須枠・表示/保存再検証)が成功しています。

ivgtr commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

5e21714で最新2件に対応しました。差分は6ファイル、+134/-11、分析指紋v111です。

  • 代表者/連絡先の役職・氏名を、最大5個の隣接する同一行のセルから成る記録として認識。明示サブフィールドと役職が分かる記録を扱い、空欄・別行・別フィールド・不完全ラベル・数量・余分なセルを越えません。後続の会社/範囲/基準を、原文字から冒頭と保存再検証まで保持します。
  • 固定表紙の統合replayだけ上限15秒を指定。既定5秒とレビュー環境の5.132秒という結果を確認しました。こちらの変更前単独実行は2.503秒で成功しており、タイムアウト自体の再現とは区別しています。検査項目・全体のtimeout・worker数は維持します。

同じ追加テストは修正前10件失敗、修正後は対象72/72・実PDFコーパス42/42成功。独立レビューの追加36プローブにも残る指摘はありません。最終コードで1,411テスト(47ファイル)、type-check・lint・build、26頁の固定再生(23数量・根拠付き13必須枠・修復なし・表示/保存再検証)が成功しました。公開treeはテストしたtreeと一致しています。

実API・実Chrome画面の検証範囲は従来のままです。差分と検証記録

@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: 5e21714b3a

ℹ️ 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 +147 to +148
if (fieldStart.test(fieldLabelText(cells[i])) || !/[|│]/.test(line)) parts.push(cells[i]);
else complete = 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 Keep ruled title/date rows in the cover

When a ruled cover places independently valid metadata in adjacent cells—for example, 2026年3月期 決算短信〔日本基準〕(連結) │ 2026年5月10日—neither cell begins with fieldStart, so this branch drops both and sets complete to false. reportingCoverBlocks() then returns an empty prefix, causing buildDocumentContext() and earningsTarget() to lose the title and subsequent issuer attributes, so otherwise valid current-period figures are suppressed. Preserve independently recognized cover titles/dates here while continuing to reject arbitrary bare table atoms.

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.

be19f63で対応しました。

罫線で区切られた表題・日付が捨てられることを再現し、完全な表紙記録の認識を共通化しました。既存の予定日・有無・URL・単位注記も同じ規則で保持します。任意の本文や、会社/範囲/基準の裸の列見出しは属性へ昇格させません。

同原因の消費側も確認し、日付が先の行、長い表題/管理ブロック、節見出しなしの当期値、予想欄のメタデータを検証しました。隣のURLの「2Q」や有無欄の「業績予想」を、表題の対象期・状態へ混ぜないよう、候補・確定事実・必須判定・保存再検証まで同じ表題文脈を使います。意味文脈の投影には完全なブロックまたは全spanの参照を要求し、原文と根拠IDは保持します。

600単位幅の罫線付き表紙を通す回帰と、未知セル・空欄・部分参照・本文混在の負例を確認しました。再開後に露呈した実行時間の変動には、不要な再解析を減らし、完全再生を行う統合ケースだけ上限30秒を設定しました。検査内容と全体5秒設定は維持しています。

最終版で既定のnpm testが1,438件(47ファイル)すべて成功し、type-check・lint・buildも通りました。実PDF全26頁の固定再生で、23数量・根拠付き13必須枠・修復なし・表示/保存再検証の一致を確認しています。公開treeは検証した最終treeと一致しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

be19f63で罫線付き表紙のP2と同原因の読み取り漏れに対応しました。今回の差分は18ファイル、+550/-233、分析指紋v112です。

  • 完全な表題・日付・予定日・有無・URL・単位注記の認識を共有し、罫線による独立セルでも保持。
  • 日付が先の行や長い管理ブロックも、表題自身の対象期・範囲・基準で解釈。隣接URLの2Qや管理欄の予想語句が、候補・確定事実・必須判定・冒頭へ漏れる経路を修正。
  • 元の引用/根拠IDを維持し、完全なブロックまたは全spanの参照だけを意味文脈へ投影。部分参照、未知セル、本文混在、空欄、裸の属性列を引き続き拒否。
  • 600単位幅の罫線付き表紙全体で、当期値の照合から保存再検証まで確認。不要な再解析を減らし、完全再生を行う統合ケースの実行上限を30秒に設定。検査内容と全体5秒設定は維持。

最終コードで既定npm testの1,438件(47ファイル)、type-check・lint・buildが成功。実PDF26頁の固定再生で23数量・根拠付き13必須枠・修復なし・表示/保存再検証の一致を確認しました。独立レビュー済みで、公開treeは検証した最終treeと一致しています。実API・実Chrome画面の検証範囲は従来のままです。

差分・操作ストーリー・検証記録

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

ℹ️ 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/lib/document-context.ts Outdated
Comment on lines +276 to +277
if (firstBlocks.some((block) => hasReportingCoverTitle(block.text)))
cover.push(...reportingCoverBlocks(firstBlocks));

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 Gate the earnings cover path on a title in the parsed prefix

If any later page-one block starts with a supported earnings title—for example, a forecast-revision notice that lists 2026年3月期 決算短信〔日本基準〕(連結) as a reference—this condition switches the entire document to strict earnings-cover parsing. reportingCoverBlocks() then stops at the notice's ordinary first title, leaving cover empty and documentSubject() null; issuer-dependent coverage such as forecasts and business KPIs consequently loses all sources. A logo or other non-metadata block before the real earnings title has the same effect, so select this path only when the parsed contiguous prefix itself contains the cover title.

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.

再現して修正しました。後段の参照短信では厳格な表紙経路へ切り替えず、文書先頭からの記録と最初の境界で所有を判定します。ロゴの後で表題に達した場合も、その表題から連続する完全なメタデータだけを読み、本文・壊れた表題・後続の別会社欄を飛び越えません。

同原因の抽出形も確認し、「お知らせ・会社欄・参照短信・参照先の会社」が一つの物理ブロックにまとまる場合も、元の発行会社だけを文書宣言へ残します。参照先の範囲・会計基準・会社を昇格させません。予想修正の4枠と根拠、月次の義務と根拠、ロゴ後の正常表紙を正例にし、遅い会社欄による予想の借用と日付先行の壊れた表題を負例にしています。

反映: 64728e5。最終1,467テスト/47ファイル、型・lint・build、全26頁の23数量と根拠付き13必須枠、表示v7のJSON/PDF再検証が成功しています。

Comment thread src/lib/summary-earnings-policy.ts Outdated
Comment on lines +59 to +61
const quarter = shapes[0]?.match(/第([1-4])四半期/)?.[1];
if (!quarter)
return { fiscal, periodKind: 'fullYear', label: fiscal, scope, subject: null, 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 Do not infer a full year from a generic quarterly title

For the accepted cover form 2026年3月期 四半期決算短信〔日本基準〕(連結), reportingPeriodShapes() returns no numbered shape, so this fallback resolves the target as fullYear. If the specific quarter is declared only in the report's performance heading, its verified cumulative-quarter actuals then fail matchesEarningsTarget() and disappear from the headline, while coverage likewise looks for annual results. Treat the explicit but unnumbered 四半期決算短信 marker as an unresolved reporting period rather than the annual fallback.

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.

再現して修正しました。番号のない「四半期決算短信」を通期にせず、冒頭と必須判定が共通の期間解釈で未特定として扱います。明示の通期・番号付き四半期・中間期・四半期単独は保持し、未特定や競合を補完しません。

年のない四半期表題を捨てて年次の経営成績見出しへ迂回する経路も点検しました。表紙に明示された期間の形は維持し、矛盾する見出しで上書きしません。原文で独立に確認済みの数値は本文と保存復元へ残し、未特定の当期対象へ年次実績を追加した保存値はPDF再検証で拒否します。

反映: 64728e5。最終1,467テスト/47ファイル、型・lint・build、全26頁の23数量と根拠付き13必須枠、表示v7のJSON/PDF再検証が成功しています。

Comment thread src/lib/summary-narrative.ts Outdated
Comment on lines +330 to +332
// The block's structural cell separator consumes text offset but is
// not an original glyph. Match every original span in order as well.
if (!rowText.startsWith(raw, offset) && rowText[offset] === '│') offset++;

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 Consume every structural separator when mapping row quantities

When two closed cells on the same row do not touch, buildBlocks() emits the hard separator ││; this line advances past only one │, so mappedRow becomes false. narrativeValues() then keeps each physical quantity ID and also adds a p…b…:q… prose ID for the same literal. Because comparison validation rejects only equal IDs, generated narrative can compare those two aliases of one source quantity and display an artificial zero change; consume the complete separator run before matching the next span.

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.

実罫線から再現しました。「営業利益 ││ 100百万円 ││ 100百万円」で各数量に物理IDと段落IDが付き、同じ数量の別名同士を比較して横ばい0.0%を表示できていました。区切りを全て消費し、全原文字の位置対応が一意な場合だけ物理IDへ統合します。同額の独立したセルは別IDのままです。

同じ二重化は段落扱いのセルにもあったため、読み取り分類に依存せず対応させました。さらに、原文照合済みの事実IDと元の数量IDによる自己比較も再現したため、事実に基づく表示値へ元数量IDを保存し、比較・補足照合・保存再検証で共有します。表示保存形式はv7へ更新し、旧形式・欠損/不正な数量参照を拒否します。独立した同額セルの正常な0%比較は生成・JSON復元・PDF再検証まで保持します。

独立確認で、空白入り単位を表示用に認識し直す際にも元IDを置き換える経路を見つけました。開始位置と全原文字が完全一致する場合だけ元IDを保持し、通常の本文と物理セル付き本文の両方で自己比較・保存復元の反例を閉じています。

反映: 64728e5。最終1,467テスト/47ファイル、型・lint・build、全26頁の23数量と根拠付き13必須枠、表示v7のJSON/PDF再検証が成功しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

64728e5 で3指摘と同原因の経路を修正しました。

  • 文書先頭と参照短信を区別し、同じ物理ブロックに混在しても発行会社を保持。参照先の会社・範囲・基準は昇格させず、壊れた表題や本文を越えた会社欄の借用も拒否。
  • 番号なし四半期を未特定にし、年なしの明示四半期や複数表題の制約を冒頭・必須判定で維持。通期への上書きを拒否し、確認済み本文を保存。
  • ││と段落扱いのセルで数量IDの二重化を防止。確定事実・物理数量・空白入り単位の元IDを一貫して照合し、自己比較を拒否。表示保存v7/分析v113でJSON・PDF再検証まで保持。

最終1,467テスト/47ファイル、型・lint・build、実PDF全26頁(23数量・根拠付き13必須枠・修復なし)が成功しました。独立した同額数量の正常比較と、属性/期間/保存改変の負例も確認しています。公開treeは検証済み 4b42fa038d6421b05c89a03f63f1baf7e1a5fb7f と一致。実APIと実Chrome画面は今回未検証です。

@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: 64728e5098

ℹ️ 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/lib/summary-earnings-policy.ts Outdated

/** The document declares the headline period; surviving figures cannot redefine it. */
export function earningsTarget(excerpts: SourceExcerpt[]): EarningsTargetResolution {
const coverFields = reportingCoverBlocks(excerpts.filter((excerpt) => excerpt.page === 1));

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 Skip a leading logo before resolving the earnings cover

Fresh evidence in the reviewed tree shows the earlier logo case remains broken in the headline path: when page 1 starts with an unrecognized logo block such as TEST GROUP, followed by a valid earnings title and 会社名, this call passes the entire excerpt list to reportingCoverBlocks(), which stops at the logo and returns no cover fields. earningsTarget() then falls back to the performance heading but loses the issuer and accounting basis, so matchesEarningsTarget() rejects every actual and the headline is suppressed despite a complete cover immediately after the logo; locate the proved title boundary before applying the contiguous-cover parser.

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.

再現して修正しました。前回は文脈側だけが先頭記録の後の会社欄へ進み、冒頭・必須判定・節のない表紙実績が別々に表紙開始を決めていました。今回、その開始位置の選択を共有し、表題の期間・会社・会計基準を同じ原ブロックから引き継ぎます。

任意の未知文をロゴとは推測しません。一つの独立した大文字の会社識別表記(GROUP/HOLDINGS/CORPORATION/INC/LTDで終わる一般名称形式)の後に、完全な決算表題と明示会社欄が連続する場合だけを対応範囲にしています。先行名自体を発行会社にはせず、前の別会社/範囲/基準、REFERENCE/APPENDIX等の参照語、本文・数量・混在セル・二つ目の未知記録を越えません。ブランド名の列挙やTEST GROUP専用処理はありません。この文法で識別できない装飾は未特定のまま残します。

TEST GROUPの例を節あり/節なしで、候補→生成前の根拠付き必須枠→冒頭/本文→JSON/PDF再検証まで通しました。表紙だけの基準を予想へ継承するケース、ACME HOLDINGS+日付/連絡欄の正例、参照・本文・遅い会社欄の負例も確認しています。

反映: 790dc42。最終1,470テスト/47ファイル、型・lint・build、全26頁の23数量と根拠付き13必須枠・修復なし・保存再検証が成功しました。分析v114/表示v7です。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

790dc42 で、先行する会社ワードマーク後の表紙開始を文脈・冒頭・必須判定・表紙実績の共通処理へ揃えました。

一つの一般的な会社識別表記と、その後の完全な表題/明示会社欄が連続する場合だけを扱います。任意の未知文や大文字をロゴとは推測せず、参照語・別通知・本文・数量・セル混在・前の別会社/属性を越えません。元の原文/IDを保持し、未知の装飾は未特定のまま残します。

節あり/節なしの実績を候補→入力の根拠付き必須枠→冒頭/本文→JSON/PDF再検証まで確認し、表紙基準の予想継承と参照/遅い会社欄の負例も維持しました。最終1,470テスト/47ファイル、型・lint・build、実PDF全26頁(23数量・根拠付き13必須枠・修復なし)が成功。公開tree 86f9914acc57291908d2990b682acd79396ee58c は検証済みの内容と一致しています。分析v114、表示v7。実APIと実Chrome画面は今回未検証です。

@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: 790dc42d66

ℹ️ 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/lib/document-context.ts Outdated
// Generic corporate identity syntax, never a list of supported companies.
// Reference/navigation labels cannot become identity marks by adding a suffix.
if (
!/^(?:[A-Z][A-Z&'-]*[ \t]+)+(?:GROUP|HOLDINGS|CORPORATION|INC\.?|LTD\.?)$/.test(mark) ||

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 Accept punctuation in legal wordmarks

Allow standard legal-name punctuation in this wordmark check. A cover beginning with a common form such as ACME, INC. or ACME CO., LTD. is rejected because commas and dotted CO. are outside this grammar, so reportingDocumentCover() returns only the pre-logo prefix instead of the following title and company field. Since buildDocumentContext(), earningsTarget(), and coverage now share this helper, those otherwise complete earnings covers lose their reporting unit and suppress current-period headline values; the subsequent complete-title and named-issuer checks already provide the necessary boundary.

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.

修正しました。ACME, INC. / ACME CO., LTD. で完全な表紙が失われ、節なしの実績候補も scope/basis 不一致になることを修正前に再現しました。語間のカンマと略語末尾のピリオドを一般構文として許容します。後続の完全な表題+明示会社欄、単独記録、参照語/本文/数量/未知セルの拒否条件は維持しています。

句読点・全角表記を部品テストで確認し、既存の節なし実績ストーリーを ACME CO., LTD. に置き換えて、候補1000百万円→根拠付き必須枠→冒頭/本文→JSON/PDF再検証まで通しました。

dc6c8b6 に反映。最終1,481テスト/48ファイル・型・lint・build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、JSON/PDF再検証が一致しました。公開ツリーは検証済み db0ceb62c243f253bcc8fae7b01b963bd00a88ae と一致しています。

Comment thread src/lib/summary-source-inventory.ts Outdated
// Issuer/owner declarations remain evidence even when their own block is
// otherwise administrative. Phone/contact-only blocks can still be omitted.
// Filtering must not erase a substantive boundary before later issuer fields.
const administrative = isAdministrativeBlock(block.text) && isReportingMetadata(block);

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 Filter projected ruled administrative records

Apply the administrative check to the projected cells rather than the original ruled block. buildBlocks() now emits complete rows such as TEL │ 03-0000-0000, URL │ https://…, and コード番号 │ 1234; isReportingMetadata() accepts these, but isAdministrativeBlock() explicitly rejects │, so this conjunction is always false for them. Consequently contact-only cover records are retained as ordinary excerpts and can enter unclassified sections and generated narrative instead of being omitted as intended.

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.

修正しました。罫線付きTEL/URL/コード/連絡先等が原文一覧と補足生成入力へ残ることを再現しました。投影した各記録が除外対象であることを確認したうえで、元ブロック全体のメタデータ完全性を証明して除外します。本文・数量・未知セル・空欄との混在を部分投影で消さず、会社の根拠、範囲/基準、日付、配当支払予定は保持します。

対象10テストは修正前8失敗→修正後すべて成功。補足生成への原文/数量入力、未分類表示、正常本文の生成・保存復元まで確認し、元の文字・ID・span参照も変更しないことを検査しました。

dc6c8b6 に反映。最終1,481テスト/48ファイル・型・lint・build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、JSON/PDF再検証が一致しました。公開ツリーは検証済み db0ceb62c243f253bcc8fae7b01b963bd00a88ae と一致しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

dc6c8b6 で追加2件を修正しました。

  • 先行会社ワードマークの語間カンマ・略語末尾ピリオドを一般構文として許容。完全な表題+明示会社欄と参照/本文/数量/混在セルの境界を維持。
  • 管理行は投影記録を分類し、元ブロック全体の完全性を証明して除外。会社根拠・属性・日付/配当日程・混在原文は保持。

修正前の再現、対象回帰、独立レビューを実施。最終1,481テスト/48ファイル・型/lint/build・168 CMaps+LICENSE・実PDF全26頁(23数量、根拠付き13必須枠、修復なし、表示/JSON/PDF再検証)成功。公開ツリー db0ceb62c243f253bcc8fae7b01b963bd00a88ae は検証版と一致。分析指紋v115、表示v7。実API/実Chromeの検証範囲は拡張していません。

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

ℹ️ 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/lib/document-context.ts Outdated
// Punctuation cannot erase a source record, quantity, or unknown trailing cell.
// Reference/navigation labels cannot become identity marks by adding a suffix.
if (
!/^(?:[A-Z][A-Z&'-]*\.?(?:[ \t]*,[ \t]*|[ \t]+))+(?:GROUP|HOLDINGS|CORPORATION|INC\.?|LTD\.?)$/.test(

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 Accept periods within initialisms in legal wordmarks

Fresh evidence in the current head shows that compact initialisms remain unsupported: a leading wordmark such as U.S. HOLDINGS fails this regex because a period is allowed only once at the end of each whitespace-delimited token. With a complete earnings title and explicit company field immediately below it, reportingDocumentCover() consequently returns an empty prefix, leaving the issuer and reporting attributes unresolved and suppressing current-period headline figures. Permit repeated dotted initials within a wordmark token while retaining the existing title and named-issuer boundary checks.

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.

修正しました。U.S. HOLDINGS で表紙が空になることを修正前に再現しました。先行名称を語に分け、通常語・略語・連続した点付きイニシャルを一般構文として検証します。U.S. / U.S.A.・末尾点なし・全角表記を既存の語彙テストへ追加しました。

完全な後続表題+明示会社欄の条件は維持しています。連続イニシャルの許容によって R.E.F.E.R.E.N.C.E. / A.P.P.E.N.D.I.X. が参照語拒否を抜けないこと、壊れた点列・数量・余分なセルを通さないことも確認しました。

8d46d28 に反映しました。最終コードで1,512テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致。公開ツリー 52bd3d505efe49044250ea947325a69b270f6a41 は検証版と一致しています。

fieldName.test(fieldLabelText(cells[i])) &&
next &&
!fieldStart.test(fieldLabelText(next)) &&
(!isIndependentReportingRecord(next) || ownsIndependentRecord(cells[i], next))

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 Validate administrative values before consuming cells

Fresh evidence after the projected-record fix shows that any adjacent non-field atom is still accepted as an administrative value: for example, コード番号 │ 参考情報 is marked complete and isReportingMetadata() returns true. sourceInventory() then discards that text, while reportingCoverBlocks() continues past it and may borrow a later company/scope/basis field across what was actually the start of reference or body content. Require field-specific value syntax (such as a securities code, URL, phone number, or exchange value), and mark an unrecognized adjacent value incomplete instead of consuming it.

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.

修正しました。コード番号 │ 参考情報 の誤受理を再現し、コード・URL・電話・取引所・役職/連絡先の値を型ごとに検査するようにしました。隣接セルと非罫線記録で同じ検査を使い、最終的に投影した全記録も確認します。

同原因の「会社名と同じ行の不正な管理値」「会社名ラベルの次セルに混じる不正な管理値」「役職/氏名に続く不正TEL」も閉じました。不正値は原文の文字/IDを保って残り、後段の会社/属性を借りる表紙延長を止めます。会社+取引所、コード+URL、役職/氏名+TEL、通常の電話表記を正例とし、既存実PDFコーパスも確認しました。

8d46d28 に反映しました。最終コードで1,512テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致。公開ツリー 52bd3d505efe49044250ea947325a69b270f6a41 は検証版と一致しています。

Comment thread src/lib/fact-coverage.ts Outdated
Comment on lines +953 to +954
const target = declarations.find((declaration) => declaration.period);
if (!target?.period || !target.shape) return null;

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 Use the dated performance heading when the cover omits a year

For the explicitly supported layout 決算短信 followed by a complete company/scope/basis cover and 1. 2026年3月期連結経営成績, earningsTarget() resolves the fiscal period from the performance heading, but this function searches only cover-title declarations and therefore returns null. As a result, coverageReport() emits COVERAGE:報告対象の決算期を確認できません even when the current-period fact and reporting unit are fully verified, forcing a needless repair/partial-result warning and making required coverage disagree with headline selection. Apply the same bounded performance-heading fallback used by earningsTarget() when the cover title is complete but undated.

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.

修正しました。年なしの通期/第3四半期表題で、冒頭の対象期は解決するのに必須判定だけ未特定になることを再現しました。期間と報告属性の選択を共通化し、先頭の完全なメタデータに直結する実績見出しだけが不足する年を供給します。既存対応の「会社属性+先頭実績見出し」も両方の消費側で同じ結果になります。

併せて、年なし表題の明示会計基準/範囲が消える漏れと、表題なしの分割会社属性が必須判定から消える漏れも修正しました。属性・期間の競合、番号不明の四半期、参照・本文・予想・別ページは保守的に拒否。候補→根拠ID付き必須枠→冒頭/本文→JSON/PDF再検証の正例と負例を確認しています。

8d46d28 に反映しました。最終コードで1,512テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致。公開ツリー 52bd3d505efe49044250ea947325a69b270f6a41 は検証版と一致しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

8d46d28 で追加3件と同原因の消費側を修正しました。

  • 先行会社名を通常語・略語・連続イニシャルとして検証。点付きの参照語による境界の迂回も拒否。
  • 管理値を型ごとに検証し、会社欄との同居・隣接セル・役職/氏名の後続欄にも同じ完全性検査を適用。不正値は原文に残し、後段の会社/属性を借りない。
  • 対象期と会社/範囲/基準を冒頭・必須判定で共通選択。年なし表題や対応済みの先頭実績見出しを扱い、明示属性と期間形を保持。競合・未知四半期・参照/本文/予想は拒否。

修正前の再現、部品と利用ストーリーの正負、独立レビューを実施。最終1,512テスト/49ファイル・型/lint/build・168 CMaps+LICENSE・実PDF26頁(23数量、根拠付き13必須枠、修復なし、表示/JSON/PDF再検証)成功。公開ツリー 52bd3d505efe49044250ea947325a69b270f6a41 は検証版と一致。分析指紋v116、表示v7。実API/実Chromeの検証範囲は拡張していません。

@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

sameReportingAttributes(
f.semantics,
(kind === 'actual' ? targets.actual : targets.forecast)?.attributes ?? null
) &&

P2 Badge Require complete attributes for coverage matches

Fresh evidence in the current head: when both the cover target and a verified actual omit basis, sameReportingAttributes() treats the matching null values as equal, so coverageReport() marks that current-results slot satisfied; hasCompleteReportingAttributes() is applied to forecast headline IDs but not to this shared actual/forecast coverage predicate. This prevents the coverage and repair path from treating the reporting unit as unresolved even though earningsTarget() suppresses the same fact, so require complete target attributes before matching coverage.

ℹ️ 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/lib/reporting-attributes.ts Outdated
case '上場取引所':
return exchange.test(compact);
default:
return isPersonnelFieldValue(value, /問.*合.*せ.*先/.test(label));

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 Accept bare names in representative-name fields

When a cover contains a valid field such as 代表者名 山田太郎 or 代表者名 │ 山田太郎, this generic personnel validator rejects the value because a lone name is accepted only when it has an additional 氏名 sublabel. reportingCoverBlocks() therefore stops at that row; if separate scope or accounting-basis fields follow it, the earnings target remains incomplete and verified current-period figures are suppressed. Treat the outer 代表者名 label itself as an explicit name label.

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.

修正しました。代表者名 山田太郎 / 代表者名 │ 山田太郎 が拒否され、後続の会社属性を持つ表紙が途切れることを修正前に再現しました。外側のフィールド型を氏名・一般の代表者・連絡先に分け、代表者名 自体が既存の氏名文法を所有するようにしています。

役職+氏名の対応済み記録を保持し、一般の代表者/連絡先へ裸の氏名を広げていません。罫線/非罫線・空欄・本文/数量・余分なセルと、完全な表紙から発行会社/範囲/基準を得る接点を確認しました。人名や会社名の辞書は追加していません。

05109c1 に反映。最終1,520テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致しました。公開ツリー 07c36f2b00dc52a5ee6241f712c8d10f342c4de0 は検証版と一致しています。

Comment thread src/lib/summary-earnings-policy.ts Outdated
const actual = facts.facts.filter((fact) => fact.quantity && fact.semantics.state === 'actual');
for (const fact of actual) {
// A comparative figure from another reporting unit cannot create a current obligation.
if (!matchesEarningsTarget({ ...fact, period: target.fiscal }, target)) continue;

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 Limit comparative warnings to the preceding period

When the retained facts contain any older actual for the same reporting unit and period shape, this replacement overwrites its real fiscal year with the target year before matching. For example, a 2020 IFRS 税引前利益 fact makes a 2026 report warn that the current tax-before-profit value is missing even if the current results never declare that metric. Verify that the candidate is the target's actual comparative period before using it to create a current-period missing-item warning.

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.

修正しました。2020年の税引前利益が2026年の当期未確認警告を作ることを再現しました。事実側の期間を書き換える処理をなくし、同じ報告単位・決算月・期間形の直前年度と元の事実を照合します。

2025年の対応する比較値は警告に使い、2020年の履歴、将来年度、別決算月、異なる期間形は使いません。古い履歴を含む数値は本文に保持されることを表示まで確認しました。独立レビューでも状態・主体/範囲/基準・量の種類を変えた境界を確認しています。

05109c1 に反映。最終1,520テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致しました。公開ツリー 07c36f2b00dc52a5ee6241f712c8d10f342c4de0 は検証版と一致しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

レビュー本文の「Require complete attributes for coverage matches」 に対応しました。

決算短信の対象と確認済み事実がともに会計基準を欠くと、当期/予想6枠がすべて充足することを修正前に再現しました。会社・範囲・基準が揃った対象だけが充足判定へ進み、「未定/非開示」による予想免除と修復用根拠IDにも同じ条件を適用しています。欠落した属性同士の一致で解決済みにしません。

属性不足時は6枠が未解決・修復用根拠なしとなり、局所で確認した6事実は本文と保存復元に残ります。固定応答で生成1回・修復0回も確認しました。属性が揃った正例、未定/非開示、既存の予想修正や月次の局所契約も確認しています。既存の四半期別名/修復テストの正例は、対象属性を明示した表紙にして元の検査目的を維持しました。

05109c1 に反映。最終1,520テスト/49ファイル・型/lint/build・168 CMaps+LICENSEが成功。実PDF全26頁も23数量/根拠付き13必須枠、修復なし、表示/JSON/PDF再検証が一致しました。公開ツリー 07c36f2b00dc52a5ee6241f712c8d10f342c4de0 は検証版と一致しています。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

05109c1 で追加3件を修正し、レビュー本文にも返信しました。

  • 決算短信の当期/予想の必須充足、未定/非開示による免除、修復用根拠を、会社・範囲・基準が揃う同じ条件に統一。属性不足でも局所で確認した本文事実を保持。
  • 外側の「代表者名」ラベルが既存の氏名文法を所有するようにし、追加の氏名ラベルを要求しない。汎用欄・数量/本文/余分なセルの境界は維持。
  • 比較値から当期未確認警告を作る際は、元の期間を保持して直前年度の同じ報告単位・決算月・期間形だけを照合。

修正前の再現、正負の生成/表示/保存ストーリー、独立レビューを実施。最終1,520テスト/49ファイル・型/lint/build・168 CMaps+LICENSE・実PDF26頁(23数量、根拠付き13必須枠、修復なし、表示/JSON/PDF再検証)成功。公開ツリー 07c36f2b00dc52a5ee6241f712c8d10f342c4de0 は検証版と一致。分析指紋v117、表示v7。実API/実Chromeの検証範囲は拡張していません。

@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: 05109c184c

ℹ️ 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/lib/document-context.ts Outdated
if (
words.length < 2 ||
!/^(?:GROUP|HOLDINGS|CORPORATION|INC\.?|LTD\.?)$/.test(words[words.length - 1]) ||
!words.slice(0, -1).every((word) => /^(?:[A-Z][A-Z&'-]*\.?|(?:[A-Z]\.)+[A-Z]?)$/.test(word)) ||

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 Allow digits in leading legal wordmarks

Fresh evidence in the reviewed tree shows that an otherwise valid leading wordmark such as M3, INC. is rejected because every token before the legal suffix must contain only letters and punctuation. With a complete earnings title and explicit company field immediately below it, reportingDocumentCover() consequently returns an empty prefix, leaving the issuer and reporting attributes unresolved and suppressing current-period headline figures; permit alphanumeric company-name tokens while retaining the existing title and named-issuer boundary checks.

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.

db11f13 で対応しました。

再現しました。修正前は M3, INC. を含む担当ケース3件が失敗しました。先行会社名の各トークンを一般的な英数字構文へ拡張し、数字先頭・全角表記も同じ規則で扱います。英字を含まない語、全体が数量である語、番号付きの参照/付録ラベルは拒否し、完全な後続表題+明示会社欄、未知本文や余分なセルで止まる所有境界は維持しました。名称の部分文字列を数量と誤認しないよう、数量判定は全トークンに限定しています。

既存の語彙/境界テストと、節のない M3 の表紙から候補→根拠付き必須枠→冒頭/本文→JSON/PDF再検証までのケースで確認しています。

最終版で1,523テスト/49ファイル、型・lint・build、168 CMaps+LICENSE、実PDF全26頁(独立固定23数量・根拠付き13必須枠、修復なし)が成功しました。独立レビュー後の最終ソースと公開ツリーの一致も確認済みです。

Comment thread src/lib/summary-renderer.ts Outdated
if (earnings)
lines.push(
'',
`### ${literalMarkdown(first.period ?? '対象期未特定')} ${stateLabels[first.state]}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Emit each earnings period heading only once

When facts for the same period and state belong to different observation groups—for example, one metric has a condition while another does not—this loop emits the identical ### 2026年3月期 実績 heading once per group. The resulting summary contains multiple indistinguishable sections and duplicate navigation headings for a single reporting period; track the last period/state heading (or include the differing grouping axis in it) instead of unconditionally emitting it for every table group.

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.

db11f13 で対応しました。

再現しました。条件・範囲・基準が異なる表で、同じ期間/状態の見出しが4回出ていました。表の意味上の分割は保ち、話題→期間→状態を先に整列して、同じ見出しを一度だけ出すようにしました。別の話題には「事業別業績」等の名称を添え、範囲・基準・条件・対象会社・比較値・注記は表に残しています。

確定表と補足表も同じ期間階層へまとめました。独立確認で見つかった半角/全角の期間表記が範囲順で交互になる経路も修正。条件/範囲/基準/会社/別期/状態を含む9行を正の件数と逆順で確認し、補足の同一/別話題、HTML見出し、保存/PDF再検証まで通しています。

また、確定事実の汎用「予想」区分には配当も含まれるため、その表示名は既存の所属節から取ります。配当の確定値と補足値が同じ節名になる場合も同じ表示順に揃え、配当を業績予想と呼んだり、別期を挟んで同じ見出しが再出現したりしないことを、原文照合済みの配当実績/予想と補足値で確認しました。

最終版で1,523テスト/49ファイル、型・lint・build、168 CMaps+LICENSE、実PDF全26頁(独立固定23数量・根拠付き13必須枠、修復なし)が成功しました。独立レビュー後の最終ソースと公開ツリーの一致も確認済みです。

ivgtr commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

最新HEAD db11f13 の再レビューをお願いします。

  • 先行会社名の英数字を一般文法で許容。数字だけ・数量・番号付き参照語と、後続の表題/会社欄の所有境界を検査しています。
  • 決算の確定表/補足表を同じ表示話題・期間・状態で並べ、見出しを一度に統合。範囲・基準・条件・対象会社・比較値・原文注記は維持します。原期間表記と配当/汎用予想の同種経路も修正しました。

最終版で1,523テスト/49ファイル、type-check/lint/build、CMaps、実PDF全26頁(23数量・根拠付き13必須枠、修復なし、表示/保存再検証)が成功。公開ツリー ee865388995c358fa7c22e1eab5793f0df4f31f2 は検証版と一致します。実APIと実Chrome画面は未検証です。

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: db11f1302c

ℹ️ 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 de24ac1 into main Oct 9, 2026
@ivgtr
ivgtr deleted the fix/earnings-result-consistency branch October 9, 2026 06:38
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