Files
Aura/fieldtests/milestone-cost-model-graph/run_scenarios.sh
T
Brummel dff99c93e4 fieldtest(milestone): cost-model graph (#148) — capability delivered green
Milestone-close gate for "Cost-model graph (in R)" (#148). The fieldtester exercised
the milestone capability end-to-end from the public CLI only (no implementation
source), on the stage1-r harness, against ledger C10 + the glossary.

Roll-up: friction_found — 0 capability bugs; the milestone promise is empirically
delivered:
- bare gross-R run is clean (net == gross, no cost forced);
- per-trade cost: gross pinned, net drops strictly/monotonically, net_r_equity tap
  persists;
- the capstone per-held-cycle carry BLEEDS the net-R curve continuously over a hold
  (the gross-net gap grows 0.367 -> 0.734 -> 1.101 -> 1.468 across one hold, vs the
  per-trade run's flat 0.367) — the holding-cost shape change, observable end-to-end;
- composition is exact-additive (the composed drag equals the sum of the single-cost
  drags to the last ULP) and `aura chart` renders the real net_r_equity series.

Evidence under fieldtests/milestone-cost-model-graph/ (run_scenarios.sh +
captured_outputs.txt + traces/ + the charted bleed + FINDINGS.md).

Non-blocking findings filed forward (none gates the close):
- cost-flag CLI ergonomics — units hint, negative-rate diagnostic, non-R-harness
  no-op + a C10 spec_gap -> #153;
- docs/project-layout.md describes the retired `aura backtest --broker` path and omits
  the cost flags -> folded into #151.

refs #148
2026-06-29 02:35:24 +02:00

54 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Milestone fieldtest — "Cost-model graph (in R)" (#148).
#
# Downstream-consumer reproduction: a research user with ONLY the public
# interface (the `aura` CLI, the design ledger C10, the glossary) investigating
# how much friction costs their edge on the stage1-r harness — and whether a
# HOLDING cost changes the SHAPE of the net-R equity curve.
#
# Run from the repo root after `cargo build -p aura-cli`:
# bash fieldtests/milestone-cost-model-graph/run_scenarios.sh
#
# net_expectancy_r is the headline net-R scalar; expectancy_r is gross R.
# The full per-cycle net-R curve is the `net_r_equity` tap (persisted with --trace).
set -u
AURA=./target/debug/aura
nr() { grep -oE '"(expectancy_r|net_expectancy_r)":[-0-9.e]+'; }
echo "### Scenario 1 — bare gross-R, NO cost model (the zero-cost floor)"
$AURA run --harness stage1-r | nr
echo
echo "### Scenario 2 — flat per-trade cost (ConstantCost, deduct AT CLOSE)"
echo "# gross expectancy_r is fixed; net_expectancy_r drops monotonically with cost:"
for c in 0.0001 0.001 0.01; do
echo -n " --cost-per-trade $c -> "; $AURA run --harness stage1-r --cost-per-trade "$c" | nr | tr '\n' ' '; echo
done
$AURA run --harness stage1-r --cost-per-trade 0.001 --trace pertrade_cost >/dev/null
echo
echo "### Scenario 3 — per-HELD-CYCLE carry (CarryCost, ACCRUE over the hold) — the capstone"
$AURA run --harness stage1-r --carry-per-cycle 0.001 --trace carry_cost | nr
# The contrast lives in the net_r_equity gap during a hold (cycles ts4..ts7):
# per-trade gap = FLAT 0.367 (would-be-close offset, steps only at close)
# carry gap = GROWING 0.367 -> 0.734 -> 1.101 -> 1.468 (continuous bleed)
echo
echo "### Scenario 4 — compose all three costs into ONE net-R curve"
echo -n " slip-vol-mult 0.5 alone -> "; $AURA run --harness stage1-r --slip-vol-mult 0.5 | nr | tr '\n' ' '; echo
echo -n " cost-per-trade 0.001 alone -> "; $AURA run --harness stage1-r --cost-per-trade 0.001 | nr | tr '\n' ' '; echo
echo -n " carry-per-cycle 0.001 alone -> "; $AURA run --harness stage1-r --carry-per-cycle 0.001 | nr | tr '\n' ' '; echo
echo -n " ALL THREE composed -> "; $AURA run --harness stage1-r --cost-per-trade 0.001 --slip-vol-mult 0.5 --carry-per-cycle 0.001 --trace composed_cost | nr | tr '\n' ' '; echo
# The composed net-R drag equals the EXACT sum of the three single-cost drags
# (gross - composed == drag_pertrade + drag_slip + drag_carry), and composed net
# is strictly below every single cost alone.
echo
echo "### Chart the bleed (self-contained HTML, series baked in):"
echo " $AURA chart carry_cost --tap net_r_equity > chart_carry_net_r_equity.html"
echo
echo "### Probes (robustness + foot-guns)"
echo -n " negative carry rate -> "; $AURA run --harness stage1-r --carry-per-cycle -0.001 >/dev/null 2>&1; echo "exit=$? (guard: refused)"
echo -n " cost flag on --harness sma (no R block) -> "; $AURA run --harness sma --cost-per-trade 0.001 | grep -oE '"total_pips":[-0-9.e]+'; echo " ^ exit=0, cost flag SILENTLY IGNORED (no net block, no warning)"