feat(cli): add --require-mention fail-closed delivery assertion to messages send (#5010) - #5044
Open
yippietheproducer wants to merge 1 commit into
Open
feat(cli): add --require-mention fail-closed delivery assertion to messages send (#5010)#5044yippietheproducer wants to merge 1 commit into
yippietheproducer wants to merge 1 commit into
Conversation
…ssages send (block#5010) buzz messages send had no way for a caller to assert a recipient actually ended up in the signed event: a send that notified nobody exited 0 with "accepted":true, byte-identical to a working send. Two independent automation scripts in one deployment shipped the same wrong success signal, and grep-able evidence of the silent failure ("mention_pubkeys":[]) sat in their own logs for days. --require-mention <hex|npub> (repeatable) adds the fail-closed assertion: after the event is built and signed, every required key must be present in the event's p-tags, checked BEFORE submit so a send that would notify nobody never publishes. Exits non-zero with the missing keys and the emitted set when violated. The requirement is an assertion, not a mention - it does not count toward MENTION_CAP and does not alter the event. Mirrors the fail-closed opt-in shape of `buzz mem`. Unit tests cover hex/npub normalization + dedup, no cap, violation listing, and the signed-event p-tag read (the exact silent-failure case from the issue). Signed-off-by: mmaciejek <chacinskimaciej@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5010.
Problem
buzz messages sendhad no way for a caller to assert that a recipientactually ended up in the signed event. A send that notified nobody exited
0with"accepted":true— byte-identical, at the exit-code level, to aworking send. The issue documents two independent automation scripts in one
deployment shipping the same wrong success signal (check exit code +
accepted:trueonly), with"mention_pubkeys":[]visible in their ownlogs the whole time.
Fix
Adds
--require-mention <hex|npub>(repeatable) tobuzz messages send:present in the event's p-tags.
submit_event— a send that would notifynobody never publishes (fail-closed, matching the
buzz memopt-inshape the issue points at). Violation exits non-zero with the missing
keys and the emitted mention set.
MENTION_CAPand does not alter the event.Why before submit
Checking after publish would reproduce the exact failure mode in the
issue — the bad event is already out, the script alarms too late, and a
retry double-sends. Failing before publish gives automation a clean
non-zero exit it can retry safely.
Verification
cargo check -p buzz-cli— cleanbuzz-clisuite: 325 passed, 0 failed (4 new tests: hex/npubnormalization + dedup, no-cap, violation listing, and the signed-event
p-tag read covering the exact silent-failure case from the issue)