Skip to content

updates to match latest lexicons#112

Merged
aspiers merged 8 commits into
hypercerts-org:developfrom
aspiers:lexicon-sync
Jan 25, 2026
Merged

updates to match latest lexicons#112
aspiers merged 8 commits into
hypercerts-org:developfrom
aspiers:lexicon-sync

Conversation

@aspiers
Copy link
Copy Markdown
Contributor

@aspiers aspiers commented Jan 24, 2026

Summary by CodeRabbit

  • New Features

    • Rich text facet support for descriptions (mentions, links, tags)
    • Optional item weights for proportional attribution within collections
    • Avatar and banner images for collections and projects (uploads or external URIs)
  • Documentation

    • Expanded docs and examples clarifying facets, weighted items, and image usage
  • Tests

    • Extensive tests for creation, updates, removal, and lifecycle events for facets, weights, avatars, and banners

✏️ Tip: You can customize this high-level summary in your review settings.

aspiers and others added 6 commits January 24, 2026 17:56
Without this patch, the collection item weights feature introduced in
lexicon v0.10.0-beta.7 lacks comprehensive documentation explaining how
to use optional weights for proportional attribution in collections.

This is a problem because developers need clear examples and explanation
of the itemWeight field to effectively use the weighted collections
feature for proportional impact attribution.

This patch solves the problem by adding comprehensive JSDoc comments to
HypercertCollectionItem and CollectionItemInput types with:
- Explanation of itemIdentifier (required) and itemWeight (optional)
- Three usage examples: basic item, weighted item, and nested collection
- Helper type documentation for SDK operations

Part 1/6 of lexicon sync v0.10.0-beta.4 → v0.10.0-beta.11

Co-authored-by: Claude Code <claude-code@anthropic.noreply.com>
Without this patch, activity descriptions in hypercerts could only contain
plain text without any inline markup or annotations.

This is a problem because the AT Protocol supports rich text facets for
mentions, URLs, hashtags, and other inline markup, and the hypercerts
lexicon v0.10.0-beta.7 added support for these facets in activity
descriptions.

This patch solves the problem by adding optional shortDescriptionFacets
and descriptionFacets fields to CreateHypercertParams, updating the
createHypercertRecord() method to include these fields in the record, and
enhancing documentation with comprehensive examples showing proper byte
indexing for facets. This enables developers to create richer, more
interactive hypercert descriptions following AT Protocol facet standards.

Changes:
- Add AppBskyRichtextFacet import to repository interfaces
- Add shortDescriptionFacets and descriptionFacets to CreateHypercertParams
- Update createHypercertRecord() to pass facets through to record
- Enhance HypercertClaim type documentation with facet usage examples
- Add changeset documenting this enhancement
- Mark Change 2 complete in lexicon sync plan (part 2 of 6)

Co-authored-by: Claude Code <noreply@anthropic.com>
These were missed from the previous item weights commit.
Without this patch, the collection avatar and banner feature (added in
beta.7) lacked comprehensive test coverage and documentation examples
showing how to use these visual branding features.

This is a problem because users need clear examples showing how to:
- Create collections with avatar/banner images using Blobs or URIs
- Update collection images (add, modify, remove, or preserve)
- Use avatar/banner in both collections and projects

This patch solves the problem by adding:

- 7 new tests for avatar/banner CRUD operations (create, update, remove)
- Tests for both Blob uploads and URI string references
- Tests for preserving images during partial updates
- Changeset documenting the new test coverage
- Update spec marking Change 3 (Collection Avatar and Banner) complete

Tests added:
- Create collection with avatar/banner (Blob)
- Create collection with avatar/banner (URI strings)
- Create project with avatar/banner
- Update collection avatar/banner (Blob)
- Update collection avatar/banner (URI strings)
- Remove avatar/banner when set to null
- Preserve avatar/banner when not updating them

All tests passing: 632 tests in sdk-core, 136 in sdk-react

Spec: specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md (Change 3)

Co-authored-by: Claude Code <claude-code@noreply.anthropic.com>
…tion

Without this patch, the lexicon sync skill and spec incorrectly emphasized
documenting types rather than methods. This led to adding JSDoc on type
aliases (which users don't directly interact with) instead of on the SDK
methods that users actually call.

This is a problem because:
- Users call methods like createCollection(), not types like HypercertCollection
- Method documentation is where users look for usage examples
- Type documentation becomes redundant when methods are well-documented
- Previous changes incorrectly marked type docs as complete when method docs weren't done

This patch solves the problem by:

- Updating sync-lexicons SKILL.md to emphasize method documentation over type docs
- Clarifying that method JSDoc should include @example tags showing new features
- Updating the spec to accurately reflect what documentation was actually completed
- Marking Change 2 and 3 as partially complete (tests done, method docs still needed)
- Adding notes explaining that Change 1 already has method docs with examples

Changes to sync-lexicons skill:
- Step 7 now focuses on documenting methods in HypercertOperationsImpl.ts
- Added guidance to keep type documentation minimal
- Updated example task list to mention method documentation explicitly
- Added "IMPORTANT: Document methods, not types" callout

Changes to spec:
- Change 1: Removed type doc tasks, noted method docs already exist
- Change 2: Marked method doc tasks as incomplete, added note
- Change 3: Marked method doc tasks as incomplete, added note

Spec: specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md

Co-authored-by: Claude Code <claude-code@noreply.anthropic.com>
Copilot AI review requested due to automatic review settings January 24, 2026 05:28
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 24, 2026

🦋 Changeset detected

Latest commit: 060516a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hypercerts-org/sdk-core Minor
@hypercerts-org/sdk-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 24, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds rich-text facets for descriptions, collection item weights, and avatar/banner support for collections/projects; updates SDK interfaces and implementation, expands tests, and adds changeset docs and lexicon-sync planning.

Changes

Cohort / File(s) Summary
Changeset Docs
\.changeset/add-collection-avatar-banner-docs.md, \.changeset/add-collection-item-weight-docs.md, \.changeset/add-rich-text-facets.md
New changelog/docs describing avatar/banner support, collection item weights, and rich-text facets with examples and test notes.
Skill Documentation
.claude/skills/sync-lexicons/SKILL.md
Reworks sync-lexicons guidance to be method-centric with JSDoc and updated workflow steps.
Public Interfaces
packages/sdk-core/src/repository/interfaces.ts
Adds optional shortDescriptionFacets?: AppBskyRichtextFacet.Main[] and descriptionFacets?: AppBskyRichtextFacet.Main[] to CreateHypercertParams.
Types & JSDoc
packages/sdk-core/src/services/hypercerts/types.ts
Adds CollectionItemInput helper type and expands JSDoc for HypercertClaim and collection items (introduces itemWeight in docs).
Implementation
packages/sdk-core/src/repository/HypercertOperationsImpl.ts
Propagates shortDescriptionFacets and descriptionFacets from create params into hypercert records before validation/creation.
Tests
packages/sdk-core/tests/repository/HypercertOperationsImpl.test.ts
Large test additions covering facets, weighted/mixed collection items, avatar/banner handling (Blob and URI), project variations, updates/removals, lifecycle events, and error scenarios.
Specs / Planning
specs/lexicon-sync/...v0.10.0-beta.4-v0.10.0-beta.11.md
Expanded lexicon sync plan describing multi-stage changes (items, facets, images, work-scope, location) and validation/checklists.

Sequence Diagram(s)

(omitted — changes are API/SDK additions, docs, and tests; no multi-component control-flow requiring visualization)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰
Facets unfurl like ribbons bright,
Weights balance items, snug and light,
Banners blossom, avatars gleam,
Tests hop onward, stitch the seam,
I munch a carrot — ship the dream!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'updates to match latest lexicons' is vague and generic, using non-descriptive phrasing that doesn't convey the specific nature of changes (rich text facets, collection weights, avatars/banners). Consider a more specific title like 'Add rich text facets, collection item weights, and avatar/banner support' to clearly communicate the main changes in the changeset.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to match lexicon changes from v0.10.0-beta.4 to v0.10.0-beta.11. The changes add support for new features in the hypercerts lexicon including rich text facets, collection item weights, and collection avatar/banner images. The PR includes comprehensive tests, type definitions, and changesets, though some documentation work is noted as pending in the sync plan.

Changes:

  • Added rich text facet support (shortDescriptionFacets, descriptionFacets) for hypercert activity descriptions
  • Added comprehensive tests for collection item weights (weighted, unweighted, and mixed collections)
  • Added comprehensive tests for collection and project avatar/banner images (Blob and URI formats, creation, updating, removal)
  • Enhanced type documentation with examples for HypercertClaim and HypercertCollectionItem
  • Updated SKILL.md to emphasize documenting methods over types

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md Sync plan document tracking implementation progress for lexicon updates
packages/sdk-core/tests/repository/HypercertOperationsImpl.test.ts Comprehensive tests for rich text facets, weighted collection items, and avatar/banner images
packages/sdk-core/src/services/hypercerts/types.ts Enhanced JSDoc documentation with examples for HypercertClaim and HypercertCollectionItem types
packages/sdk-core/src/repository/interfaces.ts Added shortDescriptionFacets and descriptionFacets fields to CreateHypercertParams with documentation
packages/sdk-core/src/repository/HypercertOperationsImpl.ts Implementation to pass facet fields from params to hypercert records
.claude/skills/sync-lexicons/SKILL.md Updated sync process guidance to emphasize method documentation over type documentation
.changeset/add-rich-text-facets.md Changeset documenting rich text facet support (minor bump)
.changeset/add-collection-item-weight-docs.md Changeset documenting collection item weights (patch bump)
.changeset/add-collection-avatar-banner-docs.md Changeset documenting avatar/banner support (minor bump)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md Outdated
Comment thread packages/sdk-core/src/services/hypercerts/types.ts Outdated

**What's Included:**

- Comprehensive JSDoc documentation for `HypercertCollection` type explaining avatar and banner usage
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changeset claims "Comprehensive JSDoc documentation for HypercertCollection type explaining avatar and banner usage" but the HypercertCollection type at line 152 has no JSDoc documentation - it's just a bare type alias. The avatar/banner documentation exists only in the CreateCollectionParams type comment (line 319). Consider either adding JSDoc documentation to the HypercertCollection type itself, or updating the changeset description to accurately reflect where the documentation was added (e.g., "Comprehensive JSDoc documentation in CreateCollectionParams explaining avatar and banner usage").

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Suggest a change

Comment thread specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md Outdated
Comment on lines +97 to +114
- [ ] Add JSDoc documentation to `createCollection()` and `updateCollection()` methods about avatar
- [ ] Add usage examples in method documentation showing avatar in collections and projects
- [x] Add/update tests for collections with avatar and banner
- [x] Build and test
- [x] Create changeset (minor - new feature available)

**Note**: Method documentation mentions banner but not avatar. Tests are complete.

**Validation**:

- [x] Format check passes (`pnpm format:check`)
- [x] Lint passes (`pnpm lint`)
- [x] Typecheck passes (`pnpm typecheck`)
- [x] Build passes (`pnpm build`)
- [x] Tests pass (`pnpm test` - 632 tests in sdk-core, 136 in sdk-react)
- [x] Types export correctly

**Status**: ✅ Complete
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sync plan note at line 103 states "Method documentation mentions banner but not avatar. Tests are complete," and the SDK Tasks list shows two unchecked items related to JSDoc documentation (lines 97-98). However, Change 3 is marked as "✅ Complete" (line 114). The createCollection() method documentation at line 1269 in HypercertOperationsImpl.ts mentions "banner" but not "avatar", despite avatar being a supported parameter. Either the documentation should be updated to include avatar, or the status should be updated to reflect that documentation work remains pending.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Suggest a change

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/sdk-core/src/repository/HypercertOperationsImpl.ts`:
- Around line 286-293: The current truthy checks in HypercertOperationsImpl that
set hypercertRecord.shortDescriptionFacets and hypercertRecord.descriptionFacets
drop empty arrays; change the guards to explicit undefined checks (e.g., if
(params.shortDescriptionFacets !== undefined) and if (params.descriptionFacets
!== undefined)) so empty arrays are preserved as intentional values when
assigning to hypercertRecord.shortDescriptionFacets and
hypercertRecord.descriptionFacets.

In `@specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md`:
- Around line 162-192: The SDK Tasks under "Change 5: Collection Location
Property" were mistakenly copied from the facets change; replace the
facet-specific checklist items (references to AppBskyRichtextFacet,
shortDescriptionFacets, descriptionFacets) with location-related tasks: import
the appropriate Location/strongRef type, add a `location` field to
`CreateCollectionParams`, update the `create()` method in
`CollectionOperationsImpl` to accept and persist `location`, add docs to the
`Collection`/`CollectionClaim` type describing the `location` property and a
usage example for referencing location records, ensure lexicon validation and
unit tests cover the new `location` field, run build/typecheck/tests, and add a
minor changeset entry.
🧹 Nitpick comments (1)
packages/sdk-core/src/services/hypercerts/types.ts (1)

82-142: Excellent documentation for HypercertClaim type.

The comprehensive JSDoc with facet examples showing byte indexing for mentions, tags, and links will be very helpful for SDK users. The examples demonstrate proper $type values and index structures.

One minor note: the @see link on line 140 points to AT Protocol record key documentation, but this type is about facets. Consider updating to a facet-specific reference.

Optional: Update `@see` link to facet documentation
- * `@see` {`@link` https://atproto.com/specs/record-key#record-key-type|AT Protocol Facets}
+ * `@see` {`@link` https://atproto.com/specs/lexicon#facet|AT Protocol Facets}

Comment on lines +286 to +293
if (params.shortDescriptionFacets) {
hypercertRecord.shortDescriptionFacets = params.shortDescriptionFacets;
}

if (params.descriptionFacets) {
hypercertRecord.descriptionFacets = params.descriptionFacets;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Preserve empty facet arrays.

Line 286 and Line 290 use truthy checks, which drop empty arrays; that loses an explicit “no facets” intent. Prefer an explicit !== undefined check.

🐛 Proposed fix
-    if (params.shortDescriptionFacets) {
+    if (params.shortDescriptionFacets !== undefined) {
       hypercertRecord.shortDescriptionFacets = params.shortDescriptionFacets;
     }

-    if (params.descriptionFacets) {
+    if (params.descriptionFacets !== undefined) {
       hypercertRecord.descriptionFacets = params.descriptionFacets;
     }
🤖 Prompt for AI Agents
In `@packages/sdk-core/src/repository/HypercertOperationsImpl.ts` around lines 286
- 293, The current truthy checks in HypercertOperationsImpl that set
hypercertRecord.shortDescriptionFacets and hypercertRecord.descriptionFacets
drop empty arrays; change the guards to explicit undefined checks (e.g., if
(params.shortDescriptionFacets !== undefined) and if (params.descriptionFacets
!== undefined)) so empty arrays are preserved as intentional values when
assigning to hypercertRecord.shortDescriptionFacets and
hypercertRecord.descriptionFacets.

Comment thread specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md
@aspiers
Copy link
Copy Markdown
Contributor Author

aspiers commented Jan 24, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 25, 2026 02:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,12 @@
---
"@hypercerts-org/sdk-core": patch
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changeset is marked as "patch" but describes adding documentation and tests for a new feature (collection item weights). According to semantic versioning, a "patch" bump should be for bug fixes or trivial documentation-only changes. Since this changeset includes:

  • Comprehensive test coverage for the new feature (tests at lines 990-1072)
  • Documentation for new functionality
  • Examples showing how to use the feature

It should be categorized as "minor" instead of "patch", as it's documenting a new feature that's now available to users. If this were truly documentation-only without any functionality change, "patch" might be appropriate, but the tests indicate this is exposing new functionality.

Suggested change
"@hypercerts-org/sdk-core": patch
"@hypercerts-org/sdk-core": minor

Copilot uses AI. Check for mistakes.
- [x] Verify CRUD operations support itemWeight (createCollection/updateCollection already pass items through)
- [x] Add/update tests for collections with weighted items
- [x] Build and test
- [x] Create changeset (minor - new feature available)
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sync plan indicates this change should have a changeset with "minor - new feature available" (line 33), but the actual changeset created (.changeset/add-collection-item-weight-docs.md) is marked as "patch". This inconsistency should be resolved - either update the plan to reflect that it's a patch (documentation-only), or update the changeset to be "minor" if it's exposing new functionality to users.

Copilot uses AI. Check for mistakes.
… changes

The tests "should update collection adding weights to existing items" and
"should update collection removing weights from items" were only checking that
the update payload was correct, but weren't actually verifying that the weight
properties were added or removed from the items.

This patch fixes both tests to explicitly verify:
- Adding weights: checks that itemWeight properties are present with correct values
- Removing weights: checks that itemWeight properties are absent

Without this fix, the tests could pass even if the implementation didn't
actually modify the weight properties, providing false confidence in the
functionality.

Co-authored-by: Claude Code <noreply@anthropic.com>
@aspiers aspiers merged commit 3b9e014 into hypercerts-org:develop Jan 25, 2026
3 checks passed
@aspiers aspiers deleted the lexicon-sync branch January 25, 2026 02:40
aspiers added a commit that referenced this pull request Jan 25, 2026
Change truthy checks to explicit !== undefined checks for
shortDescriptionFacets and descriptionFacets to ensure empty
arrays are preserved as valid values.

Fixes unresolved comment from PR #112 review thread #3700691486
aspiers added a commit that referenced this pull request Jan 26, 2026
Change truthy checks to explicit !== undefined checks for
shortDescriptionFacets and descriptionFacets to ensure empty
arrays are preserved as valid values.

Fixes unresolved comment from PR #112 review thread #3700691486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants