feat: bind private TQQQ offline baseline snapshot#262
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files ⚖️ Codex Review Arbitration🚫 block: 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c9e931369
ℹ️ 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".
| if len({(row.symbol, row.as_of) for row in rows}) != len(rows) or {row.symbol for row in rows} != set(SYMBOLS): | ||
| _fail() |
There was a problem hiding this comment.
Reject snapshots with non-matching date sets
This check only enforces uniqueness and that both symbols appear; it does not compare the per-symbol date sets. For example, an artifact with QQQ rows on 2026-01-02, 2026-01-05 and TQQQ rows on 2026-01-02, 2026-01-06 passes as long as the manifest counts, coverage, bytes, and SHA match, so downstream research can consume misaligned QQQ/TQQQ observations even though this binding is supposed to fail closed on aligned dates.
Useful? React with 👍 / 👎.
| request_start, request_end = _date_text(request["start"]), _date_text(request["end_exclusive"]) | ||
| if request_start >= request_end: | ||
| _fail() |
There was a problem hiding this comment.
Enforce the manifest request window
This validates only that start < end_exclusive, but the artifact rows are never checked against that window. If the manifest says end_exclusive is 2026-01-05 and the CSV contains aligned rows dated 2026-01-05 (or later), the snapshot still loads and the returned input advertises an exclusive request window that the data violates, which can shift offline research windows without failing closed.
Useful? React with 👍 / 👎.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 205af4921b
ℹ️ 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".
| for record in records: | ||
| if set(record) != set(COLUMNS): | ||
| _fail() | ||
| rows_list.append(PriceRow(_text(record["symbol"]), _date_text(record["as_of"]), *(_number(record[key], positive=key != "volume", nonnegative=key == "volume") for key in COLUMNS[2:]))) |
There was a problem hiding this comment.
When a supplied snapshot and manifest agree on a row whose values are individually finite but impossible as a bar (for example high below open/close, or low above them), this accepts the row because each numeric field is validated independently. Since this binding is the fail-closed gate for private research prices, such a malformed or tampered artifact can flow into downstream baseline experiments as valid OHLCV data.
Useful? React with 👍 / 👎.
| digest = hashlib.sha256(raw).hexdigest() | ||
| return OfflineBaselineInput(PROFILE, manifest["source_revision"], manifest["request"]["start"], manifest["request"]["end_exclusive"], rows, raw, digest) |
There was a problem hiding this comment.
Include manifest fields in the input digest
When the same artifact is loaded with different accepted manifest metadata, such as a wider request window or a different source_revision, the returned OfflineBaselineInput changes but input_digest remains just the artifact SHA. Any evidence or cache keyed by this advertised input digest can therefore conflate distinct baseline inputs even though the object exposes different request/provenance fields.
Useful? React with 👍 / 👎.
|
PERMANENT_FREEZE: closure exhausted; preserving review/test evidence. Fresh reslice required for OHLC/provenance contract. |
Scope
Research-only offline binding for an explicitly supplied private Yahoo adjusted_daily snapshot.
Verification
PYTHONPATH=src python3 -m pytest -q tests/test_tqqq_offline_baseline_binding.py(7 passed)a40254c7e31d6b49b4a2db5ec57b1b65215a3ab1ee33df879d9e5e2b4dae6551(not committed)Full suite was started but interrupted after 209 passed/333 subtests due to an unrelated long-running test; not merge-ready until CI and private readback evidence are confirmed.