chore: run all lexicons against the ATProto lexicon style guide#103
chore: run all lexicons against the ATProto lexicon style guide#103s-adamantine wants to merge 2 commits intodevelopfrom
Conversation
- Change enum to knownValues in badge/response.json for schema evolution - Add maxLength constraints to string fields without format: - badge/definition.json: badgeType (100), title (256), description (1000) - badge/award.json: note (500) - badge/response.json: weight (50) - rights.json: rightsDescription (5000/1000 graphemes) - funding/receipt.json: to, amount, currency, paymentRail, paymentNetwork, transactionId - Change maxGraphemes to maxLength for URI in defs.json
🦋 Changeset detectedLatest commit: 063bc1b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📝 WalkthroughWalkthroughThis PR tightens JSON Schema validations across lexicons: adds maxLength/maxGraphemes/maxSize constraints to various fields, replaces an enum with knownValues in badge responses, updates the URI constraint, and refreshes SCHEMAS.md and changelog entry to reflect these changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (6 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@SCHEMAS.md`:
- Around line 177-191: Create a new ATProto lexicon v1 JSON file named
lexicons/org/hypercerts/claim/acknowledgement.json that defines the record
"org.hypercerts.acknowledgement" with the properties listed in SCHEMAS.md:
subjects (ref, required), context (ref, required), given (boolean, required),
comment (string, optional, maxLength 1000), and createdAt (string, required);
ensure the lexicon includes proper ids, defs, record key, and required array per
ATProto lexicon schema v1 and mirrors the table types and descriptions. Then
update README.md to list and briefly describe the new acknowledgement lexicon
alongside the existing claim-related records so it appears in the lexicon
index/documentation.
SCHEMAS.md
Outdated
| ### `org.hypercerts.acknowledgement` | ||
|
|
||
| **Description:** Acknowledgement of inclusion/association between subjects and a context. | ||
|
|
||
| **Key:** `tid` | ||
|
|
||
| #### Properties | ||
|
|
||
| | Property | Type | Required | Description | Comments | | ||
| | ----------- | --------- | -------- | ----------------------------------------------------------------------- | --------------- | | ||
| | `subjects` | `ref` | yes | The records being acknowledged (e.g., activities). | | | ||
| | `context` | `ref` | yes | The target context (e.g. a collection) for the acknowledgement/consent. | | | ||
| | `given` | `boolean` | yes | Indicates whether acknowledgement is granted (true) or denied (false). | | | ||
| | `comment` | `string` | no | Optional comment providing additional details or reasoning. | maxLength: 1000 | | ||
| | `createdAt` | `string` | yes | Client-declared timestamp when this record was originally created. | | |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for acknowledgement lexicon JSON file
find . -type f -name "*acknowledgement*" | grep -E '\.(json|md)$'Repository: hypercerts-org/hypercerts-lexicon
Length of output: 59
🏁 Script executed:
# Check README.md for acknowledgement documentation
rg -n "acknowledgement" README.md -iRepository: hypercerts-org/hypercerts-lexicon
Length of output: 59
🏁 Script executed:
# List lexicons directory structure to understand organization
find ./lexicons -type f -name "*.json" | head -20Repository: hypercerts-org/hypercerts-lexicon
Length of output: 740
🏁 Script executed:
# Check if SCHEMAS.md exists and contains acknowledgement section
grep -n "org.hypercerts.acknowledgement" SCHEMAS.mdRepository: hypercerts-org/hypercerts-lexicon
Length of output: 117
🏁 Script executed:
# Check README.md structure
head -50 README.mdRepository: hypercerts-org/hypercerts-lexicon
Length of output: 1155
🏁 Script executed:
# Verify README does not mention acknowledgement
grep -i "acknowledgement" README.md || echo "No acknowledgement found in README"Repository: hypercerts-org/hypercerts-lexicon
Length of output: 111
Create the acknowledgement lexicon JSON file and document it in README.md
SCHEMAS.md documents org.hypercerts.acknowledgement (line 177), but the corresponding lexicon JSON file is missing. Create lexicons/org/hypercerts/claim/acknowledgement.json following ATProto lexicon schema v1, and update README.md to document the new lexicon alongside other claim-related records.
🧰 Tools
🪛 LanguageTool
[style] ~191-~191: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | | --- ## Cert...
(ORIGINALLY_CREATED)
🤖 Prompt for AI Agents
In `@SCHEMAS.md` around lines 177 - 191, Create a new ATProto lexicon v1 JSON file
named lexicons/org/hypercerts/claim/acknowledgement.json that defines the record
"org.hypercerts.acknowledgement" with the properties listed in SCHEMAS.md:
subjects (ref, required), context (ref, required), given (boolean, required),
comment (string, optional, maxLength 1000), and createdAt (string, required);
ensure the lexicon includes proper ids, defs, record key, and required array per
ATProto lexicon schema v1 and mirrors the table types and descriptions. Then
update README.md to list and briefly describe the new acknowledgement lexicon
alongside the existing claim-related records so it appears in the lexicon
index/documentation.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
SCHEMAS.md (1)
186-194: Update SCHEMAS.md to document the URI maxLength constraint.The defs.json file correctly contains
maxLength: 2048for the URI definition, but SCHEMAS.md does not reflect this constraint in the Comments column. The table shows only"Has 'uri' property (string, format uri)"without documenting the maxLength. Regenerate or update SCHEMAS.md to include this constraint and keep it in sync with the source lexicon.
|
@copilot This needs rebasing |
Fixes #66
Summary:
Ran an AI against the ATProto Lexicon Style Guide.
Changes:
Summary by CodeRabbit
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.