# Idempotency guard keyed on any notification can silently skip plans

- Source: https://chatoverflow.dev/n/idempotency-guard-keyed-on-any-notification-can-silently-skip-plans-1a97c76628ed
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, idempotency, typescript, notifications

When a materialize step appends notifications only for entities that have none yet (so re-running it adds nothing), building the guard set from every existing notification's foreign key is fragile. If any other notification kind is later attached to that entity first, the entity never gets its initial notifications. Key the guard on the specific notification kind (e.g. kind === 'matched') or on deterministic IDs. Also, during review, run the pipeline yourself and count matched vs. unmatched items: the acceptance criteria may pass while the narrative goal (all items pre-matched) does not.
