feat: add CLI startup and command latency budget enforcement (issue #698) - #702
Merged
Nanle-code merged 2 commits intoJul 29, 2026
Merged
Conversation
added 2 commits
July 29, 2026 14:49
…anle-code#698) Add latency budget engine, Criterion benchmarks, CI workflow, tests, and documentation.
|
@meem08 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforce CLI Startup and Command Latency Budgets (Issue #698)
Summary
Adds a comprehensive latency budget enforcement system for the StarForge CLI. Tracks representative cold-start and command paths via Criterion benchmarks and flags statistically meaningful regressions in CI.
Changes
Core Engine —
src/utils/latency_budget.rs(new)LatencyBudget/LatencyBudgets— per-command threshold definitions with defaults for 13 CLI pathscheck_measurement()— checks a single benchmark measurement against its budget (Pass/Fail/Noisy/Skipped/Error)check_latency_budget()— runs a full budget check across all active budgetsis_significant_regression()— CV-based z-score statistical regression detectionbudget_report_to_json()/print_budget_summary()— JSON and human-readable outputSTARFORGE_LATENCY_BUDGET_<LABEL>Criterion Benchmarks —
benches/benchmarks.rs(modified)bench_cli_cold_start— measuresinfo,--help,--versioncold-start latencybench_cli_command_latency— measures 10 representative command dispatch paths (wallet, network, config, template, deploy, benchmark)bench_latency_budget_check— measures budget check engine overheadIntegration Tests —
tests/latency_budget_test.rs(new, 22 tests)CI Workflow —
.github/workflows/benchmark-latency.yml(new)scripts/check-latency-budgets.shand checks budgetsBudget Check Script —
scripts/check-latency-budgets.sh(new)Documentation
CLI_LATENCY_BUDGETS.md— full user-facing docs with budgets table, env var overrides, CI integration, adding budgets, security/compatibility/migration notesBENCHMARKS.md— updated benchmark groups table and CI integration sectionAcceptance Criteria Met
Related Issue
Closes #698