Skip to content

[T-018] Trace Parquet serialisation (schema v1, zstd) and validation #47

Closed

Description

@CodewithJha

Task T-018 · Milestone M2 — Scenario + kinematic2d · Size S · Priority P0 · Epic #2

Implements 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/meta stored as file-level metadata.
  • validate_trace checks columns, dtypes, monotonic t, sample rate ≥ 10 Hz, gaps ≤ 0.2 s (FR-RUN-004 AC).

Implementation guidance

  • Keep it dependency-light (pyarrow only) so the ROS episode_recorder can 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 Unreleased updated 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:

Activity

  1. added
    area:simulatorSimulator backends (kinematic2d, Gazebo adapter)
    area:storagePostgres schema, repositories, artifacts
    priority:P0Critical path / blocks others
    milestone:M2M2 — Scenario + kinematic2d
    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:simulatorSimulator backends (kinematic2d, Gazebo adapter)area:storagePostgres schema, repositories, artifactsmilestone:M2M2 — Scenario + kinematic2dpriority:P0Critical path / blocks otherssize:S<= 1 daytaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions