feat(mentions): add channel-wide @all mentions - #6050
Conversation
Resolve the reserved token from a fresh channel roster at send time across CLI and Desktop while preserving current send semantics and atomic cap failures. Co-authored-by: user.jb <user.jb@telos-labs.ai> Signed-off-by: user.jb <user.jb@telos-labs.ai>
themiguelamador
left a comment
There was a problem hiding this comment.
I found four correctness/safety issues and fixed them on Complear/buzz:review/pr-6050-fix (b4d3e724d).
-
P1 — the documented agent feedback loop is directly reachable through both official agent send paths. A managed agent could reply with literal
@all; Desktop's managed-agent command and the injectedbuzzCLI would expand it to every member, wake other agents, and allow repeated 50-recipient fan-out with no turn or recursion bound. The per-event cap does not bound that loop. The fix reserves expansion for human identities: NIP-OA/delegated CLI identities and the managed-agent Tauri command reject active@allwhile still allowing literal code examples and explicit targeted mentions. The embedded agent guidance now states that boundary. -
P1 — common Markdown code spans can accidentally mass-notify.
strip_code_regionsonly understood a single-backtick inline delimiter. Standard double-backtick spans such as``@all``left the token visible to the detector and expanded it to the room. The shared scanner now consumes matching backtick runs, and the cross-language fixture covers the regression. -
P2 — sentence-final
@all.is not recognized. Generic mention tokenization treats.as a display-name character, so a normal sentence ending in the reserved token silently sends no group mentions. The fix adds reserved-token boundary handling that accepts trailing sentence punctuation while keeping longer dotted identities such as@all.teamdistinct, and aligns CLI name filtering with the same rule. -
P2 — CLI applies the mention cap before the promised final-set normalization. Fifty-one explicit values including the sender were rejected even though sender exclusion leaves exactly 50 recipients. The
@allpath now defers its cap until after normalization, deduplication, roster merge, and sender exclusion; ordinary mention sends retain their existing early limit.
Please also remove the PR body's references to the “authoring agent”; this repository does not attribute assistant-generated work in PR metadata.
Validation on the fix branch:
- complete
buzz-sdksuite: 266 passed - complete
buzz-clisuite: 355 passed - strict SDK/CLI Clippy: passed
- focused Desktop transport/candidate tests: 7 passed
- Desktop TypeScript typecheck and policy/file-size checks: passed (only unrelated existing warnings/infos)
- Rust/Tauri formatting and
git diff --check: passed - focused native Tauri retry: environment-blocked before project test execution because
sherpa-onnx-systimed out downloading its upstream archive twice; the source PR's reported 2,444-test Tauri run remains the available baseline
The source branch was still at 77b22c3c2131f67fb8a467df8926ce30a3604ad1 immediately before this review.
Summary
Add a reserved, case-insensitive
@alltoken for channel messages. It expands at send time into explicit signedptags for every current channel member except the sender.@alldoes not mass-notify there.This is deliberately a focused client-side fan-out change. It adds no event kind, relay schema, protocol marker, or deployment dependency.
Related issue
Addresses #5862 and #4970.
Related competing design: #3197 implements humans-only
@channel/@herethrough a relay-recognized marker rather than per-recipientptags. This PR serves a narrower but distinct use case: explicit opt-in wake-up of every current member, including agents, using existing mention delivery semantics. The tradeoff is intentional and bounded by the existing 50-recipient cap.The token name is also an explicit point of difference: #5862 asks for
@everyone, #4970 proposes@everyoneor@channel, and #3197 uses@channel/@here. This implementation uses@allbecause it is short and names the agent-inclusive behavior without colliding with #3197's humans-only semantics. That vocabulary is not presumed canonical; a maintainer-requested rename is welcome, but it would be a reviewed follow-up code change rather than a silent textual substitution.Testing
Evidence floor: mention semantics and Desktop transport were independently reviewed with mutation sensitivity proven. Full CI and isolated-relay runs were executed by the authoring agent rather than independently replayed. Two unrelated upstream-owned flakes required clean reruns and are disclosed below.
cargo test -p buzz-sdk: 266 passedcargo test -p buzz-cli: 353 passedmentions.spec.ts: 70 passedjust ci: exit 0, including 1,465 mobile testsTwo first runs were not green and are preserved rather than hidden by the final totals:
yo-yowas split using-. The isolated test passed and the exact unchanged candidate then completed full CI.No product code was changed in response to either flake.
Behavioral and privacy boundaries
ptag; this is provenance and delivery data, not a private roster mechanism.@allcan trigger another fan-out, and several such replies can form a feedback loop. The 50-recipient cap bounds one event but is not sufficient mitigation for repeated events. If maintainers accept agent-inclusive group addressing, a follow-up recursion/turn-budget control is expected before broad deployment; the alternative is to adopt feat: @channel and @here channel-wide mentions (NIP-CM) #3197's humans-only boundary instead.allcannot shadow the reserved token. That person remains addressable through an explicit pubkey mention.