Skip to content

create array for contributors in activity claim and split contributorJSON into two schemas#102

Merged
aspiers merged 4 commits intodevelopfrom
contributors-weights-details
Jan 21, 2026
Merged

create array for contributors in activity claim and split contributorJSON into two schemas#102
aspiers merged 4 commits intodevelopfrom
contributors-weights-details

Conversation

@holkexyz
Copy link
Member

@holkexyz holkexyz commented Jan 21, 2026

Fixes #83

Summary by CodeRabbit

  • New Features

    • New contributor objects with optional weight and richer contribution details; separate contributor information and contribution details record types.
  • Refactor

    • Replaced legacy contributions array with structured contributors array; split identity and detail data for clarity; contributor role/description length limits expanded.
  • Documentation

    • Regenerated schema docs to reflect the new contributor model.
  • Chores

    • CI and pre-commit updated to regenerate schemas and run formatting/checks; migration of existing data to the new format required.

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: bec3bc9

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

This PR refactors contribution-related lexicons: renames Activity's contributionscontributors, replaces strongRef arrays with contributor objects, splits contributor into contributorInformation and contributionDetails, and updates docs, ERD, and schema-generation/CI tooling. Migration of existing data is required.

Changes

Cohort / File(s) Summary
Activity lexicon & defs
lexicons/org/hypercerts/claim/activity.json, SCHEMAS.md, ERD.puml
Replace contributions with contributors (array of contributor objects); add contributor, contributorIdentity, contributorRole defs; update activityWeight references and diagram mappings.
Contributor split
lexicons/org/hypercerts/claim/contributorInformation.json, lexicons/org/hypercerts/claim/contributionDetails.json
Remove org.hypercerts.claim.contributor; add contributorInformation (identifier, displayName, image, createdAt) and contributionDetails (role, contributionDescription, startDate, endDate); increase string limits on description/role.
Docs & manifest
SCHEMAS.md, AGENTS.md, .changeset/refactor-contributions-structure.md, .coderabbit.yaml
Update SCHEMAS.md, AGENTS.md, and changeset to describe new structure and migration guidance; adjust repo validation guidance for lexicon README updates.
Tooling & CI
scripts/generate-schemas.js, package.json, .github/workflows/test.yml, .husky/pre-commit
Move gen-schemas-md out of check script into pre-commit and GitHub Actions; minor loop refactor in schema generator; update pre-commit to run gen-schemas-md and format before checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • s-adamantine

Poem

🐰 I hopped through schemas, nibbling lines anew,
Split a name in two and straightened every view.
Contributors now hold names, roles, and time,
I thump a happy beat — tidy, neat, sublime.


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 2 warnings)
Check name Status Explanation Resolution
Lexicon Documentation Sync ❌ Error ERD.puml diagram incorrectly represents contributor object structure and identifier field relationship. Correct ERD.puml to show activity::contributors pointing to intermediate #contributor entity with proper field references, and remove incorrect arrow from contributorInformation::identifier to contributorEntity.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Lexicons Styleguide Compliance ⚠️ Warning Three string-type fields in the lexicon files lack maxLength/maxGraphemes constraints required by ATProto styleguide: contributorIdentity, weight, and identifier. Add maxLength constraints to all three string fields or document intentional deviations from the styleguide in the lexicon JSON files.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: renaming contributions to contributors and splitting the contributor schema into two separate files.
Linked Issues check ✅ Passed The PR successfully addresses issue #83 by renaming contributions to contributors in the activity claim and restructuring the contributor data model.
Out of Scope Changes check ✅ Passed Changes to workflow files, scripts, documentation, and package.json updates are reasonable supporting changes for the schema refactor.
✨ Finishing touches
  • 📝 Generate docstrings

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

❤️ Share

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

@holkexyz holkexyz force-pushed the contributors-weights-details branch from ea549d6 to e0bb361 Compare January 21, 2026 04:35
@aspiers aspiers force-pushed the contributors-weights-details branch from e0bb361 to 5c9ce17 Compare January 21, 2026 04:54
@aspiers aspiers marked this pull request as ready for review January 21, 2026 04:55
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

Caution

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

⚠️ Outside diff range comments (1)
lexicons/org/hypercerts/claim/activity.json (1)

53-110: Update ERD.puml: field reference should be contributors, not contributions.

The relationship arrow in ERD.puml still references activity::contributions, but the activity.json lexicon now defines this field as contributors. Update line in ERD.puml to reflect the renamed field:

Required fix
activity::contributors -l--> contributor

instead of:

activity::contributions -l--> contributor
🤖 Fix all issues with AI agents
In `@lexicons/org/hypercerts/claim/contributorInformation.json`:
- Around line 1-38: Add documentation for the new lexicon
org.hypercerts.claim.contributorInformation: update README.md’s schema
documentation section to list the lexicon id
org.hypercerts.claim.contributorInformation and enumerate its fields
(identifier:string, displayName:string maxLength 100, image: union of
org.hypercerts.defs#uri and org.hypercerts.defs#smallImage, createdAt:string
format datetime) and note that createdAt is required; update ERD.puml to add a
contributorInformation entity with those attributes and draw relationships
linking contributorInformation to the contributor entity and to activity via the
contributions array (showing multiplicity as appropriate) so the ERD reflects
the new lexicon and its connections.

@aspiers aspiers force-pushed the contributors-weights-details branch from 5c9ce17 to b9813d1 Compare January 21, 2026 05:55
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

🤖 Fix all issues with AI agents
In `@AGENTS.md`:
- Around line 241-245: Update the README instruction that currently references
the incorrect npm script name `npm run gen-schema-md` to the actual script `npm
run gen-schemas-md` so readers run the correct command; locate the string in
AGENTS.md and replace `gen-schema-md` with `gen-schemas-md` (matching the
package.json script name) to avoid confusion.

In `@SCHEMAS.md`:
- Around line 18-30: README.md incorrectly claims "contributors and tokens do
not require lexicons" while contributorInformation.json and
contributionDetails.json lexicons now exist; update README.md to remove or
revise that sentence and add brief entries documenting
org.hypercerts.claim.contributorInformation and
org.hypercerts.claim.contributionDetails (describe purpose and link to their
JSON files), and verify every lexicon listed in README.md matches an actual JSON
file in the repo and reflects the schemas (e.g., reference
contributorInformation.json and contributionDetails.json and ensure names/IDs
match the schema identifiers).
♻️ Duplicate comments (1)
lexicons/org/hypercerts/claim/contributorInformation.json (1)

1-38: Document the new contributorInformation lexicon in README/ERD.
Line 3 introduces a new public lexicon; README.md and ERD.puml should be updated to list the new lexicon ID, fields, and relationships.

As per coding guidelines, please update README.md and ERD.puml.

🧹 Nitpick comments (1)
ERD.puml (1)

297-321: Represent contributors as a dedicated node to avoid implying two arrays.

The current edges can read as two separate arrays off activity.contributors. Consider modeling a contributor node (array item) that points to contributorInformation and contributionDetails for clarity.

♻️ Suggested diagram adjustment
-activity::contributors -l--> contributorInformation
-activity::contributors --> contributionDetails
+activity::contributors -l--> contributor
+contributor::contributorInformation --> contributorInformation
+contributor::contributionDetails --> contributionDetails

Add near the contributorInformation/contributionDetails section:

+dataclass contributor {
+    !if (SHOW_FIELDS == "true")
+    contributorInformation
+    weight?
+    contributionDetails?
+    !endif
+}

@aspiers aspiers self-assigned this Jan 21, 2026
@aspiers aspiers force-pushed the contributors-weights-details branch from b9813d1 to bec3bc9 Compare January 21, 2026 06:50
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

🤖 Fix all issues with AI agents
In `@ERD.puml`:
- Around line 297-302: Update the ERD so activity::contributors points to a new
contributor entity (not directly to contributorInformation or
contributionDetails); model contributor as an entity that contains fields
contributorInformation and contributionDetails which in turn are unions to
either string types (contributorIdentity / contributorRole) or strong
references, and remove the incorrect relationship
contributorInformation::identifier --> contributorEntity (treat identifier as a
plain string attribute, not a FK/reference).

@aspiers aspiers merged commit a173e63 into develop Jan 21, 2026
3 checks passed
@aspiers aspiers deleted the contributors-weights-details branch January 21, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants