Skip to content

update measurement schema - #120

Merged
aspiers merged 1 commit into
developfrom
update-measurement
Jan 24, 2026
Merged

update measurement schema#120
aspiers merged 1 commit into
developfrom
update-measurement

Conversation

@holkexyz

@holkexyz holkexyz commented Jan 21, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Refactor

    • Measurement schema updated: unit is now required; measurers are optional.
    • Added startDate and endDate for date ranges.
    • Single location replaced by a locations array (multiple geographic references).
    • Comments support richer text with annotation facets; metric/value descriptions clarified; createdAt clarified as client-declared.
  • Refactor (rich text)

    • Short-form text standardized to use facets; long-form content standardized to use leaflet; corresponding short-description/summary fields added.

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

@changeset-bot

changeset-bot Bot commented Jan 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b2f7b68

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

coderabbitai Bot commented Jan 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@aspiers has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 31 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.

📝 Walkthrough

Walkthrough

The measurement lexicon schema is refactored: a required unit field is added, measurers becomes optional, the single location ref is replaced by a locations array, and optional startDate/endDate, comment, and commentFacets fields are introduced; docs and migration examples updated.

Changes

Cohort / File(s) Summary
Measurement schema & changelog
lexicons/org/hypercerts/claim/measurement.json, .changeset/refactor-measurement-schema.md
Schema: add required unit (string, maxLength 50); add optional startDate/endDate (datetime); replace location (single strongRef) with locations (array of strongRefs, maxLength 100); add comment and commentFacets; move measurers from required → optional; update metric/value descriptions and required array. Changelog includes before/after migration examples.
Schema docs
SCHEMAS.md
Documentation: reflect expanded measurement properties (unit, dates, locations array, comments/facets), updated field descriptions, and required-field changes; layout and examples updated to match new schema shape.

Sequence Diagram(s)

(silently omitted — changes are schema/data-shape updates, not multi-component control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • holkexyz
  • aspiers

Poem

🐰 I hopped through JSON, tidy and bright,
Units tucked in, dates snuggled tight,
Locations multiplied, comments in cheer,
Data now clearer — a carrot for the year! 🥕


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)
Check name Status Explanation Resolution
Lexicon Documentation Sync ❌ Error ERD.puml is out of sync with lexicon changes—still references old singular 'location' field instead of new 'locations' array structure. Update ERD.puml to replace 'measurement::location' and 'measurement --> location' with 'measurement::locations'. Apply pending review comments to SCHEMAS.md and correct changeset package name format.
Lexicons Styleguide Compliance ⚠️ Warning The measurement.json lexicon has multiple style guide compliance violations including missing maxLength constraints on methodURI and commentFacets, and three description strings with style inconsistencies. Add maxLength constraints to methodURI (suggest 2000-5000) and commentFacets (suggest 100), and update descriptions: hyphenate 'one-time', fix 'etc().' punctuation, and remove 'originally' from createdAt.
✅ 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 'update measurement schema' directly relates to the main changes in the PR, which comprehensively refactors the org.hypercerts.claim.measurement schema by introducing new required and optional fields, restructuring location data, and updating field descriptions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 linked an issue Jan 21, 2026 that may be closed by this pull request

@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 (1)
lexicons/org/hypercerts/claim/measurement.json (1)

1-103: Update ERD.puml to reflect the measurement lexicon schema changes.

The .changeset/refactor-measurement-schema.md properly documents the breaking changes (new required unit field and locationlocations array), but ERD.puml still shows the outdated schema with location? (singular) instead of locations[]? (array). Update the measurement dataclass in ERD.puml to match the new schema fields.

@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

🤖 Fix all issues with AI agents
In @.changeset/refactor-richtext-fields.md:
- Around line 1-3: Update the changeset frontmatter to use the required package
name format by replacing the current quoted string "@hypercerts-org/lexicon"
with "hypercerts-org/lexicon" in the frontmatter section; ensure the top-of-file
YAML block (the frontmatter) now lists hypercerts-org/lexicon as the package
name so it conforms to the repo guidelines.

In `@SCHEMAS.md`:
- Around line 112-120: Update the field descriptions to tighten wording and
punctuation: change "one time measurement" to "one-time measurement" in the
`endDate` description and clarify that if one-time the endDate equals the
startDate; replace "etc" with "etc." (with a period) where it appears in the
`commentFacets` description; and remove the word "originally" from the
`createdAt` description so it reads "Client-declared timestamp when this record
was created." Ensure these edits are applied to the corresponding schema entries
(`endDate`, `locations`, `methodType`, `methodURI`, `evidenceURI`, `measurers`,
`comment`, `commentFacets`, `createdAt`) without changing other content.
🧹 Nitpick comments (1)
.changeset/refactor-richtext-fields.md (1)

7-10: Optional: vary repeated "Added …" sentence starts for readability.

Consider rephrasing at least one bullet to avoid repetitive starts.

Comment thread .changeset/refactor-richtext-fields.md Outdated
Comment thread SCHEMAS.md
@aspiers
aspiers force-pushed the update-measurement branch from 1c05d98 to b2f7b68 Compare January 21, 2026 23:34
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.

update measurement

2 participants