25043 Commits

  • test(cli-rs): remove repeated descriptions from TUI fixtures
    Remove setup narration and labels already given by fixture names and
    assertions. Keep the scheduling, teardown and platform constraints
    that explain why the remaining fixtures run the way they do. No test
    body, input or recorded result changes.
  • docs(cli-rs): point comments at the docs that replace the notes
    Module docs and script headers cited the step notes by ID, such as
    docs/F.9.md and docs/H.2.md. Those files are gone. A comment whose note
    has a successor names it (docs/architecture.md, docs/testing.md,
    docs/plugins.md, docs/plugin-abi.md), and the others drop the reference.
    The step, row and decision IDs on those lines go with it.
  • docs(cli-rs): replace the build-plan notes with reference docs
    packages/cli-rs/docs held one note for each build-plan step (C.0.md,
    P.4.md, T.1.md, ...). Each was written before or during its step, so it
    says what the step would build, cites decision and row IDs, and lists
    the proof the step owed. A reader who uses, builds or extends the client
    needs what the system is now.
    
    The docs are now five, with plain names:
    
    - architecture.md: the crates, the command line, how the client reaches
      the server, client-local files, the store, the UI kit, and the TUI.
    - plugins.md: the guide. Its "why" is design rationale, and it gains how
      plugins are found, approved, reloaded and fail.
    - plugin-abi.md: the contract's reference, from the content of P.1.md
      and P.4.md, in sections a reader can find.
    - testing.md: the suites, how to run them, and how to write a scenario.
    - windows.md: the manual checklist for a Windows build.
    
    The plugin SDK's README states compatibility as a rule: which binaries
    load, the optional features, and source compatibility within 2.x. Its
    release history is gone.
    
    The step notes are kept outside the repository, with the plan.
  • test(cli-rs): stop the plugin monitor in rows that count views
    Preview 44312154568's Windows runner viewed the input panel eight
    times as it opened, where the row expects one. The eight views were
    alike: the same mount and the same input (width 60, focused).
    
    A built-in's slow state flipping tells every plugin, which draws every
    claim again, and the monitor judged slowness on the real clock. These
    rows count views or compare frames, and a slow runner could flip a
    built-in mid-row, as it put a "Plugin is slow" toast over a frame in
    plugin_limits. A stepped or alternating monitor clock did not make the
    extra views on Linux, though, so this is not confirmed as their cause.
    
    support::mount_still mounts with the monitor's clock stopped, and the
    rows of plugin_input, plugin_behave, plugin_builtins and plugin_surface
    use it. The panel row now checks what it guards: its first view sees
    the panel focused and wide, and every view since the open is of that
    one mount with that input. A failure prints what the panel heard.
  • fix(cli-rs): reserve no row for a slot claim before its first tree
    A TypeScript plugin's slot claim showed a one-row placeholder until the JS host sent its first tree. A claim that draws nothing, such as the anomaly.internal plugin's app claims that only add key bindings, so lifted the session column a row per claim for a few frames as the plugin loaded, then dropped it back. TS draws a slot's claim in the frame that mounts it, so a slot mount whose key has shown nothing now reserves nothing; transcript parts keep their one row.
    
    A hidden root also reports no rows as the height its key had, so a remount does not reserve the rows of the placeholder it replaced.
  • test(cli-rs): push background wakes once the run says it waits
    The C.10 background scenarios pushed the wake events 300 ms after the
    session wait answered. In that window the client lists messages and
    jobs before it prints its wait notice. Under load the TS side ran past
    the window once (lane run suites-20261118-140807), printed the woken
    reply before background_wait, and background-subagent failed on the
    order of the two lines.
    
    P-CLI cases can now set late, which pushes events to the fake server's
    event stream once the client's stdout or stderr shows a given string.
    The three background scenarios use it on the wait notice, so the wake
    comes after the notice on both sides.
  • test(cli-rs): drop redundant expected-result test prologues
    The test names describe the behavior and their assertions specify the
    outcome. Remove the preceding narration of the same assertions and
    issue history. Keep the fixture setup notes, timing rationale and
    failure diagnostics. No test or executable statement changes.
  • test(cli-rs): gate the dialog surface Luau rows on cfg(luau)
    win-x64-link compiles Luau out on x86_64 Windows MSVC behind cfg(luau),
    but plugin_surface's dialog rows still gated their Luau carrier on
    the luau feature, so the Windows x64 check could not find
    opencode_plugin::luau. They now use cfg(luau), as the other Luau rows
    do.
  • test(cli-rs): freeze the plugin monitor while limit rows compare frames
    The plugin limit rows compare a frame with its twin, drawn moments
    apart, while the plugin monitor timed the built-ins on the real clock.
    On preview 44303912167's Windows runner the debug build of
    opencode.prompt.footer averaged 1.1 ms a frame between the two draws,
    so a "Plugin is slow" toast covered the twin and the row failed,
    though the limits behaved alike on both.
    
    The module's harnesses now give the monitor a clock that does not
    move, as the carrier and diffs rows do; the two rows that measure host
    time put the real clock back. A monitor clock stepped 2 ms a read
    reproduces the failure on Linux.
  • test(cli-rs): wait on the JS host's state without moving the test clock
    The plugin_compat and plugin_mail rows kept flaking under load. Most of
    them came from one assumption: the harness's waits for the JS host
    (settle's wait for its pong, the loader's walk, a plugin going active,
    and every row's wait) advanced the test app's clock by 1 ms on each
    poll. So the clock ran at wall-clock speed while the JS host answered,
    and a deadline of the host's raced the machine's load. Under load the
    key hold's 50 ms ran out before the answer came, and the held key went
    on: `^^a`, or a palette the listener had taken.
    
    Pipe::until is now the one wait on the JS host's or the loader's
    state: it turns the UI thread without moving its clock. settle, walked
    and active use it, and so does every plugin_compat wait that used to
    advance as it polled. A row that wants a deadline to pass still
    advances the clock itself.
    
    What the rows waited out with a sleep is now observed. A ping's pong
    says whether a command a component dropped still lingers on the JS
    host (`retiring`, the 250 ms of UNCOMMAND), and Pipe::retired waits
    until none does. A mailbox's stats say whether a thread's panic report
    waits (`reported`), so the refill row counts from the report rather
    than from when the thread began to panic. The store row's plugin
    renames its marker into place, so it never shows empty.
  • test(cli-rs): run the raw-pipe dialog row only with the JS host
    The ds-5 row drives a plugin over the raw pipe through plugin_pipe,
    which builds only with the ts feature, so the no-ts test build did not
    compile. The row now builds only with ts.
  • fix(cli-rs): build the dialog key wait only with the JS host
    The wait for a just-opened JS dialog is used only by the pipe's key
    hold. A build without the ts feature has no pipe, so OPENING,
    Owner::when_focused and Router::opening were dead code there and
    failed the no-ts gate. They now build only with ts.
  • fix(cli-rs): stop holding keys once a JS dialog's first tree shows
    The ds-3 wait held typed keys until a node of a just-opened dialog took
    the focus, or for 500 ms. A dialog with no field, or one that focuses
    nothing, so held Enter and every other key for the full 500 ms, which
    is visible lag.
    
    The wait now ends as soon as the dialog shows its first tree from the
    plugin, once the focus that tree asked for has applied. It still ends
    when the mount ends or after 500 ms. The pipe's placeholder, which
    stands in before the JS host sends a tree, is marked `stand_in` on the
    view so it does not count as that first tree.
  • fix(cli-rs): give keys typed as a JS dialog opens to its field
    A JS plugin's ui.dialog.show runs in a call the host holds input for,
    but the call's answer only opens the dialog. Its tree and the focus of
    its field come with the JS host's next revisions. Input typed between
    the answer and that focus reached no field, so the first key was lost
    or went to the Home composer (big-boi ds-3).
    
    Input now also waits while a plugin's dialog surface that opened less
    than 500 ms ago is on top and none of its nodes took the focus. It goes
    on in order once a node of that dialog takes the focus, the dialog's
    mount ends, or the 500 ms pass. Escape never waits, so it still closes
    the dialog at once.
  • fix(cli-rs): number a dialog field's ctrl+c clear as an edit
    fields-fix numbers each change of a field, and a view's echo names the
    number it saw. The ctrl+c clear of a dialog surface's field reported
    its change without one, so it no longer built. It now takes the next
    number and records it with the field's other edits.
  • fix(cli-rs): settle big-boi's dialog-surface findings
    Big-boi's hunt of the dialog surface found ten bugs that can be fixed
    before the pipe's key hold is rewritten; each now has a row that failed
    before.
    
    - ds-1: a close cleared the recorded owner only for the activation that
      showed the dialog, so after a JS reload changed it in place the owner
      stayed and the plugin's close of whatever it shows closed a later host
      dialog. A close now clears the owner of its own showing.
    - ds-10: a waiting request that changed a dialog surface in place lost
      its callback; it now runs as the dialog closes.
    - ds-2: a JS registration reload remounted the dialog's body without
      what the user typed. The draft and caret now pass to the new mount,
      also from a tree the ended activation's last view wiped.
    - ds-4, ds-5: a command's focus of a node no mount holds yet resolves
      when its effect applies, against the newest mount no other host
      dialog covers, else the newest one whose tree names no node yet (the
      JS host's first revision), whose next view settles it. A route's field
      of the same id under the dialog no longer takes it, and over the pipe
      the field takes the focus once its first revision comes.
    - ds-6: a theme rebuild of the dialog keeps the focus of its body.
    - ds-7: a dialog surface's bind of escape is left out, and its listener
      hears escape without taking it: escape closes the dialog as the
      host's own.
    - ds-8: a focused node in a scroll with an id is brought into view once
      the solve laid it out, as the scroll's To verb does.
    - ds-9: a body taller than the room the screen leaves moves into a
      bounded scroll that reveals its focused node; a body that fits stays
      in the frame, laid out as before.
    - ds-11: ui.dialog.show's surface waits for its close, so one the host
      does not open retires the showing and a later dialog.set does not
      open it.
  • test(cli-rs): keep the reconcile model's scrolls without a scrollbar
    A scroll's scrollbar shows only while its content overflows, and its
    column narrows the content, so a tree reached by updates and a fresh
    mount can each settle with or without the bar. The model compares the
    two, so its scrolls ask for none.
  • refactor(cli-rs): name the type of a dialog surface's close
    Clippy refused the boxed closure PanelMount::close returned as too complex; Closing names it.
  • fix(cli-rs): keep a JS plugin's dialog mounted across a reload
    sensitive-encrypt's panel registers a keymap layer as it mounts, which
    reloads the plugin's registrations on the JS host. The reload ended the
    dialog surface's mount and nothing mounted it again, so the dialog
    showed an empty body. The dialog now stays and mounts again from the
    new registration under the same key, as a docked panel does (CT-29),
    and the JS host adopts what it rendered.
    
    ui.dialog.show also sends its dialog at once again: a plugin that shows
    it after an await runs in no call, and a dialog.set right after resends
    it under the same key, which the host changes in place.
    
    P.8/sensitive-encrypt records CT-37 end to end: the field of the
    plugin's own dialog takes the focus and the user's typing, equal to TS
    in text. The colors of the plugin's uncolored text and fields, and the
    RPC's location query, differ as F16-v2-compat-layer records.
  • fix(cli-rs): keep a dialog surface's blur in its dialog
    A blur in a dialog surface's mount gave the focus to the composer under
    the dialog, where the user's typing went behind it. It now goes to the
    dialog's body. plugin_ownership gains the place as a dimension: every
    row runs for a route and for a dialog's body, which opens and closes
    where the route is navigated to and away from, on every carrier;
    plugin_surface checks the blur.
  • test(cli-rs): compare the board's dialog surface on every carrier
    The board example gains a dialog surface with a field its command focuses, a long scroll its key focuses, and a toast on close; plugin_carriers compares its frames, toasts and status linked, through the C ABI shims and as the built library.
  • feat(cli-rs): draw ui.dialog.show and the prompt ports as dialog surfaces
    The JS compat layer registers one dialog surface per plugin, and each ui.dialog.show mounts it under its own key: the JSX renders with the full tree, so a <scrollbox> scrolls and an <input> takes the focus (CT-37). A scroll with an id may take the host focus, as a field does, and scrolls on the arrows; a <scrollbox> asks for the scrollbar OpenTUI draws while its content overflows, in Core's colors. sidebar-prompt's native and Luau ports move to a dialog surface too, and P.8/sidebar-prompt now scrolls a long prompt, equal to TS in every checkpoint.
  • feat(cli-rs): show a plugin's dialog surface as the dialog's body
    A fifth place, Place::Dialog, and Dialog::Surface: each showing mounts the plugin's surface in the host's dialog frame, with its scrolls and fields. While that dialog is on top the mount's nodes may take the focus, its layers of no mode hold in the dialogs' mode, and ctrl+c empties its focused field before it closes the dialog. The mount ends as the dialog closes, and its handler hears Closed as the plugin's call. A command that shows the dialog may focus a field in it in the same call (CT-37).
  • test(cli-rs): check the claim oracle on a real streamed part
    each_revision_of_a_claimed_part_equals_a_fresh_mount checks the actual
    screen and rejects a wrong expected stream on the same fixture. It no
    longer needs the_oracles_can_fail to run a second TUI or a special
    plugin build mode that removes a row. a_fault_in_a_claim_falls_back_for_what_it_claims_alone
    still injects real faults and compares their isolation on both carriers.
    
    Inline the one-caller carrier callbacks into the tests that run them.
    Both carriers still execute each assertion.
  • test(cli-rs): collect scroll regression traces in one table
    Use one runner for the fixed board traces, retaining whether a trace
    applies to a scroll, a virtual list, or both. The two tall-card Nearest
    cases from nearest_keeps_a_card_that_covers_the_view_and_aligns_a_tall_one_by_its_end
    are now explicit rows of the_deep_runs_rows_hold. Keep every command in
    each trace, including resize-and-step batches that differ from a resize
    followed by a step.
  • test(cli-rs): share the canvas shape corpus generator
    Use the same shape operations for the opaque reference grid and the
    painter comparison. Keep the two palettes, ranges and random draw
    order. Resolve each reference pixel in paint order; nested clips can
    then exclude a point without a second clipped drawing implementation.
    
    Keep both independent pixel checks and all seeds: the opaque comparison
    still uses no OpenTUI drawing code. No test is removed.
  • refactor(cli-rs): share OAuth status and copy handling
    The upsell and integration dialogs receive the same API status. Decode
    pending, complete, failure and expiry in one place; each caller still
    owns its timer, cancellation guard and post-connect action. Use the same
    device code or fallback URL for copy, leaving the error wording local.
  • test(cli-rs): share the pipe carrier comparison harness
    Run the two distinct twin scripts through one mount, checkpoint and
    comparison path. Keep the absolute checks for actual mutations, mount
    notices and failure reports; compare checkpoint count and names too.
    
    a_bad_effect_or_view_fails_its_plugin_alone keeps the invalid effect,
    invalid view and exiting view as three independent fixture runs.
    the_tui_ending_leaves_nothing_its_plugins_started checks the host PID
    as well as both child PIDs; the old host-only check used /proc and its
    gone() could not fail on another platform.
  • chore(cli-rs): move the ten plugin ports out to the plugins repository
    The Rust and Luau ports of ten published TS plugins (command-hotkeys,
    context-grid, force-input, goal-plugin, queue-manager, session-manager,
    session-usage, sidebar-prompt, sidebar-tokens, subagents-sidebar) now live
    in their own repository, each building on opencode-plugin-abi by git.
    
    ports_trio.rs and the P-APP port swap go with them. ports.rs becomes
    plugin_published.rs: its rows that ran a port run the published package
    on the JS host instead, or go when another row covers the package. The
    P.8 scenarios still run every original against TS recordings.
  • fix(cli-rs): stop session mentions slicing inside a multibyte character
    mentions() checked for an optional @session: prefix by slicing nine bytes
    before each ses_ ID. Without a prefix that offset can land inside a CJK
    character or an emoji, so rendering a message such as 现abcd文ses_… panicked.
    Strip the prefix as a suffix of the text before the ID instead. Matching is
    unchanged and agrees with the TS regex, which treats any non-ASCII neighbour
    as a boundary; new rows pin that, plus a seeded no-panic walk.
  • test(cli-rs): wait for each P-PTY Escape and exit before the next key
    A step that only settled could not tell a slow program from one that was done. On a loaded box that let two kinds of key go out too early. A second Ctrl+C reached a TUI that was already exiting, as a SIGINT once the terminal was restored (P.0b/title-off-exit exited 130). A lone ESC the program had not yet timed out joined the next key as Alt+key. The harness can now wait until a string is gone (until.gone) or the program exited (until.exit). The TUI scenarios exit with one Ctrl+C and wait for the exit. Each Escape waits for what it closes; where nothing visible changes, it goes as the Kitty keyboard sends it (CSI 27 u), which both clients turned on. Mini's two-press exit and E.20's selection-ending Ctrl+C keep their two presses.
  • test(cli-rs): wait for the reload a plugin_compat row's keys follow
    Two more listener rows pressed a key right after the probe's first
    listen, whose new key layer reloads the plugin's registrations. A
    settle that saw the JS host idle could come before the host took that
    reload, so the listener heard nothing (lane run 20261118-121535). They
    now wait for the probe's live generation to change.
    
    Four rows waited out a reload with a sleep. Three now wait for the new
    generation; the refocus row, whose reload is now a change of commands
    in place, waits for the keymap to list the new command.
  • test(cli-rs): wait for the probe's reload before the two key rows
    Both rows typed as soon as a settle saw the JS host idle. The reload
    the probe's registrations asked for (a new key layer, a new store) is
    the host's own work after that answer, so under load it could come
    later. Then the listener's layer was not registered yet (ctrl+p went to
    the declining hotkey, and the palette opened), or ^ met the guest that
    had handed over. Each row now waits until the probe's live generation
    changed.
  • test(cli-rs): trim the opaque dark-theme screen matrix
    The two opaque dark themes repeat events (T10/T11), tools (V05a) and
    sidebar (V19, F04, F06-F08) with the same inputs. Keep the corresponding
    tokyonight-light-{events,tools,sidebar} screens and cursor-dark events
    and tools. Cursor's alpha rail and diff gutter exposed real bugs.
    builtin_themes_match_the_typescript_resolver checks every dark palette.
  • refactor(cli-rs): share Mermaid's accessibility directive filter
    Gantt, timeline and gitGraph each kept the same block state and
    compiled the same two regular expressions. Share that filter after
    each parser strips its own comments: gitGraph honors quoted percent
    signs, unlike gantt and timeline. diagrams_match_typescript checks
    the resulting diagrams against the TS renderer.
  • test(cli-rs): compare completion scripts directly to the TS CLI
    C.0/completions-{bash,zsh,fish,powershell} run the actual commands on
    both sides. Drift no longer runs the TS commands to write four scripts
    that a second test compares with the Rust formatter. Keep the alias
    check in completion_aliases_match_their_shells.
  • test(cli-rs): keep one parity run per session interaction
    The P-TUI runs exercise these same screens and input paths with a
    simulated server, comparing the TS and Rust cells and request logs.
    Drop their scripted P-APP counterparts and their recordings:
    
    V06 navigation: E.8/navigate.sim
    V14, DLG38/40/41 queue, steer and message actions: E.10b/queue.sim
    DLG16 session list and double-delete: E.11a/session-list.sim
    F02, DLG45 goal status, pause and footer: E.14/goal.sim
    V11, E.9a wrapped edit diff: layout-parity-2/permission-edit.sim
    
    Keep session-list-current's separate focus regression, and the APP tool
    and message screens whose simulated counterparts omit states.
  • test(cli-rs): press each key sequence once per keymap setup
    Aliases and overlapping commands sent identical bytes to the same
    registered layer. Deduplicate before dispatch, keeping the command in
    the key for isolated layers. The regenerated oracle contains all 1,906
    distinct cases from the 3,743 recordings in their original order.
    
    oracle_key_sequences_run_the_commands_typescript_runs still compares
    every distinct result, including focused input, overridden bindings,
    leader timeouts and Windows suspend. No parity scenario disappears.
  • test(cli-rs): keep the time oracle at calendar and offset boundaries
    Date conversion has a round-trip property over 1.6 million days. The
    Bun comparison needs independent known answers, not every ordinary
    month start for 41 years in all five zones. Sample ordinary instants
    across the same centuries, and keep all the parse cases, range limits,
    the US rule change, and the five-minute gap and fold probes.
    
    dates_round_trip and matches_typescript_in_every_zone cover the retained
    cases. Every row from the writer matches a row in its original zone.
  • docs(cli-rs): remove TUI implementation narration
    Cut item-by-item descriptions of assignments, branches and widget
    construction across the TUI. Reduce historical module walkthroughs to
    their TypeScript references. Retain the ordering, ownership, lifetime,
    platform and numeric constraints where they explain the implementation.
    No test, executable code or recording changes.
  • test(cli-rs): check successful ACP compaction on the wire
    streams_a_compact_turns_summary_and_completes_it_with_the_full_summary
    compares every update, including both streamed chunks, the session and
    compaction IDs and the final summary. Its companion,
    treats_a_null_compaction_capability_as_unsupported, compares the two
    marker updates. Run both against the same event sequence and drop the
    two weaker assertions on the fold. Keep early, empty, failed, cancelled
    and child compactions in the translation table.
  • refactor(cli-rs): use one encoder for URL components
    Mini and the store each rebuilt encodeURIComponent for global form
    headers. The CLI built it again for operation parameters, and encoded
    a directory through a fallible JSON serialization. Use the generated
    client's existing byte set for all of them. Query encoding stays apart.
    
    operations_fill_path_parameters_and_query now includes non-ASCII bytes,
    reserved characters and unescaped punctuation. The API request oracle
    and keeps_global_forms_per_location_and_settles_them_with_the_location_header
    cover the API and store paths.
  • test(cli-rs): retire the TS-only skips and the first models case
    No CLI or PTY scenario sets tsOnly. Keep the PTY's rsOnly handling for
    native-specific cases. H.3/models starts the same command and server
    route as C.1/models; the latter contains all three original models and
    adds case and punctuation to the ordering check. Keep C.1/models and
    the H.3/version PTY smoke path.
  • test(cli-rs): drop four redundant diff viewer captures
    E.15a/route saved the same frame for half-page, last and first after
    reviewing the last file. Keep its hunk, file and route transitions;
    E.15a/route.pty exercises scrolling on a diff long enough to move.
    E.15b/base checks the new branch in the viewer and in the reopened
    source picker; it need not capture the same viewer a second time.
    
    Re-record E.15a/route and E.15b/base. All surviving cells and HTTP
    results match their original recordings.
  • refactor(cli-rs): keep each dialog wait with its answer command
    Store the generation and waiter in the reserved command slot instead of
    maintaining a second map. A close still releases only the generation it
    names. Worker and UI waits also share the ready/pending decision, with
    no wake under the mutex or cell borrow.
    
    `reused_answer_commands_ignore_the_previous_dialogs_close` fills every
    slot, checks overflow, then delivers a stale close after reuse.
    `a_dialog_that_closes_without_an_answer_gives_none` retains keyed-select
    and escape coverage. `blocking_runs_on_a_thread_and_wakes_the_host`
    still checks the handoff from a worker.
  • test(cli-rs): keep loader checks at the observable boundary
    `a_spec_is_keyed_as_ts_keys_it` compares cache keys for the same npm
    specs with the TS implementation; keep the extra git package-name check
    in `a_package_resolves_in_the_newest_generation`. Let
    `a_client_with_nothing_to_run_starts_no_bun` cover lazy discovery and
    retain the separate missing-runtime and feature-off diagnostics.
    
    `mount_orders_claims_around_the_content` now renders two appended claims
    in enable order. It covers both additive placement and the constructors
    that the lower-level checks repeated.
  • refactor(cli-rs): separate scoped reads from forwarded plugin reads
    List the read methods passed through unchanged next to the explicit
    implementations that require an owner, plugin namespace, or mount.
    Keep the existing trait defaults for methods that were not delegated.
    
    Use the same object merge for the default store and its preflight size
    check. Keep the actual host write under the host's storage lock. Check
    name uniqueness directly rather than testing a second name parser.
    
    Kept: `the_small_reads_and_verbs_are_the_same_in_process_and_through_the_library`,
    `names_keep_every_pair_apart`, `a_merge_is_bounded_by_the_value_it_makes`
    and `a_call_that_panics_has_no_effects`.
  • chore(cli-rs): keep ICU out of retained example plugin builds
    Lock the seven standalone example workspaces staying in-tree to the
    client's idna_adapter 1.0.0. Their API requests encode paths and
    query parameters, not hostnames. Leave the SDK, its pinned author
    fixture, and all ten moving ports alone.
    
    `plugins_on_the_sdk_pull_in_no_tui` still checks SDK-only builds. The
    seven retained lockfiles passed locked clippy in both configurations
    and the examples' library tests.