[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
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -8,7 +8,7 @@ status: in_progress
sub_step:
phase: 6
name: implement-tasks
detail: "batch 6 complete: AZ-960 gps-denied-render-map CSV-truth dispatch landed (44/44 tests green across render_map + replay_api; CSV-path replay jobs now ship with map_html_url populated). Next batch 7: AZ-961 ReportContext.tlog_path → ground_truth_path rename + label fix. OKVIS2 chain (AZ-943 + AZ-951 + AZ-952) sits in todo/ but is sequenced after the Derkachi e2e flight test passes per user 2026-05-29 directive."
detail: "batch 7 complete: AZ-961 ReportContext.tlog_path → ground_truth_path rename + label fix landed (62/62 tests green; rendered report now reads '- Ground truth: <path>' for both tlog and CSV runs). The CSV-replay-input chain (AZ-959 + AZ-960 + AZ-961) is now coherent and unblocks the relocated AZ-897 UI in ../ui. Cycle-4 todo/ remainder for next batches: AZ-842 (3, docs) + AZ-899 (1) + AZ-900 (1) + AZ-901 (1) = 6 SP product. OKVIS2 chain (AZ-943 + AZ-951 + AZ-952) sits in todo/ but is sequenced after the Derkachi e2e flight test passes per user 2026-05-29 directive."
retry_count: 0
cycle: 4
tracker: jira
@@ -49,7 +49,8 @@ class ReportContext:
Attributes:
run_date_utc: ISO-8601 date (YYYY-MM-DD) at which the run
executed drives the report filename.
tlog_path: Real tlog the runner consumed.
ground_truth_path: Ground-truth source the runner consumed
either a binary tlog (AZ-697) or an AZ-896 schema CSV.
video_path: Video clip the runner consumed.
calibration_acquisition_method: Provenance of the camera
calibration (e.g. ``"factory-sheet"`` for AZ-702 or
@@ -63,7 +64,7 @@ class ReportContext:
"""
run_date_utc: str
tlog_path: Path
ground_truth_path: Path
video_path: Path
calibration_acquisition_method: str
clip_duration_s: float
@@ -141,7 +142,7 @@ def render_report(
lines.append("")
lines.append("## Run context")
lines.append("")
lines.append(f"- Tlog: `{context.tlog_path}`")
lines.append(f"- Ground truth: `{context.ground_truth_path}`")
lines.append(f"- Video: `{context.video_path}`")
lines.append(
f"- Calibration acquisition method: {context.calibration_acquisition_method}"
+1 -5
View File
@@ -237,11 +237,7 @@ class SubprocessReplayRunner:
)
context = ReportContext(
run_date_utc=datetime.utcnow().date().isoformat(),
# tlog_path is widened to "ground-truth source" in cycle-4
# (tlog or csv depending on which input drove the run);
# ReportContext field rename deferred to AZ-699 follow-up
# to keep AZ-959 scope minimal.
tlog_path=gt_source_path,
ground_truth_path=gt_source_path,
video_path=inputs.video_path,
calibration_acquisition_method=calibration_method,
clip_duration_s=clip_duration_s,
+1 -1
View File
@@ -349,7 +349,7 @@ def run_e2e_orchestration(
context = ReportContext(
run_date_utc=effective_run_date,
tlog_path=tlog_path,
ground_truth_path=tlog_path,
video_path=video_path,
calibration_acquisition_method=read_calibration_acquisition_method(
calibration_path
+1 -1
View File
@@ -280,7 +280,7 @@ def test_az699_real_flight_validation_emits_verdict_and_report(
run_date_utc=datetime.datetime.now(datetime.timezone.utc)
.date()
.isoformat(),
tlog_path=tlog_path,
ground_truth_path=tlog_path,
video_path=video_path,
calibration_acquisition_method=_read_calibration_acquisition_method(
calibration_path
+32 -1
View File
@@ -209,7 +209,7 @@ def _failing_distribution() -> HorizontalErrorDistribution:
def _context(method: str = "factory-sheet") -> ReportContext:
return ReportContext(
run_date_utc="2026-05-20",
tlog_path=Path("/tmp/derkachi.tlog"),
ground_truth_path=Path("/tmp/derkachi.tlog"),
video_path=Path("/tmp/flight_derkachi.mp4"),
calibration_acquisition_method=method,
clip_duration_s=180.0,
@@ -340,3 +340,34 @@ def test_render_report_marks_vertical_skipped_when_no_samples() -> None:
# Assert
assert "_No emissions carried a comparable altitude" in text
def test_render_report_labels_ground_truth_source_agnostic_for_csv_path() -> None:
# Arrange — AZ-961 AC-2: rendered label is "Ground truth: …" for
# both tlog AND csv inputs, never "Tlog: …".
csv_context = ReportContext(
run_date_utc="2026-05-29",
ground_truth_path=Path("/tmp/data_imu.csv"),
video_path=Path("/tmp/nadir.mp4"),
calibration_acquisition_method="factory-sheet",
clip_duration_s=180.0,
emissions_count=200,
)
# Act
text = render_report(_passing_distribution(), csv_context, passed=True)
# Assert
assert "- Ground truth: `/tmp/data_imu.csv`" in text
assert "- Tlog:" not in text
def test_render_report_labels_ground_truth_source_agnostic_for_tlog_path() -> None:
# Arrange — AZ-961 AC-2: the same canonical label applies to tlog runs
# Act
text = render_report(_passing_distribution(), _context(), passed=True)
# Assert
assert "- Ground truth: `/tmp/derkachi.tlog`" in text
assert "- Tlog:" not in text