366170aeab
Replace the hand-rolled aura-cli argv parser with a clap derive parser. Delivers, all from one declarative source: - scoped `aura <sub> --help` (stdout, exit 0) — each subcommand's own Options section; retires the #131 uniform-global-blob help - `--version` / `-V` → `aura 0.1.0` (stdout, exit 0) - GNU `--flag=value`, the `--` end-of-options terminator, and long-option abbreviation (`--harn` → `--harness`) Architecture: one root Cli/Command enum, one `*Cmd` struct per subcommand. The four dual-grammar subcommands (run/sweep/walkforward/mc) map the loaded-blueprint branch as an optional `[blueprint]` positional + a post-parse `is_file()` dispatch on a single-sourced predicate; each built-in handler re-asserts a stray-positional guard (refuse-don't-guess) so clap's optional positional cannot silently swallow a typo (pinned by two new E2E tests). The execution layer (run_*/emit_*/runs_*/reproduce_*) is untouched — only arg-plumbing changes, via thin `*_from` adapters reusing the existing value helpers. Exit codes behaviour-preserved: clap parse errors exit 2 (matching the old usage-error=2); domain refusals stay exit 2; reproduce-diverged stays exit 1. The exit-code split (2=usage / 1=runtime) is iteration 2. clap is admitted under the C16 per-case review (research-side CLI, invariant 8 untouched — a dev-loop compile tax, not a frozen-artifact tax). Forced plan corrections (implementer; verified against the diff): - Step 6's deletion of the `parse_*_args` fns orphaned ~34 grammar unit tests that called them; those were deleted and that grammar coverage moved to the renegotiated cli_run.rs E2E pins (`parse_select` kept + retested). - run_malformed_cost_value_...: a bad cost value is now a clap value-parse error (no "Usage:" line); renegotiated to pin exit 2 + empty stdout + the flag name "--cost-per-trade"; the units note stays pinned via `run --help`. - `allow_hyphen_values` on the three cost flags so `--cost-per-trade -0.5` reaches the non-negativity guard (else clap rejects -0.5 as an unknown option). - Deleted the now-dead `RealWindowGrammar` (clippy -D warnings). Orchestrator additions after the loop: - Enabled long-option abbreviation (`infer_long_args` on the root — one attribute, it propagates to subcommands) + a test, closing spec acceptance criterion 4 which the plan's RED tests did not cover. Decided to deliver rather than amend the spec: the two ratified decisions conflict on this low-tier item — Fork B (GNU compliance, getopt_long abbreviates) vs F5 (LLM/automation-first, human-only niceties deprioritized) — and the cost tiebreaker (one attribute, not per-struct work) resolves to deliver. Carry-on debt (not this iteration): the error-message "Usage:"/"usage:"/bare casing is now mixed (clap's capitalized "Usage:" beside preserved lowercase aura messages); a deliberate quality-hold since the casings are pinned by renegotiated/preserved tests. Cosmetic; a candidate for the iteration-2 exit-code-split cleanup. Verified green (orchestrator, this session): cargo build --workspace, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace all clean (0 failed across every test binary, including the renegotiated cli_run pins and the new --version / scoped-help / GNU-flag / dual-grammar tests). refs #175
49 lines
2.3 KiB
TOML
49 lines
2.3 KiB
TOML
[package]
|
|
name = "aura-cli"
|
|
edition.workspace = true
|
|
version.workspace = true
|
|
license.workspace = true
|
|
publish.workspace = true
|
|
|
|
[[bin]]
|
|
name = "aura"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
aura-core = { path = "../aura-core" }
|
|
aura-engine = { path = "../aura-engine" }
|
|
# aura-composites: the Stage-1 RiskExecutor / vol_stop composite-builders the
|
|
# stage1-r harness wires (kept out of aura-engine so the engine stays domain-free).
|
|
aura-composites = { path = "../aura-composites" }
|
|
aura-registry = { path = "../aura-registry" }
|
|
aura-std = { path = "../aura-std" }
|
|
aura-ingest = { path = "../aura-ingest" }
|
|
# data-server: the local M1 archive `aura run --real` streams from. Mirrors the
|
|
# git line in crates/aura-ingest/Cargo.toml verbatim (same source of truth).
|
|
data-server = { git = "http://192.168.178.103:3000/Brummel/data-server.git", branch = "main" }
|
|
# serde derives Serialize on the chart-trace payload (Series) so render_chart_html
|
|
# can embed it via serde_json::json!; admitted under the per-case dependency policy,
|
|
# same as aura-engine.
|
|
serde = { workspace = true }
|
|
# serde_json renders the walk-forward summary line (MetricStats + stitched total)
|
|
# and the injected chart traces (window.AURA_TRACES);
|
|
# admitted under the per-case dependency policy, same as aura-engine.
|
|
serde_json = { workspace = true }
|
|
# libc: restore the default SIGPIPE disposition at startup (see `fn main`) so a
|
|
# closed stdout pipe (`aura sweep | head`, a closed UI pane) terminates the
|
|
# process cleanly instead of panicking the runtime's SIG_IGN default into an
|
|
# EPIPE. The standard vetted crate for signal disposition, already transitive in
|
|
# Cargo.lock; admitted under the per-case dependency policy.
|
|
libc = "0.2"
|
|
# sha2: the run's topology_hash (#158) is the SHA256 of the canonical signal
|
|
# blueprint serialization. A vetted RustCrypto crate (per-case C16 review,
|
|
# SHA256 user-settled); lives in the research-side CLI, off the frozen engine
|
|
# (invariant 8).
|
|
sha2 = "0.10"
|
|
# clap: the vetted standard argument parser. Adopted (C16 per-case review) to
|
|
# replace the hand-rolled argv parser + ten duplicated help surfaces with one
|
|
# declarative source, giving scoped --help, --version, --flag=value, and
|
|
# long-option abbreviation. Research-side CLI only (invariant 8): a dev-loop
|
|
# compile tax, never a frozen-artifact tax.
|
|
clap = { version = "4", features = ["derive"] }
|