Server admin 9a: fluxer-core administration ports: actions, requests, confirms, state skeleton #675

Closed
opened 2026-11-15 19:01:11 +00:00 by charles · 0 comments
Owner

Task 9a of the Server administration plan (docs/superpowers/plans/2026-11-15-serveradmin.md, section "### Task 9a:"). The plan on the serveradmin branch is the source of truth; this copy is for reading.

Closes: —
Depends on: 1, 2, 3

Lands every enum variant and type the later core tasks fill, so that after it no task edits event.rs or effect.rs except to fill a stub. Touches two crates (the runtime must answer the new requests): serialised, nothing else of this plan is in apps/fluxer until Task 22.

Files:

  • Create: crates/fluxer-core/src/admin/{mod.rs,perms.rs,perm_spec.rs,form.rs,guild.rs,roles.rs,members.rs,bans.rs,invites.rs,channel.rs,overwrites.rs,reorder.rs,sudo.rs} (each with its state type, Default, a stub reducer wired into App::apply, stub selectors returning empty models)
  • Modify: crates/fluxer-core/src/{event.rs,effect.rs,app.rs,lib.rs}, crates/fluxer-core/src/chat/actions.rs (new Confirm variants), crates/fluxer-ui/src/screens/main/message_actions/confirm.rs (the exhaustive match draws nothing for the new variants until Task 27), apps/fluxer/src/runtime.rs (each new ApiRequest answers 501 CLIENT_NOT_WIRED until Task 22), README
  • Test: crates/fluxer-core/tests/admin_ports.rs

Interfaces:

  • Produces: UserAction::Admin(AdminAction) with AdminAction::{OpenGuildSettings { guild_id, tab }, OpenChannelSettings { channel_id, tab }, SelectTab(..), CloseSettings, Form(FormAction::{Edit(FieldEdit), Reset, Save}), Role(RoleAction::{Create, Select, Edit(RoleEdit), TogglePermission, ClearPermissions, Move(RoleMove), Duplicate, Delete { confirmed }, Search}), Member(MemberAction::{OpenNickname, SetNickname, ToggleRole, OpenTimeout, Timeout { duration, reason }, RemoveTimeout { confirmed }, Kick { confirmed }, OpenBan, Ban(BanForm), OpenTransfer, Transfer { confirmed }}), Bans(BanListAction::{Search, Details, Revoke { confirmed }}), Invites(InviteListAction::{Revoke { confirmed }, SetPaused { paused, confirmed }}), MembersPage(MembersPageAction), Channel(ChannelAdminAction::{Delete { confirmed }, OpenDuplicate, Duplicate { name }, SetAnnouncement { on, confirmed }}), Overwrite(OverwriteAction::{Select, Add(OverwriteTarget), Set { permission, state }, SetAll(state), Remove, SyncWithCategory, Search, SearchTargets}), MoveChannel(ChannelMove), DeleteGuild { confirmed }, Sudo(SudoAction::{Submit(SudoAnswer), Cancel}), CloseModal, DismissError}. SudoAnswer carries the secret in a type whose Debug prints … and which is not Serialize.

  • ApiRequest/ApiResult pairs for every method of Tasks 4 and 5 (UpdateGuild, DeleteGuild, TransferOwnership, CreateRole, UpdateRole, DeleteRole, UpdateRolePositions, UpdateChannel, UpdateChannelPositions, FetchFollowerStats, UpdateMember, UpdateOwnMember, AddMemberRole, RemoveMemberRole, KickMember, BanMember, FetchBans, UnbanMember, SearchMembers, FetchGuildInvites, DeleteInvite, FetchRtcRegions if no request exists for it yet); the three sudo-capable ones carry sudo: Option<SudoAnswer>; CoreEvent::SudoToken { valid_until } (the runtime tells the store it holds a token; the store never sees it). Existing EditChannel, DeleteChannel and #663's create request are kept unchanged.

  • chat::Confirm gains DeleteChannel { channel_id }, DeleteRole { guild_id, role_id }, KickMember { guild_id, user_id }, RemoveTimeout { .. }, RevokeBan { .. }, RevokeInvite { code }, PauseInvites { guild_id, paused }, AnnouncementOff { channel_id, followers }, DeleteGuild { guild_id }, TransferOwnership { guild_id, user_id } — the one store confirm, closed by CloseConfirm.

  • app.admin: Admin as spec §6.1, all None/empty; MenuItemId gains the new row ids (kebab-case, as the existing ones).

  • Step 1: Write failing tests: state_defaults, stubs_emit_nothing, new_confirm_variants_close_with_close_confirm, sudo_answer_debug_hides_the_secret, logout_resets_admin_state, existing_tests_untouched (run the whole suite).

  • Step 2–5: FAIL → implement → PASS → commit feat(core): administration ports.

Task 9a of the Server administration plan (`docs/superpowers/plans/2026-11-15-serveradmin.md`, section "### Task 9a:"). The plan on the `serveradmin` branch is the source of truth; this copy is for reading. **Closes:** — **Depends on:** 1, 2, 3 Lands every enum variant and type the later core tasks fill, so that after it no task edits `event.rs` or `effect.rs` except to fill a stub. Touches two crates (the runtime must answer the new requests): serialised, nothing else of this plan is in `apps/fluxer` until Task 22. **Files:** - Create: `crates/fluxer-core/src/admin/{mod.rs,perms.rs,perm_spec.rs,form.rs,guild.rs,roles.rs,members.rs,bans.rs,invites.rs,channel.rs,overwrites.rs,reorder.rs,sudo.rs}` (each with its state type, `Default`, a stub reducer wired into `App::apply`, stub selectors returning empty models) - Modify: `crates/fluxer-core/src/{event.rs,effect.rs,app.rs,lib.rs}`, `crates/fluxer-core/src/chat/actions.rs` (new `Confirm` variants), `crates/fluxer-ui/src/screens/main/message_actions/confirm.rs` (the exhaustive `match` draws nothing for the new variants until Task 27), `apps/fluxer/src/runtime.rs` (each new `ApiRequest` answers 501 `CLIENT_NOT_WIRED` until Task 22), README - Test: `crates/fluxer-core/tests/admin_ports.rs` **Interfaces:** - Produces: `UserAction::Admin(AdminAction)` with `AdminAction::{OpenGuildSettings { guild_id, tab }, OpenChannelSettings { channel_id, tab }, SelectTab(..), CloseSettings, Form(FormAction::{Edit(FieldEdit), Reset, Save}), Role(RoleAction::{Create, Select, Edit(RoleEdit), TogglePermission, ClearPermissions, Move(RoleMove), Duplicate, Delete { confirmed }, Search}), Member(MemberAction::{OpenNickname, SetNickname, ToggleRole, OpenTimeout, Timeout { duration, reason }, RemoveTimeout { confirmed }, Kick { confirmed }, OpenBan, Ban(BanForm), OpenTransfer, Transfer { confirmed }}), Bans(BanListAction::{Search, Details, Revoke { confirmed }}), Invites(InviteListAction::{Revoke { confirmed }, SetPaused { paused, confirmed }}), MembersPage(MembersPageAction), Channel(ChannelAdminAction::{Delete { confirmed }, OpenDuplicate, Duplicate { name }, SetAnnouncement { on, confirmed }}), Overwrite(OverwriteAction::{Select, Add(OverwriteTarget), Set { permission, state }, SetAll(state), Remove, SyncWithCategory, Search, SearchTargets}), MoveChannel(ChannelMove), DeleteGuild { confirmed }, Sudo(SudoAction::{Submit(SudoAnswer), Cancel}), CloseModal, DismissError}`. `SudoAnswer` carries the secret in a type whose `Debug` prints `…` and which is not `Serialize`. - `ApiRequest`/`ApiResult` pairs for every method of Tasks 4 and 5 (`UpdateGuild`, `DeleteGuild`, `TransferOwnership`, `CreateRole`, `UpdateRole`, `DeleteRole`, `UpdateRolePositions`, `UpdateChannel`, `UpdateChannelPositions`, `FetchFollowerStats`, `UpdateMember`, `UpdateOwnMember`, `AddMemberRole`, `RemoveMemberRole`, `KickMember`, `BanMember`, `FetchBans`, `UnbanMember`, `SearchMembers`, `FetchGuildInvites`, `DeleteInvite`, `FetchRtcRegions` if no request exists for it yet); the three sudo-capable ones carry `sudo: Option<SudoAnswer>`; `CoreEvent::SudoToken { valid_until }` (the runtime tells the store it holds a token; the store never sees it). Existing `EditChannel`, `DeleteChannel` and #663's create request are kept unchanged. - `chat::Confirm` gains `DeleteChannel { channel_id }`, `DeleteRole { guild_id, role_id }`, `KickMember { guild_id, user_id }`, `RemoveTimeout { .. }`, `RevokeBan { .. }`, `RevokeInvite { code }`, `PauseInvites { guild_id, paused }`, `AnnouncementOff { channel_id, followers }`, `DeleteGuild { guild_id }`, `TransferOwnership { guild_id, user_id }` — the one store confirm, closed by `CloseConfirm`. - `app.admin: Admin` as spec §6.1, all `None`/empty; `MenuItemId` gains the new row ids (kebab-case, as the existing ones). - [ ] **Step 1: Write failing tests**: `state_defaults`, `stubs_emit_nothing`, `new_confirm_variants_close_with_close_confirm`, `sudo_answer_debug_hides_the_secret`, `logout_resets_admin_state`, `existing_tests_untouched` (run the whole suite). - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(core): administration ports`.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#675
No description provided.