v1.0.29 (CLEAR): clear-safe notification actions — no default, exact-key dispatch, focus-first open #60

Merged
ClaudiuSchuster merged 1 commit from oss-oo/pinky-clear-notify into main 2026-10-08 15:05:12 +00:00
Owner

The standing bug (steer A3-1)

The owner cleared 7 notifications in the notify-manager and the observatory opened in Chrome 7 times. Mechanism (diagnosis on file): notify_click.sh registered a default action and its catch-all dispatch sent every close-without-activation — notify-send prints NOTHING and exits 0 (expiry, dismiss, CLEAR-ALL; live-pinned on the real Cinnamon daemon) — into open_observatory; Cinnamon keeps action-bearing notifications resident, so bells pile up and every clear-all was an open.

The fix (both directions)

  • No default action (b): only -A "obs=…" and -A "zcode=…" are registered — never a default= key. -u normal -a zcode-dispatch and title/body forwarding unchanged.
  • Exact-key dispatch: case handles only obs/zcode; the * branch is an explicit commented no-op — clear-all/dismiss/expiry (and even a stray "default" stdout key a DE might hypothetically fire) open NOTHING. || exit 0 fail-silently contract kept.
  • Focus-first open (a): wmctrl -a "zcode-dispatch observatory" (exact page <title>, curl-verified) focuses an existing window before any xdg-open; absent wmctrl or no match falls through to the unchanged port-probe → open / deep-link chain. Limitation documented in-code: window titles mirror the active tab, so an inactive observatory tab is not findable — the fallback opens exactly one more tab (bounded, never N).
  • argv protocol unchanged (dispatch.py bell sites + the stream.py:384 mqtt-watchdog shape); open_session.sh untouched.

Offline suite leg (CI-runnable, zero owner-screen contact)

Helper-matrix rig: rig-dir helper copy + recording open_session.sh sibling (BRIDGE is dirname-resolved), PATH-first recording stubs (notify-send argv incl. every -A registration + scripted stdout/rc, xdg-open, wmctrl rc 0/1), loopback accept-loop listener as the observatory (ZDO_OBSERVATORY_URL), and a stub-only PATH dir (bash/timeout symlinks) proving the missing-wmctrl fall-through without any station binary leaking into the rig. Matrix: close-empty → zero opens; stray default → zero; obs+up → exactly one xdg-open with the full session URL; obs+window-found → focus only; obs+down → exactly one deep link; zcode → exactly one deep link; registration carries NO default key and BOTH explicit keys + title/body pass-through; the watchdog argv shape runs clean. Tripwire-verified: the OLD helper under the same rig fires xdg-open on close-empty (the bug reproduced), the fixed one records zero.

Docs

docs/USAGE.md §4: explicit-actions behavior, resident persistence, focus-first semantics + the clear-all-safety rationale (consistent with the v1.0.27 lineage-gate text — spawn policy untouched); command-table row updated.

Non-goals kept

No spawn-policy/lineage-gate/mute/rate-budget changes; no observatory-repo work; file set is exactly notify_click.sh, stream_functional_test.py, docs/USAGE.md.

## The standing bug (steer A3-1) The owner cleared 7 notifications in the notify-manager and the observatory opened in Chrome **7 times**. Mechanism (diagnosis on file): `notify_click.sh` registered a **default** action and its catch-all dispatch sent every close-without-activation — `notify-send` prints NOTHING and exits 0 (expiry, dismiss, CLEAR-ALL; live-pinned on the real Cinnamon daemon) — into `open_observatory`; Cinnamon keeps action-bearing notifications resident, so bells pile up and every clear-all was an open. ## The fix (both directions) - **No default action (b)**: only `-A "obs=…"` and `-A "zcode=…"` are registered — never a `default=` key. `-u normal -a zcode-dispatch` and title/body forwarding unchanged. - **Exact-key dispatch**: `case` handles only `obs`/`zcode`; the `*` branch is an explicit commented no-op — clear-all/dismiss/expiry (and even a stray `"default"` stdout key a DE might hypothetically fire) open NOTHING. `|| exit 0` fail-silently contract kept. - **Focus-first open (a)**: `wmctrl -a "zcode-dispatch observatory"` (exact page `<title>`, curl-verified) focuses an existing window before any `xdg-open`; absent wmctrl or no match falls through to the unchanged port-probe → open / deep-link chain. Limitation documented in-code: window titles mirror the active tab, so an inactive observatory tab is not findable — the fallback opens exactly one more tab (bounded, never N). - **argv protocol unchanged** (`dispatch.py` bell sites + the `stream.py:384` mqtt-watchdog shape); `open_session.sh` untouched. ## Offline suite leg (CI-runnable, zero owner-screen contact) Helper-matrix rig: rig-dir helper copy + recording `open_session.sh` sibling (BRIDGE is dirname-resolved), PATH-first recording stubs (`notify-send` argv incl. every `-A` registration + scripted stdout/rc, `xdg-open`, `wmctrl` rc 0/1), loopback accept-loop listener as the observatory (`ZDO_OBSERVATORY_URL`), and a stub-only PATH dir (bash/timeout symlinks) proving the **missing-wmctrl** fall-through without any station binary leaking into the rig. Matrix: close-empty → zero opens; stray `default` → zero; obs+up → exactly one xdg-open with the full session URL; obs+window-found → focus only; obs+down → exactly one deep link; zcode → exactly one deep link; registration carries NO `default` key and BOTH explicit keys + title/body pass-through; the watchdog argv shape runs clean. Tripwire-verified: the OLD helper under the same rig fires xdg-open on close-empty (the bug reproduced), the fixed one records zero. ## Docs `docs/USAGE.md` §4: explicit-actions behavior, resident persistence, focus-first semantics + the clear-all-safety rationale (consistent with the v1.0.27 lineage-gate text — spawn policy untouched); command-table row updated. ## Non-goals kept No spawn-policy/lineage-gate/mute/rate-budget changes; no observatory-repo work; file set is exactly `notify_click.sh`, `stream_functional_test.py`, `docs/USAGE.md`.
v1.0.29 (CLEAR): clear-safe notification actions — no default, exact-key dispatch, focus-first open
All checks were successful
Checks / Functional checks (pull_request) Successful in 12m39s
470564b81c
The owner cleared 7 notifications in the notify-manager and the
observatory opened 7 times: notify_click.sh registered a DEFAULT
action and its catch-all dispatch sent every close-without-activation
(notify-send prints NOTHING, exit 0 — expiry, dismiss, CLEAR-ALL)
into open_observatory, and Cinnamon keeps action-bearing
notifications resident, so every clear-all was an open.

- register ONLY the explicit actions obs/zcode (never a default key)
- exact-key dispatch: obs/zcode branches; the * branch is an explicit
  no-op — a clear/dismiss/expiry (and even a stray 'default' stdout
  key) opens NOTHING
- focus-first open: wmctrl -a 'zcode-dispatch observatory' focuses an
  existing window before any xdg-open (absent wmctrl or no match
  falls through; bounded to one more tab, never N)
- argv protocol unchanged (dispatch.py bell sites + stream.py:384
  watchdog shape); open_session.sh untouched
- offline suite: helper-matrix rig (recording notify-send/xdg-open/
  wmctrl stubs + recording open_session.sh sibling + loopback
  observatory listener; stub-only PATH dir proves the missing-wmctrl
  fall-through) — 8 matrix legs incl. registration (no default key)
- docs/USAGE.md: explicit-actions behavior, resident persistence,
  clear-all safety rationale
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-Singularity/zcode-dispatch!60
No description provided.