Repository navigation
fix: host-authored session state for every client - #608
Merged
Merged
Conversation
…st-authored-session-state
…st-authored-session-state
…sion-state # Conflicts: # crates/protocol/src/lib.rs # crates/runtime/src/app/tests.rs
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
Every fact a client shows about a thread is now computed once on the host and read by every client, so the desktop, a phone and the browser agree with each other and with what the host will accept.
Each predicate has one owner on the host and is shared between command validation and the status projection:
session_activity,session_fork_availability,native_rewind_blocked,checkout_blocked,queued_message_editable,terminal_*,session_approval_policy,WorktreeSharing. CheckoutBranch now gates onturn_in_flight(a provider that dies without closing its timeline turn no longer blocks checkout forever).UI changes that fall out of this: the phone thread row shows Background (muted) distinct from Working; queue rows in delivery have their edit/drop/steer actions disabled; rewind conversation modes use the absolute turn index; the plan panel and Implement/Refine read the plan replica so a phone with a partial history window sees the same plan as the desktop; the archived page's permanent delete uses the host's worktree-sharing fact and the list reloads on
archived_revision.PROTOCOL_VERSIONstays at 9 with an Unreleased note (Principle 9). Wire changes:SessionStatus.working/turn_runningmove intoactivity;archived_worktree_branchesremoved;ArchivedSessionsresponse carriesworktree_sharedandrevision.Evidence
fork_thread, rewind enabled while the host rejected (background tasks), queue edit enabled on the in-flight delivery, orphan-worktree prompt wrong for archived cwd-only forks, phone row showing "Working" for background-only threads, and an acknowledged send retired by an unrelated same-text record.After: each has a host owner; negative controls (old checkout predicate, background_only without the delivery guard, text-equality adoption, pre-Ack adoption ignored, old scheduled send-now guard) made the new contract tests fail for the intended reason before the fix was restored.
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,RUSTFLAGS=-D warnings cargo check -p tcode-web --target wasm32-unknown-unknown, iOS sim check,cargo machete;cargo nextest run --workspace --locked: 937 passed, 11 skipped. Android NDK not available locally.Merge Danger
Door: two-way
Revert is a clean
git revertof the merge; no data migration. Between releases the wire may change freely (Principle 9), so mixed-commit host/client pairs are not a supported state.Blast Radius: protocol-wide
Every client surface that shows thread state (sidebar, composer, chat, plan panel, terminal drawer, archived page) now reads different fields.
IndexSummarynow carries an entry per unarchived thread and is re-sent whenever any of them changes; snapshot construction is one pass but larger indexes send more bytes per summary replacement.