Skip to content

feat(engine): replay engine core#50

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/replay-engine
Jul 11, 2026
Merged

feat(engine): replay engine core#50
sepehr-safari merged 1 commit into
mainfrom
feat/replay-engine

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

What

feat(engine): the pure ReplayEngine core (S4 #44) — deterministic,
timer-free replay of a trace's events.

Part of #44. (The manual-scrub UI transport is the remaining piece; this PR is the
parity core it builds on.)

Changes

  • src/ocpp/replay.zigReplayEngine mirroring the toolkit's
    replay/engine.ts:
    • init(events, failures, { speed, start_index }); step / stepBack
      (rewind-two-step-one) / jumpTo / getState / reset; current (null when
      empty — the toolkit's -1); totalEvents.
    • Each ReplayEvent carries the failures whose event_ids include that event.
  • Wired into ocpp.zig; CURRENT_STATE updated.

Scope (per the spike + your call)

Tests

115/115 headless tests pass (native test -Dplatform=null); native check --strict clean; zig fmt clean. New coverage: forward stepping with
failures-at-position, stepBack semantics + start boundary, jumpTo range
checks, getState played/remaining/complete, reset + start_index / speed
seeding, and the empty-trace case.

Add src/ocpp/replay.zig: a deterministic, timer-free ReplayEngine mirroring the
toolkit's replay/engine.ts — step / stepBack / jumpTo / getState / reset over a
trace's events, exposing the failures detected at each position, plus current /
totalEvents. Pure and headless.

Real wall-clock auto-playback needs a timer source the zero-config runner does
not expose (spiked), so it is deferred to the runner-eject bucket (#33); speed is
carried for that future consumer but the pure engine never acts on it.

Part of #44 (the manual-scrub UI transport is the remaining piece).
@sepehr-safari sepehr-safari merged commit 9281c90 into main Jul 11, 2026
3 checks passed
@sepehr-safari sepehr-safari deleted the feat/replay-engine branch July 11, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant