Skip to content

fx_pairs/07_gbm passes a supersedes hash a first run cannot use, so a clean clone fails before any fit #614

Description

@stefan-jansen

case_studies/fx_pairs/07_gbm.py:102 declares SUPERSEDES_POPULATION: str = "06e9ea03f2f2" and line 258 passes it through unchanged:

execution, population = run_model_population(
    study, resolved, population_name=population_name, supersedes=SUPERSEDES_POPULATION or None
)

OfficialPopulation.create (case_studies/research/population.py:135) raises first population version cannot supersede another snapshot whenever the name has no earlier generation. run_log/ is gitignored (.gitignore:173), so a reader on a clean clone starts with an empty registry: the notebook fails at the population write, before any fit, on the path it defaults to. The same refusal fires on the narrowed-run path the notebook documents, because a caller-chosen POPULATION_NAME has no prior generation either.

supersedes_for_run (population.py:245) was written for exactly this and returns None when no generation exists. case_studies/cme_futures/06_linear.py:305 and case_studies/cme_futures/07_gbm.py:288 route through it. Every other SUPERSEDES_POPULATION in case_studies/ defaults to "" or None, where or None already covers the case; fx_pairs/07_gbm is the only non-empty default that bypasses the helper.

The suite cannot catch it: tests/pm_helpers.py:951 clears SUPERSEDES_POPULATION on the preview path, and fx_pairs/07_gbm runs preview by default.

Fix

supersedes = supersedes_for_run(
    study, population_name=population_name,
    declared=SUPERSEDES_POPULATION, execution_tier=EXECUTION_TIER,
)

plus supersedes_for_run in the import block.

This changes the .py blob, so 07_gbm.ipynb goes stale against its provenance stamp (source_py_blob 8a4786da2108) and guards fails until the notebook is re-run canonically. On the canonical path the helper returns the declared hash unchanged, so the outputs are expected to reproduce, but that has not been run.

Introduced by #590. Found by the RoboRev push gate (job 15511), not by inspection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions