Skip to content

feat(id): F13.4 tier presenters for SSH and iroh TTY (#10888) - #11189

Merged
dezren39 merged 1 commit into
mainfrom
queue/19423-10888-f13-4-presenters
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/19423-10888-f13-4-presenters

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Closes the implementation remainder of #10888 (parent #786 stays open until its full F13.4 acceptance is met). Design: doc/2026-11-01_design_id786.md phases 3-5.

What was already landed (verified on current main)

This PR — the presenters themselves

  • world_terminal: new shared TierPresenter built from a probe outcome.
    • Tier 2: cell-grid rendering — full render first, row diffs after; full repaint on resize/attach/invalidation; incremental state committed only after a render is produced.
    • Tier 3: line mode via TextDelta — no full-screen escapes; after the first view only changed lines are emitted; TextDelta::apply is the parity oracle.
    • Tier 1: Tier 2 rendering bracketed in synchronized output (DEC 2026), plus presenter-owned image encoding — chunked Kitty graphics (id 31, f=24) preferred, Sixel fallback — emitted only behind the positive feature evidence that selected Tier 1. No guest image payload, no capability frame, no Kitty keyboard parsing.
    • finish() returns the mode-restore bytes adapters must write on every exit path; PresenterCounters now records real frames/bytes/full-renders for baseline comparison.
    • TerminalProfile, PresentationTier, and ProbeOutcome::tier/profile are public so the iroh adapter (id-cli) can consume them.
  • world_ssh: the probe outcome selects the session's presenter (previously the tier was logged only and Tier 3 stayed active); raw screen views render through it; the leave path restores presenter modes before leaving the alternate screen. Sessions that never probed (no PTY, command mode) keep the previous rendering path exactly.
  • id-cli world join: the TTY probe returns its presenter; the pump renders view frames carrying screen/text surfaces through it and restores modes on exit. Non-TTY and --json keep the JSON-lines behavior exactly; form views keep JSON-lines (the pump has no form collector).

Tests (oracle: full render / full text)

  • New: cross-transport harness — the same transcript through parse_transcript (iroh seam) and ProbeDemux (SSH seam) selects the same tier and the presenters emit byte-identical frames and counters across Tier 1 / Tier 2 / no-reply / malformed / conflicting / interleaved cases.
  • Tier 2 second frame equals render_ansi_diff and is smaller than the full render; ScreenPatch::diff().apply() reproduces the next frame exactly.
  • Tier 3 delta apply-parity for change + shrink; unchanged views emit nothing.
  • Graphics: exact 1x1 Kitty frame and exact 2x6 Sixel encoding; Kitty chunking round-trips a 64x64 image byte-for-byte; graphics refused without full Tier 1 evidence and for mis-sized/oversized input.

Local results (laptop, fleet-build-lock): cargo test -p id-worlds -p id-cli — id-cli lib 686 passed, aliases 7 passed, id-cli doc-tests 7 passed, id-worlds lib 888 passed / 0 failed / 3 ignored, id-worlds doc 0. One earlier full-run failure (world_net records-client TLS handshake, UnknownIssuer) passes alone on both clean main and this branch — a load flake in that harness, unrelated to this diff. Local clippy could not run to completion: the pooled target cache was built with rustc 1.99.0 and the local clippy is 1.99.1 (E0514 rmeta mismatch in id-core, untouched by this PR); CI's nix-sandbox clippy is the authority.

Task 19423, lane any-l.

Implements design phases 3-5 of doc/2026-11-01_design_id786.md on top of the merged detector (PR #5023) and the landed batching/diff prerequisites:

- world_terminal: shared TierPresenter (Tier 2 cell-grid full/diff ANSI, Tier 3 TextDelta line mode with apply-parity, Tier 1 synchronized-output bracketing), gated Kitty (chunked, round-trip tested) and Sixel graphics encoders behind positive Tier 1 evidence only, PresenterCounters wiring, finish() mode restore. TerminalProfile/PresentationTier/ProbeOutcome tier made public for adapters.

- world_ssh: the probe outcome now selects the session presenter (was: tier logged only, Tier 3 fallback always); raw screen views render through it; leave path restores presenter modes before leaving the alternate screen. Sessions that never probed keep the previous rendering path exactly.

- id-cli world join: the TTY probe returns its TierPresenter; the pump renders view frames (screen/text surfaces) through it and restores modes on exit. Non-TTY and --json keep the JSON-lines behavior exactly; form views keep JSON-lines (the pump has no form collector).

- Tests: cross-transport harness (same transcript via parse_transcript and ProbeDemux selects the same tier and produces byte-identical presenter frames), Tier 2 diff vs full-render oracle + ScreenPatch apply parity, Tier 3 delta apply parity, graphics gating + exact Kitty/Sixel encodings + Kitty chunk round-trip.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 09:56
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T09:56:38.695903Z
We couldn’t complete this review. Comment @codex review to try again.
de044eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc0887a3-6046-4409-a3da-7fe07cbd9dbe
Commits

Reviewing files that changed from the base of the PR and between 57ad2db and de044eb.

Files selected for processing: 3

  • pkgs/id/crates/id-cli/src/commands/world.rs
  • pkgs/id/crates/id-worlds/src/world_ssh.rs
  • pkgs/id/crates/id-worlds/src/world_terminal.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 3b20b9d into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/19423-10888-f13-4-presenters branch November 17, 2026 09:58
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