fix(acp): restrict owner-only trigger authority to the exact owner - #6087
Open
manolitnora wants to merge 3 commits into
Open
fix(acp): restrict owner-only trigger authority to the exact owner#6087manolitnora wants to merge 3 commits into
manolitnora wants to merge 3 commits into
Conversation
Signed-off-by: manolitonora <manolitonora.us@gmail.com>
Signed-off-by: manolitonora <manolitonora.us@gmail.com>
Signed-off-by: manolitonora <manolitonora.us@gmail.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Problem
With
respond-to = owner-only,author_allowedadmitted same-owner siblingagents as trigger authority, not just the registered owner. Combined with a
wildcard subscription (
subscribe-mode = allleaveskindsempty, which thefilter treats as match-all) and the automatic 👀 "seen" reaction added at
queue-push time, sibling agents in a shared channel could trigger each other's
turns.
Each queued event produced new lifecycle events (kind 7 reactions, kind 20002
typing, kind 5 deletions) that were themselves delivered as work, so the
population of turns grew instead of settling. The 👀 is added before the agent
turn begins and is gated only on whether the event was queued — not on its kind
— so no prompt or persona change can interrupt the cycle.
Change
RespondTo::OwnerOnlynow admits only the exact registered owner as automaticwork, in both the DM and non-DM paths. A new private
is_ownerhelper does theexact-match check;
is_owner_or_siblingis retained and still used byAllowlistandAnyone, whose behavior is unchanged.Sibling-authored messages remain fully readable as conversation context — the
context parser is untouched, and a test pins that visibility so the fix cannot
silently become a censor.
The production change is confined to
crates/buzz-acp/src/lib.rs. Thepool.rschange is test-only.Tests
Seven tests exercise the real author gate, the real subscription matcher, and
signed Nostr events:
strict_owner_accepts_owner_kind9_as_workstrict_owner_rejects_sibling_kind9_as_workstrict_owner_rejects_self_authored_kind9strict_owner_dm_accepts_owner_but_rejects_siblingstrict_owner_rejects_sibling_lifecycle_kinds_even_when_filter_wildcard_matchesstrict_owner_owner_message_cannot_seed_sibling_reply_chainstrict_owner_sibling_message_remains_readable_contextThe lifecycle test asserts that the wildcard subscription still matches kinds
5/7/20002 while those sibling events no longer reach work, so the fix is pinned
at the author boundary rather than by narrowing the kind filter.
These guards were verified non-vacuous: reverting only the two
RespondTo::OwnerOnly => is_owner(...)arms back tois_owner_or_siblingfails 4 of the 7 (
..._owner_message_cannot_seed_sibling_reply_chainfailsleft: 33, right: 1, i.e. 33 events became work where 1 should have).Restoring returns them to green.
Local results on this branch:
cargo test -p buzz-acp→ 784 passed / 0 failedcargo clippy -p buzz-acp --all-targets -- -D warnings→ cleancargo fmt --all -- --check→ cleanCompatibility
This narrows behavior.
Allowlist,Anyone,Nobody, setup-mode reuse,and history-query semantics are preserved, but any deployment that relies on
same-owner sibling agents triggering each other under
owner-onlywill stopworking and must move those pubkeys to
Allowlist. Worth a release note.