Skip to content

feat: allow for multiple location refs in activity claims - #47

Merged
aspiers merged 2 commits into
developfrom
multiple-location-refs
Jan 12, 2026
Merged

feat: allow for multiple location refs in activity claims#47
aspiers merged 2 commits into
developfrom
multiple-location-refs

Conversation

@satyam-mishra-pce

@satyam-mishra-pce satyam-mishra-pce commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Every organization would have some sites (aka location records) in their organization. They should be able to choose multiple of these sites or location records, at the time of creation of an activity claim.

Until now, we thought the following solution is best:

Fetch the sites in the organization → Merge into a single feature collection → Regenerate a single geojson → Upload as location lexicon.

But it poses some problems:

  • This creates an additional “location” record in the repository. Apps might be using this lexicon to display all the sites in an organization, and an additional record with the same data would just add redundancy.
  • Location lexicon has some required properties, like createdAt, srs, lpVersion, etc… which might be important for the sites if they exist individually. Creating a new location lexicon would REQUIRE those properties, and would also lead to loss of information holded by the individual sites. Other unrequired fields, such as “name” that exist for individual location records would also be lost.
  • Most importantly, the new aggregated location record just created, would not be able to reference to the other stuff that the individual location records did. For example, if there is a relationship defined between a project and a location record, it would be lost if we just create a new location record with the same geojson data.
  • Changes in the location record, such as “name” of the site.. won’t be synced once the claim activity is created.

Therefore, we propose a solution where the location property in the activity record holds an array of multiple location refs. This would solve all the problems listed so far.. and doesn’t seem to have any downsides.

Summary by CodeRabbit

  • New Features

    • Activity claims now support multiple locations: activities can include an array of location references rather than a single location, enabling listing of several places per activity.
  • Documentation

    • Updated lexicon docs and README to reflect multi-location support, including examples and usage guidance for the new array-based locations field.

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

@coderabbitai

coderabbitai Bot commented Dec 22, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Replaces the singular location field with a locations array of strong refs (com.atproto.repo.strongRef) in the activity claim lexicon; updates README, ERD, and a changeset to record the minor version change.

Changes

Cohort / File(s) Summary
Schema
lexicons/org/hypercerts/claim/activity.json
Replaced location (single ref) with locations (array of ref to com.atproto.repo.strongRef); description updated to indicate multiple locations.
Documentation
README.md
Updated documentation and table entries to reflect locationlocations rename and new array semantics.
ER Diagram
ERD.puml
Changed activity field from location?locations[]? and updated the relationship edge to activity::locations --> location.
Release / Changeset
.changeset/sparkly-doors-bet.md
Added changeset marking @hypercerts-org/lexicon as a minor bump with note: "Add support for multiple locations in an activity claim."

Sequence Diagram(s)

(omitted — change is a schema/documentation update without multi-component control-flow changes)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • s-adamantine
  • holkexyz

Poem

🐰 I hopped through schema, light and quick,

One spot became many — a playful trick.
Activities roam to places anew,
Little paws clap, the map grew and grew. 🌷


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 README.md line 300 documents locations as Type: ref, but activity.json defines it as type: array with items of type ref. Documentation is out of sync with the actual JSON schema. Update README.md line 300 to change locations Type from ref to array, and ensure the description matches the JSON schema definition exactly.
✅ 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 'feat: allow for multiple location refs in activity claims' accurately summarizes the main change: converting the location property from a single reference to an array of references.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 d28e27b and 6fbcb6c.

📒 Files selected for processing (1)
  • lexicons/org/hypercerts/claim/activity.json
🧰 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/org/hypercerts/claim/activity.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/org/hypercerts/claim/activity.json
🧠 Learnings (3)
📓 Common 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 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-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/org/hypercerts/claim/activity.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/org/hypercerts/claim/activity.json
🪛 GitHub Actions: Lint
lexicons/org/hypercerts/claim/activity.json

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.

🪛 GitHub Actions: Validate release (PR)
lexicons/org/hypercerts/claim/activity.json

[error] 1-1: Prettier formatting check failed in 'lexicons/org/hypercerts/claim/activity.json'. Run 'prettier --write lexicons/org/hypercerts/claim/activity.json' to fix code style issues. (format:check)

Comment on lines 71 to 78
"location": {
"type": "ref",
"ref": "com.atproto.repo.strongRef",
"description": "A strong reference to the location where the activity was performed. The record referenced must conform with the lexicon app.certified.location."
"type": "array",
"description": "An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location.",
"items": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update README.md and ERD.puml to reflect the schema change.

The location property changed from a single reference to an array, altering the cardinality of the activity-to-location relationship. Per the coding guidelines, both README.md and ERD.puml should be updated:

  • README.md: Document that location is now an array of strong references supporting multiple locations per activity.
  • ERD.puml: Update the entity relationship diagram to reflect the new 1-to-many cardinality between activity and location records.

Based on coding guidelines: "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)" and "update ERD.puml if entity relationships changed."

🤖 Prompt for AI Agents
In lexicons/org/hypercerts/claim/activity.json around lines 71-78, the
"location" property was changed from a single strongRef to an array of
strongRefs; update README.md to document that activity.location is now an array
(supports multiple locations) and revise any examples or schema snippets to show
an array of com.atproto.repo.strongRef items, and update ERD.puml to change the
relationship between Activity and Location from 1-to-1 to 1-to-many (adjust
cardinality notation and any labels) so the docs and diagram reflect the new
cardinality.

⚠️ Potential issue | 🔴 Critical

Breaking change: single ref → array requires migration strategy.

Changing location from a single strong reference to an array is a breaking change. Existing activity records that contain a single location reference will become invalid against the new schema. Consider:

  • Migration path: How will existing records be migrated? Will there be a script to wrap single refs in arrays?
  • Backward compatibility: Should there be a transition period supporting both formats via a union type?
  • Client impact: All clients reading/writing activity records must be updated simultaneously.
Alternative: Union type for backward compatibility

If backward compatibility during migration is needed, consider a union that accepts both single ref and array:

 "location": {
-  "type": "array",
-  "description": "An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location.",
-  "items": {
-    "type": "ref",
-    "ref": "com.atproto.repo.strongRef" 
-  }
+  "type": "union",
+  "description": "A strong reference or array of strong references to the location(s) where activity was performed. The record referenced must conform with the lexicon app.certified.location.",
+  "refs": ["com.atproto.repo.strongRef", "#locationArray"]
 }

Then define locationArray in defs:

"locationArray": {
  "type": "array",
  "items": {
    "type": "ref",
    "ref": "com.atproto.repo.strongRef"
  }
}

This would allow both old (single ref) and new (array) formats during transition, with eventual deprecation of the single-ref variant.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In lexicons/org/hypercerts/claim/activity.json around lines 71-78, the schema
change from a single strongRef for "location" to an array is a breaking change;
update the schema and migration plan by either (1) providing a migration
script/utility to convert existing records by wrapping existing single refs into
single-element arrays and documenting the run procedure, or (2) implement a
backward-compatible union in the schema that accepts either a single ref or an
array (add a "locationArray" def for the array form and make "location" a union
of "ref" and "locationArray"), and communicate a deprecation timeline for the
single-ref variant so clients can be updated gradually.

@holkexyz holkexyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, this makes sense to me. Adding Adam as a reviewer.

@holkexyz
holkexyz requested a review from aspiers January 5, 2026 18:39

@aspiers aspiers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@satyam-mishra-pce Please could you fix the linting errors and include doc updates as highlighted by CodeRabbit? Thanks!

@changeset-bot

changeset-bot Bot commented Jan 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0ae8ed0

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

This PR includes changesets to release 1 package
Name Type
@hypercerts-org/lexicon Minor

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

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

@satyam-mishra-pce
satyam-mishra-pce changed the base branch from main to develop January 10, 2026 14:45
@satyam-mishra-pce
satyam-mishra-pce changed the base branch from develop to main January 10, 2026 14:45
@satyam-mishra-pce
satyam-mishra-pce changed the base branch from main to develop January 10, 2026 14:51
coderabbitai[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
ERD.puml (1)

56-71: ERD field should reflect array semantics (locations[]?, not locations?).

Right now the activity dataclass suggests a singular optional field, but the lexicon change is an array. This will diverge from the schema and mislead readers. As per coding guidelines / learnings, ERD should match lexicon structures.

Proposed fix
 dataclass activity <<largeBold>> #B4E5D0 {
     !if (SHOW_FIELDS == "true")
@@
     contributions[]?
-    locations?
+    locations[]?
     rights?
     project?
     createdAt
     !endif
 }
README.md (1)

289-302: README: locations row is inconsistent (Type says ref, description says array).

This should document locations as an optional array (of strong refs), otherwise readers will implement the wrong shape. As per coding guidelines, README properties must match the lexicon schema.

Proposed fix
-| `locations`         | `ref`    | ❌       | An array of strong references to the locations where the work for done hypercert was located    | References must conform to `app.certified.location`                       |
+| `locations`        | `array`  | ❌       | Strong references to the location(s) where the activity took place               | References must conform to `app.certified.location`                       |
🧹 Nitpick comments (1)
ERD.puml (1)

305-309: Relationship rename looks right; consider adding multiplicity to make “many locations” obvious.

activity::locations --> location aligns with the rename. Nice-to-have: annotate cardinality (e.g., 0..*) so the multi-ref intent is clear even when fields are hidden.

📜 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 db586a3 and 6a33949.

📒 Files selected for processing (2)
  • ERD.puml
  • README.md
🧰 Additional context used
📓 Path-based instructions (3)
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
!(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:

  • ERD.puml
  • 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 (13)
📚 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
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes

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

  • 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 : 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:

  • README.md
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions

Applied to files:

  • 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:

  • 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.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)

Applied to files:

  • 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 that all lexicons documented in README.md exist as JSON files in the lexicons/ directory

Applied to files:

  • README.md
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Run `npm run check` before committing to validate lexicon syntax and ensure valid lexicon definitions

Applied to files:

  • README.md
📚 Learning: 2025-12-15T10:13:27.945Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:27.945Z
Learning: For the hypercerts-lexicon repository, CI automatically runs `npm run gen-api` and `npm run check` to regenerate TypeScript types and validate lexicon definitions, so manual reminders about running these commands are not needed in code reviews.

Applied to files:

  • 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 ERD.puml : Ensure that all entities referenced in ERD.puml correspond to lexicons defined in lexicons/**/*.json

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

satyam-mishra-pce and others added 2 commits January 12, 2026 14:38
Every organization would have some sites (aka location records) in their organization. They should be able to choose multiple of these sites or location records, at the time of creation of an activity claim.

Until now, we thought the following solution is best:

Fetch the sites in the organization → Merge into a single feature collection → Regenerate a single geojson → Upload as location lexicon.

But it poses some problems:

- This creates an additional “location” record in the repository. Apps might be using this lexicon to display all the sites in an organization, and an additional record with the same data would just add redundancy.
- Location lexicon has some required properties, like `createdAt`, `srs`, `lpVersion`, etc… which might be important for the sites if they exist individually. Creating a new location lexicon would REQUIRE those properties, and would also lead to loss of information holded by the individual sites. Other unrequired fields, such as “name” that exist for individual location records would also be lost.
- Most importantly, the new aggregated location record just created, would not be able to reference to the other stuff that the individual location records did. For example, if there is a relationship defined between a project and a location record, it would be lost if we just create a new location record with the same geojson data.
- Changes in the location record, such as “name” of the site.. won’t be synced once the claim activity is created.

Therefore, we propose a solution where the `location` property in the `activity` record holds an array of multiple `location` refs. This would solve all the problems listed so far.. and doesn’t seem to have any downsides.
We don't use bun in this repo.  This was accidentally added a while ago.
@aspiers
aspiers force-pushed the multiple-location-refs branch from 37b27ec to 0ae8ed0 Compare January 12, 2026 14:40
@aspiers

aspiers commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

@satyam-mishra-pce To keep the git history clean I extracted the bunb.lock deletion into a separate commit, and squashed all the other changes into one commit, since they are all part of the same logical change.

@aspiers aspiers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think this is good now!

@aspiers
aspiers merged commit 556471b into develop Jan 12, 2026
2 of 3 checks passed
@aspiers
aspiers deleted the multiple-location-refs branch January 12, 2026 14:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @README.md:
- Line 300: Update the documentation row for the `locations` field: change the
Type column from `ref` to `array`, and replace the current description with the
schema-accurate text such as "An array of strong references to the location
where activity was performed. The record referenced must conform with the
lexicon app.certified.location." Ensure the README entry for `locations` matches
the JSON schema semantics (array of refs) and the references constraint.
📜 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 cfb98d4 and 0ae8ed0.

⛔ Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
📒 Files selected for processing (4)
  • .changeset/sparkly-doors-bet.md
  • ERD.puml
  • README.md
  • lexicons/org/hypercerts/claim/activity.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/sparkly-doors-bet.md
  • lexicons/org/hypercerts/claim/activity.json
🧰 Additional context used
📓 Path-based instructions (3)
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
!(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:

  • ERD.puml
  • 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 (12)
📚 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
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Update `ERD.puml` when modifying lexicon structures to reflect entity relationship changes

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

  • 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 lexicons/**/*.json : Verify that lexicon IDs in JSON files match what's documented in README.md

Applied to files:

  • 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:

  • 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.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Update `README.md` documentation when adding or modifying lexicon definitions

Applied to files:

  • README.md
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Organize lexicon files by namespace following the directory structure pattern (e.g., `org/hypercerts/claim/*.json`)

Applied to files:

  • 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 that all lexicons documented in README.md exist as JSON files in the lexicons/ directory

Applied to files:

  • README.md
📚 Learning: 2025-12-15T17:53:11.871Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-lexicon PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T17:53:11.871Z
Learning: Applies to lexicons/**/*.json : Run `npm run check` before committing to validate lexicon syntax and ensure valid lexicon definitions

Applied to files:

  • README.md
📚 Learning: 2025-12-15T10:13:27.945Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 34
File: lexicons/org/hypercerts/claim/evaluation.json:45-63
Timestamp: 2025-12-15T10:13:27.945Z
Learning: For the hypercerts-lexicon repository, CI automatically runs `npm run gen-api` and `npm run check` to regenerate TypeScript types and validate lexicon definitions, so manual reminders about running these commands are not needed in code reviews.

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] ~302-~302: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | ...

(ORIGINALLY_CREATED)

🔇 Additional comments (1)
ERD.puml (1)

66-66: LGTM!

The field rename from location? to locations[]? and the updated relationship activity::locations --> location correctly reflect the schema change to support multiple location references. The array notation [] and optional marker ? are consistent with the lexicon definition.

Also applies to: 307-307

Comment thread README.md
| `endDate` | `string` | ✅ | When the work ended | |
| `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contribution` |
| `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
| `locations` | `ref` | ❌ | An array of strong references to the locations where the work for done hypercert was located | References must conform to `app.certified.location` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat lexicons/org/hypercerts/claim/activity.json | jq '.defs.main.record.properties.locations'

Repository: hypercerts-org/hypercerts-lexicon

Length of output: 347


Type column should be array, not ref, and the description must match the actual JSON schema.

The Type column currently shows ref, but the JSON schema defines locations as type: "array" with items of type ref. Additionally, the description in README doesn't match the actual schema. The schema states: "An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location."

Proposed fix
-| `locations`        | `ref`    | ❌       | An array of strong references to the locations where the work for done hypercert was located | References must conform to `app.certified.location`                       |
+| `locations`        | `array`  | ❌       | An array of strong references to the location where activity was performed. The record referenced must conform with the lexicon app.certified.location. |                                                                             |
🤖 Prompt for AI Agents
In @README.md at line 300, Update the documentation row for the `locations`
field: change the Type column from `ref` to `array`, and replace the current
description with the schema-accurate text such as "An array of strong references
to the location where activity was performed. The record referenced must conform
with the lexicon app.certified.location." Ensure the README entry for
`locations` matches the JSON schema semantics (array of refs) and the references
constraint.

@satyam-mishra-pce

Copy link
Copy Markdown
Contributor Author

@satyam-mishra-pce To keep the git history clean I extracted the bunb.lock deletion into a separate commit, and squashed all the other changes into one commit, since they are all part of the same logical change.

Thanks. I'll remember in future to squash commits that fall under one logical change.

@aspiers

aspiers commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

@satyam-mishra-pce commented on Jan 15, 2026, 4:18 PM GMT+11:

Thanks. I'll remember in future to squash commits that fall under one logical change.

Great thanks, that will make reviewing a lot easier! And also keep the git history easier to follow in the long term.

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