feat(tui): consume odek turn_started frame for card reconciliation - #70
Merged
Conversation
odek now announces every turn with a dedicated turn_started frame (turn_id, initiated=system|operator) right after the session frame — per the TEMP_ODEK_TURN_STARTED_TASKS.md spec implemented upstream. bodek consumes it as the primary card-opening signal: system turns open the wake-marked card, foreign operator turns (prompted from another client on this session) open a plain remote card, replays and live-turn arrivals are idempotently suppressed. The stamped session frame and the lazy first-stream fallback stay as belt-and-suspenders — a turn must be missed by all three paths to drop from the transcript. turn_id on streamed frames (R3) decodes but does not yet drive UI state.
Contributor
Author
|
Closes #69 — implements the consumption side of the turn_started protocol (supersedes the lazy-open heuristic as primary signal; it remains as belt-and-suspenders fallback). |
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
Consumes odek's new
turn_startedwire frame — the implementation ofTEMP_ODEK_TURN_STARTED_TASKS.md(verified against the upstream code:frame lands after the session frame, every turn,
initiated∈{system, operator}, server-gated, plus R3
turn_idtagging onstreamed frames).
Behavior
initiated: system)turn_started→ stamped session frame → lazy fallback⬡ odek · waketurn_started→ lazy fallbackIdempotency (R2): guards (
cur() >= 0 \|\| busy) suppress replays andlive-turn arrivals. All three opening paths coexist — a turn must be
missed by all three to drop from the transcript.
R3
turn_idon streamed frames decodes intoclient.Event.TurnIDbutdoes not yet drive UI state (no mid-turn attribution UI exists).
Tests (RED-first)
5 TUI tests (system → wake card, operator → plain card, replay
idempotency, own-turn no-op, busy suppression) + 2 client decode tests.
RED before the Event fields/handler existed, GREEN after. Full race
suite 7/7; vet/fmt clean. AGENTS.md + README synced.