Skip to content

Polish CLI UX and speed up local preview flows#44

Merged
TrevorBasinger merged 1 commit intomainfrom
tb/roar-cli-polish
Mar 18, 2026
Merged

Polish CLI UX and speed up local preview flows#44
TrevorBasinger merged 1 commit intomainfrom
tb/roar-cli-polish

Conversation

@TrevorBasinger
Copy link
Member

Summary

This PR is a CLI polish and startup/performance pass for roar.

It focuses on two things:

  1. making common CLI behavior more trustworthy and easier to recover from
  2. making local read-only and preview flows feel fast by keeping them local and cutting unnecessary startup work

What Changed

CLI UX and correctness

  • return non-zero exit codes for user-facing show, log, and status errors instead of printing failure text as success
  • fix roar init --path so .gitignore handling uses the target repo, not the caller repo
  • fix recovery/help text, including removing the stale roar clean guidance
  • add explicit roar show --path, --job, --artifact, and --session selectors
  • make lazy subcommand import failures surface as Click errors instead of Python tracebacks
  • promote roar auth key as the primary SSH key workflow and keep auth register as a compatibility alias
  • improve top-level help and success output for run, put, and register

Performance and profiling framework

  • add a reusable profiling harness at scripts/profile_roar.py
  • add profiling docs at docs/developer/profiling.md
  • lazy-load query, DB, presenter, core model, config, and GLaaS integration surfaces to reduce startup work
  • add a sqlite-backed read-only query context for status, log, and show
  • keep put --dry-run local by skipping backend/runtime/git setup
  • keep register --dry-run local with preview-only runtime, raw config access, lightweight git/session prep, and lightweight job normalization
  • add regression coverage around lazy import boundaries and preview-path behavior

Profiling Results

Latest full profile sweep from this branch:

  • cli_help: 47.1ms
  • cli_run_simple: 985.2ms
  • cli_status_active: 70.3ms
  • cli_show_session: 82.1ms
  • cli_register_dry_run: 111.2ms
  • cli_put_dry_run: 77.6ms

Largest wins from the original branch baseline:

  • cli_put_dry_run: 3131.6ms -> 77.6ms
  • cli_status_active: 491.0ms -> 70.3ms
  • cli_show_session: 445.2ms -> 82.1ms
  • cli_register_dry_run: 424.5ms -> 111.2ms

The main remaining product-path hotspot is still roar run, which is dominated by tracer/process and provenance collection work rather than generic CLI startup.

Verification

Ran from /home/trevor/dev/roar-cli-polish:

uv run --extra dev ruff check .
uv run --extra dev mypy roar
uv run --extra dev pytest -m "not live_glaas and not ebpf"
uv run --extra dev python scripts/profile_roar.py --scenario cli_register_dry_run --iterations 5 --top 20 --output tests/benchmarks/results/profile_register_dry_run_latest.json
uv run --extra dev python scripts/profile_roar.py --iterations 3 --top 15

Results:

  • ruff check .: passed
  • mypy roar: passed
  • pytest -m "not live_glaas and not ebpf": 1021 passed, 1 skipped
  • focused cli_register_dry_run: 106.4ms
  • full profiling artifacts refreshed under tests/benchmarks/results/

Follow-Up

The next highest-value work is deeper phase timing around roar run, plus runtime startup/atexit overhead behind the sitecustomize performance guardrail.

@TrevorBasinger TrevorBasinger merged commit 2122805 into main Mar 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant