feat(research,cli): the CostSpec campaign vocabulary (#234 task 2)
CampaignDoc gains an additive cost: Vec<CostSpec> block — a closed, externally tagged vocabulary over the three shipped cost nodes (constant/vol_slippage/carry, field names = the builders' ParamSpec names), mirroring the risk block: serde default + skip-if-empty (cost- less documents keep their content ids, pinned), DocFault::BadCost validation (finite/bounds per component), std::cost construct- vocabulary block + SlotKind::Costs + open-slot mirror, prose arm, and all CampaignDoc struct literals across crates carry cost: vec![] (compile-driven). Verified: aura-research suite green, campaign validate e2e green, full workspace suite green, clippy -D warnings clean; in-loop spec review compliant and quality review approved (real diff fingerprint — the worktree-anchored review prompt works). refs #234
This commit is contained in:
@@ -144,6 +144,9 @@ pub(crate) fn doc_fault_prose(f: &DocFault) -> String {
|
||||
DocFault::BadRegime { index } => {
|
||||
format!("risk[{index}]: stop length must be >= 1 and k must be > 0")
|
||||
}
|
||||
DocFault::BadCost { index } => {
|
||||
format!("cost[{index}]: the component's price-unit knob must be finite and >= 0")
|
||||
}
|
||||
DocFault::NoStrategy => "strategies is empty".into(),
|
||||
DocFault::EmptyAxes { strategy } => format!("strategies[{strategy}]: axes is empty"),
|
||||
DocFault::EmptyAxis { strategy, axis } => {
|
||||
|
||||
@@ -162,6 +162,7 @@ pub(crate) fn translate_sweep(inv: &SugarInvocation) -> Result<GeneratedSweep, S
|
||||
// established parity). The other verbs bind the single Vol regime
|
||||
// through this same seam.
|
||||
risk: risk_from(inv.stop),
|
||||
cost: vec![],
|
||||
// No stage of a selection-free single-sweep pipeline consumes the
|
||||
// seed; a fixed zero keeps generated bytes deterministic so identical
|
||||
// invocations dedupe onto identical content ids.
|
||||
@@ -241,6 +242,7 @@ pub(crate) fn translate_generalize(
|
||||
// The stop is a single structural risk regime; the member runner maps
|
||||
// it back to StopRule::Vol at run time.
|
||||
risk: risk_from(inv.stop),
|
||||
cost: vec![],
|
||||
seed: 0,
|
||||
presentation: Presentation {
|
||||
persist_taps: vec![],
|
||||
@@ -441,6 +443,7 @@ pub(crate) fn translate_walkforward(
|
||||
}],
|
||||
process: ProcessRef { r#ref: DocRef::ContentId(content_id_of(&process_to_json(&process))) },
|
||||
risk: risk_from(inv.stop),
|
||||
cost: vec![],
|
||||
seed: 0,
|
||||
presentation: Presentation {
|
||||
persist_taps: persist_taps_from(inv.trace),
|
||||
@@ -596,6 +599,7 @@ pub(crate) fn translate_mc(
|
||||
}],
|
||||
process: ProcessRef { r#ref: DocRef::ContentId(content_id_of(&process_to_json(&process))) },
|
||||
risk: risk_from(inv.stop),
|
||||
cost: vec![],
|
||||
seed: mc.seed,
|
||||
presentation: Presentation {
|
||||
persist_taps: vec![],
|
||||
|
||||
Reference in New Issue
Block a user