Add deterministic QQQ research input bundle#47
Conversation
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: f4b505f550
ℹ️ 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".
🤖 Codex PR Review🚫 Merge blocked: 2 serious issue(s) found in high-risk files 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🔴 [CRITICAL] Bug in
|
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: 72094b233d
ℹ️ 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".
| elif isinstance(value, date): | ||
| text = value.isoformat() |
There was a problem hiding this comment.
Handle datetime-like provider dates before serializing
download_price_history returns a pandas DataFrame whose as_of values are normalized pd.Timestamp objects (yfinance_prices.py:147). Timestamp is a datetime/date subclass, so this branch calls isoformat() and produces YYYY-MM-DDT00:00:00; the subsequent date.fromisoformat rejects that value. Consequently, the default provider path rejects every normal yfinance response as T2B3_BUNDLE_PROVIDER_DATA_INVALID before it can publish a bundle; the focused tests only use plain date values and do not exercise this path.
Useful? React with 👍 / 👎.
| prices = "prices.csv" | ||
| event_set = "geopolitical-deescalation" | ||
| benchmark_symbol = "QQQ" |
There was a problem hiding this comment.
Supply the crisis component's market symbol
When this embedded config is consumed, it leaves market_symbol unset while the enabled crisis component defaults it to SPY (crisis_context_research.py:27), but SPY is not among REQUESTED_SYMBOLS. The resulting input therefore has an all-missing market series: the QQQ-vs-market relative-return and financial-relative-return checks in build_crisis_context_features cannot activate, silently changing crisis-route results. Set market_symbol to an included series or include the intended market benchmark in the bundle.
Useful? React with 👍 / 👎.
| def strict_readback_bundle( | ||
| directory: str | Path, | ||
| *, | ||
| expected_manifest_sha256: str, | ||
| expected_commit: str, | ||
| expected_end_exclusive: str, | ||
| ) -> None: |
There was a problem hiding this comment.
Verify bundle lineage in the PRESENT consumption path
The verifier is never called by a production consumer: repo-wide search finds it only in this module and its test, while tqqq_market_regime_control_present.run_present directly reads config.toml's prices.csv and hashes whatever bytes it finds. Thus, after publication, replacing all three bundle files with a consistently self-attested config/raw/manifest still produces a PRESENT package from the altered prices; its input hash merely records the tampered content. Wire this verification into the admitted PRESENT path with independently supplied manifest hash, commit, and end-date values before reading the input.
Useful? React with 👍 / 👎.
T2B3 QSP Stage-1: deterministic QQQ research input bundle
qsl_t2b3_deterministic_qqq_projection_acceptance_contract_v2_2026-07-21.md22223aea8b94ab3157c7897eb883fb84c79fa4d6db271f6629bd47e4ca2b8e06ac3cb0b64024ae0eff0594aee8d477688bf320d2f4b505f550fd0876225165bd080a69edb53bb4easrc/quant_strategy_plugins/tqqq_research_input_bundle.py,tests/test_tqqq_research_input_bundle.pyonly.Tests-first evidence
python3 -m pytest -q tests/test_tqqq_research_input_bundle.pyinitially failed collection because the authorized module did not exist.15; related PRESENT/security suites passed65; full suite passed138.Validation gates
uv run --offline --extra test python -m pytest -q tests/test_tqqq_research_input_bundle.py— passed (15)uv run --offline --extra test python -m pytest -q tests/test_tqqq_market_regime_control_present.py tests/test_strategy_plugin_runner.py— passed (65)uv run --offline --extra test python -m pytest -q— passed (138)uv run --offline --extra test ruff check .— passeduv run --offline --extra test python -m compileall -q src tests— passeduv run --offline --extra test python -m build— passedgit diff --check ac3cb0b64024ae0eff0594aee8d477688bf320d2...HEAD— passedTests used injected deterministic frames/bytes. Real provider/network market-data calls: 0. No real or synthetic runtime bundle, package, replay, evidence, or performance execution was performed.
Boundary
This is research-only immutable input publication plus a pure deterministic QQQ projection.
external_contextis exactlyABSENT; A/as-of is only the last complete provider-observed QQQ row, not an official XNAS-calendar claim. Failures are fail-closed and logically quarantined without repair/retry. T2/T3 remain evidence-only/no-order: no decision, position, order, capital, broker, leverage, optimization, cloud, or live scope is introduced.Excluded scope
No existing provider/PRESENT producer, dependency, workflow, config, documentation, lockfile, generic data framework, UESP consumer, or third repository file changed.