Text chat 36: fluxer-proto channel types: forums, media, links, announcements, thread admin (#321) #351

Manually merged
charles merged 0 commits from textchat-36-proto-channel-types into textchat 2026-11-13 08:46:39 +00:00
Owner

Implements spec section 18.3 in fluxer-proto (plan Task 36).

  • Channel parent fields: url, flags, applied_tags, member_ids_preview, available_tags, default_reaction_emoji, default_sort_order, default_forum_layout, default_tag_setting, default_auto_archive_duration, default_thread_rate_limit_per_user (lenient, serde(default), skipped when empty so old fixtures round-trip byte for byte); newly_created read from THREAD_CREATE, never serialised.
  • ChannelFlags, ForumTag, DefaultReaction, ForumSortOrder, ForumLayout (unknown kept), ForumTagSetting (unknown -> MatchSome).
  • models::forum: forum post create/created, thread search query/response (202 -> NotReady), post data, limits; models::thread: archived threads, edit thread (only set fields), member settings patch, follow/crosspost, purge result.
  • Gateway: GuildSubscription.{threads, thread_member_lists} (old frames identical), op 28 RequestForumUnreads, FORUM_UNREADS and THREAD_MEMBER_LIST_UPDATE dispatches.
  • Fixtures shaped from the server files named in the fixture commit (b047b68).
  • Tests: tests/channel_types.rs (24 tests + proptest arbitrary_parent_fields_never_panic), spec contract against spec/openapi.json.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green on f5cd92e (merged with origin/textchat).

Closes #321

🤖 Generated with Claude Code

Implements spec section 18.3 in `fluxer-proto` (plan Task 36). - Channel parent fields: `url`, `flags`, `applied_tags`, `member_ids_preview`, `available_tags`, `default_reaction_emoji`, `default_sort_order`, `default_forum_layout`, `default_tag_setting`, `default_auto_archive_duration`, `default_thread_rate_limit_per_user` (lenient, `serde(default)`, skipped when empty so old fixtures round-trip byte for byte); `newly_created` read from THREAD_CREATE, never serialised. - `ChannelFlags`, `ForumTag`, `DefaultReaction`, `ForumSortOrder`, `ForumLayout` (unknown kept), `ForumTagSetting` (unknown -> MatchSome). - `models::forum`: forum post create/created, thread search query/response (202 -> `NotReady`), post data, limits; `models::thread`: archived threads, edit thread (only set fields), member settings patch, follow/crosspost, purge result. - Gateway: `GuildSubscription.{threads, thread_member_lists}` (old frames identical), op 28 `RequestForumUnreads`, `FORUM_UNREADS` and `THREAD_MEMBER_LIST_UPDATE` dispatches. - Fixtures shaped from the server files named in the fixture commit (b047b68). - Tests: `tests/channel_types.rs` (24 tests + proptest `arbitrary_parent_fields_never_panic`), spec contract against `spec/openapi.json`. Local gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green on f5cd92e (merged with origin/textchat). Closes #321 🤖 Generated with [Claude Code](https://claude.com/claude-code)
REST fixtures, each shaped from the fork's server source (ba98441b4):
- channel_forum/media/announcement/link/personal_notes.json:
  fluxer_api/src/api/channel/ChannelMappers.ts:96-172 (serializeThreadOnlyChannel,
  serializeGuildTextChannel, serializeGuildLinkChannel, serializeDMPersonalNotesChannel)
  plus services/thread/ThreadParentSettings.ts:180-222 (mapThreadParentFields: forum and
  media always carry flags, available_tags, default_tag_setting; media lacks
  default_forum_layout; text parents only the set default_*)
- thread_private/thread_announcement.json, forum_post_created.json:
  services/thread/ThreadMappers.ts:58-92 (invitable only on private threads; posts carry
  applied_tags and member_ids_preview) and ThreadCreationService.ts:292
  ({...mapThreadToResponse(view), message}), schema ForumRequestSchemas.ts:168-173
- thread_search.json, thread_search_not_ready.json: ForumRequestSchemas.ts:242-276,
  services/thread/ThreadForumService.ts:110-195 and
  packages/errors/src/domains/channel/SearchIndexNotReadyError.ts (202,
  {code, message, documents_indexed, retry_after}; FluxerError.toJSON)
- post_data.json: ForumRequestSchemas.ts:181-206, ThreadForumService.ts:60-100
- archived_threads.json: S/channel/ThreadRequestSchemas.ts:109-118
- followed_channel.json: S/channel/ChannelFollowSchemas.ts:12-15
- crosspost_source.json: S/message/CrosspostSourceSchemas.ts
- crosspost_message.json: services/message/CrosspostDeliveryService.ts:384-420 and the
  webhook author of fluxer_messages/src/shard_impl.rs:1456-1470
- purge_notes.json: api/channel/controllers/MessageController.ts:414-427

Gateway fixtures:
- forum_unreads.json: fluxer_gateway/src/guild/guild_request_forum_unreads.erl:207-285
- thread_member_list_update.json: guild_thread_subscriptions.erl:535-578
- thread_create_forum_post.json: services/thread/ThreadDispatch.ts:26-39 as forwarded by
  guild_thread_dispatch.erl:467-471 (public_payload drops member_ids_preview)
- lazy_request_threads.json: guild_unified_subscriptions.erl:140-165

Refs #321

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Channel parent fields (tags, default reaction, sort order, layout, tag
setting, defaults), channel flags, forum post create/search/post-data,
archived threads, thread edit and member settings, follow/crosspost,
purge result, lazy request thread fields, op 28 RequestForumUnreads and
the FORUM_UNREADS / THREAD_MEMBER_LIST_UPDATE dispatches (spec 18.3).

Refs #321

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Review round 1, changes per finding:

  1. Branch did not exist / nothing to review: the implementation (12 modified files, new models/forum.rs, gateway/forum.rs, tests/channel_types.rs) is now committed as 4601091 feat(proto): forum, media, link, announcement and thread admin types on top of the fixture commit b047b68, merged with origin/textchat (f5cd92e), pushed to textchat-36-proto-channel-types, and opened as this PR. Diff to review: 9fcc13d..origin/textchat-36-proto-channel-types.
  2. cargo xtask ci never finished: re-ran FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on f5cd92e with no other cargo build running; it completed with all steps passed (channel_types: 24 tests plus the proptest, all ok; livekit-interop skipped as usual).
Review round 1, changes per finding: 1. **Branch did not exist / nothing to review**: the implementation (12 modified files, new `models/forum.rs`, `gateway/forum.rs`, `tests/channel_types.rs`) is now committed as 4601091 `feat(proto): forum, media, link, announcement and thread admin types` on top of the fixture commit b047b68, merged with origin/textchat (f5cd92e), pushed to `textchat-36-proto-channel-types`, and opened as this PR. Diff to review: `9fcc13d..origin/textchat-36-proto-channel-types`. 2. **cargo xtask ci never finished**: re-ran `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on f5cd92e with no other cargo build running; it completed with `all steps passed` (channel_types: 24 tests plus the proptest, all ok; livekit-interop skipped as usual).
Task 18's channel_of builds a Channel literal; Task 36 adds forum/thread
fields to Channel, so the merge needs them set (flags from the thread).

Refs #321

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged origin/textchat (7a0678e) into the branch. Task 18 (core threads) builds a Channel literal in fluxer-core/src/chat/threads.rs::channel_of, so the merge needed the new Task 36 fields filled in (c66a96e, flags taken from the thread, the rest empty/None). This is the only change outside fluxer-proto. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on c66a96e: all steps passed.

Merged origin/textchat (7a0678e) into the branch. Task 18 (core threads) builds a `Channel` literal in `fluxer-core/src/chat/threads.rs::channel_of`, so the merge needed the new Task 36 fields filled in (c66a96e, `flags` taken from the thread, the rest empty/None). This is the only change outside fluxer-proto. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on c66a96e: all steps passed.
# Conflicts:
#	crates/fluxer-proto/src/lib.rs
#	crates/fluxer-proto/tests/models_roundtrip.rs
#	crates/fluxer-proto/tests/spec_contract.rs
Author
Owner

Independent review: Text chat 36 (proto channel types)

Reviewed 67da1c7..400a708 (b047b68 fixtures, 4601091 feat, c66a96e core fix, merges).

Checks

  1. Plan tests: all 25 named tests are in crates/fluxer-proto/tests/channel_types.rs, plus spec_contract_channel_type_requests in tests/spec_contract.rs (against spec/openapi.json). They assert the spec's values: flags bits 1<<1/1<<4/1<<15, layout 0/1/2, sort 0/1, match_some default, limits 20/5/50/4096/25/9975/100/40/25, op 28, 202 retry_after, repeated tag, ISO before.
  2. Interfaces: every name in the Task 36 Interfaces block exists with the stated shape. That covers the Channel fields (lenient, skipped when empty, newly_created read but never written), ChannelFlags, ForumTag::emoji, DefaultReaction::as_reaction_emoji, the enums with Unknown kept, every request/answer type, GuildSubscription.{threads, thread_member_lists}, RequestForumUnreads::into_envelope, the two GatewayEvent variants, TYPED_DISPATCH_NAMES += 2, and the forum:: limit constants. Opcode::RequestForumUnreads = 28 was already on the base.
  3. Invariants: fluxer-proto stays pure data. fluxer-core gains no dependency. Fixtures match the server source I checked against: ThreadParentSettings.ts:180-222 (forum always has flags/tags/tag_setting, media has no layout, text parents get only the set defaults), guild_request_forum_unreads.erl (count capped at 25 or missing), guild_thread_subscriptions.erl:562-578, ThreadDispatch.ts:26-39, ForumRequestSchemas.ts, CrosspostSourceSchemas.ts, MessageController.ts purge, and ThreadConstants.ts. Commit b047b68 names each source file. The proptest shows malformed parent fields never cost the channel. No secrets, signed URLs or paths.
  4. Review Focus: no item belongs to Task 36 (7 is Tasks 1/23); the parent-field proptest covers its spirit.
  5. Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree on 400a708: green (exit 0).

Findings

  • minor: c66a96e changes crates/fluxer-core/src/chat/threads.rs (channel_of), which is outside the Files list. It is the minimal change that lets core compile against the new Channel fields (it fills defaults and copies flags) and adds no dependency. Acceptable; noted for scope.
  • minor: CrosspostSourceGuild.{icon, banner, description, features} are not read leniently. A wrong-typed value from the server fails the whole crosspost-source answer (an error, not a panic). Consider lenient_option when Task 37/48 consume it.

Verdict: approve. No blocking findings, and local CI is green.

## Independent review: Text chat 36 (proto channel types) Reviewed `67da1c7..400a708` (b047b68 fixtures, 4601091 feat, c66a96e core fix, merges). **Checks** 1. Plan tests: all 25 named tests are in `crates/fluxer-proto/tests/channel_types.rs`, plus `spec_contract_channel_type_requests` in `tests/spec_contract.rs` (against `spec/openapi.json`). They assert the spec's values: flags bits 1<<1/1<<4/1<<15, layout 0/1/2, sort 0/1, `match_some` default, limits 20/5/50/4096/25/9975/100/40/25, op 28, 202 `retry_after`, repeated `tag`, ISO `before`. 2. Interfaces: every name in the Task 36 Interfaces block exists with the stated shape. That covers the Channel fields (lenient, skipped when empty, `newly_created` read but never written), `ChannelFlags`, `ForumTag::emoji`, `DefaultReaction::as_reaction_emoji`, the enums with `Unknown` kept, every request/answer type, `GuildSubscription.{threads, thread_member_lists}`, `RequestForumUnreads::into_envelope`, the two `GatewayEvent` variants, `TYPED_DISPATCH_NAMES` += 2, and the `forum::` limit constants. `Opcode::RequestForumUnreads = 28` was already on the base. 3. Invariants: fluxer-proto stays pure data. fluxer-core gains no dependency. Fixtures match the server source I checked against: `ThreadParentSettings.ts:180-222` (forum always has flags/tags/tag_setting, media has no layout, text parents get only the set defaults), `guild_request_forum_unreads.erl` (count capped at 25 or `missing`), `guild_thread_subscriptions.erl:562-578`, `ThreadDispatch.ts:26-39`, `ForumRequestSchemas.ts`, `CrosspostSourceSchemas.ts`, `MessageController.ts` purge, and `ThreadConstants.ts`. Commit b047b68 names each source file. The proptest shows malformed parent fields never cost the channel. No secrets, signed URLs or paths. 4. Review Focus: no item belongs to Task 36 (7 is Tasks 1/23); the parent-field proptest covers its spirit. 5. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree on 400a708: **green (exit 0)**. **Findings** - minor: c66a96e changes `crates/fluxer-core/src/chat/threads.rs` (`channel_of`), which is outside the Files list. It is the minimal change that lets core compile against the new `Channel` fields (it fills defaults and copies `flags`) and adds no dependency. Acceptable; noted for scope. - minor: `CrosspostSourceGuild.{icon, banner, description, features}` are not read leniently. A wrong-typed value from the server fails the whole crosspost-source answer (an error, not a panic). Consider `lenient_option` when Task 37/48 consume it. **Verdict: approve.** No blocking findings, and local CI is green.
charles manually merged commit 15154126d0 into textchat 2026-11-13 08:46:39 +00:00
Sign in to join this conversation.
No description provided.