Repository navigation
spec: enum where it decides shape or is user-facing, string for UI plumbing - #124
Merged
Merged
Conversation
…umbing Documented in CONTRIBUTING.md. From a census of 858 stored responses: back to enum: LimitedAction.action / LimitedActionResultsData.action (19 values), ConversationControl.policy (6, incl. Co), TweetCardLegacyBindingValueData.type (5), Community.role aligned with AuthorCommunityRelationship.role. To plain string with the known values in comments: 24 UI fields (prompt / cover / alert display styles, feedback icon and kind, community action reasons, footer icon, card fetch state, CTA type, ...). 805 stored responses still at match rate exactly 1.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #123. Applies one rule to every enum in the spec and writes it down in CONTRIBUTING.md:
enumwhen the value decides the shape of the data or the branch a client takes (__typename,itemType,*Ref.type,cursorType,urlType,media.type, binding valuetype), or when it is user-facing and a closed set. A new value should fail loudly in the strict test and be added the same day. twitter-snap is the reference consumer: anything a renderer branches on belongs here.stringwhen the value is UI plumbing that changes nothing structurally. Known values stay in a comment next to the field.The lists below come from a census of every enum-like value in 858 stored responses (the two strict sweeps, the HAR capture, the nightly and drift recordings).
Back to
enum(user-facing, closed)LimitedAction.action/LimitedActionResultsData.action: 19 observed values (Reply, Retweet, QuoteTweet, Like, React, AddToBookmarks, AddToMoment, PinToProfile, ViewHiddenReplies, VoteOnPoll, ShowRetweetActionMenu, ReplyDownVote, SendViaDm, ViewPostEngagements, CopyLink, ShareTweetVia, Embed, HideCommunityTweet, ViewTweetActivity). What a user may do with a tweet.ConversationControl.policy: ByInvitation, Community, Co, Subscribers, Verified, MyNetwork.Cois what X sends for some Community-limited tweets (39 occurrences). Who may reply.TweetCardLegacyBindingValueData.type: STRING, IMAGE, USER, BOOLEAN, IMAGE_COLOR. Decides which*_valueis present; twitter-snap reads cards through it.Community.role: Member, Moderator, Admin, NonMember (was[NonMember]; same backend enum asAuthorCommunityRelationship.role).To plain
string(UI plumbing, 24 fields)Session.superFollowsApplicationStatus,ModuleHeader.displayType,TimelinePromptContent.contentType/.displayType,TimelineMessagePromptContent.contentType,TimelineTombstone.tombstoneDisplayType,TimelineTopicContext.functionalityType,TimelineShowAlert.alertType/.displayLocation,TimelineHalfCover.halfCoverDisplayType,CoverCta.buttonStyle,CtaClientEventInfo.action,FeedbackAction.confirmationDisplayType/.icon,UnifiedCard.card_fetch_state,Community{Delete,Leave}ActionResult.reason,CommunityJoinActionUnavailable.reason,CommunityInvitesResult.reason,BirdwatchPivot.footerIconType,TweetCardPlatformAudience.name,TweetPostCta.display_locations[],CtaLimitedActionPrompt.cta_type.Kept as
enum(all observed values already present):TypeName,InstructionType,ContentEntryType,ContentItemType,CursorType,DisplayType,tweetDisplayType,userDisplayType, every*Ref.type/urlType,TimelineGeneralContext.contextType,TimelineCoverBehavior.type,TweetInterstitial.displayType,Media.type,MediaSize.resize,ExtMediaAvailability.status,TweetView.state,richtext_types,TweetLegacy.limited_actions,verified_type,profile_image_shape,parody_commentary_fan_label,professional_type,UserLabel.*, birthdate visibilities,TwitterList.mode, communityjoin_policy/invites_policy,AuthorCommunityRelationship.role,BirdwatchPivot.visualStyle,ai_generated_detection_source.Generated clients
The Python enum classes of the 24 fields disappear and three new ones appear (limited action, policy, binding value type). Neither wrapper, twitter-snap nor the snap apps reference any of the removed classes (checked by grep; twitter-snap uses
RichtextTypesEnumandTimelineTweetTweetDisplayTypeEnum, both kept).Verification
errorsbeside complete data and are logged as warnings.🤖 Generated with Claude Code