Trace re-run hardcodes the default vol-stop, false-failing the C1 drift alarm for non-default risk regimes #219
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?
Summary
The campaign trace re-run (the C1 drift alarm inside
persist_campaign_traces)hardcodes the default vol-stop
Vol { R_SMA_STOP_LENGTH, R_SMA_STOP_K }insteadof the regime the cell actually ran under. For any campaign that uses a
non-default risk regime and persists a trace, the re-run diverges from the
recorded nominee and the guard returns a hard
Err— a false C1 violation:it refuses to persist a correct trace, blaming non-determinism that its own
hardcoded stop introduced.
Root cause — a lossy record, not an ignored variable
The stop crosses a record boundary that drops it:
CellSpec.regime: Option<RiskRegime>(crates/aura-campaign/src/lib.rs:39)is the source of truth during the run.
crates/aura-cli/src/campaign_run.rs:271:None => Vol { R_SMA_STOP_LENGTH, R_SMA_STOP_K },Some(Vol { length, k }) => Vol { length, k }.CellRealization(
crates/aura-campaign/src/exec.rs:459) carries onlystrategy, instrument, window_ms, stages— no regime field. Neither doesthe zipped
CellOutcome(exec.rs:56,nominee: Option<(params, RunReport)>).crates/aura-cli/src/campaign_run.rs:741has nothing to readand hardcodes the default:
StopRule::Vol { length: R_SMA_STOP_LENGTH, k: R_SMA_STOP_K }.The fix is at the record boundary (persist the regime), not at the re-run site
(where there is currently nothing better to read).
Observable failure
crates/aura-cli/src/campaign_run.rs:766comparesrerun_metricsagainstnominee_report.metricsand, on inequality, returns:The
Errpropagates through?atcampaign_run.rs:564→aura campaignexitsnon-zero. The recorded metrics reflect the real regime
Vol{l,k}; the re-runuses
Vol{3, 2.0}; different stop → different exits → different R rows →different metrics.
Reachability
Trace persistence runs when
outcome.record.trace_nameisSome(
campaign_run.rs:555); the drift-alarm re-run + equality check fires for everycell with a nominee, unconditionally on the taps. The trigger is therefore:
aura campaign <doc.json>where the doc has a non-emptyrisklist with anon-default
Vol { length, k }(length != 3ork != 2.0) and a tracename. The default-regime path (empty
risk) matches by construction and hidesthe bug, which is why it has gone unnoticed.
(Latent secondary smell in the same area: even a fix that only threads the
regime leaves
run_blueprint_memberstamping anr_sma-flavoured broker labeland the empty-risk default constants living in the runner — cosmetic, out of
scope here.)
Fix direction (GREEN side — RED-first)
RED test first: a campaign doc with
risk: [Vol { length: 5, k: 3.0 }]and atrace name; assert the traces persist (today it errors with the false C1
message). GREEN: add
regime: Option<RiskRegime>toCellRealization, populateit in
executewhere the cell is realized, and have the re-run atcampaign_run.rs:741match it exactly as the member runner does atcampaign_run.rs:271.Provenance
Surfaced by an audit during #159 (retiring the hardwired demo harnesses). The
fast/slow verb-sugar weld is tracked separately; this is the independent
trace-fidelity defect the audit turned up.