Thread the regime through trace persistence (non-default regime traces use the default stop) #212

Closed
opened 2026-07-06 14:53:00 +02:00 by Brummel · 1 comment
Owner

A campaign that persists traces (presentation.persist_taps non-empty) AND runs
more 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 cell
runs 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 the
selected nominee to drain and persist its taps, and that re-run reads a
CellRealization record which carries no regime information — only
CampaignGeneralization gained regime_ordinal this cycle. So the trace re-run
binds the default stop (StopRule::Vol { R_SMA_STOP_LENGTH, R_SMA_STOP_K }) for
every 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 dirs strategy8-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 common
case, 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 regime
itself, or enough to reconstruct its stop) to CellRealization, thread it into
campaign_cell_key for a -r{regime_ordinal} dir discriminator, and have the
trace re-run bind the nominee's actual regime stop instead of the default.

A campaign that persists traces (`presentation.persist_taps` non-empty) AND runs more 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 cell runs 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 the selected nominee to drain and persist its taps, and that re-run reads a `CellRealization` record which carries **no regime information** — only `CampaignGeneralization` gained `regime_ordinal` this cycle. So the trace re-run binds the default stop (`StopRule::Vol { R_SMA_STOP_LENGTH, R_SMA_STOP_K }`) for every 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 dirs `strategy8-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 common case, 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 regime itself, or enough to reconstruct its stop) to `CellRealization`, thread it into `campaign_cell_key` for a `-r{regime_ordinal}` dir discriminator, and have the trace re-run bind the nominee's actual regime stop instead of the default.
Brummel added the bug label 2026-07-06 14:53:00 +02:00
Author
Owner

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#212