Fix #92: no silent emission drops #101

Merged
crueber merged 2 commits from fix/issue-92 into main 2026-09-05 02:59:27 +00:00
Owner

Fixes #92 (minor-7): silent emission drops in internal/notify/emit.go (reserveSeq bare return; ignored appendActivity errors arming fanout for a nonexistent event).

What changed (06 §4 emission contract):

  • Every drop path logs a notify: emission … Warn with repo/num/class/actor/seq cause via new Service.Logger (exported, nil → discard — the events-bridge convention), wired to slog.Default() in composition (cmd/walhub/notify.go).
  • appendActivity failure no longer arms notify-fanout (nothing to drain — fanoutOne probes a gap and does nothing, so arming lost every recipient with zero trace). Overflow/shortfall return after logging; sync path keeps landed tray entries, publishes frames, wakes webhooks.
  • Regression tests (internal/notify/emit_drop_test.go) fault-inject reserve/append failures: assert logged + no phantom fanout arming + no phantom activity; nil-Logger discard path covered.
  • Updated TestCreateOneStoreError (it asserted the old phantom-arming) + Decisions entry in docs/features/06_notifications.md (law 12).

Verification: go test ./internal/notify/ -race -count=1 → ok, coverage 97.3% (≥95% gate); go vet clean on internal/notify + cmd/walhub; gofmt clean; go test ./cmd/walhub/ ok. Main-worktree uncommitted changes untouched (work done in scratch worktree /tmp/wt92).

Fixes #92 (minor-7): silent emission drops in internal/notify/emit.go (reserveSeq bare return; ignored appendActivity errors arming fanout for a nonexistent event). What changed (06 §4 emission contract): - Every drop path logs a `notify: emission …` Warn with repo/num/class/actor/seq cause via new Service.Logger (exported, nil → discard — the events-bridge convention), wired to slog.Default() in composition (cmd/walhub/notify.go). - appendActivity failure no longer arms notify-fanout (nothing to drain — fanoutOne probes a gap and does nothing, so arming lost every recipient with zero trace). Overflow/shortfall return after logging; sync path keeps landed tray entries, publishes frames, wakes webhooks. - Regression tests (internal/notify/emit_drop_test.go) fault-inject reserve/append failures: assert logged + no phantom fanout arming + no phantom activity; nil-Logger discard path covered. - Updated TestCreateOneStoreError (it asserted the old phantom-arming) + Decisions entry in docs/features/06_notifications.md (law 12). Verification: go test ./internal/notify/ -race -count=1 → ok, coverage 97.3% (≥95% gate); go vet clean on internal/notify + cmd/walhub; gofmt clean; go test ./cmd/walhub/ ok. Main-worktree uncommitted changes untouched (work done in scratch worktree /tmp/wt92).
reserveSeq failure and every appendActivity failure path now log a
notify: emission Warn (Service.Logger, nil-discard convention shared
with the events bridge) instead of returning silently; an append
failure no longer arms a notify-fanout task for a nonexistent event
(fanoutOne would probe a gap and drain nothing). Sync path keeps its
landed tray entries. Regression tests fault-inject reserve/append
failures (logged + no phantom fanout). Docs: 06 Decisions entry.
Sign in to join this conversation.
No description provided.