feat(discord): add request-owned guild settings to discord_admin - #86432
andrexibiza wants to merge 10 commits into
Conversation
feat(discord): scalar guild-settings REST action A clean, well-validated pure request builder; the test matrix (ranges, types, snowflake bounds, allowlists, only-provided-fields) is thorough. Observations:
|
|
Current-head/topology verification complete at The branch is still builder-only. The actual production owner is the existing model-facing The current builder also has four contract defects:
I prepared the current-main repair with a real |
fb76942 to
b089e9d
Compare
b089e9d to
d8015d5
Compare
Implementation complete — guild-settings consumer now executes the validated PATCHApplied the handoff packet to a fresh worktree at PR branch CommitPushed to Files changed (source of truth = packet files/)
Verification (real checkout at exact pushed head d8015d586619)Additional checks run against the same checkout:
Acceptance gates — status
|
Rebuild A5 on current main as the issue-scoped pure request-builder contract. Remove the premature model-callable mutator and its arbitrary guild target; preserve only approved-scalar validation and focused tests. Fixes NousResearch#86431 Part of NousResearch#79564
d8015d5 to
d272399
Compare
Close the allowlist ownership gap by registering bounded Discord actions through the existing discord_admin authority. Keep credentials, config, transport, and 403 policy with the canonical owner, remove the parallel public tool, and merge current upstream main before publication. Signed-off-by: Axl Ibiza <andrexibiza@gmail.com>
Correct the Discord REST v10 wire contract, attach permission overwrite operations to the canonical discord_admin owner, and fail closed unless the target channel belongs to the active request guild. This stack depends on the bounded Discord action seam in NousResearch#86432. Signed-off-by: Axl Ibiza <andrexibiza@gmail.com>
Exact-head closure receiptVerified the live A5 guild-settings head
This closes the author-side consumer/topology/hosted-verification residue for A5: the action is now owned by the canonical |
Summary
Implements Discord Feature Package A5 as a request-owned action on the existing
discord_adminauthority.Exact head:
d4364a5d960ae0057b078059cdb9ecb6e0101322Current-main parent:
4a5b6dd4512a10c3c18da3e5b9e5c7fb681cbfbbCurrent diff: seven files; no second public model tool.
Root cause closed
The prior branch had two contradictory shapes:
PATCH /guilds/{guild_id}request builder; anddiscord_guild_settingsmodel tool that duplicated token, allowlist, transport, and error ownership.That second tool could not participate correctly in
discord.server_actions: the canonical allowlist validates names againstdiscord_tool._ACTIONS, where the parallel action did not exist. Explicit allowlists therefore made the action impossible to enable, while tests hid the defect by monkeypatching the loader.This head removes that parallel ownership model. Bounded feature modules now contribute action metadata to the canonical
discord/discord_admintools, while the existing owner retains credentials, config policy, REST transport, dynamic schema, and 403 enrichment.Runtime contract
edit_current_guild_settings(settings)is exposed only throughdiscord_adminand:HERMES_SESSION_SCOPE_ID;guild_idfor this action;discord.server_actionsallowlist;false,0, andnullvalues;MANAGE_GUILDguidance on Discord 403 responses.The scalar request builder remains transport-free and restricted to approved settings.
Architectural seam
tools/discord_api/action_registry.pydefines bounded action metadata and rejects duplicate ownership/schema ambiguity.tools/discord_action_extensions_tool.pycomposes discovered actions into the existing public tools without growingtools/discord_tool.pyor registering another model surface.tools/discord_api/guild_settings_action.pyowns only A5 request-context validation and payload composition; credentials and transport remain canonical.This seam is reusable by the remaining Discord admin packages instead of repeating the same ownership bug.
Verification
Local pre-publication receipts:
The original guild-settings builder suite is retained. Hosted acceptance is exact-head CI attached to
d4364a5d960ae0057b078059cdb9ecb6e0101322; no earlier green run is inherited.Fixes #86431
Part of #79564