singularity-forge/packages
Mikael Hugo a055b3adf2 feat: structured notification event model with metadata-first classification
Replace brittle string-matching in headless-events.ts with structured
source/kind/blocking/dedupe_key metadata on notify() events. String
matching is preserved as a fallback for the ~940 untagged call sites.

- Add NotificationMetadata type to headless-types.ts (canonical definition)
- Extend rpc-types.ts notify event with optional metadata field
- Extend ExtensionUIContext.notify() signature with optional 3rd arg
- Pass metadata through RPC notify implementation in rpc-mode.ts
- Update headless-events.ts: isTerminalNotification, isBlockedNotification,
  isMilestoneReadyNotification, isPauseNotification all check metadata first
- Update notification-store.ts: store metadata on NotificationEntry; use
  metadata.dedupe_key as dedup key when provided (falls back to message hash)
- Update notify-interceptor.ts to thread metadata through to store + original
- Tag critical emit sites with structured metadata:
  stopAuto → { kind: "terminal" } (+ blocking: true when reason includes "block")
  pauseAuto → { kind: "terminal", blocking: true }
  guided-flow milestone ready → { kind: "approval_request", blocking: true }
- Update notification-overlay.ts to prefer metadata.source for [label] display
- Add 17-test regression suite (notification-event-model.test.ts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 23:07:57 +02:00
..
daemon feat: stabilize autonomous workflow system 2026-05-01 20:18:50 +02:00
mcp-server feat: stabilize autonomous workflow system 2026-05-01 20:18:50 +02:00
native sf snapshot: pre-dispatch, uncommitted changes after 46m inactivity 2026-04-30 21:07:36 +02:00
pi-agent-core feat: stabilize autonomous workflow system 2026-05-01 20:18:50 +02:00
pi-ai feat: stabilize autonomous workflow system 2026-05-01 20:18:50 +02:00
pi-coding-agent feat: structured notification event model with metadata-first classification 2026-05-01 23:07:57 +02:00
pi-tui release: v2.75.0 2026-04-17 17:26:59 +00:00
rpc-client feat: structured notification event model with metadata-first classification 2026-05-01 23:07:57 +02:00