Repository navigation
Description
What
Wire BenchmarkComparisonEngine and the new reporters into a real
benchmark-gate compare command, refactor CheckCommand into pure
orchestration over the same comparison engine, and update docs.
CLI
benchmark-gate compare \
--baseline <path> \
--results <path> \
[--format console|json|markdown] \
[--output <path>] \
[--quiet]Explicitly absent: --policy, --fail-on-warning, JUnit output, any
threshold arguments.
CheckCommand refactor
Parse results
→ load, validate, and compile baseline
→ load, validate, and compile policy
→ BenchmarkComparisonEngine.Compare
→ RegressionEvaluator.Evaluate
→ decision reporting (unchanged reporters from v0.2/v0.3)
→ exit-code mapping
CheckCommand must not itself calculate percentages, match benchmarks,
match metrics, check units, or derive improvement/degradation direction
— all of that is BenchmarkComparisonEngine's job, called once, from
one place.
CompareCommand
Parse results
→ load, validate, and compile baseline
→ BenchmarkComparisonEngine.Compare
→ comparison reporting
→ exit-code mapping
No policy acquisition anywhere in this path.
Exit code mapping (reuses existing ExitCodes, no new codes)
| Condition | Code |
|---|---|
| Comparison completed, regardless of improvement/degradation | Passed (0) |
| Invalid/incomplete CLI arguments | InvalidArguments (2) |
| Baseline could not be loaded/validated/compiled | InvalidBaselineOrPolicy (3) |
| Results could not be parsed | UnsupportedSchema (8) |
| Unexpected internal failure | InternalError (10) |
| Requested report could not be written | OutputWriteFailure (11) |
ValidationFailed (12) is explicitly excluded — compare produces no
severity-based verdict. A slower benchmark, an added/removed benchmark,
a missing metric, a unit mismatch — none of these are process failures;
they're comparison results. The command fails only when it cannot
construct a trustworthy comparison artifact at all.
Docs
README.md—compareusage section, matching the existing
check/capture/validatesection formatdocs/ARCHITECTURE.md— comparison layer added to the pipeline diagramdocs/EXIT-CODES.md—compare's column added to the "Returned by" field
for each applicable code- CLI help text /
Program.cscommand description
Acceptance criteria
-
CompareCommand.csandCheckCommand.csfollow the same
thin-orchestration pattern as existing commands — no comparison
logic in either command itself - Integration tests (
CompareCommandTests) covering: valid
comparison, each--formatoption, added/removed benchmarks,
nonexistent baseline/results paths,--outputfile writing -
CheckCommand's existing test suite passes unmodified in outcome
(sameSuiteDecision/exit codes for the same inputs) after the
refactor - README/ARCHITECTURE.md/EXIT-CODES.md updated
Activity
Fix CheckCommand compile break from RegressionEvaluator's new signatu…
Core: refactor RegressionEvaluator onto ComparisonResult, with a mini…
Add benchmark-gate compare command
Add ADR-0004 (versioned artifacts) and ADR-0005 (comparison facts vs.…
Release v0.4.0-alpha.1 (#39)