Repository navigation
Description
Task
T-048· Milestone M3 — Oracles + runner + store · Size S · Priority P0 · Epic #3Implements FR-RUN-001 · NFR-REL-002
Branch
feat/t-048-orchestrator-service-multi-campaign-supervisor— one task = one branch = one PR (doc 32 §6)
Summary
Implement runner/orchestrator.py: discover RUNNING campaigns, run up to runner.max_concurrent_campaigns CampaignLoops (threads), schedule the reaper, expose /healthz (last tick age) and metrics; graceful shutdown.
Context / motivation
The orchestrator is the long-running service in compose (roboprobe orchestrator).
Scope
In scope
- Supervisor loop with stop event; per-campaign error isolation (one failing campaign → FAILED with reason, others continue).
- Queue depth gauge
roboprobe_queue_depth.
Implementation guidance
- Keep orchestration logic thin; delegate to CampaignLoop/Reaper.
- 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.
Configuration keys
From the configuration reference (doc 27). Keys marked (new) must be added to the typed settings models and appear in the generated reference (T-003c).
runner.max_concurrent_campaignsrunner.tick_interval_srunner.reaper_interval_s
Acceptance criteria
- Starts/stops cleanly; picks up newly started campaigns within one tick.
- Health endpoint reports tick age.
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
tests/integration/runner/test_orchestrator.py.
Dependencies
Blocked by: #86 (T-041b), #82 (T-042a), #94 (T-046)
Blocks: #96 (T-045c), #138 (T-075b), #214 (T-125)
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/runner/orchestrator.py
Independent module.
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-048 (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 §5.1 · doc 04 §5 · doc 21 §5.4 · doc 34 §8
Requirements: FR-RUN-001 · NFR-REL-002 (traceability: doc 28)
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
roboprobe.bootstrap) and plugin entry-point registries #94orchestrator,worker,api) and ad-hocrun --scenario,scenario export#96roboprobe analyze#138