From e07ea0d9bc76a55830f31ff30087b66ba1c80cad Mon Sep 17 00:00:00 2001 From: Yvette Carlisle Date: Mon, 29 Jun 2026 21:04:50 +0800 Subject: [PATCH] {"schema":"decodex/commit/1","summary":"Split ELF CLI benchmark argument models into a private child module after local validation.","authority":"manual"} --- apps/elf-cli/src/args.rs | 84 ++---------------------------- apps/elf-cli/src/args/benchmark.rs | 83 +++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 79 deletions(-) create mode 100644 apps/elf-cli/src/args/benchmark.rs diff --git a/apps/elf-cli/src/args.rs b/apps/elf-cli/src/args.rs index 37274c71..981b3a24 100644 --- a/apps/elf-cli/src/args.rs +++ b/apps/elf-cli/src/args.rs @@ -1,4 +1,8 @@ -use std::path::PathBuf; +mod benchmark; + +pub(crate) use self::benchmark::{ + BenchmarkArgs, BenchmarkCommand, BenchmarkReportArgs, BenchmarkRunArgs, +}; use clap::{Args, Parser, Subcommand, ValueEnum}; @@ -167,54 +171,6 @@ pub(crate) struct BackfillArgs { pub(crate) dry_run: bool, } -#[derive(Debug, Args)] -pub(crate) struct BenchmarkArgs { - #[command(subcommand)] - pub(crate) command: BenchmarkCommand, -} - -#[derive(Debug, Args)] -pub(crate) struct BenchmarkRunArgs { - #[command(flatten)] - pub(crate) output: OutputArgs, - /// Benchmark task wrapper to run. - #[arg(long, value_enum, default_value_t = BenchmarkRunKind::Live)] - pub(crate) kind: BenchmarkRunKind, - /// Project filter passed to ELF_BASELINE_PROJECTS. - #[arg(long)] - pub(crate) projects: Option, - /// Corpus profile passed to ELF_BASELINE_PROFILE. - #[arg(long)] - pub(crate) profile: Option, - /// Private production corpus manifest path. - #[arg(long)] - pub(crate) production_corpus_manifest: Option, - /// Markdown addendum path for production-private-addendum. - #[arg(long)] - pub(crate) private_addendum: Option, - /// Soak duration override in seconds. - #[arg(long)] - pub(crate) soak_seconds: Option, - /// Print the resolved task and environment without running it. - #[arg(long)] - pub(crate) dry_run: bool, -} - -#[derive(Debug, Args)] -pub(crate) struct BenchmarkReportArgs { - #[command(flatten)] - pub(crate) output: OutputArgs, - /// Source live-baseline report JSON path. - #[arg(long)] - pub(crate) report: Option, - /// Markdown output path. - #[arg(long)] - pub(crate) out: Option, - /// Print the resolved task and environment without running it. - #[arg(long)] - pub(crate) dry_run: bool, -} - #[derive(Debug, Args)] pub(crate) struct DiagnosticsArgs { #[command(subcommand)] @@ -356,36 +312,6 @@ impl PayloadLevel { } } -#[derive(Debug, Subcommand)] -#[command(rename_all = "kebab")] -pub(crate) enum BenchmarkCommand { - /// Run one checked-in Docker baseline task. - Run(BenchmarkRunArgs), - /// Render Markdown from a live-baseline JSON report. - Report(BenchmarkReportArgs), -} - -#[derive(Clone, Copy, Debug, ValueEnum)] -#[value(rename_all = "kebab")] -pub(crate) enum BenchmarkRunKind { - Live, - ProductionSynthetic, - ProductionPrivate, - ProductionPrivateAddendum, - Soak, -} -impl BenchmarkRunKind { - pub(crate) fn task_name(self) -> &'static str { - match self { - Self::Live => "baseline-live-docker", - Self::ProductionSynthetic => "baseline-production-synthetic", - Self::ProductionPrivate => "baseline-production-private", - Self::ProductionPrivateAddendum => "baseline-production-private-addendum", - Self::Soak => "baseline-soak-docker", - } - } -} - #[derive(Debug, Subcommand)] #[command(rename_all = "kebab")] pub(crate) enum DiagnosticsCommand { diff --git a/apps/elf-cli/src/args/benchmark.rs b/apps/elf-cli/src/args/benchmark.rs new file mode 100644 index 00000000..5b63547e --- /dev/null +++ b/apps/elf-cli/src/args/benchmark.rs @@ -0,0 +1,83 @@ +use std::path::PathBuf; + +use clap::{Args, Subcommand, ValueEnum}; + +use crate::args::OutputArgs; + +#[derive(Debug, Args)] +pub(crate) struct BenchmarkArgs { + #[command(subcommand)] + pub(crate) command: BenchmarkCommand, +} + +#[derive(Debug, Args)] +pub(crate) struct BenchmarkRunArgs { + #[command(flatten)] + pub(crate) output: OutputArgs, + /// Benchmark task wrapper to run. + #[arg(long, value_enum, default_value_t = BenchmarkRunKind::Live)] + pub(crate) kind: BenchmarkRunKind, + /// Project filter passed to ELF_BASELINE_PROJECTS. + #[arg(long)] + pub(crate) projects: Option, + /// Corpus profile passed to ELF_BASELINE_PROFILE. + #[arg(long)] + pub(crate) profile: Option, + /// Private production corpus manifest path. + #[arg(long)] + pub(crate) production_corpus_manifest: Option, + /// Markdown addendum path for production-private-addendum. + #[arg(long)] + pub(crate) private_addendum: Option, + /// Soak duration override in seconds. + #[arg(long)] + pub(crate) soak_seconds: Option, + /// Print the resolved task and environment without running it. + #[arg(long)] + pub(crate) dry_run: bool, +} + +#[derive(Debug, Args)] +pub(crate) struct BenchmarkReportArgs { + #[command(flatten)] + pub(crate) output: OutputArgs, + /// Source live-baseline report JSON path. + #[arg(long)] + pub(crate) report: Option, + /// Markdown output path. + #[arg(long)] + pub(crate) out: Option, + /// Print the resolved task and environment without running it. + #[arg(long)] + pub(crate) dry_run: bool, +} + +#[derive(Debug, Subcommand)] +#[command(rename_all = "kebab")] +pub(crate) enum BenchmarkCommand { + /// Run one checked-in Docker baseline task. + Run(BenchmarkRunArgs), + /// Render Markdown from a live-baseline JSON report. + Report(BenchmarkReportArgs), +} + +#[derive(Clone, Copy, Debug, ValueEnum)] +#[value(rename_all = "kebab")] +pub(crate) enum BenchmarkRunKind { + Live, + ProductionSynthetic, + ProductionPrivate, + ProductionPrivateAddendum, + Soak, +} +impl BenchmarkRunKind { + pub(crate) fn task_name(self) -> &'static str { + match self { + Self::Live => "baseline-live-docker", + Self::ProductionSynthetic => "baseline-production-synthetic", + Self::ProductionPrivate => "baseline-production-private", + Self::ProductionPrivateAddendum => "baseline-production-private-addendum", + Self::Soak => "baseline-soak-docker", + } + } +}