-
Notifications
You must be signed in to change notification settings - Fork 7
Project as collection sidecar #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hypercerts-org/lexicon": minor | ||
| --- | ||
|
|
||
| Remove org.hypercerts.claim.project lexicon and replace with org.hypercerts.claim.collection.project sidecar. Projects are now represented as collections with an optional project sidecar (same TID) that provides rich-text descriptions, avatars, and cover photos. Avatar and coverPhoto fields moved from base collection to project sidecar. Collections without the project sidecar are simple groupings; collections with it are "projects" with rich documentation. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hypercerts-org/lexicon": minor | ||
| --- | ||
|
|
||
| Refactor collection lexicon to use items array instead of activities. The items array contains plain strongRefs (com.atproto.repo.strongRef) that can reference activities (org.hypercerts.claim.activity) and/or other collections (org.hypercerts.claim.collection), enabling recursive collection nesting. This change removes the activityWeight object structure from the base collection lexicon. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| "lexicon": 1, | ||
| "id": "org.hypercerts.claim.collection.project", | ||
| "defs": { | ||
| "main": { | ||
| "type": "record", | ||
| "description": "Project-specific metadata for a collection. Uses the sidecar pattern with the same record key (TID) as the collection record. Provides rich-text description capabilities for project-type collections.", | ||
| "key": "tid", | ||
| "record": { | ||
| "type": "object", | ||
| "required": ["projectDescription", "createdAt"], | ||
| "properties": { | ||
| "projectTitle": { | ||
| "type": "string", | ||
| "description": "The title of this collection", | ||
| "maxLength": 800, | ||
| "maxGraphemes": 80 | ||
| }, | ||
| "shortProjectDescription": { | ||
| "type": "string", | ||
| "maxLength": 3000, | ||
| "maxGraphemes": 300, | ||
| "description": "Short summary of this project, suitable for previews and list views" | ||
| }, | ||
| "projectDescription": { | ||
| "type": "ref", | ||
| "ref": "pub.leaflet.pages.linearDocument#main", | ||
| "description": "Rich-text description of this project, represented as a Leaflet linear document." | ||
| }, | ||
|
Comment on lines
+25
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's see the full project.json file to understand the structure
cat -n lexicons/org/hypercerts/claim/collection/project.jsonRepository: hypercerts-org/hypercerts-lexicon Length of output: 2332 🏁 Script executed: # Search for strongRef usage in other lexicon files to understand the pattern
rg "strongRef" lexicons/ -A 2 -B 2Repository: hypercerts-org/hypercerts-lexicon Length of output: 6317 🏁 Script executed: # Check for usage of pub.leaflet.pages.linearDocument in the codebase
rg "linearDocument" --include="*.json" --include="*.md"Repository: hypercerts-org/hypercerts-lexicon Length of output: 518 🏁 Script executed: # Check README.md for documentation about projectDescription
grep -n "projectDescription\|project.json\|collection" README.md | head -20Repository: hypercerts-org/hypercerts-lexicon Length of output: 2246 🏁 Script executed: # Look for other examples of 'ref' type fields in the codebase
rg '"type":\s*"ref"' lexicons/ -A 1 -B 1 | head -40Repository: hypercerts-org/hypercerts-lexicon Length of output: 2482 🏁 Script executed: # Search for Leaflet lexicon files
find lexicons -name "*leaflet*" -o -name "*linear*"Repository: hypercerts-org/hypercerts-lexicon Length of output: 59 🏁 Script executed: # Look for pub.bsky patterns to understand ATProto definition refs
rg "pub\.bsky" lexicons/ | head -20Repository: hypercerts-org/hypercerts-lexicon Length of output: 59 🏁 Script executed: # Check if there are any inline type definitions vs record references
rg '"type":\s*"ref"' lexicons/ -B 2 | grep -E "(ref|description)" | head -30Repository: hypercerts-org/hypercerts-lexicon Length of output: 2968 🏁 Script executed: # Search for documentation on how refs are used in ATProto
rg "richtext\|facet" lexicons/ -lRepository: hypercerts-org/hypercerts-lexicon Length of output: 59 🌐 Web query:
💡 Result: Use a full NSID (optionally with a fragment) as the ref string. Per the Lexicon spec, a ref value may be:
Notes/rules:
Example ref entries:
Source: AT Protocol Lexicon specification. [1] 🏁 Script executed: # Check if pub.leaflet exists anywhere in the repo or if it's external
find . -type f -name "*.json" | xargs grep -l "leaflet\|pub\.leaflet" 2>/dev/null | head -10Repository: hypercerts-org/hypercerts-lexicon Length of output: 183 🏁 Script executed: # Look at existing strongRef definition to understand the pattern
cat -n lexicons/com/atproto/repo/strongRef.jsonRepository: hypercerts-org/hypercerts-lexicon Length of output: 532 🏁 Script executed: # Check how the README currently describes projectDescription to compare with review claim
sed -n '450,475p' README.mdRepository: hypercerts-org/hypercerts-lexicon Length of output: 2492 🏁 Script executed: # Check if there are any examples in the README showing how projectDescription should be used
sed -n '475,530p' README.mdRepository: hypercerts-org/hypercerts-lexicon Length of output: 1661 🏁 Script executed: # Search for any other direct definition references (not strongRef) to see if this is a pattern
rg '"ref":\s*"[^c]' lexicons/ | grep -v strongRef | grep -v "did" | head -20Repository: hypercerts-org/hypercerts-lexicon Length of output: 525 🏁 Script executed: # Check the full context around where projectDescription is used in examples
sed -n '475,510p' README.mdRepository: hypercerts-org/hypercerts-lexicon Length of output: 1082 Fix The schema uses Proposed fix "projectDescription": {
"type": "ref",
- "ref": "pub.leaflet.pages.linearDocument#main",
- "description": "Rich-text description of this project, represented as a Leaflet linear document."
+ "ref": "com.atproto.repo.strongRef",
+ "description": "Strong reference to a Leaflet linear document describing this project. The referenced record must conform to pub.leaflet.pages.linearDocument#main."
},🤖 Prompt for AI Agents |
||
| "avatar": { | ||
| "type": "blob", | ||
| "description": "Primary avatar image representing this project across apps and views; typically a square logo or project identity image.", | ||
| "accept": ["image/png", "image/jpeg"], | ||
| "maxSize": 1000000 | ||
| }, | ||
| "coverPhoto": { | ||
| "type": "blob", | ||
| "description": "The cover photo of this project.", | ||
| "accept": ["image/png", "image/jpeg"], | ||
| "maxSize": 1000000 | ||
| }, | ||
| "createdAt": { | ||
| "type": "string", | ||
| "format": "datetime", | ||
| "description": "Client-declared timestamp when this project metadata was created" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Correct the
projectTitledescription.The description says "The title of this collection" but should say "The title of this project" to match the sidecar context.
📝 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents