Skip to content

fix(notebook,#18124): research_commodity_term_structure -- real 21-futures universe replaces np.random roll simulation - #18168

Merged
myia-ai-01 merged 1 commit into
mainfrom
feature/18124-researchexec-commodity
Sep 28, 2026
Merged

myia-ai-01 merged 1 commit into
mainfrom
feature/18124-researchexec-commodity

Conversation

@jsboige

@jsboige jsboige commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Grain: MED/notebook-python -- lane myia-po-2026:CoursIA -- prev: #18165

Summary

SOTA repair of Research-Executor/research_commodity_term_structure.ipynb
(re-audit of #18124 against current state found it still degraded: the
central cell was np.random.normal(0, 0.15, 21) dressed up as "Simulated
Roll Returns"
, the ending printed the author's numbers as results).

  • Real universe: 19/21 front-month commodity futures via yfinance (2
    unavailable on Yahoo, reported), 1-year realized returns measured:
    Heating Oil +92.4%, Gasoline +60.7%, Crude +46.7% ... Coffee -25.3%,
    Orange Juice -36.3%.
  • The quintile long-short mechanism computed on real returns: long leg
    (top quintile) mean +66.6%, short leg -31.1%, spread +97.7%.
  • Honest scope statement instead of fabricated roll numbers: roll
    returns need the distant-expiry contract, which Yahoo does not expose
    reliably -- the true term-structure screen (near/distant ratio) runs on
    QC Cloud with multi-contract data. The substitution (realized front-month
    returns) is stated in the output, not disguised.
  • The author's numbers (-15.71% 5Y CAGR, 80.8% MaxDD, then +38.85% quarter
    with 3M Sharpe 10.5) are quoted as a design reference and read
    critically
    : that pattern is the signature of a fragile regime-dependent
    strategy, not an edge.

Validation

  • Papermill: 7/7 cells, 0 errors, all execution_count set (C.2)
  • C.1: no raise NotImplementedError / assert False / 1/0 (verified)
  • Catalogue byte-identical to main (single .ipynb changed)
  • SOTA verdict: SOTA-OK for the measurable part (real futures data);
    the roll-return screen itself is explicitly INTRINSIC to multi-contract
    data and routed to QC Cloud -- no proxy faked as roll returns

See #18124 (8 of 10 repaired by this lane; remaining: runner.ipynb single
unexecuted harness cell).

🤖 Generated with Claude Code

…tures universe replaces np.random roll simulation

SOTA repair (last degraded research notebook of the #18124 audit apart from
the runner). The central cell simulated "roll returns" with
np.random.normal(0, 0.15, 21) dressed up as analysis; the ending printed the
author's numbers as if they were results.

- The universe is now REAL: 19/21 front-month commodity futures fetched via
  yfinance (2 unavailable, reported), 1-year realized returns measured per
  commodity (Heating Oil +92.4% ... Orange Juice -36.3%).
- The long-short quintile mechanism is computed on those realized returns
  (long leg mean +66.6%, short leg -31.1%, spread +97.7%), with the
  substitution stated explicitly: roll returns need the distant expiry,
  which Yahoo does not expose -- the true term-structure screen runs on QC
  Cloud with multi-contract data. No fabricated roll numbers.
- The author's published numbers (-15.71% 5Y CAGR, 80.8% MaxDD, then
  +38.85% quarter with 10.5 3M Sharpe) are quoted as a design reference and
  read critically: regime fragility, not an edge.

Executed 7/7 cells, 0 errors, all execution_count set (C.1/C.2).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the variation-tag-prev-absent Tag Grain sans 'prev: <TIER>/<GENRE> #<PR>' (adjacence G-VAR-3 inevaluable) label Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Prose/output review needed in the notebooks this PR changed: a numeric value is not anchored, an explicit relation is contradicted, or its evidence is missing. These cases remain distinct in the JSON report; the signal is advisory, NOT a merge gate.

Scope = notebooks CHANGED in this PR, not the whole corpus. Explicit claim-check relations resolve only against named CLAIM_METRICS from the local output window and are classified SUPPORTED, CONTRADICTED, or UNPROVEN.
The markdown-claims-output-report run artifact contains the structured JSON report. See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 numeric pathology, extended with low-noise relational evidence.

@github-actions

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 11.5s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 8.3s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.3s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 4.2s
Search-01-StateSpace.ipynb ✅ SUCCESS 3.2s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.2s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 19.3s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 3.2s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@github-actions

Copy link
Copy Markdown
Contributor

No organ-duplication: no added def/class collides with another series organ API (scripts/audit/organ_api_index.yaml).

Detector: python scripts/audit/detect_organ_duplication.py --base <merge-base> --body-file <pr body>
Rationale: #16776 / #13564 (rule merged in #16778).

@github-actions

Copy link
Copy Markdown
Contributor

Notebook outputs-required (H.4 schema): PASS (every code cell carries an outputs: list)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 3
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@jsboige

jsboige commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

[ADJOINT PREFLIGHT]
schema: 1
lane: myia-po-2026:CoursIA-3
pr: 18168
head: 4fbd990
complete: true
body: read
comments-reviewed: 5
reviews-reviewed: 0
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: b51a4c6dcaf600b22bf33a01d1d20d779e5aa0a216d31347456ab99c4a0b5655
diff-files: 1
diff-additions: 276
diff-deletions: 114
checks: latest-wins-green
b0: clear
scope: pass
domain: pass
verdict: READY
[/ADJOINT PREFLIGHT]

Dossier READY sur PR #18168 (lane myia-po-2026:CoursIA-3, cycle c.248, 28/09 07:52Z).

Substance : fix(notebook,#18124): research_commodity_term_structure -- real 21-futures universe replaces np.random roll simulation.

Vérif substance : +276/-114 sur 1 fichier MyIA.AI.Notebooks/Research-Executor/research_commodity_term_structure.ipynb. Grain MED/notebook-python.

Substance (item 11 crible de fond — PASS) :

  • Le body énonce honnêtement : « the central cell was np.random.normal(0, 0.15, 21) dressed up as 'Simulated Roll Returns', the ending printed the author's numbers as results. »
  • Le PR restaure l'exécution réelle : 21 commodités front-month via yfinance (19/21 dispo, 2 indisponibles sur Yahoo signalées dans le notebook), 1-year realized returns mesurés (Heating Oil +92.4%, Gasoline +60.7%, Crude +46.7%, ... Coffee -25.3%, Orange Juice ...).
  • C'est un fix anti-SOTA-dégradé. Le PR nomme explicitement le workaround (np.random.normal maquillé en "Simulated") et ne le reproduit pas.
  • Crible item 11 PASS : pas de marqueurs de dégradation persistants.

État actuel : mergeStateStatus: CLEAN, mergeable: MERGEABLE, reviewDecision: NONE, B.0 rc=0.

Vérif checks (latest-wins) : tous checks verts (PR gate success).

Grain: META/secretary -- lane myia-po-2026:CoursIA-3 -- prev: META/secretary c.247

@myia-ai-01
myia-ai-01 merged commit 8890d7c into main Sep 28, 2026
88 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

variation-tag-prev-absent Tag Grain sans 'prev: <TIER>/<GENRE> #<PR>' (adjacence G-VAR-3 inevaluable)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants