fix(commands): keep a staff-gated /guild answer private to the caller (#46) #50

Merged
whitlocktech merged 1 commits from fix/guild-ephemeral-46 into main 2026-11-27 13:35:08 -06:00
Member

What & why

Closes #46.

/guild checked the caller's rung against the shard's guilds audience, then posted the permitted answer into the channel. When a shard limits guilds to staff and a moderator runs /guild in a public channel, everyone in that channel saw the guild list, or one guild's counts and leaders.

The list and detail replies now set ephemeral: true whenever the guilds audience is narrower than public. Public shards still answer publicly. This is the same rule as module-rust D127.

One difference from the issue text: the issue suggests feature.audience !== 'public'. This module has no public value. Its lowest rung is anonymous (shardVisibility LADDER), so !== 'public' would have made every reply private. The check is audience !== 'anonymous', and a missing audience is treated as narrow, so the reply stays private.

Docs: RunicGateway/docs PR (TEAMS.md §7.1 + MODULE_API.md registerSlashCommands) — linked below.

How it was tested

  • cd server && npm test: 738 pass, 0 fail.
  • Two new tests in server/test/guildCommand.test.js:
    • For the audiences logged_in, player, staff and admin, both the list and the detail reply come back ephemeral: true.
    • For anonymous, both stay ephemeral: false.
  • Not tested: a live run through the Discord bot. Turning ephemeral into a private follow-up after a public deferral is the bot's existing behaviour (TEAMS.md §7.1, phase 7 fix), and this change doesn't touch it.

Checklist

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand
    every change, and take responsibility for it. AI-authored commits are
    marked with a Co-Authored-By / Assisted-By trailer.

License

  • I agree that my contribution is licensed under this project's license
    (GNU GPL v3.0 or later), and I have the right to contribute it.

🤖 Generated with Claude Code

https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t

## What & why Closes #46. `/guild` checked the caller's rung against the shard's `guilds` audience, then posted the permitted answer **into the channel**. When a shard limits guilds to staff and a moderator runs `/guild` in a public channel, everyone in that channel saw the guild list, or one guild's counts and leaders. The list and detail replies now set `ephemeral: true` whenever the `guilds` audience is narrower than public. Public shards still answer publicly. This is the same rule as module-rust D127. **One difference from the issue text:** the issue suggests `feature.audience !== 'public'`. This module has no `public` value. Its lowest rung is `anonymous` (`shardVisibility` `LADDER`), so `!== 'public'` would have made every reply private. The check is `audience !== 'anonymous'`, and a missing audience is treated as narrow, so the reply stays private. Docs: RunicGateway/docs PR (TEAMS.md §7.1 + MODULE_API.md `registerSlashCommands`) — linked below. ## How it was tested - `cd server && npm test`: **738 pass, 0 fail**. - Two new tests in `server/test/guildCommand.test.js`: - For the audiences `logged_in`, `player`, `staff` and `admin`, both the list and the detail reply come back `ephemeral: true`. - For `anonymous`, both stay `ephemeral: false`. - **Not tested:** a live run through the Discord bot. Turning `ephemeral` into a private follow-up after a public deferral is the bot's existing behaviour (TEAMS.md §7.1, phase 7 fix), and this change doesn't touch it. ## Checklist - [x] I have read [CONTRIBUTING.md](CONTRIBUTING.md). - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` / `Assisted-By` trailer. ## License - [x] I agree that my contribution is licensed under this project's license (**GNU GPL v3.0 or later**), and I have the right to contribute it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t
wtclaude added 1 commit 2026-11-27 13:26:47 -06:00
fix(commands): keep a staff-gated /guild answer private to the caller
All checks were successful
PR Checks / client-build (pull_request) Successful in 44s
PR Checks / server-tests (pull_request) Successful in 52s
PR Checks / frozen-manifest (pull_request) Successful in 39s
5d793389e4
/guild checked the caller's rung against the shard's guilds audience and
then posted the permitted answer into the channel, where every member
reads it. A moderator running /guild on a staff-gated shard published the
guild list (or one guild's counts and leaders) to everyone.

The list and detail envelopes now carry ephemeral: true whenever the
guilds audience is above the public rung. This module's public rung is
`anonymous` (shardVisibility LADDER), not `public`; a missing audience
fails closed. Public shards keep public answers. Same rule as module-rust
D127.

Closes #46

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t
whitlocktech merged commit c8e96fcef6 into main 2026-11-27 13:35:08 -06:00
whitlocktech deleted branch fix/guild-ephemeral-46 2026-11-27 13:35:08 -06:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Module-uo#50
No description provided.