singularity-forge/packages/pi-coding-agent/src
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
..
cli sf snapshot: pre-dispatch, uncommitted changes after 47m inactivity 2026-04-30 20:21:12 +02:00
core feat: structured notification event model with metadata-first classification 2026-05-01 23:07:57 +02:00
modes feat: structured notification event model with metadata-first classification 2026-05-01 23:07:57 +02:00
resources/extensions/memory Rename @sf-run/* → @singularity-forge/* package scope 2026-04-15 22:56:33 +02:00
tests sf snapshot: pre-dispatch, uncommitted changes after 53m inactivity 2026-04-30 19:10:38 +02:00
types fix(gsd): align ADR-009 integration with type-safe builds 2026-04-14 20:46:46 -05:00
utils rip out antigravity from SF + pi-coding-agent UI/config layer 2026-04-19 10:39:36 +02:00
cli.ts port(pi-mono): disable undici body/headers idle timeouts on global dispatcher (refs ea90a6783) 2026-04-29 14:35:08 +02:00
config.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
index.ts Harden SF model routing and harness contracts 2026-04-30 07:41:24 +02:00
main.ts Rename @sf-run/* → @singularity-forge/* package scope 2026-04-15 22:56:33 +02:00
migrations.ts fix(migrations): drop press-any-key block to avoid stdin wedge 2026-04-21 00:56:18 +02:00