Repository navigation
Conversation
Adds convertListingToCommunityApp, a read-only conversion from a fyi.atstore.listing.detail record to community.lexicon.app.entry or community.lexicon.app.profile. It returns the proposed record when the listing fits the community schema. Otherwise it returns every blocking problem at once, each with a stable code, source and target paths, a message, and actual and allowed lengths where they apply. Information with no community equivalent (slug, categories, the earlier record and game links, link types without a community role) is listed without blocking. Image alt text comes from the caller, since a listing holds none and the community schema requires it. Nothing calls this yet. Limits come from the schemas at tangled.org/lexicon.community/lexicons, commit 47d55d9. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017yeQBcxFaoaDjfVwZ1vgvi
This branch has not been deployed
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.
Work prompted from rainshare.dev
Part of #7. This adds the first piece of the move to the
community.lexicon.appschemas: a read-only conversion from afyi.atstore.listing.detailrecord tocommunity.lexicon.app.entryorcommunity.lexicon.app.profile. Nothing calls it yet. It doesn't publish, and it doesn't touch the database, Tap, login or the UI.This came from Rainshare: https://rainshare.dev/seed/byarielm.fyi/3n2cbhm3kqp2m. An AI agent (Claude Code) did the work for Dame and wrote this description, so "I" below is the agent.
What it does
convertListingToCommunityApp(listing, format, { imageAlt })insrc/lib/atproto/community-app-record.tstakes a listing and a format ("app.entry"or"app.profile") and returns one of:{ ok: true, record, unmapped }when the listing fits the community schema as it stands{ ok: false, problems, unmapped }when it doesn't, with every blocking problem foundEach problem has a stable
code, asourcePath, atargetPathand amessage. Length, count and size problems also carryactualandallowed:{ "code": "too_many_graphemes", "sourcePath": "description", "targetPath": "longDescription", "message": "The description has 4001 characters; the limit is 4000.", "actual": 4001, "allowed": 4000 }The codes are
missing_required_field,missing_image_alt,too_many_graphemes,too_many_bytes,too_many_items,image_too_large,invalid_image,invalid_uri,invalid_didandinvalid_datetime.namenametaglinedescriptiondescriptionlongDescriptionexternalUrllinks[0], with the website rolelinkslinks, withtypemapped to a role where one existsicon,heroImage,screenshotsimages, in that order, with the icon, hero and screenshot purposesappTagstagsproductAccountDidprofileDid(entry only)createdAt,updatedAtcreatedAt,updatedAtunmappedlists what has no place in the community record and stays on the listing:slug,categorySlug,migratedFromAtUri,game, link types with no community role (blog,community,donate,license), andproductAccountDidwhen the format is a profile. None of it blocks conversion.The two formats differ in one field the conversion writes. An entry carries
profileDid. A profile is published from the app's own account, so it has no such field. Entries also havelangsin the schema, which a listing has nothing to fill.Text is never trimmed or truncated. The listing is not modified, and the record shares no objects with it.
Judgment calls
These are the places where the request left room, so they are the ones to check.
alton every image and a listing stores none, so without alt text every listing is blocked bymissing_image_alt, starting with its icon. The function takes alt text asimageAltand never makes any up. If you would rather add alt fields tofyi.atstore.listing.detailand read them from the record, that is a small change here.—tagline is not copied.listing-record.tsand Tap ingest write—when a listing has no tagline. The conversion leavesdescriptionout in that case and says so inunmapped.contactlinks get the support role. The schema describes that role as "Support, help, or contact page."$type,ref.$link,mimeType,size). A legacy blob has no size to check against the 2,000,000-byte limit, so it is reported asinvalid_image.47d55d9(6 October 2026) of tangled.org/lexicon.community/lexicons. I didn't copy the schema files intolexicons/, because that folder is whatpnpm atproto:publish-lexiconspublishes.I haven't looked at live listings, which is out of scope here. From the schemas alone, the limits that tighten most are the long description (20,000 bytes on a listing, 4,000 characters in the community record), hero images and screenshots (12 MB down to 2 MB) and tags (64 down to 10).
How I checked it
pnpm run format:check,lint,typecheck,testandbuildall pass locally. The suite is 212 tests, 65 of them new.@atproto/lexicon0.6.2 loaded with the schema files from tangled. Records at each limit passed and records one past each limit failed, for both formats. That validator doesn't enforce blob size or type, so the 2,000,000-byte andimage/*checks rest on my reading ofdefs.json.What's left for #7
🤖 Generated with Claude Code
https://claude.ai/code/session_017yeQBcxFaoaDjfVwZ1vgvi