fix(aura-cli, ledger): review fixes — override stamps the base hash (#343 revised), prose corrections
Harvest sweep, whole-diff review fix block. The review refuted the #343 ratification's factual premise: the campaign leg does NOT mint a reopened member's hash — runner.rs passes the stored strategy_id as topo even for reopened members (reference semantics). Decision revised on the issue (fix, not ratify): exec's override run now stamps the LOADED base document's content id (computed before reopen_all; RED-first — the inverted pin failed on the old reopened-hash behaviour), keeping topology_hash store-resolvable and identical in meaning across both legs; the variation lives in manifest.params. C24/C12/C18 rewritten to the corrected reading. Also per review: C24's retired build-free-introspection sentence updated (old wording archived in the history sidecar, #339 item 4); C14's partition key precisely scoped to the routing seam, naming the legs' differing content-validation exits honestly; measure.rs's false unreachability comment corrected; --taps added to the guide's introspect cheat-sheet and pinned on the content-id path; the zero-trade-cell note routed through the diag macro; doc-comment, issue-ref, and gate-name corrections; the Fixed-regime NaN branch pinned. refs #339 refs #342 refs #343
This commit is contained in:
@@ -48,9 +48,8 @@ pub(crate) fn note_zero_trade_windows(mut window_trades: impl ExactSizeIterator<
|
||||
/// — a campaign cell whose families are ALL non-walk-forward (grid sweep, MC
|
||||
/// bootstrap, …) has no per-window vocabulary to note through, yet a
|
||||
/// consumer still cannot tell "0.0 = break-even" from "0.0 = never traded"
|
||||
/// without this. Takes the per-report trade counts across every family the
|
||||
/// cell ran; a no-op unless there is at least one report and every one of
|
||||
/// them traded zero times.
|
||||
/// without this. Pure over the count so the wording is unit-pinned (mirrors
|
||||
/// `zero_trade_note_text`'s singular/plural split, #313).
|
||||
fn zero_trade_cell_note_text(n_reports: usize) -> String {
|
||||
if n_reports == 1 {
|
||||
"the cell's one report recorded zero trades; its metrics are vacuous, not a break-even \
|
||||
@@ -64,8 +63,10 @@ fn zero_trade_cell_note_text(n_reports: usize) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// See `zero_trade_cell_note_text`. Called from the campaign cell loop's
|
||||
/// non-walk-forward branch (`campaign_run.rs`), independent of `emit`.
|
||||
/// See `zero_trade_cell_note_text`. Takes the per-report trade counts across
|
||||
/// every family the cell ran; a no-op unless there is at least one report
|
||||
/// and every one of them traded zero times. Called from the campaign cell
|
||||
/// loop's non-walk-forward branch (`campaign_run.rs`), independent of `emit`.
|
||||
pub(crate) fn note_zero_trade_cell(mut report_trades: impl ExactSizeIterator<Item = u64>) {
|
||||
let n_reports = report_trades.len();
|
||||
if n_reports > 0 && report_trades.all(|n| n == 0) {
|
||||
|
||||
@@ -1070,7 +1070,7 @@ fn taps_lines(target: &str, env: &aura_runner::project::Env) -> Result<String, S
|
||||
let composite = if is_file { composite_from_authored_text(&text, env)? } else { composite_from_any(&text, env)? };
|
||||
let taps = composite.declared_taps();
|
||||
if taps.is_empty() {
|
||||
eprintln!("aura: note: {target} declares no taps");
|
||||
crate::diag::note!("{target} declares no taps");
|
||||
return Ok(String::new());
|
||||
}
|
||||
let mut out = String::new();
|
||||
|
||||
@@ -19,16 +19,17 @@ use aura_core::Cell;
|
||||
#[cfg(test)]
|
||||
use aura_composites::StopRule;
|
||||
use aura_engine::{
|
||||
blueprint_from_json, f64_field, join_on_ts,
|
||||
blueprint_from_json, blueprint_to_json, f64_field, join_on_ts,
|
||||
JoinedRow,
|
||||
SelectionMode,
|
||||
};
|
||||
// `blueprint_to_json`/`Composite` lost their last production caller with
|
||||
// `topology_hash` (#319 Task 9 — the CLI-side wrapper retired, its survival
|
||||
// rationale disproven); reached only from the test module now, mirroring
|
||||
// `Bias` below.
|
||||
// `Composite` lost its last production caller with `topology_hash` (#319
|
||||
// Task 9 — the CLI-side wrapper retired, its survival rationale disproven);
|
||||
// reached only from the test module now, mirroring `Bias` below.
|
||||
// (`blueprint_to_json` regained a production caller with the #343 revised
|
||||
// override-hash fix in `exec_blueprint_leg` above.)
|
||||
#[cfg(test)]
|
||||
use aura_engine::{blueprint_to_json, Composite};
|
||||
use aura_engine::Composite;
|
||||
#[cfg(test)]
|
||||
use aura_engine::{window_of, ColumnarTrace, Harness, VecSource};
|
||||
use aura_registry::{group_families, rank_by, FamilyMember, NameKind, RunTraces};
|
||||
@@ -1291,6 +1292,15 @@ fn exec_blueprint_leg(path: &str, overrides: &[String], tap: &[String], env: &au
|
||||
*ov_by_path.get(raw).expect("override set derived from these exact overrides")
|
||||
})
|
||||
.collect();
|
||||
// #343 (revised decision): `topology_hash` carries REFERENCE
|
||||
// semantics on every leg — it names the loaded base document, never
|
||||
// a transient reopened variant, mirroring the campaign leg's own
|
||||
// precedent (`runner.rs::MemberRunner::run_member` passes
|
||||
// `&cell.strategy_id`, the stored base document's id, as `topo` even
|
||||
// for a reopened member). Computed here, over the still-unreopened
|
||||
// `signal`, before `reopen_all` consumes it.
|
||||
let base_topo =
|
||||
content_id(&blueprint_to_json(&signal).expect("a buildable signal serializes"));
|
||||
let signal = reopen_all(signal, &paths);
|
||||
// An out-of-domain override value fails a node's own domain check at
|
||||
// bootstrap (e.g. `Sma::new`'s `assert!`, or a negative length
|
||||
@@ -1302,13 +1312,18 @@ fn exec_blueprint_leg(path: &str, overrides: &[String], tap: &[String], env: &au
|
||||
// `SilencedPanic` + `catch_unwind`) and render it as a runtime-class
|
||||
// refusal (exit 1, C14 partition) instead of an uncaught exit 101 —
|
||||
// the input was well-formed argv; the value is what the node refuses.
|
||||
let report = aura_campaign::catch_member_panic(|| {
|
||||
let mut report = aura_campaign::catch_member_panic(|| {
|
||||
run_signal_r(signal, ¶ms, RunData::Synthetic, 0, env, tap_plan)
|
||||
})
|
||||
.unwrap_or_else(|msg| {
|
||||
eprintln!("aura: {}", panic_refusal_prose(&msg));
|
||||
std::process::exit(1);
|
||||
});
|
||||
// Overwrite `run_signal_r`'s own (reopened-topology) hash with the
|
||||
// base document's id: reference semantics (#343). The manifest's
|
||||
// `params` already carries the override as the variation; the base
|
||||
// document + params deterministically reconstruct this run.
|
||||
report.manifest.topology_hash = Some(base_topo);
|
||||
// #324 (comment 4501): this leg always runs `RunData::Synthetic` (no
|
||||
// direct-blueprint exec ever binds real data), so a validating
|
||||
// caller reading zero trades here as "broken strategy" needs telling
|
||||
|
||||
Reference in New Issue
Block a user