[AZ-961] accuracy_report: rename tlog_path -> ground_truth_path

ReportContext.tlog_path was widened in-place by AZ-959 to mean
"ground-truth source path" without renaming, leaving the rendered
report's "- Tlog: <csv_path>" line cosmetically wrong for CSV
runs. This rename + label fix completes the cleanup.

- helpers/accuracy_report.py: field rename + docstring update +
  rendered line now reads "- Ground truth: <path>" for both
  inputs.
- replay_api/app.py: kwarg updated, AZ-959 inline comment about
  the overload removed (field name now carries the intent).
- tests/unit/test_az699_report_writer.py: fixture updated, two
  new symmetric tests assert the canonical label for tlog AND
  csv inputs (AC-2).
- tests/e2e/replay/_e2e_orchestrator.py +
  test_derkachi_real_tlog.py: kwarg updated.

Tests: 62/62 green across test_az699_report_writer.py,
test_az700_render_map.py, test_az701_replay_api.py.

CSV-replay-input chain (AZ-959 + AZ-960 + AZ-961) is now coherent:
- API accepts (video, csv) with XOR validation
- /static/example-csv serves the AZ-896 reference doc
- Runner dispatches --imu vs --tlog argv
- Report renders with source-agnostic "Ground truth:" label
- Map renders from CSV truth via gps-denied-render-map dispatch

Bookkeeping: AZ-961 spec moved todo/ → done/, dep-table preamble
eighth bump documents the rename + summarises the cycle-4 CSV
chain, state.md records batch 7 complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-29 12:55:57 +03:00
parent 7f590582cc
commit a3dc8e2636
8 changed files with 41 additions and 13 deletions
@@ -1,52 +0,0 @@
# accuracy_report: rename ReportContext.tlog_path to ground_truth_path
**Task**: AZ-961_report_context_field_rename
**Name**: Rename `ReportContext.tlog_path``ground_truth_path` + update the rendered report label so CSV-path runs no longer say "Tlog: <csv_path>"
**Description**: AZ-959 widened the meaning of `ReportContext.tlog_path` to "ground-truth source path" without renaming the field, so the rendered report still emits `"- Tlog: <path>"` even for CSV-driven runs. This ticket completes the cleanup: rename the field, update the renderer's label, and migrate all call sites.
**Complexity**: 1 SP
**Dependencies**: AZ-699 (existing report renderer this renames a field on, done), AZ-959 (introduced the field-overload this ticket closes, done)
**Blocks**: (none — purely cosmetic)
**Component**: helpers/accuracy_report + replay_api/app (kwarg update)
**Tracker**: AZ-961 (https://denyspopov.atlassian.net/browse/AZ-961)
**Parent Epic**: (none — cycle-4 replay UX follow-up to AZ-959)
Jira AZ-961 is the authoritative spec; this file is the in-workspace mirror.
## Goal
Replace the overloaded `ReportContext.tlog_path` field name (which AZ-959 quietly widened) with `ground_truth_path`, and update the rendered Markdown line from `"- Tlog: <path>"` to `"- Ground truth: <path>"` so the report is honest about its data source regardless of input format.
## Scope
1. **`src/gps_denied_onboard/helpers/accuracy_report.py`**:
- Rename `ReportContext.tlog_path: Path``ReportContext.ground_truth_path: Path`.
- Update the docstring entry from "Real tlog the runner consumed" to "Ground-truth source the runner consumed (binary tlog or AZ-896 CSV)".
- Update the rendered line in `render_report` from `f"- Tlog: \`{context.tlog_path}\`"` to `f"- Ground truth: \`{context.ground_truth_path}\`"`.
2. **`src/gps_denied_onboard/replay_api/app.py`**:
- In `_maybe_render_report`, change `tlog_path=gt_source_path``ground_truth_path=gt_source_path`.
- Drop the AZ-959 inline comment that documented the overload; the new field name carries its own intent.
3. **All other `ReportContext(tlog_path=...)` call sites**:
- Grep for the kwarg + update. Typically `tests/unit/test_az699_report_writer.py` and any e2e orchestrator using the report assembler.
4. **`tests/unit/test_az699_report_writer.py`**:
- Update fixtures from `tlog_path=...``ground_truth_path=...`.
- Add one assertion that the rendered Markdown contains `"- Ground truth:"` and does NOT contain `"- Tlog:"` (label is now source-agnostic).
## Acceptance Criteria
- **AC-1**: `ReportContext` no longer has a `tlog_path` field; the only path field is `ground_truth_path: Path`.
- **AC-2**: Rendered report's input-source line reads `"- Ground truth: <path>"` for both tlog and CSV runs.
- **AC-3**: Existing AZ-699 unit tests pass against the renamed field with the new label.
- **AC-4**: AZ-959 integration test (`test_subprocess_runner_renders_report_for_csv_ground_truth`) still passes after the rename.
## Out of scope
- The `RenderInputs.truth_track` field in `cli/render_map.py` — that's a `list[(lat, lon)]` tuple, already source-agnostic.
- The deprecation surface in `replay_input/__init__.py` (`AutoSyncConfig`, etc.) — cycle-5+ removal under AZ-908.
## Notes
- Pure rename; no logic changes. Touches ~3 files.
- This ticket is sequenced AFTER AZ-960 because AZ-960's `_maybe_render_map` edits would re-conflict if AZ-961 lands first; it's cheaper to settle the map path then do the rename.