Skip to content

Apply reviewed SEC revenue and filing dates - #118

Merged
YuzeJ21 merged 4 commits into
mainfrom
codex/sec-direct-field-canonical-apply
Aug 21, 2026
Merged

Apply reviewed SEC revenue and filing dates#118
YuzeJ21 merged 4 commits into
mainfrom
codex/sec-direct-field-canonical-apply

Conversation

@YuzeJ21

@YuzeJ21 YuzeJ21 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a hash-, HEAD-, path-, provenance-, and confirmation-guarded apply path for exactly four reviewed SEC canonical cells
  • update only AAPL and AMD revenue and sec_filed_date
  • preserve the 35-column/237-row schema, ticker order, and all unrelated bytes
  • bind the committed canonical diff to an exact same-range proof ledger so unreviewed generated data remains blocked

Evidence

  • reviewed patch packet SHA-256: 8d0da6bdd2dd52a938adcd1e882031fd3f278d3fc245151943f6f0d2c0e91553
  • apply receipt SHA-256: af7d95169fdf568bfee93cc2f90dc94ce15b28326dbb3ab1c372f69715aaa944
  • canonical SHA-256: 1b27ac9b... -> 6cd354f2...
  • proof ledger: RB-20260820-SEC-DIRECT-001
  • exact PR range hygiene passed with only data/fundamentals.csv admitted as reviewed canonical data
  • GitHub run 32434689197 passed: full suite, dashboard startup, Research routes, public wording, generated-artifact hygiene, and whitespace
  • local focused checks: 82 passed; canonical validation passed; Research render smoke passed 6/6 routes
  • independent final review: Critical 0 / Important 0 / Minor 0

Boundaries

  • no schema or currency expansion
  • no full-row replacement or unrelated canonical changes
  • no provider/source-rights expansion
  • no readiness rebuild/materialization or generated output changes
  • research-only; no recommendation or trading action

@YuzeJ21
YuzeJ21 marked this pull request as ready for review August 20, 2026 20:27

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

ℹ️ 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 data/fundamentals.csv
QQQ,Nasdaq Growth,ETF,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
XLF,Financials,ETF,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
AMD,,,,2.2434570906877664,0.8134734471758304,,5329000000.0,2.65,6735000000.0,,1.2638393694877088,0.6931882154250328,,,5585000000.0,4098000000.0,,1630600639.0,,,,,,sec_companyfacts,2017-12-30,2488,10-K,2018-02-27,0000002488-18-000042,EBITDA was not staged because no direct SEC EBITDA fact was available.,ADVANCED MICRO DEVICES INC,,,
AMD,,,,2.2434570906877664,0.8134734471758304,,34639000000.0,2.65,6735000000.0,,1.2638393694877088,0.6931882154250328,,,5585000000.0,4098000000.0,,1630600639.0,,,,,,sec_companyfacts,2017-12-30,2488,10-K,2026-02-04,0000002488-18-000042,EBITDA was not staged because no direct SEC EBITDA fact was available.,ADVANCED MICRO DEVICES INC,,,

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 Recompute FCF margin when replacing revenue

This replaces AMD's revenue denominator while retaining fcf_margin=1.263839..., which is still 6.735B / 5.329B; with the new 34.639B revenue it should be about 19.4%. The same stale-denominator problem exists for AAPL. scenario_lab._like_for_like_baseline prefers the explicit margin over recomputing it and default_scenario_parameters consequently clamps AMD's stale 126% margin to 45%, materially overstating DCF projections. Recompute the dependent margins or apply a period-coherent set of fundamentals.

Useful? React with 👍 / 👎.

Comment thread data/fundamentals.csv
QQQ,Nasdaq Growth,ETF,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
XLF,Financials,ETF,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
AMD,,,,2.2434570906877664,0.8134734471758304,,5329000000.0,2.65,6735000000.0,,1.2638393694877088,0.6931882154250328,,,5585000000.0,4098000000.0,,1630600639.0,,,,,,sec_companyfacts,2017-12-30,2488,10-K,2018-02-27,0000002488-18-000042,EBITDA was not staged because no direct SEC EBITDA fact was available.,ADVANCED MICRO DEVICES INC,,,
AMD,,,,2.2434570906877664,0.8134734471758304,,34639000000.0,2.65,6735000000.0,,1.2638393694877088,0.6931882154250328,,,5585000000.0,4098000000.0,,1630600639.0,,,,,,sec_companyfacts,2017-12-30,2488,10-K,2026-02-04,0000002488-18-000042,EBITDA was not staged because no direct SEC EBITDA fact was available.,ADVANCED MICRO DEVICES INC,,,

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 SEC filing metadata from the same filing

The AMD row now pairs a 2026-02-04 filing date with accession 0000002488-18-000042 and a 2017-12-30 period; AAPL similarly pairs its new 2025 date with a 2018 accession and period. build_research_change_snapshot treats sec_filed_date and sec_accession as one latest-filing identity, while _filing_events detects arrivals only when the accession changes, so these new filings are missed and downstream snapshots expose impossible date/accession pairs. Update the companion accession and period metadata or leave the filing date unchanged.

Useful? React with 👍 / 👎.

os.chmod(temporary_path, canonical_path.stat().st_mode & 0o777)
if _live_repository_head(result.repository_root) != result.authorized_repository_head:
raise ValueError("repository HEAD changed before materialization")
os.replace(temporary_path, canonical_path)

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 Lock the canonical file across validation and replacement

If another process edits the canonical CSV after the hash check at line 398 but before this replacement—for example while the temporary file is flushed or the second Git command runs—os.replace silently overwrites those edits without rechecking the canonical hash. This defeats the stale-canonical guard and can lose concurrent work; hold an exclusive lock through validation and replacement or otherwise perform a conditional update that fails when the source changes.

Useful? React with 👍 / 👎.

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

ℹ️ 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 scripts/diff_hygiene.py
Comment on lines +726 to +727
or not _is_sha256(binding.get("patch_preview_sha256"))
or not _is_sha256(binding.get("apply_receipt_sha256"))

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 Verify proof artifacts before exempting canonical data

In the checked commercial-research-beta.yml PR workflow, a contributor can bypass the generated-data hygiene gate by editing data/fundamentals.csv and appending a ledger row containing the readily computed before/after hashes plus arbitrary 64-character values for these two proof hashes. Because neither referenced preview nor receipt is loaded, hashed, or authenticated, the same PR that changes the canonical data can manufacture all evidence needed for _range_fundamentals_proof_matches to return true, allowing arbitrary fundamentals changes through the gate. Bind these hashes to immutable artifacts available to CI or another independently verified authorization source before granting the exemption.

Useful? React with 👍 / 👎.

@YuzeJ21
YuzeJ21 merged commit fbbfffe into main Aug 21, 2026
1 check passed
@YuzeJ21
YuzeJ21 deleted the codex/sec-direct-field-canonical-apply branch August 21, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant