Skip to content

[T-045b] CLI: campaign create/start/pause/resume/cancel/status [--watch] and run --inline #91

Closed

Description

@CodewithJha

Task T-045b · Milestone M3 — Oracles + runner + store · Size M · Priority P0 · Epic #3

Implements FR-CLI-001 · PR-02

Branch feat/t-045b-cli-campaign-create-start-pause — one task = one branch = one PR (doc 32 §6)

Summary

Implement cli/campaign.py per doc 05 §11, including campaign run <config.yaml> --inline --workers N that creates, starts and drives a campaign in-process (orchestrator loop + N worker threads) — the CI workhorse.

Context / motivation

Every dashboard action must be possible from the CLI (FR-CLI-001); --inline makes end-to-end campaigns runnable without Docker (NFR-PORT-001).

Scope

In scope

  • Campaign config YAML validated by schemas/campaign.schema.json; configs/campaigns/k2d_random_100.yaml, k2d_probe_smoke.yaml.
  • status --watch live table (Rich).
  • --fail-on-failure → exit 3.
  • runs requeue --stuck and queue stats helpers (runbook RB-05).

Implementation guidance

  • Inline mode uses the same composition root as services (T-046) with thread-based workers; no special code paths in runner modules.
  • 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

  • roboprobe campaign run configs/campaigns/k2d_random_100.yaml --inline --workers 4 completes 100 runs.
  • Lifecycle commands respect the state machine (T-041c).
  • 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_campaign_cmds.py.

Dependencies

Blocked by: #86 (T-041b), #80 (T-040a), #89 (T-045a)

Blocks: #92 (T-044), #96 (T-045c), #99 (T-049), #109 (T-102b)

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/campaign.py
  • backend/src/roboprobe/cli/runs.py
  • configs/campaigns/*.yaml

Independent command modules.

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-045b (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 14 §2 · doc 30 §RB-05 · doc 17 §3

Requirements: FR-CLI-001 · PR-02 (traceability: doc 28)

Activity

  1. added
    area:runnerQueue, workers, campaign orchestration
    area:cliCommand-line interface
    priority:P0Critical path / blocks others
    milestone:M3M3 — Oracles + runner + store
    taskChild task of a milestone epic
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCommand-line interfacearea:runnerQueue, workers, campaign orchestrationmilestone:M3M3 — Oracles + runner + storepriority:P0Critical path / blocks otherssize:M1-3 daystaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions