Add two separate CLI commands. push:preview shows the notification and
eligible devices for a DID without sending. push:test sends one
diagnostic notification to exactly one registration, selected by both
DID and device id, and fails closed on a missing, inactive, other-DID,
or ambiguous registration.
Log the stage and safe error code for notification, daily-run,
renewal, and pass failures instead of the raw exception message. The
raw message can carry JWTs, FCM tokens, or URLs with credentials.
Keep attempted and failed counts outside the pass try block so an
unexpected pass-level failure records the counts reached so far.
Notification errors still count separately from daily-run failures.
A pending-query failure still records zero counts.
Record each FCM scheduler pass and the users it reviewed in two new tables, alert_search_scheduler_passes and alert_search_scheduler_runs, linked by pass id. Deferred users get a row too, so a pass that found no due work is still visible.
Log the FCM error code and a truncated description with the
registration token removed, instead of the raw exception message, in
the alert search send path. Stored outcomes and send counts are
unchanged.
Retention is unchanged at 30 days, shared by alert_push_sends and
alert_push_device_sends. Pruning is lazy and per DID on that DID's
next write; there is no global cleanup job.
Record each device attempted in an AlertSearch digest send in
alert_push_device_sends, with the FCM message id or error code and a
sanitized detail. FCM accepting a message does not mean the device
displayed it.
- alert_push_sends remains the DID-level daily-cap record, unchanged
- device rows link to it when one exists
- a failed device-log write is logged and does not change the send
result or retry FCM
- push:watch adds a Device attempts view (key 5) and a per-DID
summary, still read-only
Starred-project items that are not offers or gives now read as info, and other incoming items read as updates, so those lines no longer call them claims.
AlertSearch does not return the requester's own actions, so offerFromYou, giveFromYou, and otherClaimFromYou are not real notification lines. Incoming claims stay classified as offers, gives, or other claims to the user.