V2Event's Event impl now folds adjacent deltas of one part (session, message, ordinal) or one tool call, so a 10 ms batch of streamed deltas reaches the store as one edit.
Session.Message.Info has a Compaction member that is itself a union tagged by status, so the generator fell back to an untagged enum. serde then decoded an assistant message as the first member that fits (AgentSelected). Nested unions now join the outer tag when all their objects share one value.
A fake server serves a scenario's route table and logs requests. P-CLI runs the TS CLI from source and opencode-rs against it in isolated homes and compares exit code, stdout, stderr and requests. P-PTY runs both under a PTY through OpenTUI's embedded terminal and compares the OSC log and screen checkpoints.
G.10 added Diff::gutter and sizes unified diffs to their lines. diff::view
now gives every hunk PatchDiff's gutter (padding 1 + gutter_padding, digits
of the largest line number) and drops the automatic-basis workaround. The
first hunk matches TypeScript, so the V05a deviation goes.
markdown::view now takes conceal and streaming as TextPart passes them,
draws grid tables with one column of cell padding and Core's conceal-scope
border color, and applies a CodeBlockRenderers registry for the LaTeX and
Mermaid plugins. New P-COMP fixtures cover raw mode and a table; the rows
that still differ are colors from MarkdownColors (V03).
G.3 changed the Markdown widget to '-' bullets and unpadded code blocks, so
those rows match TypeScript now and the suite failed on the stale exemption.
The remaining rows differ only in color; the fence rows are H06 queries.
tool_inline_info ports toolInlineInfo over the generated SessionMessageAssistantTool, with the tool-display, todo, and toolPath helpers the TUI's tool views use. A P-ORACLE runs 60 parts built with the TUI's canonicalToolPart fixture through both; OPENCODE_TOOL_PARTS compares parts recorded from real sessions.
Records decoded into BTreeMap, which sorts keys. The TUI prints tool inputs in wire order (primitiveInputSummary, the fallback JSON title), so records are now IndexMap; serde_json already preserves order.
Port generateSyntax as code::syntax_theme, proven scope for scope against the TS function for four theme views. Add the transcript's Markdown, numbered code, and PatchDiff wrappers on the current opentui-rust widgets, compared cell by cell with Core renders of a small corpus. Rows where the widgets still differ (conceal and Markdown layout, highlight queries, the diff gutter) are exempted per deviation file, and the test fails once a row matches.
A Rust client is always another version than the service it finds, so
the warning went to stderr on every run. Per O-22 it now goes to the log
under --print-logs; --server keeps the TS warning on stderr.
Port ServerConnection.resolve, the /api/info probe and its decide()
classification, and the connect error texts. Discovery tries the
OPENCODE_CHANNEL registration, then service.json, then every other
service*.json newest first (O-21), so the client finds a channel
build's service without flags. A mismatched version warns and is
never replaced; standalone and ensure wait for F.9.
P-ORACLE: the harness runs 2,733 key sequences through the TypeScript Keymap.Provider for every default binding and an override corpus; the Rust test replays the same bytes through the input parser into TuiKeymap. The 16 cases that differ depend on the parser's legacy linefeed and keypad Enter reports (G.9).
Keybinds resolves the keybinds config as TuiKeybind.parse and TuiConfig.resolve do. TuiKeymap installs the Provider's addons on opentui::keymap and adds layers, the mode stack, dispatch input, the timed leader, and shortcut formatting.
The keymap layer on opentui::keymap: generated keybind names, config resolution, the Provider's addons, layers, modes, and the P-ORACLE against @opentui/keymap.
A Bun helper drives the TypeScript Flock, channel and registration functions, and ServiceConfig; the Rust interop test contends for one lock from both sides and compares the service config bytes and validation messages. An example prints the registration discovery resolves to.
Ports the XDG roots, channel naming, the Flock directory lock, the service registration file, and the service config file with its legacy migrations, so the Rust client shares these files with the TypeScript client.
Ports the V2 schema check, expansion, and resolver, both V1 migrations, the system theme, custom theme discovery, and the TUI theme state (mode, lock, palette, fallback). The state queues config writes, palette probes, and theme errors for its owner.
parity/oracle/U.1-themes.ts records the TypeScript tokens of every built-in theme in every mode and surface, the system theme over six palettes, and fifteen broken themes; tests/theme_oracle.rs matches all of them.
script/gen/themes.ts writes every built-in theme as the V2 document the TypeScript TUI resolves: V1 themes migrated by both migrations (current and new-designs), plus opencode and opencode2. The Rust resolver starts from the same documents.
An opt-in live test (OPENCODE_LIVE=1) reads through the generated client from
the service script/live.sh uses: info, sessions, messages, inbox, forms,
permissions, location collections, and the event stream. It skips
experimental.session.stats, which took the shared service down unbounded.
A P-ORACLE fixture records the requests the TypeScript Promise client builds;
the generated Rust client must build the same ones, and query::append must
match appendQuery. Unit tests cover tagged unions (known, rpc.*, unknown),
literal enums, double options, declared errors, binary bodies, auth, and
the event stream through F.3's SSE reader.
Every endpoint's location query decoded into its own struct; equal anonymous
objects and unions now share one, and the location query is LocationQueryInput.
script/gen/api.ts compiles ClientApi with the Promise client's options and emits
types and one method per endpoint (166) into crates/api/src/generated. The
request core, errors, query encoding, and the reqwest transport are written
by hand. Tagged unions decode through a generated Deserialize that keeps
unknown members and routes rpc.* events.
All 48 commands of the TypeScript CLI with clap derive, proven against the dumped Spec tree. A pre-pass and a post-parse check keep the Effect CLI behaviors scripts see: --no-<flag>, boolean literals, repeated flags, k=v values, -w without a following value, the scope of --standalone and --server, and root flags before a subcommand. Help, version, completions for six shells, exit code 1 on usage errors, and stdout that ignores EPIPE. Handlers are stubs that name their step; the root command reports that the TUI is not built yet.
script/gen/commands.ts writes the Spec tree of packages/cli/src/commands/commands.ts to crates/cli/tests/fixtures/commands.json: names, aliases, descriptions, arguments, and flags with types, bounds, and defaults. The Rust tree test compares against it.
opencode-parity loads P-COMP fixtures, compares a capture cell by cell, and reports each differing row with markers plus the fields of each differing cell. Tests cover byte-exact reformatting, an injected one-cell change, and an opentui-rust box matching the TypeScript render.
renderComponent renders a TUI component in createTestRenderer at a fixed size and theme, inside the TUI providers or bare, and writes its cells through the same native resolved-chars call opentui-rust's Capture uses. bun run fixtures now also runs parity/component scripts.
Build socket URLs as the PTY and client MCP clients do (path prefix and base query kept, URLSearchParams.set order, ws or wss), with an optional ticket parameter, and open them with handshake headers.
SharedEvents ports shared-events.ts: one upstream per subscriber set, a types filter, the latest server.connected for late subscribers, and a 4,096-event cap per subscriber. connect() ports createClientConnection: server.connected first, the 2 s connect and 45 s idle limits, resync, 1 s reconnect, and 10 ms batches with adjacent deltas merged on a bounded queue. Both are generic over an Event trait. An opt-in live test (OPENCODE_LIVE=1) reads the running service.
Port Identifier.create with session, message, and part prefixes. A P-ORACLE script records the time prefixes TypeScript mints for a call sequence, counter restarts and overflow included, and the Rust test replays it.
Port the generated TypeScript client's SSE reader: blank-line blocks, joined data lines, CRLF and CR normalization across chunks, streaming UTF-8 decoding, and the 16 MiB limit counted in UTF-16 units. Every chunk reports activity, keepalive comments included.
Add packages/cli-rs: a Cargo workspace with the 14 crates of the plan,
module stubs for api, local, service, store, and ui, and the expected
third-party crates in [workspace.dependencies]. opentui is a path
dependency on the local opentui-rust checkout, linked statically.
script/opentui-lib.sh copies native artifacts whose header matches the
bindings into ~/.cache/opencode-rs/opentui, where .cargo/config.toml
points OPENTUI_LIB_DIR. opencode-rs --version runs; script/live.sh
runs it against the elected background service.