# Replay: hard removal of deprecated auto-sync surface (AZ-895 follow-up)

**Task**: AZ-908_replay_auto_sync_hard_removal
**Name**: Cycle-5+ cleanup that physically removes the auto-sync surface AZ-895 deprecated
**Description**: Follow-up to AZ-895 (cycle 4). AZ-895 made the auto_sync surface a no-op and deprecated the CLI flags (`--time-offset-ms`, `--skip-auto-sync`, `--auto-trim`) with one-cycle warnings, but left the call sites, config fields, and interface DTOs intact for backward compat. AZ-908 completes the removal in cycle 5+ after a one-cycle deprecation window has passed.

**Complexity**: 3 SP
**Dependencies**: AZ-895 (hard — must ship first; AZ-908 removes what AZ-895 deprecated), AZ-842 (hard — replay protocol docs coordinate)
**Component**: replay_input (auto_sync.py + tlog_video_adapter.py + interface.py), cli/replay, runtime_root/_replay_branch + runtime_root/__init__, config/schema + config/loader + config/__init__, replay_api/app
**Tracker**: AZ-908 (https://denyspopov.atlassian.net/browse/AZ-908)
**Parent Epic**: (none — cycle-4 replay-input redesign follow-up)

## Why

Auto-sync surface is dead in production code: AZ-894 (cycle 4) made the CSV-driven path mandatory via required `--imu`, and AZ-895 (cycle 4) deprecated the surface. After one cycle's deprecation window the deprecation warnings should fire in real CI runs (if any operator scripts still pass the deprecated flags); that surface area can then be removed without breaking anyone.

## Touch list (production)

- DELETE `src/gps_denied_onboard/replay_input/auto_sync.py` (currently a no-op stub from AZ-895)
- DELETE `src/gps_denied_onboard/replay_input/tlog_video_adapter.py` (currently a deprecated coordinator from AZ-895)
- Drop `AutoSyncConfig`, `AutoSyncDecision`, `AlignedWindow` DTOs from `replay_input/interface.py`. Drop `auto_sync_result` + `aligned_window` fields from `ReplayInputBundle`.
- Drop `--time-offset-ms`, `--skip-auto-sync`, `--auto-trim` CLI flags from `cli/replay.py` entirely
- Drop `ReplayConfig.time_offset_ms`, `.skip_auto_sync_validation`, `.auto_trim`, `.auto_sync` from `config/schema.py`. Drop `ReplayAutoSyncConfig` class.
- Drop `REPLAY_TIME_OFFSET_MS` env var + `auto_sync` block handling from `config/loader.py`
- Update `runtime_root/_replay_branch.py` to drop any lingering imports / dead code
- Update `runtime_root/__init__.py` if it references removed symbols
- Update `replay_api/app.py` if it references removed symbols
- Update `e2e/fixtures/sitl_replay_builder/builder.py` if it references removed symbols

## Touch list (tests)

- Delete remaining auto-sync test residue (no-op stub tests from AZ-895)
- Update CLI tests to drop deprecated-flag assertions (the flags no longer exist)
- Confirm `test_az401_compose_root_replay.py` is clean

## Touch list (docs)

- Update `_docs/02_document/module-layout.md` replay_input file list — remove deleted entries
- Update `_docs/02_document/contracts/replay/replay_protocol.md` — remove auto-sync surface narrative (coordinate with AZ-842)
- Update `_docs/02_document/contracts/replay/csv_replay_format.md` cross-references

## Acceptance Criteria

- **AC-1**: All files listed under "DELETE" above are removed from the workspace
- **AC-2**: Unit tests pass with no auto-sync, AutoSyncConfig, AutoSyncDecision, or AlignedWindow symbols in `src/gps_denied_onboard/**`
- **AC-3**: CLI `--help` output does not mention `--time-offset-ms`, `--skip-auto-sync`, or `--auto-trim`
- **AC-4**: `_docs/02_document/module-layout.md` does not mention `auto_sync.py` or `tlog_video_adapter.py`
- **AC-5**: `tests/e2e/replay/test_derkachi_real_tlog.py` continues to `@xfail` with AZ-848-scoped reason

## Out of scope

- AZ-848 / AZ-883 structural fix (tlog clock bug) — unchanged from AZ-895
- Replacing the deprecated coordinator with something else — the CSV path is the replacement (see `_replay_branch._build_csv_bundle`)

## References

- Companion in cycle 4: AZ-894 (CSV adapter), AZ-895 (deprecation)
- Decision audit trail: this file + AZ-895 batch_03_cycle4_report.md
- User decision 2026-05-26 (cycle-4 /autodev batch 3): chose Option A (light deprecation now, file AZ-908 for hard removal in cycle 5+) over Option B (full removal in cycle 4).
