Skip to content

feat: track OMP sessions as per-pane rows with tab-title labels - #7

Merged
alphastorm merged 3 commits into
mainfrom
feat/per-pane-rows
Nov 6, 2026
Merged

alphastorm merged 3 commits into
mainfrom
feat/per-pane-rows

Conversation

@alphastorm

Copy link
Copy Markdown
Owner

Direction B, transport-independent part. SidePulse still receives exactly what 0.1.0 sends; the SidePulse #72 adapter and the 0.2.0 release stay held until inteliwear/sidepulse#72 merges and a SidePulse release ships it.

What changes

  • Per-pane rows. The coordinator keeps one row per OMP session, keyed by (host, pane) and deduplicated across windows: the highest-priority mode wins, and the label comes from the newest snapshot that has one. It hands the whole row list to the transport. The hook-event transport reduces the rows to its one combined mode (combined_mode, the old aggregate), so events, timing and the constant OMP in Tern title are unchanged. Every pre-existing coordinator test asserts the same sent modes as before.
  • Tab-title labels. window.luau labels each OMP pane with its user-given tab name, else the pane's own title, never the title of whichever pane is focused in a split tab. It reads them through one cx.session:panes() call and one cx.session:tabs() call per 5 s pass, made only when the window has an OMP pane. The coordinator sanitizes each label: whitespace is collapsed; controls, lone surrogates and private-use characters (OMP's status glyph) are dropped; the result is capped at 96 characters. Labels and host keys stay in coordinator memory. They never reach the log, doctor.json, status, acknowledgements or the SidePulse payload. status and doctor show only row counts.
  • Bounded snapshots. The window encodes each snapshot under pcall, so an encode failure can no longer leave a call marked in flight for ever. Snapshots stay under 192 KiB: labels are dropped if needed and counted as labels_dropped. The coordinator's request cap rises to 1 MiB, because the helper re-escapes non-ASCII text up to 3×.
  • Luau harness in the repo. tests/luau/ runs the real window.luau headlessly. It covers backoff, interpreter replacement, the latch and role scenarios (A–G), labels and host keys (L1–L12), and the snapshot budget and encode failure (B1–B3). CI's luau job installs Luau 0.745 and requires it.
  • Docs. Every owned surface that said "never reads pane titles" now states what is read and where it goes: README, SECURITY, CONTRIBUTING, compatibility, site, PR and issue templates. CHANGELOG has an Unreleased section.
  • Removed test_documented_test_count_is_current. It pinned test counts written in prose, including the historical 0.1.0 changelog entry, to the live suite size.

Evidence

  • python3 -B -m unittest discover -s tests -t . → Ran 155 tests … OK (skipped=1), with luau present and TERN_SIDEPULSE_REQUIRE_LUAU=1. luau-lsp analyze --definitions=types/tern.d.luau window.luau is clean.
  • Non-vacuous harness: drive_labels fails at L1 against main's window.luau, and drive_budget fails at B1; drive_backoff passes on both.
  • Live probe on Tern 0.9.12 (a disposable plugin, unlinked afterwards):
    • panes() and tabs() cover every session, including attached remote hosts, at about 0.03 ms each.
    • PaneInfo.tab equals TabInfo.id.
    • OMP titles start with a private-use glyph (U+F1517, U+F412, …).
    • tern.json.encode replaces invalid UTF-8 rather than raising.
  • Live tracer of the spike adapter: a side-by-side copy of this branch plus the spike adapter, sending to an isolated SidePulse #72 server. The window's three real OMP sessions (two local, one on a remote host) became three rows: Review docs DOCS, RepoPrompt ROWS, Context and Task Briefs V0211. After unlinking, the leases expired, the rows were cleared, and the coordinator exited drained.

SidePulse #72 spike

The branch spike/pr72-adapter (never merged) plugs a per-row ProgramStatusTransport into this PR's transport boundary without changing it. spike/FINDINGS.md covers:

  • A SidePulse service restart drops every row. The adapter restores them in 0.73 s by watching the socket inode.
  • A killed coordinator leaves its rows. The next coordinator clears them from a write-ahead ledger.
  • #72 no longer applies the user's idle timeout to any row, so a dead reporter's working or blocked_error row stays until SidePulse restarts.

The coordinator now builds rows (host, pane, mode, label) from complete snapshots, deduplicated across windows, and hands them to the transport. The hook-event transport reduces rows to its single combined mode, so SidePulse still sees exactly what 0.1.0 sent. Labels are sanitized at parse time and never reach logs, status, doctor.json, acks, or the SidePulse payload.
…shot

Each OMP observation carries a host key and a label (the user-given tab name, else the pane's own title), cut at a UTF-8 boundary. Snapshots are encoded under pcall and kept under 192 KiB by dropping labels. The window harness moves into tests/luau and runs against the real window.luau in CI.
The window now reads OMP panes' titles and user-given tab names as labels. Every owned surface says what is read, that labels stay in coordinator memory, and that SidePulse still receives one combined status until the SidePulse #72 adapter ships.
@alphastorm
alphastorm merged commit 7cb0373 into main Nov 6, 2026
6 checks passed
@alphastorm
alphastorm deleted the feat/per-pane-rows branch November 6, 2026 04:32
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