Skip to content

[T-045c] CLI: service commands (orchestrator, worker, api) and ad-hoc run --scenario, scenario export #96

Closed

Description

@CodewithJha

Task T-045c · Milestone M3 — Oracles + runner + store · Size S · Priority P1 · Epic #3

Implements FR-CLI-001 · FR-SCN-008

Branch feat/t-045c-cli-service-commands-and-ad — one task = one branch = one PR (doc 32 §6)

Summary

Add long-running service entry points used by compose, plus single ad-hoc runs from a regression scenario file and scenario export <run_id>.

Context / motivation

FR-SCN-008 AC: scenario export produces a file that roboprobe run --scenario file.yaml executes.

Scope

In scope

  • cli/services.py: orchestrator, worker --backend B [--concurrency N], api [--host --port] (api command wired once T-080a exists — guard with clear error).
  • cli/scenario.py: export; cli/run.py: run --scenario file.yaml --backend B [--seed S] creating a one-off manual campaign/run and printing the verdict.

Implementation guidance

  • Service commands only parse options and call bootstrap factories (no business logic).
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • Export → run round-trip executes and checks expect.verdict (exit 3 on mismatch with --fail-on-failure).
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • tests/integration/cli/test_run_scenario.py.

Dependencies

Blocked by: #95 (T-048), #39 (T-026), #91 (T-045b)

Blocks: #97 (T-047)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • backend/src/roboprobe/cli/services.py
  • backend/src/roboprobe/cli/scenario.py
  • backend/src/roboprobe/cli/run.py

Independent.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-045c (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 05 §11 · doc 06 §6 · doc 14 §9 · doc 03 §UC-07

Requirements: FR-CLI-001 · FR-SCN-008 (traceability: doc 28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCommand-line interfacearea:runnerQueue, workers, campaign orchestrationmilestone:M3M3 — Oracles + runner + storepriority:P1Required for milestone exitsize:S<= 1 daytaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions