feat(engine): replay engine core#50
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.zig—ReplayEnginemirroring the toolkit'sreplay/engine.ts:init(events, failures, { speed, start_index });step/stepBack(rewind-two-step-one) /
jumpTo/getState/reset;current(null whenempty — the toolkit's
-1);totalEvents.ReplayEventcarries the failures whoseevent_idsinclude that event.ocpp.zig; CURRENT_STATE updated.Scope (per the spike + your call)
runner exposes no timer/tick effect (its
Commandtype is menu/shortcutcommands, not a TEA effect scheduler).
speedis stored for that futureconsumer; the pure engine stays timer-free and consumer-driven, like the toolkit.
remaining part of feat(engine): replay engine + wall-clock playback #44 and lands next.
Tests
115/115 headless tests pass (
native test -Dplatform=null);native check --strictclean;zig fmtclean. New coverage: forward stepping withfailures-at-position,
stepBacksemantics + start boundary,jumpTorangechecks,
getStateplayed/remaining/complete,reset+start_index/speedseeding, and the empty-trace case.