Skip to content

[T-035c] ReplayBackend: return a stored trace for oracle re-evaluation and tests #56

Closed

Description

@CodewithJha

Task T-035c · Milestone M2 — Scenario + kinematic2d · Size XS · Priority P1 · Epic #2

Implements FR-ORC-006

Branch feat/t-035c-replaybackend-return-a-stored-trace — one task = one branch = one PR (doc 32 §6)

Summary

Implement backends/replay/backend.py returning a pre-recorded trace (path from the request's MaterializedScenario/metadata) so oracles can be re-evaluated offline and tests can feed golden traces through the full worker pipeline.

Context / motivation

Doc 05 §2.2 lists replay as a standard adapter; it enables oracle reevaluate and fast worker tests.

Scope

In scope

  • Entry point replay.
  • Capabilities: deterministic, all params supported (ignored).

Implementation guidance

  • The trace source is injected via constructor (mapping run_id → trace path) to keep it pure for tests.
  • 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

  • Contract suite passes (with appropriate skips documented).
  • Returned trace equals stored trace.
  • 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/unit/backends/test_replay_backend.py.

Dependencies

Blocked by: #48 (T-035a), #47 (T-018)

Blocks: no other task (leaf)

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/replay/backend.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-035c (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.2 · doc 10 §1

Requirements: FR-ORC-006 (traceability: doc 28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:simulatorSimulator backends (kinematic2d, Gazebo adapter)good first issueGood for newcomersmilestone:M2M2 — Scenario + kinematic2dpriority:P1Required for milestone exitsize:XS< 2 hourstaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions