refactor: split the aura-std roster into C28 layer crates
Phase 4 of the Stratification milestone. aura-std held four C28 ladder layers in one roster; this cuts them into layer-aligned, aura-core-only node crates so the import direction is enforced by the crate graph: - aura-std — engine nodes only (arithmetic/logic/rolling + sinks) - aura-market — session, resample - aura-strategy — bias, stops, sizer, cost-model machinery - aura-backtest — sim_broker, position_management - aura-vocabulary — the relocated closed std_vocabulary roster Node modules move verbatim (byte-identical renames); consumers are rewired by import path only. A new structural test (aura-vocabulary/tests/c28_layering.rs) asserts each node crate's [dependencies] stay within its C28-permitted inner set, catching the acyclic-but-outward violation the compiler misses. Behaviour byte-identical: full workspace suite green (1448 tests), no golden edited, clippy -D warnings clean. C28 Status block updated. closes #288
This commit is contained in:
@@ -36,6 +36,10 @@ rayon = "1"
|
||||
# positionally, by index), so aura-std stays out of [dependencies] and the engine is
|
||||
# `-> aura-core` only. The node-naming composite-builders live in `aura-composites`.
|
||||
aura-std = { path = "../aura-std" }
|
||||
aura-market = { path = "../aura-market" }
|
||||
aura-strategy = { path = "../aura-strategy" }
|
||||
aura-backtest = { path = "../aura-backtest" }
|
||||
aura-vocabulary = { path = "../aura-vocabulary" }
|
||||
# chrono / chrono-tz build the Berlin-local-wall-clock epoch-ns timestamps the
|
||||
# GER40 session-breakout E2E fixture (tests/ger40_breakout.rs) feeds the engine,
|
||||
# exactly as `Session`'s own unit test does. Pinned to aura-std's versions (the
|
||||
|
||||
@@ -1384,7 +1384,9 @@ mod tests {
|
||||
use crate::test_fixtures::{composite_sma_cross_harness, synthetic_prices};
|
||||
use crate::{f64_field, summarize, ParamRange, RandomSpace, RunManifest, VecSource};
|
||||
use aura_core::{Cell, Ctx, FieldSpec, Firing, NodeSchema, Timestamp};
|
||||
use aura_std::{Bias, Ema, LinComb, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Ema, LinComb, Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
/// One knob fanning into two sibling open params passes the gate; the
|
||||
@@ -3122,7 +3124,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn param_space_reflects_only_open_knobs() {
|
||||
use aura_std::{Bias, Sma};
|
||||
use aura_strategy::Bias;
|
||||
use aura_std::Sma;
|
||||
// "sma2_entry": Sma "bias" with length bound to 2 (a structural constant)
|
||||
// plus Bias "exp" whose `scale` stays open. The bound knob must be
|
||||
// absent from param_space; only the open one remains.
|
||||
@@ -3148,7 +3151,8 @@ mod tests {
|
||||
/// order — the bound value becomes a default an axis may override.
|
||||
#[test]
|
||||
fn reopen_returns_a_bound_knob_to_param_space() {
|
||||
use aura_std::{Bias, Sma};
|
||||
use aura_strategy::Bias;
|
||||
use aura_std::Sma;
|
||||
let strat = Composite::new(
|
||||
"sma2_entry",
|
||||
vec![
|
||||
@@ -3169,7 +3173,8 @@ mod tests {
|
||||
/// error, not a silent no-op — open axes pass through without reopen.
|
||||
#[test]
|
||||
fn reopen_unknown_or_open_path_errors() {
|
||||
use aura_std::{Bias, Sma};
|
||||
use aura_strategy::Bias;
|
||||
use aura_std::Sma;
|
||||
let strat = Composite::new(
|
||||
"sma2_entry",
|
||||
vec![
|
||||
@@ -3190,7 +3195,8 @@ mod tests {
|
||||
/// carries the bound value (the default the CLI renders in --list-axes).
|
||||
#[test]
|
||||
fn bound_param_space_is_path_qualified_with_values() {
|
||||
use aura_std::{Bias, Sma};
|
||||
use aura_strategy::Bias;
|
||||
use aura_std::Sma;
|
||||
let strat = Composite::new(
|
||||
"sma2_entry",
|
||||
vec![
|
||||
|
||||
@@ -244,7 +244,7 @@ fn reconstruct(
|
||||
}
|
||||
|
||||
/// Load a blueprint from canonical JSON, resolving each primitive's type identity
|
||||
/// through the injected `resolve` (e.g. `aura_std::std_vocabulary`). The version
|
||||
/// through the injected `resolve` (e.g. `aura_vocabulary::std_vocabulary`). The version
|
||||
/// envelope is checked before the payload is reconstructed.
|
||||
pub fn blueprint_from_json(
|
||||
data: &str,
|
||||
@@ -267,7 +267,8 @@ mod tests {
|
||||
use crate::harness::{Edge, Target};
|
||||
use crate::VecSource; // crate-root re-export (blueprint.rs tests import it the same way, e.g. :923)
|
||||
use aura_core::{Scalar, ScalarKind, Timestamp};
|
||||
use aura_std::{Bias, Recorder, Sma, Sub};
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
// Open param point for the sink-free signal (fast.length is bound): [slow.length, bias.scale].
|
||||
@@ -303,7 +304,7 @@ mod tests {
|
||||
fn serialized_blueprint_runs_bit_identical_to_rust_built() {
|
||||
let rust_built = crate::test_fixtures::sink_free_sma_cross_signal();
|
||||
let json = blueprint_to_json(&rust_built).expect("serializes");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
|
||||
let trace_rust = run_recording(rust_built);
|
||||
let trace_loaded = run_recording(loaded);
|
||||
@@ -316,7 +317,7 @@ mod tests {
|
||||
fn serializer_and_loader_are_inverse() {
|
||||
let original = crate::test_fixtures::sink_free_sma_cross_signal();
|
||||
let json = blueprint_to_json(&original).expect("serializes");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
// serialize -> load -> serialize is byte-stable (canonical round-trip identity)
|
||||
assert_eq!(json, blueprint_to_json(&loaded).expect("re-serializes"));
|
||||
}
|
||||
@@ -339,7 +340,7 @@ mod tests {
|
||||
vec![OutField { node: 0, field: 0, name: "bias".into() }],
|
||||
);
|
||||
let json = blueprint_to_json(&outer).expect("serializes");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let loaded = blueprint_from_json(&json, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
assert_eq!(json, blueprint_to_json(&loaded).expect("re-serializes"));
|
||||
// the nested composite survived as a composite, not flattened
|
||||
assert!(json.contains(r#"{"composite":{"name":"sma_cross""#), "nested composite preserved");
|
||||
@@ -370,7 +371,7 @@ mod tests {
|
||||
assert_ne!(plain_json, doced_json, "the doc is canonical-byte-bearing");
|
||||
assert!(doced_json.contains("why this graph"), "doc serialized: {doced_json}");
|
||||
assert!(!plain_json.contains("\"doc\""), "absent doc emits no key: {plain_json}");
|
||||
let loaded = blueprint_from_json(&doced_json, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let loaded = blueprint_from_json(&doced_json, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
assert_eq!(loaded.doc(), Some("why this graph: the spread detects trend turns"));
|
||||
assert_eq!(doced_json, blueprint_to_json(&loaded).expect("re-serializes"), "round-trip byte-stable");
|
||||
assert_eq!(
|
||||
@@ -395,7 +396,7 @@ mod tests {
|
||||
let tapped_json = blueprint_to_json(&tapped).expect("serializes");
|
||||
assert_ne!(plain_json, tapped_json, "taps are canonical-byte-bearing");
|
||||
assert!(!plain_json.contains("\"taps\""), "absent taps emit no key: {plain_json}");
|
||||
let loaded = blueprint_from_json(&tapped_json, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let loaded = blueprint_from_json(&tapped_json, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
assert_eq!(loaded.taps(), tapped.taps());
|
||||
assert_eq!(tapped_json, blueprint_to_json(&loaded).expect("re-serializes"), "round-trip byte-stable");
|
||||
}
|
||||
@@ -431,14 +432,14 @@ mod tests {
|
||||
let json = r#"{"format_version":1,"blueprint":{"name":"x","nodes":[{"primitive":{"type":"NoSuchNode"}}]}}"#;
|
||||
// `.err().unwrap()` (not `.unwrap_err()`): the Ok type `Composite` holds a
|
||||
// build closure and is not `Debug`, which `unwrap_err`'s bound would require.
|
||||
let err = blueprint_from_json(json, &|t| aura_std::std_vocabulary(t)).err().unwrap();
|
||||
let err = blueprint_from_json(json, &|t| aura_vocabulary::std_vocabulary(t)).err().unwrap();
|
||||
assert!(matches!(err, LoadError::UnknownNodeType(t) if t == "NoSuchNode"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unsupported_version_fails_named() {
|
||||
let json = r#"{"format_version":2,"blueprint":{"name":"x","nodes":[]}}"#;
|
||||
let err = blueprint_from_json(json, &|t| aura_std::std_vocabulary(t)).err().unwrap();
|
||||
let err = blueprint_from_json(json, &|t| aura_vocabulary::std_vocabulary(t)).err().unwrap();
|
||||
assert!(matches!(err, LoadError::UnsupportedVersion { found: 2, supported: 1 }));
|
||||
}
|
||||
|
||||
@@ -466,7 +467,7 @@ mod tests {
|
||||
assert_ne!(with_unknown, canonical, "probe must actually inject unknown keys");
|
||||
|
||||
// tolerated, not refused
|
||||
let loaded = blueprint_from_json(&with_unknown, &|t| aura_std::std_vocabulary(t))
|
||||
let loaded = blueprint_from_json(&with_unknown, &|t| aura_vocabulary::std_vocabulary(t))
|
||||
.expect("an unknown optional field is tolerated, not refused");
|
||||
|
||||
// the unknown keys did not leak into the graph: re-serialization equals the
|
||||
@@ -474,7 +475,7 @@ mod tests {
|
||||
assert_eq!(blueprint_to_json(&loaded).expect("re-serializes"), canonical);
|
||||
|
||||
// and the loaded graph runs bit-identically to the plain canonical one (C1).
|
||||
let plain = blueprint_from_json(&canonical, &|t| aura_std::std_vocabulary(t)).expect("loads");
|
||||
let plain = blueprint_from_json(&canonical, &|t| aura_vocabulary::std_vocabulary(t)).expect("loads");
|
||||
assert_eq!(
|
||||
run_recording(loaded),
|
||||
run_recording(plain),
|
||||
@@ -655,9 +656,9 @@ mod tests {
|
||||
}
|
||||
|
||||
// The resolver used by the gang-serde tests below (mirrors the inline
|
||||
// `&|t| aura_std::std_vocabulary(t)` closure the rest of this module uses).
|
||||
// `&|t| aura_vocabulary::std_vocabulary(t)` closure the rest of this module uses).
|
||||
fn fixture_resolver() -> impl Fn(&str) -> Option<PrimitiveBuilder> {
|
||||
|t: &str| aura_std::std_vocabulary(t)
|
||||
|t: &str| aura_vocabulary::std_vocabulary(t)
|
||||
}
|
||||
|
||||
// Shared topology: two open SMAs feeding a `Sub`. `ganged_fixture_named`
|
||||
|
||||
@@ -344,7 +344,9 @@ mod tests {
|
||||
use crate::test_fixtures::sma_cross as hand_sma_cross;
|
||||
use crate::{Composite, OutField, Role, Target};
|
||||
use aura_core::{Firing, ScalarKind};
|
||||
use aura_std::{Bias, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
/// The `sma_cross` sub-composite authored through the builder.
|
||||
|
||||
@@ -472,7 +472,7 @@ pub fn replay(
|
||||
mod tests {
|
||||
use super::{GraphSession, Op, OpError};
|
||||
use aura_core::{BindOpError, Scalar, ScalarKind};
|
||||
use aura_std::std_vocabulary;
|
||||
use aura_vocabulary::std_vocabulary;
|
||||
|
||||
fn session(name: &str) -> GraphSession<'static> {
|
||||
GraphSession::new(name, &std_vocabulary)
|
||||
@@ -736,7 +736,7 @@ mod tests {
|
||||
Op::Tap { from: "fast.value".into(), as_name: "fast_ma".into() },
|
||||
Op::Expose { from: "sub.value".into(), as_name: "bias".into() },
|
||||
];
|
||||
let flat = super::replay("g", ops, &aura_std::std_vocabulary)
|
||||
let flat = super::replay("g", ops, &aura_vocabulary::std_vocabulary)
|
||||
.expect("replays")
|
||||
.compile_with_params(&[Scalar::i64(2), Scalar::i64(4)])
|
||||
.expect("compiles");
|
||||
@@ -949,7 +949,7 @@ mod tests {
|
||||
let finalize = ops.len();
|
||||
// `.err()` not `.unwrap_err()`: the Ok arm `Composite` holds build closures
|
||||
// and is not `Debug`.
|
||||
let (idx, _err) = super::replay("g", ops, &aura_std::std_vocabulary)
|
||||
let (idx, _err) = super::replay("g", ops, &aura_vocabulary::std_vocabulary)
|
||||
.err()
|
||||
.expect("a cyclic op-list must be rejected (DAG invariant 5 / C9)");
|
||||
// An eager realisation attributes the fault to the closing connect op; a
|
||||
@@ -976,7 +976,7 @@ mod tests {
|
||||
Op::Expose { from: "s.value".into(), as_name: "out".into() },
|
||||
];
|
||||
assert!(
|
||||
super::replay("g", ops, &aura_std::std_vocabulary).is_err(),
|
||||
super::replay("g", ops, &aura_vocabulary::std_vocabulary).is_err(),
|
||||
"a self-loop op-list must be rejected (DAG invariant 5 / C9)"
|
||||
);
|
||||
}
|
||||
@@ -990,7 +990,7 @@ mod tests {
|
||||
];
|
||||
// `.err().unwrap()` rather than `.unwrap_err()`: the Ok arm `Composite` is
|
||||
// not `Debug` (it holds build closures), which `unwrap_err` would require.
|
||||
let err = super::replay("g", ops, &aura_std::std_vocabulary).err().unwrap();
|
||||
let err = super::replay("g", ops, &aura_vocabulary::std_vocabulary).err().unwrap();
|
||||
assert_eq!(err, (1, OpError::UnknownNodeType("Nope".into())));
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,8 @@ mod tests {
|
||||
fn replay_built_signal_compiles_identically_to_graphbuilder() {
|
||||
use crate::GraphBuilder;
|
||||
use aura_core::Scalar;
|
||||
use aura_std::{Bias, Sma, Sub};
|
||||
use aura_std::{Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
|
||||
// param space of the flat root: fast.length(i64), slow.length(i64),
|
||||
// bias.scale(f64) — same vector applied to both sides, so it cancels.
|
||||
@@ -1023,7 +1024,7 @@ mod tests {
|
||||
Op::Connect { from: "sub.value".into(), to: "bias.signal".into() },
|
||||
Op::Expose { from: "bias.bias".into(), as_name: "bias".into() },
|
||||
];
|
||||
let replay_flat = super::replay("root", ops, &aura_std::std_vocabulary)
|
||||
let replay_flat = super::replay("root", ops, &aura_vocabulary::std_vocabulary)
|
||||
.expect("replay resolves")
|
||||
.compile_with_params(¶ms)
|
||||
.expect("replay compiles");
|
||||
|
||||
@@ -321,7 +321,8 @@ mod tests {
|
||||
use aura_core::{
|
||||
Cell, FieldSpec, Node, NodeSchema, PortSpec, PrimitiveBuilder, Scalar,
|
||||
};
|
||||
use aura_std::{Bias, Recorder, Sma, Sub};
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
/// A bare node whose only purpose is to back a `PrimitiveBuilder` in a test.
|
||||
|
||||
@@ -676,7 +676,9 @@ mod tests {
|
||||
// PortSpec / NodeSchema name the fixtures' declared signatures, brought in here
|
||||
// (production code reads them via the carried signatures, never naming the types).
|
||||
use aura_core::{FieldSpec, NodeSchema, PortSpec};
|
||||
use aura_std::{Bias, Recorder, Sma, SimBroker, Sub, When};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub, When};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
/// Build an f64 source stream from (timestamp, value) points.
|
||||
|
||||
@@ -312,7 +312,9 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::{Edge, FlatGraph, Harness, SourceSpec, Target, VecSource};
|
||||
use aura_core::{Firing, NodeSchema, PortSpec, ScalarKind};
|
||||
use aura_std::{Bias, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
use crate::{BlueprintNode, Composite, Edge, OutField, Role, Target};
|
||||
use aura_core::{Firing, Scalar, ScalarKind, Timestamp};
|
||||
use aura_std::{Bias, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use std::sync::mpsc;
|
||||
|
||||
/// Seven synthetic F64 ticks driving the harness; deterministic input fixture.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! End-to-end coverage for blueprint serialization (C24, cycle 0087): a
|
||||
//! param-generic `Composite` is projected to canonical, versioned JSON
|
||||
//! (`blueprint_to_json`) and reconstructed from it (`blueprint_from_json`) through
|
||||
//! an **injected** node-vocabulary resolver (`aura_std::std_vocabulary`).
|
||||
//! an **injected** node-vocabulary resolver (`aura_vocabulary::std_vocabulary`).
|
||||
//!
|
||||
//! The in-module tests in `blueprint_serde.rs` reach into crate internals
|
||||
//! (`crate::test_fixtures::sink_free_sma_cross_signal`, the crate-private
|
||||
@@ -19,7 +19,9 @@ use aura_engine::{
|
||||
blueprint_from_json, blueprint_identity_json, blueprint_to_json, BlueprintNode, Composite,
|
||||
Edge, LoadError, OutField, Role, Target, VecSource, BLUEPRINT_FORMAT_VERSION,
|
||||
};
|
||||
use aura_std::{std_vocabulary, Bias, Recorder, Sma, Sub};
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use aura_vocabulary::std_vocabulary;
|
||||
|
||||
/// Seven synthetic F64 ticks (mirrors the crate-private `synthetic_prices`):
|
||||
/// short enough that the fast (2) and slow (4) SMA windows warm up within the
|
||||
@@ -102,7 +104,7 @@ fn run_recording(signal: Composite) -> Vec<(Timestamp, Vec<Scalar>)> {
|
||||
|
||||
/// Property (C24 acceptance, through the public seam): a blueprint authored via the
|
||||
/// exported `Composite` builder, serialized to JSON, then loaded back through
|
||||
/// `blueprint_from_json` + the injected `aura_std::std_vocabulary` and run, records
|
||||
/// `blueprint_from_json` + the injected `aura_vocabulary::std_vocabulary` and run, records
|
||||
/// a `bias` trace **byte-identical** to the Rust-built twin's run — proven entirely
|
||||
/// through `aura_engine`/`aura_std` public exports (the World/cdylib seam C24
|
||||
/// serves). The serialization round-trip is behaviour-preserving (C1): same input,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//! (`crate::GraphBuilder`, `crate::CompileError`, `super::replay`). These tests
|
||||
//! use only the **exported** surface — `aura_engine::{replay, Op, OpError,
|
||||
//! GraphBuilder, Composite, FlatGraph, Scalar, ScalarKind}` plus the injected
|
||||
//! `aura_std::std_vocabulary` — the exact seam the iteration-2 CLI (`aura graph
|
||||
//! `aura_vocabulary::std_vocabulary` — the exact seam the iteration-2 CLI (`aura graph
|
||||
//! build`/`introspect`) and the World consume. A refactor that made `Op`,
|
||||
//! `OpError`, `replay`, or a needed re-export (`ScalarKind`, `Scalar`)
|
||||
//! unreachable across the crate boundary would break that consumer while leaving
|
||||
@@ -15,7 +15,9 @@
|
||||
//! addition to the per-property invariants below.
|
||||
|
||||
use aura_engine::{replay, GraphBuilder, Op, OpError, Scalar, ScalarKind};
|
||||
use aura_std::{std_vocabulary, Bias, Sma, Sub};
|
||||
use aura_std::{Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
use aura_vocabulary::std_vocabulary;
|
||||
|
||||
/// The flat root's open param point: fast.length(i64), slow.length(i64),
|
||||
/// bias.scale(f64), in param-space traversal order. The same vector is applied to
|
||||
@@ -45,7 +47,7 @@ fn signal_ops() -> Vec<Op> {
|
||||
}
|
||||
|
||||
/// Property (C24 acceptance-1, through the public seam): an op-script replayed via
|
||||
/// the exported `replay` + the injected `aura_std::std_vocabulary` compiles to a
|
||||
/// the exported `replay` + the injected `aura_vocabulary::std_vocabulary` compiles to a
|
||||
/// `FlatGraph` whose index-wired topology (`edges`) and lowered bound sources
|
||||
/// (`sources`) are **identical** to the same signal hand-wired on the exported
|
||||
/// `GraphBuilder` surface and compiled with the same param point. The two
|
||||
|
||||
@@ -32,7 +32,9 @@ use std::sync::mpsc;
|
||||
|
||||
use aura_core::{NodeSchema, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{Edge, FlatGraph, Harness, Source, SourceSpec, Target, VecSource};
|
||||
use aura_std::{And, Delay, EqConst, Gt, Latch, Recorder, Resample, Session, SimBroker};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_market::{Resample, Session};
|
||||
use aura_std::{And, Delay, EqConst, Gt, Latch, Recorder};
|
||||
use chrono::TimeZone;
|
||||
use chrono_tz::Europe::Berlin;
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ use aura_engine::{
|
||||
f64_field, summarize, sweep, BlueprintNode, Composite, Edge, ListSpace, OutField, ParamSpec,
|
||||
Role, RunManifest, RunReport, Scalar, SweepError, Target, VecSource,
|
||||
};
|
||||
use aura_std::{Bias, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
|
||||
/// Seven synthetic F64 ticks — the same fixture shape as `random_sweep_e2e.rs`,
|
||||
/// short enough that small SMA windows warm up deterministically.
|
||||
|
||||
@@ -11,7 +11,8 @@ use std::sync::mpsc;
|
||||
|
||||
use aura_core::{Firing, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{blueprint_from_json, BlueprintNode, Composite, Edge, Role, Target, VecSource};
|
||||
use aura_std::{std_vocabulary, Recorder};
|
||||
use aura_std::Recorder;
|
||||
use aura_vocabulary::std_vocabulary;
|
||||
|
||||
// value = (high - low) + (close - open): every column is load-bearing, so any
|
||||
// mis-pairing of roles to sources (or a wrong merge tie-break) changes the
|
||||
|
||||
@@ -27,10 +27,8 @@
|
||||
|
||||
use aura_core::{AnyColumn, Ctx, Node, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{PositionAction, RMetrics, derive_position_events, summarize_r};
|
||||
use aura_std::{
|
||||
ConstantCost, CostSum, FixedStop, PM_FIELD_NAMES, PM_RECORD_KINDS, PM_WIDTH,
|
||||
PositionManagement, VolSlippageCost,
|
||||
};
|
||||
use aura_backtest::{PM_FIELD_NAMES, PM_RECORD_KINDS, PM_WIDTH, PositionManagement};
|
||||
use aura_strategy::{ConstantCost, CostSum, FixedStop, VolSlippageCost};
|
||||
|
||||
// The indices `report.rs::summarize_r` reads the dense record by. Re-declared here
|
||||
// (the consumer's `r_col` module is private to `aura-engine`) so the guard test can
|
||||
@@ -267,7 +265,7 @@ fn net_of_cost_is_charged_per_r_so_a_wider_stop_dilutes_it() {
|
||||
assert!(tight_cost > wide_cost, "a tighter stop must pay more R per fixed price-unit cost");
|
||||
}
|
||||
|
||||
/// Drive the REAL `aura_std::ConstantCost(c)` node over a recorded PM `ledger`,
|
||||
/// Drive the REAL `aura_strategy::ConstantCost(c)` node over a recorded PM `ledger`,
|
||||
/// node-by-node off the producer's own `closed`/`open`/`entry_price`/`stop_price`
|
||||
/// columns — the actual cost producer the run-path graph taps (not an algebraic stand-in
|
||||
/// like `const_cost_stream`). Returns the node's 3-wide `[cost_in_r, cum_cost_in_r,
|
||||
@@ -336,7 +334,7 @@ fn net_r_equity_final_sample_agrees_with_summarize_r_net_total() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Drive the REAL `aura_std::VolSlippageCost(k)` node over a recorded PM `ledger`
|
||||
/// Drive the REAL `aura_strategy::VolSlippageCost(k)` node over a recorded PM `ledger`
|
||||
/// with a constant `vol` per cycle — the run-path's vol-slippage producer. Returns
|
||||
/// the node's 3-wide `[cost_in_r, cum_cost_in_r, open_cost_in_r]` rows, co-temporal
|
||||
/// 1:1 with `ledger`.
|
||||
@@ -367,7 +365,7 @@ fn vol_slippage_node_stream(
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Drive the REAL `aura_std::CostSum(n)` aggregator over `n` co-temporal cost
|
||||
/// Drive the REAL `aura_strategy::CostSum(n)` aggregator over `n` co-temporal cost
|
||||
/// streams, summing them per-field — the run-path's cost-graph output node.
|
||||
fn cost_sum_node_stream(streams: &[&[(Timestamp, Vec<Scalar>)]]) -> Vec<(Timestamp, Vec<Scalar>)> {
|
||||
let n = streams.len();
|
||||
|
||||
@@ -18,7 +18,9 @@ use aura_engine::{
|
||||
f64_field, summarize, sweep, BlueprintNode, Composite, Edge, OutField, ParamRange, ParamSpec,
|
||||
RandomSpace, Role, RunManifest, RunReport, Scalar, Space, SweepError, Target, VecSource,
|
||||
};
|
||||
use aura_std::{Bias, Recorder, SimBroker, Sma, Sub};
|
||||
use aura_backtest::SimBroker;
|
||||
use aura_std::{Recorder, Sma, Sub};
|
||||
use aura_strategy::Bias;
|
||||
|
||||
/// Seven synthetic F64 ticks (mirrors the crate-private `synthetic_prices`):
|
||||
/// short enough that small SMA windows warm up, so every run yields finite,
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
use aura_core::{Scalar, ScalarKind};
|
||||
use aura_engine::{Composite, Role, Target};
|
||||
use aura_std::{Bias, Sma};
|
||||
use aura_std::Sma;
|
||||
use aura_strategy::Bias;
|
||||
|
||||
/// A single bound `Sma`, wired from a root role so it compiles standalone.
|
||||
fn one_bound_sma() -> Composite {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Acceptance proof for issue #236: an **RSI-class** signal — the classic
|
||||
//! gain/loss split of the price change and the smoothed **ratio** of average gain
|
||||
//! to average loss — composes *purely from blueprint data* through the injected
|
||||
//! `aura_std::std_vocabulary` and runs to hand-computable RS values. This is the
|
||||
//! `aura_vocabulary::std_vocabulary` and runs to hand-computable RS values. This is the
|
||||
//! property that pins the four std-vocabulary gaps the issue names as a single
|
||||
//! honest behaviour: `Div`, a `Const` source, `Abs`, and pairwise `Max`/`Min`.
|
||||
//!
|
||||
@@ -24,7 +24,8 @@ use std::sync::mpsc;
|
||||
|
||||
use aura_core::{Firing, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{blueprint_from_json, BlueprintNode, Composite, Edge, Role, Target, VecSource};
|
||||
use aura_std::{std_vocabulary, Recorder};
|
||||
use aura_std::Recorder;
|
||||
use aura_vocabulary::std_vocabulary;
|
||||
|
||||
// The RSI-class signal as blueprint data. Raw price fans out to a zero `Const`
|
||||
// (its clock is the price role), a `Delay[1]`, and a `Sub`; `delta = price - prev`
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
use aura_core::{AnyColumn, Ctx, Node, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{summarize, summarize_r};
|
||||
use aura_std::{GatedRecorder, SeriesReducer, PM_RECORD_KINDS, PM_WIDTH};
|
||||
use aura_backtest::{PM_RECORD_KINDS, PM_WIDTH};
|
||||
use aura_std::{GatedRecorder, SeriesReducer};
|
||||
use std::sync::mpsc;
|
||||
|
||||
const CLOSED: usize = 0;
|
||||
|
||||
@@ -12,7 +12,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::mpsc;
|
||||
|
||||
use aura_core::{AnyColumn, Ctx, Node, Scalar, ScalarKind, Timestamp};
|
||||
use aura_std::{GatedRecorder, PM_RECORD_KINDS, PM_WIDTH};
|
||||
use aura_backtest::{PM_RECORD_KINDS, PM_WIDTH};
|
||||
use aura_std::GatedRecorder;
|
||||
|
||||
struct CountingAlloc;
|
||||
static LIVE: AtomicUsize = AtomicUsize::new(0);
|
||||
|
||||
@@ -21,7 +21,8 @@ use std::sync::mpsc;
|
||||
|
||||
use aura_core::{Firing, Scalar, ScalarKind, Timestamp};
|
||||
use aura_engine::{GraphBuilder, VecSource};
|
||||
use aura_std::{Abs, Gt, Recorder, Resample, When};
|
||||
use aura_market::Resample;
|
||||
use aura_std::{Abs, Gt, Recorder, When};
|
||||
|
||||
/// A deterministic `f64` tick stream, no timestamps/randomness beyond a fixed
|
||||
/// literal sequence.
|
||||
|
||||
Reference in New Issue
Block a user