Skip to content

Conversation

@holkexyz
Copy link
Member

@holkexyz holkexyz commented Dec 16, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a comprehensive badges system enabling creation of badge definitions with customizable types, titles, and descriptions.
    • Added badge issuance functionality to assign badges to users with optional notes.
    • Enabled recipients to respond to badge issuances with accept or reject options.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 67f96d7 and 8b9adc3.

⛔ Files ignored due to path filters (4)
  • ERD-with-fields.png is excluded by !**/*.png
  • ERD-with-fields.svg is excluded by !**/*.svg
  • ERD.png is excluded by !**/*.png
  • ERD.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • ERD.puml (2 hunks)
  • README.md (1 hunks)
  • lexicons/app/certified/badge/award.json (1 hunks)
  • lexicons/app/certified/badge/definition.json (1 hunks)
  • lexicons/app/certified/badge/response.json (1 hunks)
  • lexicons/app/certified/defs.json (1 hunks)
  • lexicons/org/hypercerts/claim/evaluation.json (1 hunks)
  • lexicons/org/hypercerts/claim/measurement.json (1 hunks)
  • lexicons/org/hypercerts/funding/receipt.json (1 hunks)

Walkthrough

This 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

Cohort / File(s) Summary
Entity Relationship Diagram
ERD.puml
Adds three new badge-related data classes (badgeDefinition, badgeIssuance, badgeResponse) with fields and establishes relationships: badgeIssuance→badgeDefinition, badgeResponse→badgeIssuance, plus links to contributor (DID) and activity (record).
Documentation
README.md
Adds Badges Lexicon section under Certified Lexicons documenting badge definition, issuance, and response lexicons with properties and types. Note: section appears duplicated in two locations.
Badge Definition Lexicon
lexicons/app/certified/badge/definition.json
Defines app.certified.badge.definition record with required fields (title, badgeType, icon, createdAt), optional description and allowedIssuers array (refs to DIDs), and blob constraints for icon (max 1MB, image formats: png, jpeg, webp, svg+xml).
Badge Issuance Lexicon
lexicons/app/certified/badge/issuance.json
Defines app.certified.badge.issuance record with required fields (badge ref to definition, subject union of DID or strongRef, createdAt), optional note, and key tid.
Badge Response Lexicon
lexicons/app/certified/badge/response.json
Defines app.certified.badge.response record with required fields (badgeIssuance ref, response enum ["accepted","rejected"], createdAt), optional weight, and key tid.
Definitions Schema
lexicons/app/certified/defs.json
Adds shared type definition app.certified.defs with defs.did type (DID string format) for reuse across badge and related protocols.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Multiple new lexicon files with cross-references requiring consistency verification across badge definition, issuance, and response schemas
  • README duplication noted in summary—verify whether intentional or merge artifact
  • Icon blob constraints and allowedIssuers array structure should be validated against intended use cases
  • Confirm all ref targets (app.certified.badge.definition, app.certified.defs#did, com.atproto.repo.strongRef) exist or are correctly defined

Suggested reviewers

  • s-adamantine

Poem

🐰 Three badges hop into view,
Definition, Issuance, Response too!
DIDs and icons in perfect arrays,
The schema grows stronger with each passing day! ✨

Pre-merge checks and finishing touches

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)
Check name Status Explanation Resolution
Lexicon Documentation Sync ❌ Error PR fails to maintain synchronization between JSON lexicons, README.md, and ERD.puml due to critical schema violations. Fix schema violations in definition.json and issuance.json; update ERD.puml and README.md to accurately reflect union semantics.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'adding badges' directly reflects the main change: three new badge-related lexicon definitions (badgeDefinition, badgeIssuance, badgeResponse) are added across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Copy link

@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

🧹 Nitpick comments (1)
lexicons/app/badges/definition.json (1)

13-16: Consider constraining badgeType with an enum.

The badgeType field 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

📥 Commits

Reviewing files that changed from the base of the PR and between d1eec9e and 0c82764.

📒 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 running npm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Run npm run check before committing to validate lexicon syntax and ensure valid lexicon definitions
Update ERD.puml when modifying lexicon structures to reflect entity relationship changes
Update README.md documentation 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.json
  • lexicons/app/badges/definition.json
  • lexicons/app/badges/response.json
!(types)/**/*.{js,ts,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Run npm run format with Prettier before committing to ensure consistent code formatting

Files:

  • lexicons/app/badges/issue.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • 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: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes

Applied to files:

  • lexicons/app/badges/issue.json
  • lexicons/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.json
  • 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: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification

Applied to files:

  • lexicons/app/badges/issue.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • lexicons/app/badges/definition.json
  • lexicons/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.json
  • lexicons/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 refs array 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.

@holkexyz holkexyz requested a review from aspiers December 16, 2025 14:41
Copy link

@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: 4

🧹 Nitpick comments (1)
lexicons/app/certified/badges/response.json (1)

23-26: Consider constraining weight to accepted responses only.

The weight field is described as being for "accepted badges," but the schema allows it to be set when response is "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

📥 Commits

Reviewing files that changed from the base of the PR and between 351b626 and 1877990.

📒 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 running npm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Run npm run check before committing to validate lexicon syntax and ensure valid lexicon definitions
Update ERD.puml when modifying lexicon structures to reflect entity relationship changes
Update README.md documentation 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
  • lexicons/app/certified/badges/issue.json
  • lexicons/app/certified/badges/definition.json
!(types)/**/*.{js,ts,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Run npm run format with Prettier before committing to ensure consistent code formatting

Files:

  • lexicons/app/certified/badges/response.json
  • lexicons/app/certified/badges/issue.json
  • lexicons/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.json
  • lexicons/app/certified/badges/issue.json
  • 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/response.json
  • lexicons/app/certified/badges/issue.json
  • 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 : Update `README.md` documentation when adding or modifying lexicon definitions

Applied to files:

  • lexicons/app/certified/badges/issue.json
  • 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 README.md to reflect changes (document new lexicons, update modified properties, remove deleted lexicons from documentation)

Applied to files:

  • lexicons/app/certified/badges/issue.json
  • 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 : 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.

Comment on lines 21 to 31
"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
},
Copy link

@coderabbitai coderabbitai bot Dec 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Copy link
Member Author

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;)

Copy link

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!

@aspiers aspiers force-pushed the adding-badges branch 2 times, most recently from a8b7f17 to 934e5ba Compare December 16, 2025 23:49
Copy link

@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: 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 field badgeDefinition to badge for consistency.

In issue.json, the property is named badge (line 13), but the ERD shows badgeDefinition. 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

📥 Commits

Reviewing files that changed from the base of the PR and between b208ca0 and a8b7f17.

⛔ Files ignored due to path filters (4)
  • ERD-with-fields.png is excluded by !**/*.png
  • ERD-with-fields.svg is excluded by !**/*.svg
  • ERD.png is excluded by !**/*.png
  • ERD.svg is 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 running npm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Run npm run check before committing to validate lexicon syntax and ensure valid lexicon definitions
Update ERD.puml when modifying lexicon structures to reflect entity relationship changes
Update README.md documentation 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.json
  • lexicons/app/certified/badges/issue.json
!(types)/**/*.{js,ts,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Run npm run format with Prettier before committing to ensure consistent code formatting

Files:

  • lexicons/app/certified/badges/definition.json
  • lexicons/app/certified/badges/issue.json
  • ERD.puml
  • README.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.json
  • lexicons/app/certified/badges/issue.json
  • README.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.json
  • lexicons/app/certified/badges/issue.json
  • 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: 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
  • lexicons/app/certified/badges/issue.json
  • ERD.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.json
  • lexicons/app/certified/badges/issue.json
  • 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: 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.json
  • ERD.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.json
  • lexicons/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.json
  • lexicons/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.json
  • lexicons/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.json
  • lexicons/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 → badgeDefinition reflects the badge ref
  • badgeResponse → badgeIssued reflects the badgeIssued ref
  • The "may target" relationships accurately represent the union type in the subject field
README.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 generic image/* wildcard pattern documented in README. Update lines 127-128 to reflect the actual constraints. Additionally, fix the subject field in issue.json line 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/**/*.json
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: 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
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: 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.

Copy link

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8b7f17 and 934e5ba.

⛔ Files ignored due to path filters (4)
  • ERD-with-fields.png is excluded by !**/*.png
  • ERD-with-fields.svg is excluded by !**/*.svg
  • ERD.png is excluded by !**/*.png
  • ERD.svg is 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 running npm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Run npm run check before committing to validate lexicon syntax and ensure valid lexicon definitions
Update ERD.puml when modifying lexicon structures to reflect entity relationship changes
Update README.md documentation 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 format with Prettier before committing to ensure consistent code formatting

Files:

  • lexicons/app/certified/badges/response.json
  • ERD.puml
  • README.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.json
  • README.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.json
  • 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: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes

Applied to files:

  • lexicons/app/certified/badges/response.json
  • README.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.json
  • README.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.puml
  • README.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 definitions
  • badgeResponse → badgeIssuance: Links responses to issuances
  • badgeIssuance → contributor: Supports targeting DIDs
  • badgeIssuance → activity: Supports targeting activity records
README.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.

Copy link

@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

♻️ Duplicate comments (1)
lexicons/app/certified/badge/issuance.json (1)

18-22: Critical: Union cannot reference primitive string type.

The subject union references "app.certified.defs#did", which is defined as a primitive string type in defs.json. ATProto unions require object definitions with a $type discriminator, not primitive types. This will cause schema validation to fail.

This issue is addressed by updating app.certified.defs to include a proper object wrapper for DID (see comment on defs.json). Once defs.json defines didSubject as 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

📥 Commits

Reviewing files that changed from the base of the PR and between 934e5ba and 67f96d7.

⛔ Files ignored due to path filters (4)
  • ERD-with-fields.png is excluded by !**/*.png
  • ERD-with-fields.svg is excluded by !**/*.svg
  • ERD.png is excluded by !**/*.png
  • ERD.svg is 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 running npm run gen-api
Lexicon JSON files should follow the ATProto lexicon schema v1 specification
Run npm run check before committing to validate lexicon syntax and ensure valid lexicon definitions
Update ERD.puml when modifying lexicon structures to reflect entity relationship changes
Update README.md documentation 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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
!(types)/**/*.{js,ts,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Run npm run format with Prettier before committing to ensure consistent code formatting

Files:

  • lexicons/app/certified/badge/response.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
  • README.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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
  • 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: 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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/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.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/defs.json
  • README.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.json
  • lexicons/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.json
  • lexicons/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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
  • 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: Applies to lexicons/**/*.json : Lexicon JSON files should follow the ATProto lexicon schema v1 specification

Applied to files:

  • lexicons/app/certified/badge/response.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/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.json
  • lexicons/app/certified/badge/definition.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/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.json
  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
  • 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:

  • lexicons/app/certified/badge/issuance.json
  • lexicons/app/certified/defs.json
  • 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 (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 weight field 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.definition and the optional note field provide good flexibility for badge issuance records. The createdAt timestamp 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, and createdAt fields 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 found

The 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.

Comment on lines +36 to +43
"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"
}
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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"
fi

Repository: 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.

@aspiers aspiers merged commit d1e4ff1 into main Dec 17, 2025
3 checks passed
@aspiers aspiers deleted the adding-badges branch December 17, 2025 00:11
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.

3 participants