Skip to content

tern-sidepulse 0.2.0

Latest

Choose a tag to compare

@alphastorm alphastorm released this 10 Nov 23:20
· 1 commit to main since this release
Immutable release. Only release title and notes can be modified.
1c1c5a6
  • Breaking requirement — SidePulse with program_status (inteliwear/sidepulse#72): Requires a SidePulse build installed or updated with sidepulse update on or after 2026-11-10 (merge commit ad4a5217). When an older SidePulse is present (relay-events.sock without program-status.sock), tern-sidepulse: doctor reports an error on receiver (this SidePulse predates program status) with the remedy sidepulse update. Use tern-sidepulse 0.1.0 for older SidePulse builds.
  • SidePulse program-status transport (tern_sidepulse/transport.py, tern_sidepulse/coordinator.py, tern_sidepulse/doctor.py): replaces the 0.1.0 hook-event transport (events.sock, relay-events.sock, UserPromptSubmit/Interrupt/… hook-event lines, and the single combined tern-sidepulse:<install_id> session) with SidePulseTransport over SidePulse's program-status.sock ($XDG_STATE_HOME/sidepulse/agent-monitor/program-status.sock, ~/.local/state/sidepulse/agent-monitor/program-status.sock, or /tmp/sidepulse-status-<uid>/<sha256(path)[:16]>.sock when the program-status.sock path exceeds 96 bytes). Each OMP session is reported as its own row under salted scope tern-sidepulse-<24 hex> (sha256(install_id NUL host NUL pane)[:24], salted by install_id from identity.json), mapped to states working, blocked (waiting_for_input), error (blocked_error), done (completed), idle (idle_ready), and clear across at most 32 rows (most urgent first). Unchanged rows are not resent; active rows (working, blocked, error) refresh every 300 s; retries reuse request_id with 2, 4, 8, 16, 30 s backoff and wake immediately when a socket appears or changes; SidePulse restarts (including a move to another socket candidate) resubmit every current row except delivered done rows; and a scope ledger (<runtime dir>/program-scopes.json, mode 0600, salted scope hashes only) written before each scope's first report lets the next coordinator overwrite still-open panes in place and clear stale ones after a 15 s grace period following a crash (at once if they would exceed the 32-row cap). An exiting coordinator keeps clearing rows for up to 2 s, and disable now stops the coordinator after clearing its rows, so the coordinator that enable lets the next snapshot start reads config.json afresh.
  • Per-pane rows and session labels (window.luau, tern_sidepulse/coordinator.py, tern_sidepulse/reducer.py, tests/test_privacy.py, tests/test_rows.py, tests/test_transport.py): observations are keyed by (host, pane) (local, or a remote host's address, name, or id:<n>) and deduplicated across windows by mode priority (blocked_error, waiting_for_input, working, completed, idle_ready) and newest non-empty label. When a window has at least one OMP pane, window.luau reads cx.session:panes() and cx.session:tabs() at most once per 5 s pass and labels each OMP pane from its user-given tab name (TabInfo.name) or its own PaneInfo.title (cut to 256 UTF-8 bytes in the window and sanitized in the coordinator to at most 96 characters without control, surrogate, or private-use characters). Sanitized labels are sent to SidePulse in context.title by default ("labels": false in <plugin data dir>/config.json sends "title": "" and "display_name": "OMP in Tern" instead); host keys never appear outside coordinator memory, pane ids and host keys never leave the Mac (SidePulse reports and program-scopes.json carry salted scope hashes only), and labels never appear in coordinator.log, doctor.json, bridge.py status, coordinator replies, or program-scopes.json.
  • Configuration, environment, CLI, and status updates (tern_sidepulse/cli.py, tern_sidepulse/client.py, tern_sidepulse/doctor.py): <plugin data dir>/config.json takes program_sockets (replacing ui_sockets and service_sockets, which are ignored if still present) and labels (false disables labels); TERN_SIDEPULSE_PROGRAM_SOCKETS replaces TERN_SIDEPULSE_UI_SOCKETS and TERN_SIDEPULSE_SERVICE_SOCKETS; bridge.py coordinator --program-socket PATH (repeatable) replaces --ui-socket and --service-socket; doctor replaces receiver_ui and receiver_service with receiver (plus receiver_rejections when SidePulse rejects a report) and shows install <first 8 chars>… on its identity check; and status drops session_id in favour of per-mode rows counts, rows_total, rows_labelled, status.transport, and delivery = {"program_status": …} in coordinator replies.
  • Snapshot budget and request limits (window.luau, tern_sidepulse/limits.py): the window keeps each encoded snapshot within 192 KiB by dropping labels and retrying once (labels_dropped), host keys are capped at 128 bytes in the window and 128 characters in the coordinator, and the coordinator request cap is raised from 256 KiB to 1 MiB.
  • Headless Luau window harness and contract checks (tests/luau/, tests/test_luau_harness.py, tests/test_sidepulse_contract.py, .github/workflows/ci.yml): runs the real window.luau under the luau 0.745 CLI across the backoff/interpreter/latch/role test drive (drive_backoff.luau, scenarios A–G), the label and host-key drive (drive_labels.luau, scenarios L1–L12), and the snapshot-budget drive (drive_budget.luau, scenarios B1–B3), and checks the program_status wire contract against SidePulse ad4a5217.