Repository navigation
Description
Task
T-018· Milestone M2 — Scenario + kinematic2d · Size S · Priority P0 · Epic #2Implements FR-RUN-004
Branch
feat/t-018-trace-parquet-serialisation-schema-v1— one task = one branch = one PR (doc 32 §6)
Summary
Implement backends/trace_io.py: write_trace(trace, path) / read_trace(path) -> Trace with the column schema of doc 11 §6.2 (trace_schema_version=1, zstd), plus validate_trace(trace, min_hz, max_gap_s).
Context / motivation
Traces are the single artefact oracles consume; replay, golden-trace tests, API trace endpoint and the Gazebo recorder all share this format.
Scope
In scope
- PyArrow schema with units in field metadata;
goal_x/goal_y/metastored as file-level metadata. validate_tracechecks columns, dtypes, monotonict, sample rate ≥ 10 Hz, gaps ≤ 0.2 s (FR-RUN-004 AC).
Implementation guidance
- Keep it dependency-light (pyarrow only) so the ROS
episode_recordercan vendor/reuse the schema definition. - 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
- Round-trip write→read yields an identical
Trace(array equality, metadata). - Validation catches gaps and missing columns.
- 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_trace_io.py.
Dependencies
Blocked by: #15 (T-002a)
Blocks: #54 (T-033d), #56 (T-035c), #57 (T-035d), #69 (T-019), #150 (T-081e), #197 (T-094b)
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/trace_io.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-018 (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 11 §6.2 · doc 05 §1 · doc 02 §3.3
Requirements: FR-RUN-004 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsReady
Activity
episode_recorder: 20 Hz Trace v1 Parquet writer + optional rosbag2 MCAP #197