-
Notifications
You must be signed in to change notification settings - Fork 3
adding badges #41
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
adding badges #41
Conversation
|
Warning Rate limit exceeded@aspiers has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (9)
WalkthroughThis PR introduces a new Badge system to the lexicon framework comprising three data classes: badgeDefinition (defines badge types with metadata and optional issuers), badgeIssuance (records badge issuance to subjects), and badgeResponse (captures recipient responses). Corresponding JSON lexicon schemas, entity relationships, and documentation are added. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (3 passed)
Comment |
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
lexicons/app/badges/definition.json (1)
13-16: Consider constraining badgeType with an enum.The
badgeTypefield is currently an open string (line 14), but the description provides examples like "endorsement, participation, affiliation" that suggest a limited set of categories. Consider defining this as an enum for consistency and validation, or use a union type if extensibility is needed while still providing well-known categories.Example with enum:
"badgeType": { - "type": "string", + "type": "string", + "enum": ["endorsement", "participation", "affiliation", "achievement", "certification"], "description": "Category of the badge (e.g. endorsement, participation, affiliation)." },Alternatively, keep as string if you want full flexibility for custom badge types.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
lexicons/app/badges/definition.json(1 hunks)lexicons/app/badges/issue.json(1 hunks)lexicons/app/badges/response.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
lexicons/**/*.json
📄 CodeRabbit inference engine (Custom checks)
lexicons/**/*.json: When adding, modifying, or deleting files in lexicons//*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
When adding, modifying, or deleting files in lexicons//*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Verify that lexicon IDs in JSON files match what's documented in README.md
lexicons/**/*.json: After modifying lexicon JSON files, regenerate TypeScript types by runningnpm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Runnpm run checkbefore committing to validate lexicon syntax and ensure valid lexicon definitions
UpdateERD.pumlwhen modifying lexicon structures to reflect entity relationship changes
UpdateREADME.mddocumentation when adding or modifying lexicon definitions
Organize lexicon files by namespace following the directory structure pattern (e.g.,org/hypercerts/claim/*.json)
Files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
🧠 Learnings (12)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directory
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-15T10:13:17.689Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:17.689Z
Learning: In the hypercerts-lexicon repository, CI automatically runs npm run gen-api and npm run check to regenerate TypeScript types and validate lexicon definitions. Do not include manual reminders to run these commands in code reviews, as CI handles consistency and validation for all lexicon JSON definitions under lexicons/.
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-15T15:33:19.949Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: In the hypercerts-lexicon repository, do not comment on Prettier/formatting issues in code reviews since they are reported by the lint workflow. Do not duplicate the lint output in reviews to reduce noise; focus review comments on functional/semantic issues and other non-formatting concerns.
Applied to files:
lexicons/app/badges/issue.jsonlexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Applied to files:
lexicons/app/badges/definition.jsonlexicons/app/badges/response.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Applied to files:
lexicons/app/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: This repository contains ATProto lexicon definitions for the Hypercerts protocol with auto-generated TypeScript types - prioritize lexicon accuracy and consistency
Applied to files:
lexicons/app/badges/definition.json
🪛 GitHub Actions: Lint
lexicons/app/badges/issue.json
[warning] 1-1: Prettier formatting issues detected in this file. Run 'prettier --write' to fix.
lexicons/app/badges/definition.json
[warning] 1-1: Prettier formatting issues detected in this file. Run 'prettier --write' to fix.
lexicons/app/badges/response.json
[warning] 1-1: Prettier formatting issues detected in this file. Run 'prettier --write' to fix.
🪛 GitHub Actions: Test
lexicons/app/badges/response.json
[error] 1-1: Invalid lexicon: Required field "badgeIssue" not defined. ZodError: {"issues":[{"code":"custom","message":"Required field "badgeIssue" not defined","path":["record"]}]} (from lex gen-api)
🔇 Additional comments (1)
lexicons/app/badges/issue.json (1)
18-25: Remove "did" from the refs array—it is not a valid lexicon reference.In ATProto lexicon unions, the
refsarray must contain references to actual Lexicon type definitions (NSIDs or local definitions), not primitive types. "did" is a string format, not a referenceable type. Replace"did"with a proper lexicon definition—either create a custom object definition with"type": "string"and"format": "did", or use an existing Lexicon type that represents a DID (e.g., by defining a local or global type reference).Likely an incorrect or invalid review comment.
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.
Actionable comments posted: 4
🧹 Nitpick comments (1)
lexicons/app/certified/badges/response.json (1)
23-26: Consider constrainingweightto accepted responses only.The
weightfield is described as being for "accepted badges," but the schema allows it to be set whenresponseis "rejected" as well. While this may be intentional flexibility, it could lead to confusion.If weight should only apply to accepted badges, consider documenting this constraint clearly or implementing validation at the application level.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
lexicons/app/certified/badges/definition.json(1 hunks)lexicons/app/certified/badges/issue.json(1 hunks)lexicons/app/certified/badges/response.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
lexicons/**/*.json
📄 CodeRabbit inference engine (Custom checks)
lexicons/**/*.json: When adding, modifying, or deleting files in lexicons//*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
When adding, modifying, or deleting files in lexicons//*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Verify that lexicon IDs in JSON files match what's documented in README.md
lexicons/**/*.json: After modifying lexicon JSON files, regenerate TypeScript types by runningnpm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Runnpm run checkbefore committing to validate lexicon syntax and ensure valid lexicon definitions
UpdateERD.pumlwhen modifying lexicon structures to reflect entity relationship changes
UpdateREADME.mddocumentation when adding or modifying lexicon definitions
Organize lexicon files by namespace following the directory structure pattern (e.g.,org/hypercerts/claim/*.json)
Files:
lexicons/app/certified/badges/response.jsonlexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
lexicons/app/certified/badges/response.jsonlexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
🧠 Learnings (12)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
📚 Learning: 2025-12-15T10:13:17.689Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:17.689Z
Learning: In the hypercerts-lexicon repository, CI automatically runs npm run gen-api and npm run check to regenerate TypeScript types and validate lexicon definitions. Do not include manual reminders to run these commands in code reviews, as CI handles consistency and validation for all lexicon JSON definitions under lexicons/.
Applied to files:
lexicons/app/certified/badges/response.jsonlexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T15:33:19.949Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: In the hypercerts-lexicon repository, do not comment on Prettier/formatting issues in code reviews since they are reported by the lint workflow. Do not duplicate the lint output in reviews to reduce noise; focus review comments on functional/semantic issues and other non-formatting concerns.
Applied to files:
lexicons/app/certified/badges/response.jsonlexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Applied to files:
lexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Applied to files:
lexicons/app/certified/badges/issue.jsonlexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: This repository contains ATProto lexicon definitions for the Hypercerts protocol with auto-generated TypeScript types - prioritize lexicon accuracy and consistency
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md
Applied to files:
lexicons/app/certified/badges/definition.json
🪛 GitHub Actions: Lint
lexicons/app/certified/badges/response.json
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.
lexicons/app/certified/badges/issue.json
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.
lexicons/app/certified/badges/definition.json
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.
🔇 Additional comments (1)
lexicons/app/certified/badges/issue.json (1)
18-25: Replace "did" bare ref with proper type definition in union.The union on line 22 uses
"did"as a bare ref, but according to the ATProto lexicon schema v1 specification, "did" is a string format, not a referenceable named type. Union refs must be either global NSID references (e.g.,"com.atproto.repo.strongRef") or local named definitions (prefixed with#). Define "did" as a named type in the defs object or replace it with an appropriate object definition that wraps the DID value.
| "icon": { | ||
| "type": "blob", | ||
| "description": "Icon representing the badge, stored as a blob for compact visual display.", | ||
| "accept": ["image/png", "image/jpeg", "image/webp", "image/svg+xml"], | ||
| "maxSize": 1048576 | ||
| }, |
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.
Consider SVG security implications.
The icon blob accepts "image/svg+xml" which can contain embedded scripts. While this provides flexibility for vector graphics, it introduces potential XSS risks if SVGs are rendered without sanitization.
Ensure that the application layer sanitizes SVG content before rendering or consider restricting to raster formats only (png, jpeg, webp) if vector graphics aren't essential.
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.
@aspiers please check this one. I like SVGs generally;)
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
a8b7f17 to
934e5ba
Compare
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
lexicons/app/certified/badges/definition.json (1)
1-48: LGTM!The lexicon schema is well-structured and follows the ATProto lexicon v1 specification. The namespace issue from previous reviews has been addressed, and the properties align with the README documentation.
🧹 Nitpick comments (1)
ERD.puml (1)
151-158: Consider renaming fieldbadgeDefinitiontobadgefor consistency.In
issue.json, the property is namedbadge(line 13), but the ERD showsbadgeDefinition. For consistency between the ERD and the actual lexicon schema, consider using the same property name.dataclass badgeIssued { !if (SHOW_FIELDS == "true") - badgeDefinition + badge subject note? createdAt !endif }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
ERD-with-fields.pngis excluded by!**/*.pngERD-with-fields.svgis excluded by!**/*.svgERD.pngis excluded by!**/*.pngERD.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
ERD.puml(2 hunks)README.md(1 hunks)lexicons/app/certified/badges/definition.json(1 hunks)lexicons/app/certified/badges/issue.json(1 hunks)lexicons/app/certified/badges/response.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- lexicons/app/certified/badges/response.json
🧰 Additional context used
📓 Path-based instructions (4)
lexicons/**/*.json
📄 CodeRabbit inference engine (Custom checks)
lexicons/**/*.json: When adding, modifying, or deleting files in lexicons//*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
When adding, modifying, or deleting files in lexicons//*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Verify that lexicon IDs in JSON files match what's documented in README.md
lexicons/**/*.json: After modifying lexicon JSON files, regenerate TypeScript types by runningnpm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Runnpm run checkbefore committing to validate lexicon syntax and ensure valid lexicon definitions
UpdateERD.pumlwhen modifying lexicon structures to reflect entity relationship changes
UpdateREADME.mddocumentation when adding or modifying lexicon definitions
Organize lexicon files by namespace following the directory structure pattern (e.g.,org/hypercerts/claim/*.json)
Files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.json
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.jsonERD.pumlREADME.md
ERD.puml
📄 CodeRabbit inference engine (Custom checks)
ERD.puml: Ensure that all entities referenced in ERD.puml correspond to lexicons defined in lexicons//*.json
Ensure all relationships shown in ERD.puml are valid based on the JSON lexicon schemas in lexicons//*.json
Verify that entity names in ERD.puml match lexicon IDs (e.g., 'activity' entity should correspond to org.hypercerts.claim.activity lexicon)
Files:
ERD.puml
README.md
📄 CodeRabbit inference engine (Custom checks)
README.md: Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directory
Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Files:
README.md
🧠 Learnings (16)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.jsonREADME.md
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.jsonERD.puml
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Applied to files:
lexicons/app/certified/badges/definition.jsonERD.puml
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: This repository contains ATProto lexicon definitions for the Hypercerts protocol with auto-generated TypeScript types - prioritize lexicon accuracy and consistency
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T15:33:19.949Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: In the hypercerts-lexicon repository, do not comment on Prettier/formatting issues in code reviews since they are reported by the lint workflow. Do not duplicate the lint output in reviews to reduce noise; focus review comments on functional/semantic issues and other non-formatting concerns.
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to ERD.puml : Verify that entity names in ERD.puml match lexicon IDs (e.g., 'activity' entity should correspond to org.hypercerts.claim.activity lexicon)
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Run `npm run check` before committing to validate lexicon syntax and ensure valid lexicon definitions
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to ERD.puml : Ensure that all entities referenced in ERD.puml correspond to lexicons defined in lexicons/**/*.json
Applied to files:
lexicons/app/certified/badges/definition.json
📚 Learning: 2025-12-15T10:13:17.689Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:17.689Z
Learning: In the hypercerts-lexicon repository, CI automatically runs npm run gen-api and npm run check to regenerate TypeScript types and validate lexicon definitions. Do not include manual reminders to run these commands in code reviews, as CI handles consistency and validation for all lexicon JSON definitions under lexicons/.
Applied to files:
lexicons/app/certified/badges/definition.jsonlexicons/app/certified/badges/issue.json
📚 Learning: 2025-12-15T16:39:23.964Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 39
File: README.md:17-17
Timestamp: 2025-12-15T16:39:23.964Z
Learning: In the hypercerts-lexicon repository, standardize on the hyphenless spelling 'onchain' across Markdown documentation (e.g., README.md and other md files) to match the industry standard. Update any occurrences of 'on-chain' to 'onchain' and ensure consistency throughout all documentation.
Applied to files:
README.md
🪛 GitHub Actions: Lint
lexicons/app/certified/badges/definition.json
[warning] 1-1: Prettier formatting issues found. Run 'prettier --write' to fix code style in this file.
lexicons/app/certified/badges/issue.json
[warning] 1-1: Prettier formatting issues found. Run 'prettier --write' to fix code style in this file.
README.md
[warning] 1-1: Prettier formatting issues found. Run 'prettier --write' to fix code style in this file.
🪛 LanguageTool
README.md
[style] ~132-~132: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Issue Lexicon ID: `...
(ORIGINALLY_CREATED)
[style] ~145-~145: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Response **Lexicon ID:*...
(ORIGINALLY_CREATED)
[style] ~158-~158: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | --- ## Hypercerts Lexicons Hyperc...
(ORIGINALLY_CREATED)
🔇 Additional comments (2)
ERD.puml (1)
326-329: LGTM!The new relationships correctly model the badge issuance flow:
badgeIssued → badgeDefinitionreflects thebadgerefbadgeResponse → badgeIssuedreflects thebadgeIssuedref- The "may target" relationships accurately represent the union type in the
subjectfieldREADME.md (1)
113-159: Update README icon documentation and fix subject field schema.The icon field in the Badge Definition lexicon accepts only specific MIME types (
image/png,image/jpeg,image/webp,image/svg+xml), not the genericimage/*wildcard pattern documented in README. Update lines 127-128 to reflect the actual constraints. Additionally, fix the subject field inissue.jsonline 21-24, as"did"is not a valid lexicon union reference; it should reference an actual schema or use a string field with format"did".⛔ Skipped due to learnings
Learnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0 Timestamp: 2025-12-11T15:44:24.397Z Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.jsonLearnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-15T17:53:11.862Z Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitionsLearnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0 Timestamp: 2025-12-11T15:44:24.397Z Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)Learnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0 Timestamp: 2025-12-11T15:44:24.397Z Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.mdLearnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0 Timestamp: 2025-12-11T15:44:24.397Z Learning: Applies to README.md : Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directoryLearnt from: CR Repo: hypercerts-org/hypercerts-lexicon PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-15T17:53:11.862Z Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specificationLearnt from: aspiers Repo: hypercerts-org/hypercerts-lexicon PR: 37 File: lexicons/org/hypercerts/funding/receipt.json:1-71 Timestamp: 2025-12-15T15:33:19.949Z Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
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.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
ERD-with-fields.pngis excluded by!**/*.pngERD-with-fields.svgis excluded by!**/*.svgERD.pngis excluded by!**/*.pngERD.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
ERD.puml(2 hunks)README.md(1 hunks)lexicons/app/certified/badges/definition.json(1 hunks)lexicons/app/certified/badges/issuance.json(1 hunks)lexicons/app/certified/badges/response.json(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- lexicons/app/certified/badges/issuance.json
🚧 Files skipped from review as they are similar to previous changes (1)
- lexicons/app/certified/badges/definition.json
🧰 Additional context used
📓 Path-based instructions (4)
lexicons/**/*.json
📄 CodeRabbit inference engine (Custom checks)
lexicons/**/*.json: When adding, modifying, or deleting files in lexicons//*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
When adding, modifying, or deleting files in lexicons//*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Verify that lexicon IDs in JSON files match what's documented in README.md
lexicons/**/*.json: After modifying lexicon JSON files, regenerate TypeScript types by runningnpm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Runnpm run checkbefore committing to validate lexicon syntax and ensure valid lexicon definitions
UpdateERD.pumlwhen modifying lexicon structures to reflect entity relationship changes
UpdateREADME.mddocumentation when adding or modifying lexicon definitions
Organize lexicon files by namespace following the directory structure pattern (e.g.,org/hypercerts/claim/*.json)
Files:
lexicons/app/certified/badges/response.json
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
lexicons/app/certified/badges/response.jsonERD.pumlREADME.md
ERD.puml
📄 CodeRabbit inference engine (Custom checks)
ERD.puml: Ensure that all entities referenced in ERD.puml correspond to lexicons defined in lexicons//*.json
Ensure all relationships shown in ERD.puml are valid based on the JSON lexicon schemas in lexicons//*.json
Verify that entity names in ERD.puml match lexicon IDs (e.g., 'activity' entity should correspond to org.hypercerts.claim.activity lexicon)
Files:
ERD.puml
README.md
📄 CodeRabbit inference engine (Custom checks)
README.md: Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directory
Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Files:
README.md
🧠 Learnings (11)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Applied to files:
lexicons/app/certified/badges/response.jsonREADME.md
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Applied to files:
lexicons/app/certified/badges/response.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Applied to files:
lexicons/app/certified/badges/response.jsonREADME.md
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md
Applied to files:
lexicons/app/certified/badges/response.jsonREADME.md
📚 Learning: 2025-12-15T10:13:17.689Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:17.689Z
Learning: In the hypercerts-lexicon repository, CI automatically runs npm run gen-api and npm run check to regenerate TypeScript types and validate lexicon definitions. Do not include manual reminders to run these commands in code reviews, as CI handles consistency and validation for all lexicon JSON definitions under lexicons/.
Applied to files:
lexicons/app/certified/badges/response.json
📚 Learning: 2025-12-15T15:33:19.949Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: In the hypercerts-lexicon repository, do not comment on Prettier/formatting issues in code reviews since they are reported by the lint workflow. Do not duplicate the lint output in reviews to reduce noise; focus review comments on functional/semantic issues and other non-formatting concerns.
Applied to files:
lexicons/app/certified/badges/response.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Applied to files:
ERD.pumlREADME.md
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Applied to files:
README.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: This repository contains ATProto lexicon definitions for the Hypercerts protocol with auto-generated TypeScript types - prioritize lexicon accuracy and consistency
Applied to files:
README.md
📚 Learning: 2025-12-15T16:39:23.964Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 39
File: README.md:17-17
Timestamp: 2025-12-15T16:39:23.964Z
Learning: In the hypercerts-lexicon repository, standardize on the hyphenless spelling 'onchain' across Markdown documentation (e.g., README.md and other md files) to match the industry standard. Update any occurrences of 'on-chain' to 'onchain' and ensure consistency throughout all documentation.
Applied to files:
README.md
🪛 LanguageTool
README.md
[style] ~132-~132: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Issuance **Lexicon ...
(ORIGINALLY_CREATED)
[style] ~145-~145: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Res...
(ORIGINALLY_CREATED)
[style] ~158-~158: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | --- ## Hypercerts Lexicons Hy...
(ORIGINALLY_CREATED)
🔇 Additional comments (2)
ERD.puml (1)
327-330: LGTM! Badge relationships are well-defined.The relationships correctly model the badge system:
badgeIssuance → badgeDefinition: Links issuances to their definitionsbadgeResponse → badgeIssuance: Links responses to issuancesbadgeIssuance → contributor: Supports targeting DIDsbadgeIssuance → activity: Supports targeting activity recordsREADME.md (1)
113-159: No action needed. The README documentation for Badges Lexicon is accurate and complete with no duplicates. All three lexicon definitions (app.certified.badge.definition,app.certified.badge.issuance,app.certified.badge.response) appear exactly once in the documentation (lines 113-159) with matching JSON files and properties.
934e5ba to
67f96d7
Compare
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.
Actionable comments posted: 2
♻️ Duplicate comments (1)
lexicons/app/certified/badge/issuance.json (1)
18-22: Critical: Union cannot reference primitive string type.The
subjectunion references"app.certified.defs#did", which is defined as a primitive string type indefs.json. ATProto unions require object definitions with a$typediscriminator, not primitive types. This will cause schema validation to fail.This issue is addressed by updating
app.certified.defsto include a proper object wrapper for DID (see comment ondefs.json). Oncedefs.jsondefinesdidSubjectas an object type, update this reference:-"refs": ["app.certified.defs#did", "com.atproto.repo.strongRef"] +"refs": ["app.certified.defs#didSubject", "com.atproto.repo.strongRef"]Based on past review comments.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
ERD-with-fields.pngis excluded by!**/*.pngERD-with-fields.svgis excluded by!**/*.svgERD.pngis excluded by!**/*.pngERD.svgis excluded by!**/*.svg
📒 Files selected for processing (6)
ERD.puml(2 hunks)README.md(1 hunks)lexicons/app/certified/badge/definition.json(1 hunks)lexicons/app/certified/badge/issuance.json(1 hunks)lexicons/app/certified/badge/response.json(1 hunks)lexicons/app/certified/defs.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- ERD.puml
🧰 Additional context used
📓 Path-based instructions (3)
lexicons/**/*.json
📄 CodeRabbit inference engine (Custom checks)
lexicons/**/*.json: When adding, modifying, or deleting files in lexicons//*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
When adding, modifying, or deleting files in lexicons//*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Verify that lexicon IDs in JSON files match what's documented in README.md
lexicons/**/*.json: After modifying lexicon JSON files, regenerate TypeScript types by runningnpm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Runnpm run checkbefore committing to validate lexicon syntax and ensure valid lexicon definitions
UpdateERD.pumlwhen modifying lexicon structures to reflect entity relationship changes
UpdateREADME.mddocumentation when adding or modifying lexicon definitions
Organize lexicon files by namespace following the directory structure pattern (e.g.,org/hypercerts/claim/*.json)
Files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.json
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.jsonREADME.md
README.md
📄 CodeRabbit inference engine (Custom checks)
README.md: Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directory
Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Files:
README.md
🧠 Learnings (16)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure that all lexicons documented in README.md exist as JSON files in the lexicons/ directory
Applied to files:
lexicons/app/certified/badge/response.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/defs.jsonREADME.md
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to lexicons/**/*.json : When adding, modifying, or deleting files in lexicons/**/*.json, update ERD.puml if entity relationships changed (add new entities, modify relationships, remove deleted entities)
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to ERD.puml : Verify that entity names in ERD.puml match lexicon IDs (e.g., 'activity' entity should correspond to org.hypercerts.claim.activity lexicon)
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/issuance.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to ERD.puml : Ensure that all entities referenced in ERD.puml correspond to lexicons defined in lexicons/**/*.json
Applied to files:
lexicons/app/certified/badge/response.json
📚 Learning: 2025-12-11T15:44:24.397Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-12-11T15:44:24.397Z
Learning: Applies to README.md : Ensure all properties documented in README.md match the actual JSON schema definitions in lexicons/**/*.json
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-15T10:13:17.689Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:17.689Z
Learning: In the hypercerts-lexicon repository, CI automatically runs npm run gen-api and npm run check to regenerate TypeScript types and validate lexicon definitions. Do not include manual reminders to run these commands in code reviews, as CI handles consistency and validation for all lexicon JSON definitions under lexicons/.
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-15T15:33:19.949Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:19.949Z
Learning: In the hypercerts-lexicon repository, do not comment on Prettier/formatting issues in code reviews since they are reported by the lint workflow. Do not duplicate the lint output in reviews to reduce noise; focus review comments on functional/semantic issues and other non-formatting concerns.
Applied to files:
lexicons/app/certified/badge/response.jsonlexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.json
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions
Applied to files:
lexicons/app/certified/badge/definition.jsonlexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.jsonREADME.md
📚 Learning: 2025-12-15T17:53:11.862Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.862Z
Learning: This repository contains ATProto lexicon definitions for the Hypercerts protocol with auto-generated TypeScript types - prioritize lexicon accuracy and consistency
Applied to files:
lexicons/app/certified/badge/issuance.jsonlexicons/app/certified/defs.jsonREADME.md
📚 Learning: 2025-12-15T16:39:23.964Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 39
File: README.md:17-17
Timestamp: 2025-12-15T16:39:23.964Z
Learning: In the hypercerts-lexicon repository, standardize on the hyphenless spelling 'onchain' across Markdown documentation (e.g., README.md and other md files) to match the industry standard. Update any occurrences of 'on-chain' to 'onchain' and ensure consistency throughout all documentation.
Applied to files:
README.md
🪛 LanguageTool
README.md
[style] ~132-~132: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Issuance **Lexicon ...
(ORIGINALLY_CREATED)
[style] ~145-~145: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | #### Badge Res...
(ORIGINALLY_CREATED)
[style] ~158-~158: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created. | --- ## Hypercerts Lexicons Hy...
(ORIGINALLY_CREATED)
🔇 Additional comments (4)
lexicons/app/certified/badge/response.json (1)
1-36: LGTM! Schema is well-defined and consistent.The badge response lexicon is properly structured with appropriate field types and descriptions. The use of string type for the
weightfield is consistent with the repository's pattern of avoiding float precision issues (as seen in activity weights elsewhere).lexicons/app/certified/badge/issuance.json (1)
13-17: Badge reference and metadata fields are well-defined.The reference to
app.certified.badge.definitionand the optionalnotefield provide good flexibility for badge issuance records. ThecreatedAttimestamp follows the repository's standard pattern.Also applies to: 23-31
lexicons/app/certified/badge/definition.json (1)
13-20: Badge metadata fields are well-structured.The
badgeType,title,description, andcreatedAtfields provide appropriate metadata for badge definitions. The required fields are sensible, and the optional description allows for additional context when needed.Also applies to: 32-35, 44-48
README.md (1)
113-159: Duplication claim and ERD.puml verification: No issues foundThe Badges Lexicon section appears only once in README.md (line 113), with no duplicate instances. ERD.puml has been properly updated with all three badge entities (
badgeDefinition,badgeIssuance,badgeResponse) and their relationships, including the union type for the subject field (targeting either DID or activity records). Schema properties in the JSON files match the documentation in README.md.Likely an incorrect or invalid review comment.
| "allowedIssuers": { | ||
| "type": "array", | ||
| "description": "Optional allowlist of DIDs allowed to issue this badge. If omitted, anyone may issue it.", | ||
| "items": { | ||
| "type": "ref", | ||
| "ref": "app.certified.defs#did" | ||
| } | ||
| }, |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find and examine the app.certified lexicon files
echo "=== Looking for app.certified lexicon files ==="
find . -path "*app/certified*" -name "*.json" 2>/dev/null | head -20
echo -e "\n=== Examining app.certified.defs.json if it exists ==="
if [ -f "lexicons/app/certified/defs.json" ]; then
cat lexicons/app/certified/defs.json | grep -A 10 '"did"'
else
echo "File not found - checking for definition.json"
find . -path "*app/certified*" -name "*.json" -exec cat {} \; 2>/dev/null | head -50
fi
echo -e "\n=== Running npm run check to validate lexicons ==="
if [ -f "package.json" ]; then
npm run check 2>&1 | grep -i "certified\|badge\|error" | head -20
else
echo "package.json not found"
fiRepository: hypercerts-org/hypercerts-lexicon
Length of output: 579
Use type: "string" with format: "did" instead of type: "ref" for array items.
Per ATProto specifications, refs cannot point to token types, and refs cannot be declared as top-level named types in a schema defs array. The app.certified.defs#did is a top-level named primitive definition (type: "string", format: "did"), which violates this constraint. Standard practice across ATProto lexicons uses inline type: "string" with format: "did" for DID fields.
Change lines 36-43 to:
"allowedIssuers": {
"type": "array",
"description": "Optional allowlist of DIDs allowed to issue this badge. If omitted, anyone may issue it.",
"items": {
"type": "string",
"format": "did"
}
}🤖 Prompt for AI Agents
In lexicons/app/certified/badge/definition.json around lines 36 to 43, the array
items for "allowedIssuers" currently use "type":"ref" pointing to
app.certified.defs#did which violates ATProto rules for token/primitive types;
replace the items schema with a primitive DID string by changing the items to
use "type":"string" and "format":"did" and update the description if needed so
the array enforces DID strings rather than a ref.
67f96d7 to
8b9adc3
Compare
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.