Commit Graph
15 Commits
Author SHA1 Message Date
Neil d3b6609ac9 refactor(rpc): group root modules by defining owner (#41475)
* refactor(rpc): group root modules by defining owner

* test(orcad): include JSON CLI failures in launcher diagnostics
2026-11-12 02:18:19 -08:00
Neil e902c9a65b refactor(workspace-layout): organize concrete domain owners (#41350)
* refactor(workspace-layout): organize concrete domain owners

* test(layout): retire obsolete legacy-leaf publication setup
2026-11-11 20:54:34 -08:00
Neil dedec14074 refactor(renderer): group pane layout and terminal input owners (#40989) 2026-11-10 20:09:37 -08:00
OrcaWinandOrcaWin f637498b34 test: remove obsolete manual tools and duplicate launch coverage (#40317)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-09 03:57:10 -08:00
Neil 39902f398b refactor: bind browser and remote runtime consumers to concrete owners (#40135)
* refactor: use concrete browser and input owners

* refactor: bind remote runtime callers to concrete transport owners

* Use checked subscription mock argument types

* Type browser lease mock with its subscription contract

* refactor: bind sleeping VM status probe test to socket owner
2026-11-08 21:41:28 -08:00
Neil 4e66fb5510 fix(terminal): stop recovery snapshots from piling up on slow links; let opt-in pacing engage under floods (#39765)
* fix(terminal): send one ACK overflow recovery image per drained window

Recovery snapshots bypass ACK windows, so on a link slower than a flooding
TUI each ACK while overflowed published another full-screen image behind
the queued window. Measured through real orcad over a 1 Mbit/s shaped link
this queued images without bound: keystroke echo grew from 22s to 50s over
a 45s flood and the pane took 51s to settle. Holding the next image until
the output sent ahead of the previous one is acknowledged bounds that
queue to the window plus one image (echo <= 18s, settle 7s, 10x fewer
snapshot bytes). Server-only; no protocol change.

* fix(terminal): let adaptive ACK pacing engage under overflowing TUI floods

Through real orcad on a shaped 1 Mbit/s link, ORCA_TERMINAL_ADAPTIVE_ACK_WINDOW=1
never paced a 60fps full-screen TUI: once its queue overflowed, recovery
images cleared the queue, so later sends counted as idle trickle and the
estimate never collected window-limited samples. When it did, the images
(never acked) inflated paced RTT and tripped the divergence fallback.

- A stream whose output outran the window stays backlogged until an ACK
  finds its queue empty, so sends after a recovery still measure the link.
- The estimate records recovery images: they count as queue ahead of later
  sends (no drained/paced samples behind them) and as delivered bytes once
  an ACK of a later send confirms them.

Shaped-link soak (1 Mbit/s, 50ms): echo p50 13s -> 2.2s, settle 7s -> 1.1s.
Bench gains a 6.4 MB/s TUI scenario: paced 7.7s -> 1.2s.
2026-11-07 23:02:27 -08:00
Neil 3a0e9a27d0 refactor: organize backend runtime by defining owner (#39625)
* refactor(main): organize runtime implementation owners

* test: retire wall-clock CLI title recovery case

* refactor: route new folder mutation to runtime store owner

* test: import folder mutation store contract from its owner
2026-11-07 22:24:34 -08:00
Neil 7ae6448b44 perf(terminal): opt-in adaptive ACK pacing for alternate-screen streams on slow remote links (#39735)
* refactor(terminal): own multiplex ACK window accounting in one module

* perf(terminal): pace alternate-screen multiplex output to the measured link BDP

Slow SSH links queued up to 2MB of superseded TUI frames ahead of keystroke
echo. orcad now estimates delivery rate and base RTT from existing output ACK
timing, caps in-flight output for alternate-screen streams near 2x BDP on links
under 4 MB/s, and replaces a backlog larger than that budget with the existing
recovery snapshot. Normal-screen streams and fast links keep the legacy
windows. ORCA_TERMINAL_ADAPTIVE_ACK_WINDOW=0 restores legacy behavior.

* perf(terminal): back off unavailable superseding snapshots and bound legacy echo checks

* perf(terminal): gate ACK pacing to measured remote links and keep supersedes history-neutral

Pacing now needs a base RTT of at least 40ms, 16 fresh window-limited samples,
and a sample within 15s, so LAN/local links and stale estimates keep the legacy
windows. Superseding snapshots are screen-only, only replace frames that never
switch screen mode (rechecked after serializing), and leave client history
untouched. Paced streams keep today's total buffering before overflow, so
overflow recovery fires no earlier than with legacy windows.

* fix(terminal): close supersede gaps found in review

Scan for screen switches and OSC side effects across frame and send
boundaries (raw and JSON-escaped), back off after an aborted supersede so it
cannot re-serialize in a loop, and keep paced pending headroom until the queue
drains so leaving the alternate screen cannot force an overflow recovery.

* fix(terminal): judge supersedable backlogs on decoded text across every seam

Scan the joined text of the whole queue (plus the sent tail) so screen
switches split across any frame, send, or covered/retained boundary are
seen; never supersede span frames; reject bells (via the shared bell
detector), OSC clipboard/notification writes and 8-bit OSC; back off for 1s
after a rejected scan instead of rescanning on every ACK.

* perf(terminal): make backlog superseding opt-in and forget the sent tail after snapshots

Every recovery snapshot makes current clients replay their reattach reset
(cursor shape/visibility, focus reporting), which is visible when it fires
routinely, so superseding is opt-in via ORCA_TERMINAL_SUPERSEDE_ALT_BACKLOG=1
until clients can skip it. Pacing stays on by default: on a slow link the
existing overflow recovery then reaches the client promptly instead of queuing
behind a 2MB window. After any snapshot the sent tail is unknown (it can end
inside an escape), so superseding waits for the next text frame.

* test(terminal): cover default pacing and opt-in superseding separately

* perf(terminal): read the supersede switch once per connection and skip its bookkeeping when off

* perf(terminal): make adaptive ACK pacing opt-in and fix review findings

- Default off: ORCA_TERMINAL_ADAPTIVE_ACK_WINDOW=1 enables it; when off every
  new path is a single flag check, so behavior matches legacy windows.
- Base RTT is a windowed minimum kept honest by periodic probes that drain our
  own queue; a paced RTT beyond what our window can add means the path changed,
  so legacy windows hold while the base re-learns (no more self-tightening to
  64KiB after an RTT increase).
- Paced pending headroom is capped by the connection window legacy would have
  used and released on drain, pause and detach.
- Superseding refuses snapshots that end inside an escape.
- Replace the latency-threshold unit test with hardcoded estimator tests and
  move the link simulation to bench:terminal-multiplex-ack-pacing.

* perf(terminal): drop backlog superseding and harden opt-in ACK pacing

- Remove the opt-in backlog-superseding snapshot path (code, env switch,
  frame classifier and tests); it needs a client capability to skip the
  reattach reset before it can ship.
- Paced-ness is decided once at admission (alt screen checked before the
  estimate) and reused by the send, so a probe starting in between cannot
  mislabel a sample.
- Base RTT is fed only by sends with a near-empty connection queue; probes end
  only on such samples from paced streams, and a probe that cannot drain backs
  off. A path change forgets the base and holds legacy windows until a drained
  sample re-learns it.
- Paced pending headroom is sized from the steady window (never a probe's
  zero) and released whenever the queue drains back within the legacy cap.
- Flow-level tests: disabled pacing keeps legacy frames on a measured slow
  link; drained headroom returns so later output overflows at the legacy cap.

* fix(terminal): release paced headroom whenever the queue drains, including after recovery
2026-11-07 21:07:59 -08:00
Neil 944ed9f2ca refactor(terminal): organize remaining pane features by owner (#39270)
* refactor: organize remaining terminal pane features by owner

* refactor(terminal): consolidate replay guard type imports

* refactor(terminal): retarget notification mocks and generated consumer import

* refactor(terminal): repair benchmark owner lookup and stale mock export
2026-11-06 19:45:07 -08:00
Neil 7823b122f1 refactor(renderer): organize terminal pane lifecycle and layout owners (#39242) 2026-11-06 17:52:55 -08:00
Neil 051bc5bc15 refactor(terminal): organize PTY connection lifecycle owners (#39188)
* refactor(terminal): organize PTY connection lifecycle owners

* refactor(terminal): consolidate imports from concrete owners

* test(e2e): assert durable pending automation acknowledgement
2026-11-06 15:23:27 -08:00
Neil 0314da7ed8 refactor(main): group RPC and orchestration modules by owner (#38813) 2026-11-06 08:21:33 -08:00
OrcaWinandOrcaWin 384b445585 test: remove 143 low-value tests and 13 entire suites (#38614)
* test: remove report inventories and dependency policy replays

* test: remove lint rule inventories and release mock replays

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-05 10:27:41 -08:00
Neil 2f217b4d0d refactor(daemon): group endpoint, provider, session and transport owners (#38462)
* refactor(daemon): group transport, provider, endpoint, and terminal owners

* refactor(daemon): consolidate owner imports and preserve pinned baseline sources

* refactor(daemon): import termination budgets from their defining owner

* fix(ci): retain serve mode coverage for extracted orcad startup

* fix daemon build smoke to load concrete argument owner

* read daemon protocol facts from historical defining paths

* route protocol revision owners through compatibility checks
2026-11-05 01:54:51 -08:00
Neil 6bb2e13c35 refactor(tooling): organize remaining scripts by domain owners (#38407)
* refactor(tooling): group remaining scripts by concrete domain owners

* fix(tooling): preserve relocated launcher resource roots
2026-11-05 00:29:16 -08:00