Repository navigation
Description
Task
T-035a· Milestone M2 — Scenario + kinematic2d · Size S · Priority P0 · Epic #2Implements FR-RUN-006 · NFR-EXT-001 · PR-19
Branch
feat/t-035a-simulatorbackend-port-capabilities-episoderequest-result— one task = one branch = one PR (doc 32 §6)
Summary
Define backends/base.py (normative doc 05 §2.1: BackendCapabilities, EpisodeRequest, EpisodeResult, MaterializedScenario, SimulatorBackend Protocol with PLUGIN_API_VERSION) and backends/registry.py (get_backend(name, settings) via importlib.metadata.entry_points(group='roboprobe.backends')).
Context / motivation
This is the swap point that makes the runner simulator-agnostic (Liskov, doc 10 §1). Freezing it early lets k2d, replay and Gazebo backends and the worker be built in parallel.
Scope
In scope
- Protocol + models exactly as doc 05 §2.1.
- Registry with clear
PluginErrorfor unknown names / API version mismatch. supported_paramscheck helperassert_supports(capabilities, enabled_params)→BACKEND_UNSUPPORTED_PARAM.
Implementation guidance
EpisodeRequest.sim_time_budget_s/wall_timeout_sdefaults come fromWorkerSettings(the literal defaults in doc 05 are illustrative, doc 05 §0).- 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
- Signatures match doc 05 §2.1 exactly.
- Registry loads a dummy backend registered in a test entry point (use
importlib.metadatamonkeypatching). - Version mismatch raises
PluginError. - 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/unit/backends/test_registry.py.
Dependencies
Blocked by: #15 (T-002a), #16 (T-002b)
Blocks: #55 (T-035b), #56 (T-035c), #57 (T-035d), #68 (T-036a), #80 (T-040a), #103 (T-052), #202 (T-096b)
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/backends/base.pybackend/src/roboprobe/backends/registry.py
Interface task — merge early; afterwards changes require doc 05 update.
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-035a (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 §2 · doc 05 §2.1 · doc 05 §2.2 · doc 10 §1 · doc 10 §10 · ADR-0016
Requirements: FR-RUN-006 · NFR-EXT-001 · PR-19 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsReady
Activity
branin_falsify,multi_mode_6d) and benchmark backend #103