Thread the regime through trace persistence (non-default regime traces use the default stop) #212
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A campaign that persists traces (
presentation.persist_tapsnon-empty) AND runsmore than one risk regime persists the wrong stop for every non-default regime.
Mechanism
The risk regime is a structural campaign axis (
CampaignDoc.risk): each cellruns under its regime's stop, and the member manifest stamps that resolved stop.
But
persist_campaign_traces(crates/aura-cli/src/campaign_run.rs) re-runs theselected nominee to drain and persist its taps, and that re-run reads a
CellRealizationrecord which carries no regime information — onlyCampaignGeneralizationgainedregime_ordinalthis cycle. So the trace re-runbinds the default stop (
StopRule::Vol { R_SMA_STOP_LENGTH, R_SMA_STOP_K }) forevery nominee, including one that actually ran under a non-default regime. The
persisted trace then reflects the default stop, not the regime the run used.
The same missing carrier is why the trace directory is not regime-distinct:
campaign_cell_key(campaign_run.rs) names dirsstrategy8-instrument-w{window}with no
-r{regime}, so two regimes' persisted traces for the same(strategy, instrument, window) would collide.
Scope
Only the persist path is affected. A campaign with
persist_taps: [](the commoncase, and the cycle's own e2e) is correct: the core run/stamp/generalize path
binds each regime's real stop, and every member manifest records it. This was a
documented descope of the risk-regime axis cycle (#210) — "multi-regime
trace-dir isolation deferred" — surfaced concretely here.
Fix shape
Carry the regime through the stored record: add
regime_ordinal(and the regimeitself, or enough to reconstruct its stop) to
CellRealization, thread it intocampaign_cell_keyfor a-r{regime_ordinal}dir discriminator, and have thetrace re-run bind the nominee's actual regime stop instead of the default.
Correction from the cycle-close architect review: this is a LOUD refusal, not silent wrong data. The persist re-run's result is equality-checked against the recorded nominee (the C1 drift alarm), so a non-default regime + non-empty persist_taps trips that refusal rather than quietly writing a trace under the default stop. The defect is that the persist path REFUSES for a non-default regime, not that it persists wrong values — a smaller blast radius than the issue body's "silently persists the wrong stop" implies. The fix shape (carry the regime on CellRealization) is unchanged.