Skip to content

feat!: report each OMP session to SidePulse's program-status socket - #9

Merged
alphastorm merged 3 commits into
mainfrom
feat/program-status-transport
Nov 10, 2026
Merged

alphastorm merged 3 commits into
mainfrom
feat/program-status-transport

Conversation

@alphastorm

Copy link
Copy Markdown
Owner

SidePulse merged inteliwear/sidepulse#72 on 2026-11-10 (ad4a5217). It removes the hook-event sockets tern-sidepulse 0.1.0 writes to: relay-events.sock is gone, and events.sock now ignores everything except open-settings. SidePulse desktop installs from main (setup.sh, sidepulse update), so anyone who updates SidePulse now gets no OMP status from 0.1.0.

0.2.0 switches to the new program-status protocol and shows one SidePulse row per OMP session, named after its tab or pane.

What changes

  • Transport (tern_sidepulse/transport.py): one acknowledged program_status report per row, at most 32 rows (most urgent first), each under a salted scope tern-sidepulse-<24 hex>. Rows that leave are cleared. Active rows are refreshed every 300 s; delivery backs off 2–30 s; a socket that appears during backoff is tried at once. When SidePulse restarts, its rows are resubmitted, except done rows.
  • Crash recovery: a write-ahead ledger of scope hashes (program-scopes.json) lets the next coordinator clear a crashed coordinator's rows after one 15 s lease. Rows that are still open are overwritten in place, not cleared and re-added. A graceful exit clears every row.
  • Founder decisions: labels go to SidePulse by default, and "labels": false in config.json sends OMP in Tern instead. Program-status only: on an older SidePulse, doctor says to run sidepulse update. cwd is never read or sent.
  • Renames: program_sockets / TERN_SIDEPULSE_PROGRAM_SOCKETS / --program-socket replace the ui/service socket settings. doctor's receiver check replaces receiver_ui and receiver_service.
  • Already on main, released here: per-pane rows and labels (feat: track OMP sessions as per-pane rows with tab-title labels #7) and the luau-lsp config (feat: register luau-lsp for omp sessions with the tern definitions #8). Version 0.2.0.

Verification

  • 177 tests pass on Python 3.15.2 and 3.13.18 at b016915. The opt-in 20 s timing test also passes.
  • New contract test (tests/test_sidepulse_contract.py) drives the transport against SidePulse's own ProgramServer. It passes against the ad4a5217 source and against the installed 0.2.4.dev36+gad4a5217f. A new CI job pins ad4a5217 and fails if the test is skipped.
  • Live on the laptop (Tern 0.9.16, OMP 18.18.7, SidePulse 0.2.4.dev36+gad4a5217f):
    • A side-by-side copy turned four live sessions into four rows (4 reports accepted, 0 rejected). Unlinking it cleared them in 11 s.
    • A running 0.1.0 coordinator stepped aside on version_mismatch, and a 0.2.0 coordinator took over the same runtime directory.
    • After kill -9, the next coordinator overwrote the still-open row in place and cleared the closed one when the grace ended.
    • SIGTERM cleared every row.
  • Focused critical review of 07cceee (review-daybreak-blue and review-gemini-argon; review-gpt-astra supplemental) returned 10 items:
    • 8 fixed in b016915, each with a regression test that fails at 07cceee. The fixes: disable now stops the coordinator, so a changed "labels": false takes effect after disable + enable; an exiting coordinator keeps clearing rows for up to 2 s; rows are resubmitted when SidePulse comes back on another socket candidate; a predecessor's leftover rows count toward the 32-row cap; doctor's pre-#72 detection covers the /tmp fallback; the window's UTF-8 cut handles invalid titles; resync requires a data dir.
    • 1 rejected: an undelivered done row is current state, not a replayed completion.
    • 1 question resolved: the socket path rule matches upstream exactly.

Details: docs/compatibility.md.

Not exercised with 0.2.0

Sleep/wake, Tern quit/relaunch and remote disconnect: the window, lease and clock code they cover is unchanged since the 0.1.0 checks. Also not run against a real SidePulse: the /tmp fallback for socket paths longer than 96 bytes.

SidePulse removed the hook-event sockets tern-sidepulse 0.1.0 wrote to
(inteliwear/sidepulse#72, merged 2026-11-10 as ad4a5217; SidePulse desktop
installs from main, so `sidepulse update` ships it). 0.2.0 talks only to the
new program-status protocol and shows one SidePulse row per OMP session,
named after its tab or pane.

- transport.py: SidePulseTransport sends one acknowledged program_status
  report per row (at most 32, most urgent first) under a salted scope, clears
  rows that leave, refreshes active rows every 300 s, backs off 2-30 s, retries
  at once when a socket appears, and resubmits rows (except done) when
  SidePulse restarts. A write-ahead ledger of scope hashes lets the next
  coordinator clear a crashed one's rows after one lease, overwriting rows
  that are still open instead of clearing and re-adding them. Rejections log
  fixed text only.
- Labels go to SidePulse by default; `"labels": false` in config.json sends
  an empty title and "OMP in Tern" instead. cwd is never read or sent.
- config `program_sockets`, TERN_SIDEPULSE_PROGRAM_SOCKETS and
  --program-socket replace the ui/service socket settings; doctor's
  `receiver` check tells a pre-#72 SidePulse to `sidepulse update`.
- Tests: transport units, doctor checks, migrated coordinator and subprocess
  suites, and a contract test against SidePulse's own server (CI pins
  ad4a5217). Docs and site describe the new contract and the laptop checks.

BREAKING CHANGE: requires a SidePulse build that includes inteliwear/sidepulse#72;
use tern-sidepulse 0.1.0 with older SidePulse.
Findings from the focused review of 07cceee, each with a regression test that
fails at 07cceee and passes here:

- disable stops the coordinator once its rows are cleared, so the
  coordinator that enable lets the next snapshot start reads config.json and
  a changed "labels": false takes effect
- an exiting coordinator keeps clearing rows for up to 2 s, stopping at the
  first failed send, instead of giving up after one 0.3 s tick
- SidePulse coming back on another socket candidate gets every row
  resubmitted, idle rows included
- rows left by a crashed coordinator are cleared at once when they would push
  this install past its 32-row cap
- doctor finds a pre-#72 relay socket in SidePulse's state directories,
  including its /tmp fallback for long paths
- window: a title of UTF-8 continuation bytes cuts to an empty label instead
  of passing through whole
- bridge.py resync requires a data dir, like register and disable
@alphastorm
alphastorm merged commit 1c1c5a6 into main Nov 10, 2026
8 checks passed
@alphastorm
alphastorm deleted the feat/program-status-transport branch November 10, 2026 23:19

This branch was successfully deployed

1 active deployment
github-pages — 1c1c5a60 Deployed Nov 10, 2026 by alphastorm via deploy #4
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