Dead code: wrap_r's single-run cost-graph branch has no caller (post-#159) #221
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?
Surfaced by the cycle-close audit of the #159 demo-retirement arc (adversarially verified against the current tree at
ee70016).Finding
wrap_r's cost-graph branch is dead: no caller ever passesSome(cost), so the entire branch and its supporting types/imports are statically unreachable.crates/aura-cli/src/main.rs:1338—if let Some((cfg, tx_net, tx_cost)) = cost {is the cost-graph branch.wrap_rcallers passcost: None—main.rs:1101/1442/1486/1533/3345andcampaign_run.rs:735(the complete caller set).struct CostConfig(main.rs:1193) has zero construction sites (only its definition + thewrap_rsignature type at 1258).SLIP_VOL_LENGTH(main.rs:1189) is referenced only inside theSome(...)-guardedvol_proxyarm (guard at 1299), hence dead.cost_graph(line 16, used only at 1355),ConstantCost/VolSlippageCost/CarryCost(lines 32-33, used only at 1344/1348/1351) — all inside the dead branch. (RollingMax/RollingMin/Subare correctly excluded — live uses elsewhere; thecost_graphcomposite itself stays alive in aura-composites.)Behaviour-preserving removal (if CUT)
1338-1390branch,vol_proxymatch arm + itsprice_targetspush (1298-1308,1315-1318),CostConfig(1191-1197),SLIP_VOL_LENGTH(1185-1189),The suite stays green either way — the branch never executes.
The decision (why this is not folded into the audit tidy)
This is not the
#152sweep-cost scaffold:#152targets the reduce-mode sweep path, whereas this branch only fires on the non-reduce single-run path. So the open question is a design call, not a mechanical tidy:aura run <bp.json> --cost …); then it should get a live caller, and this issue tracks that the intent currently survives only in code, not a wired path.net_r_equityon the reduce path); then delete per the list above.Held out of the
#159cycle-close doc-tidy commit deliberately: a code deletion in the C10 cost subsystem deserves its own scrutiny and commit, not a ride-along in a prose sweep.Decision (2026-07-09, orchestrator, autonomous run): CUT.
The fork posed in the issue body was KEEP (treat the branch as a deliberate seam for a future single-run
aura run --cost …) vs CUT (delete the unreachable branch). Chosen: CUT — the settled cost design (ledger C10) routes cost through the sweep/campaign reduce path, so a single-run cost seam kept alive only as unreachable code contradicts the forward-queue discipline (intent lives in the tracker, not in dead code); git history preserves the wiring pattern should a single-run cost feature ever be specified, at which point it gets its own issue and a live caller.Execution: behaviour-preserving removal per the issue's removal list, via a signature edit (drop
wrap_r'scostparameter; the compiler enumerates the 6 call sites). Done-signal: clean build AND suite green unchanged.