Repository navigation
Conversation
…erer Add claurst_tui::application, the seam between the interactive loop and the renderers: - SessionScope/SessionGeneration: each query worker tags its events with the generation it was spawned under; clear, rewind (command and in-App) and resume advance the generation, so late events from a replaced conversation no longer mutate the new one. Bridge and relay consumers still receive every event. - App::apply_query_event is the reducer step; the completion bell is returned as a PresentationEffect and performed by the loop. - A bounded delivery queue (1024) between per-turn forwarders and the loop; forwarders wait for space and never drop events. The query loop's own per-turn buffer remains unbounded (query-crate API). - COVEN_CODE_UI=classic|next, read only on the interactive route. Unset or empty selects Classic; unsupported values warn on stderr and in the TUI and start Classic. - An opt-in Next renderer over the TranscriptView projection. Any frame where a surface owns input (permission, overlays, pickers, familiar switcher, slash suggestions) or an error modal shows is drawn by Classic. Next clears Classic mouse hit-test geometry. Classic remains the default and its rendering is unchanged. Headless, stream-json and ACP never read the selector. Refs #408
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9 of 10 tasks
This branch was successfully deployed
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.
Summary
Extract the typed presentation seam for TUI v2 (#408): runtime events scoped to session generations, a reducer step that returns its external effects, an interactive-only renderer selector and an opt-in Next renderer over a shared projection. Classic stays the default and renders unchanged.
Context
4bbef53(main).tui/src/application/,tui/src/next/, theAppquery-event reducer, and the interactive loop incli/src/main.rs.Changes
SessionGenerationit was spawned under. Clear, rewind (command and in-App) and resume advance the generation. Presentation discards stale events, so late output from a replaced conversation no longer mutates the new one. Bridge and relay consumers still see every event./clearor/resume.App::apply_query_eventis the reducer step. The completion bell is returned asPresentationEffect::RingBell, and the loop performs it in the same drain step.handle_query_eventkeeps its existing behavior for other callers.run_query_looptakes anUnboundedSender. Bounding the producer needs a query-crate change and is documented as such.COVEN_CODE_UI=classic|nextis read only on the interactive route. Unset or empty selects Classic.TranscriptView.any_modal_open, the familiar switcher, the effort picker and slash suggestions. An error modal is handled the same way.Validation
Failing-first runs:
next_hands_every_input_owning_surface_to_classicfail on the familiar switcher andnext_draws_permission_requests_through_classicfail. Both pass with the fix.Commands, run from
src-rust/on the final tree:git diff --checkcargo fmt --all -- --checkcargo check --workspace --lockedcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked: 2789 passed, 0 failed, 52 ignored (--no-fail-fast)cargo test -p claurst-tui --test presentation_parity: 7 passed. Covers deterministic replay, identical outgoing operations (submitted input, permission decision, draft) for both renderers under the same keys, delegation of every input-owning surface, permission through Classic, cleared mouse geometry, and newest-output visibility at 40x12, 80x24 and 1x4.cargo test -p claurst-tui --lib -- application:: turn_completion_bell: 6 passed.cargo test -p claurst --bin coven-code -- scoped_forwarder goal_dispatch: 14 passed. Covers ordered delivery of 200 events through a capacity-1 queue with a slow consumer, the forwarder stopping when the loop is gone, and, in every goal-dispatch test, the queue closing within 1 s of the turn finishing.cargo test -p claurst --test engine_contract: 18 passed. New:--version,--printand stream-json produce identical stdout and exit codes, and no selector warning, withCOVEN_CODE_UIset tonext,classicor an unsupported value.cargo test -p claurst --test acp_smoke: 6 passed, with an unsupportedCOVEN_CODE_UIset for every ACP run.scripts/tui-tests/run.shwithREQUIRE_TMUX=1and a disposableHOME, Classic default, 120x40: 48 passed, 0 failed, 0 skipped.python3 -m unittest discover -s scripts/tui-tests -p 'test_*.py': OK.COVEN_CODE_UI=next, 100x24:COVEN_CODE_UI=fancyshows the warning notification and starts Classic.goal_dispatch_payload_decision_injection_and_spawn_fenceshit its fixture's 45 s timeout. In isolation it passes in 24.2 s on this branch versus 31.8 s on the base commit, so it is a pre-existing load-sensitive limit, not a regression.large_response_stream_does_not_block_child_exit);acp_smokethen passed 5/5 in isolation and in the final full run.PR Readiness
Refs #408