Text chat 42: apps/fluxer channel-type runtime (#327) #450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-42-app-channel-types-runtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this builds
Text chat 42 (
apps/fluxerchannel-type runtime, spec §18.3/§18.4):runtime::perform_chatnow carries out every Phase 5ApiRequestof Task 38 through Task 37's calls:FetchChannel(GET, retried),CreateForumPost(JSON),SearchThreads(HTTP 202 →ThreadSearchResponse::NotReady, retried GET),PostData(fluxer-api splits into calls of 100),ArchivedThreads(Public/Private page by archive timestamp, MinePrivate by thread id),EditThread,DeleteChannel,Add/RemoveThreadMember,PatchThreadMemberSettings,Crosspost,CrosspostSource(retried GET),FollowChannel,PurgeNotes, each answered with the matchingApiResult. No request returnsCLIENT_NOT_WIREDany more.upload_rt:UploadCommand::StartForumPostruns as a job like a message send: multipartPOST /channels/{forum}/threads(payload_json+files[n]) or the presigned flow (presign/PUT/complete in the forum, then the JSON post withupload_filenameper attachment), with throttled progress andUploadEvent::ForumPostDone(orFailed), cancellable by nonce. The upload code was generalised over a smallJobview (nonce, presign channel, attachment entries, files) so both kinds share the multipart and presigned paths; the message path behaves as before.threads: true) and op 28 frames already go out through the existingEffect::SendGateway; the tests confirm the forum's posts arrive byTHREAD_LIST_SYNC.upload_rt::perform_upload(doc-hidden, likeperform_chat): runs oneUploadCommandinline and returns its reports, for end-to-end tests of jobs the store does not start yet (Task 39 starts forum posts).apps/fluxerdescribes the new requests and forum-post jobs; thefluxer-coreREADME line saying the runtime fails them is updated.How it was tested
apps/fluxer/tests/channel_types_runtime.rsagainst the in-process devserver (textchatandtextchat_presignedscenarios):forum_opens_with_posts_after_thread_sync,create_post_with_image_multipart_then_opens_it,create_post_with_image_presigned_then_opens_it(extra),forum_post_without_files_is_json(extra),thread_search_not_ready_then_results,unknown_thread_fetched_and_messages_shown,crosspost_round_trip(with follow and crosspost-source),purge_notes_round_trip,thread_administration_requests_round_trip(extra: fetch, edit, members, settings, all three archived lists, delete).I ran them before the change and watched them fail (
CLIENT_NOT_WIRED, "forum post uploads are not supported yet"), then pass.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green locally. No test needs a display, clipboard, file dialog or the live instance.Deviations from the plan
perform_chat/perform_uploaddirectly, as the Text chat 21 tests do. Where the store already acts (op 14 subscription, opening an unknown thread, gateway echoes such asMESSAGE_UPDATE,MESSAGE_DELETE_BULK,THREAD_CREATE, theCHANNEL_FOLLOW_ADDmessage) the tests check the store.forum_opens_with_posts_after_thread_syncandunknown_thread_fetched_and_messages_showndepend partly on code that was already wired (Task 38 +SendGateway). The first one also checksPostData, which failed before this change; the second one passed only afterFetchChannelwas wired.ApiRequest::ArchivedThreadshas nolimit, so the runtime asks for 50 per page (the server's default, and what the original's thread browser gets). The original's forum fallback asks for 25; if Task 39 needs that, the request should get alimitfield. Abeforeof the wrong kind for the list (which the store never sends) starts from the newest page.SelectGuild.Stacked on: textchat-37-api-channel-types, textchat-38-core-channel-routing, textchat-41-devserver-channel-types
Follow-up from review: #454 (ArchivedThreads has no limit). Branch updated with current textchat and textchat-38-core-channel-routing (
666d3aa); FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green again.Closes #327
🤖 Generated with Claude Code
The textchat scenario serves the channel types of spec §18.6: READY lists only the joined active threads; op 14 `threads: true` answers with a THREAD_LIST_SYNC of the guild and `thread_member_lists` with THREAD_MEMBER_LIST_UPDATE; op 28 answers FORUM_UNREADS. REST: GET /channels/{id}, forum and media posts (JSON and multipart, tag rules, starter id = post id, THREAD_CREATE then MESSAGE_CREATE), thread search (202 on the first call per channel, then filtered, sorted and paged, with first_messages), post-data, the archived lists, PATCH/DELETE of threads, thread members and member settings, crosspost and crosspost-source, followers (CHANNEL_FOLLOW_ADD notice) and the personal notes purge. Thread and forum routes are a 404 without X-Fluxer-Features: channel_threads; `thread_search = false` turns the search off. Refs #326 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Independent review: Text chat 42 (app channel-type runtime)
Reviewed
df84215..0d1cec6(runtime.rs, upload_rt.rs, tests/channel_types_runtime.rs, two README lines).Plan tests (1): all 6 named tests exist (
forum_opens_with_posts_after_thread_sync,create_post_with_image_multipart_then_opens_it,thread_search_not_ready_then_results,unknown_thread_fetched_and_messages_shown,crosspost_round_trip,purge_notes_round_trip) and run against the devservertextchatscenario. There are 3 more tests: a presigned post, a JSON post and a thread-admin round trip.Interfaces (2): every Phase 5
ApiRequestis executed inperform_chatthrough Task 37's calls and returns the Task 38ApiResultvariants. The exhaustive list arm is gone, so nothing falls through tonot_a_chat_request.UploadCommand::StartForumPostruns multipart (create_forum_post_with_files) or presigned in the forum, then the JSON post withupload_filename, and reports progress andUploadEvent::ForumPostDone. Op 14 and op 28 go out unchanged throughEffect::SendGateway. The message upload path was refactored intoJobwithout changing its behaviour; the Text chat 21 tests still pass.Invariants (3): only
apps/fluxerchanged. No new dependencies or fixtures. Logs contain only the file count and mode, with no paths or URLs. The forum multipart call and the presign/PUT/complete calls are unobserved in fluxer-api, so--recorddoes not see them. The JSON post after a presign is observed, the same as the existing message path, and it holds onlyupload_filenamekeys. Archivedbeforeof the wrong kind is ignored and does not panic.Review Focus (4): items 4 and 5 (upload flow shape, no leaks) hold for forum posts, which use the same code path as messages.
CI (5):
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green in the review worktree (all steps passed; channel_types_runtime 9/9).Findings
apps/fluxer/src/runtime.rsARCHIVED_PAGE = 50:ApiRequest::ArchivedThreadshas no limit, so every archived list asks for 50. Spec §18.2.1 (design doc line 990) says the forum fallback isthreads/archived/public?...&limit=25. Task 39's fallback will page by 50 rather than the original's 25. This is not a data problem, but Task 39 should either add alimitto the request or accept 50. Suggest a follow-up issue.apps/fluxer/tests/channel_types_runtime.rs(crosspost_round_trip, the CrosspostSource part): the test passes on any HTTP error exceptCLIENT_NOT_WIRED.PUBLISHEDis the source message in #releases (not anIS_CROSSPOSTcopy), so the devserver answers UNKNOWN_MESSAGE and the success branch never runs. Pointing it at a crossposted copy or the follow notice in #general would actually test theCrosspostSourceresult.Verdict: approve. No blocking findings; local CI is green.
🤖 Generated with Claude Code
Independent review: Text chat 42 (channel-type runtime), head
666d3aaScope: task commits
8dfde6dand0d1cec6against basedf84215, plus the merges into666d3aa. After the merges, onlyruntime.rschanged in the task's files (+8/-2).Checks
forum_opens_with_posts_after_thread_sync,create_post_with_image_multipart_then_opens_it,thread_search_not_ready_then_results,unknown_thread_fetched_and_messages_shown,crosspost_round_tripandpurge_notes_round_trip. Three more were added: the presigned forum post, the JSON post with a 400 when the tag is missing, and a round trip of the thread administration calls. The values match the fixtures and the spec: 23 active posts in #ideas, 30 search results, 4 purged notes, the starter's id equal to the post id, andCROSSPOSTEDset.perform_chatnow handles every Phase 5ApiRequest(the not-wired fallback is gone) and builds the matchingApiResultvariants from Task 38.UploadCommand::StartForumPostuses the multipart path or the presigned path (presign in the forum, then the JSON post withupload_filename, asForumCommands.ts:58-102does). It reports throttled progress, thenUploadEvent::ForumPostDone, orFailedon an error. Op 14 goes out through the existingEffect::SendGateway, which the forum test exercises. Nothing another task consumes was renamed.ApiError/CoreError, never as a panic.Jobstruct now shares. The message path behaves as before.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin the review worktree: green ("all steps passed"; channel_types_runtime 9/9).Findings
runtime.rsARCHIVED_PAGE = 50: spec §18.2.1 says the forum fallback (threads/archived/public) asks forlimit=25.ApiRequest::ArchivedThreads(Task 38) has no limit field, so this cannot be fixed here without changing an interface. Follow-up #454 tracks it and the PR links it. Acceptable.channel_types_runtime.rscrosspost_round_trip: theCrosspostSourcecall targets the source messagePUBLISHED. The devserver answers UNKNOWN_MESSAGE for it, because it only answers for copies (IS_CROSSPOST) orCHANNEL_FOLLOW_ADDnotices (forums.rs:1092). So theOkbranch never runs, and the assertion only proves the request is wired. Pointing it at the follow notice the test has just created in #general would check the success path. This is not blocking: the endpoint mapping itself is covered by the Task 37 wiremock tests.Verdict: approve. No blocking findings, and local CI is green.