Skip to content

Roll back failed override batches and keep structural-reform nodes across parameter rebuilds #2374

Closed

Description

@MaxGhenis

GPT-6.1 Sol's round-3 review of #2305 approved it, with four low-severity notes, all reproduced against #2305's head (603fecb):

  1. A failed batch of legacy overrides stays partly applied. Scenario.from_reform({rate: {"2027": 0.3}, "gov.not_a_real_parameter": {"2027": 1}}).apply(sim) raises, but the rate already reads 0.3 for 2027, and nothing records it. The next rebuild silently reverts it.
  2. Nodes a structural reform adds don't survive a rebuild or reprocessing. After Simulation(reform=(add_bonus, {"test_budget.bonus": 7})), both sim.apply_parameter_changes(...) and no_economic_assumptions.apply(sim) fail with Could not find the parameter test_budget.bonus. process_parameters has no rollback, so the failure also leaves a half-processed tree.
  3. Two shared caches are handed out uncopied: a memo entry's projected timelines, and the module function projected_timelines(). Nothing in the repo mutates them, but the docs said they were copies.
  4. The docs don't say that Scenario.apply on a built simulation edits the annualised values, nor that single-day keys and a scenario's own modifier run after the UC rebalancing and parameter-gated structural reforms.

Found while reviewing #2305 (Budget CI W1).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions