Skip to content

Lexicon review - #23

Merged
aspiers merged 16 commits into
mainfrom
lexicon-review
Dec 5, 2025
Merged

Lexicon review#23
aspiers merged 16 commits into
mainfrom
lexicon-review

Conversation

@s-adamantine

@s-adamantine s-adamantine commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added ability to attach supporting documents to rights
    • Added measurement methodology identifier field
  • Improvements

    • Replaced flat timeframe fields with explicit startDate/endDate across claims and contributions
    • Made evidence titles mandatory and clarified descriptions
    • Expanded evaluation linking to reference evidence and measurements
    • Enhanced work scope with flexible label-based conditions

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

@aspiers

aspiers commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 4, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Dec 4, 2025

Copy link
Copy Markdown

Walkthrough

Schema lexicons under org.hypercerts.claim were updated: timeframe fields renamed to startDate/endDate; workScope converted from string to label-condition object; evidence and relationship edges were reworked; measurementMethodType and rights.attachment fields added; evidence title requirement and evaluations linking were changed.

Changes

Cohort / File(s) Summary
ER diagram
ERD.puml
Updated relationships and fields: workTimeFrameFrom/workTimeFrameTo → startDate/endDate (activity, contributions); removed activity→evidence and contributions→hypercert edges; added evaluations→evidence and evaluations→measurements; adjusted workScope representation.
Activity schema
lexicons/org/hypercerts/claim/activity.json
Replaced required workTimeFrameFrom/workTimeFrameTo with startDate/endDate; workScope changed from string to a workScope object (allOf/anyOf/noneOf); removed evidence property.
Contribution schema
lexicons/org/hypercerts/claim/contribution.json
Removed hypercert field; renamed workTimeframeFromstartDate and workTimeframeToendDate.
Evidence schema
lexicons/org/hypercerts/claim/evidence.json
Required fields updated: title is now required; shortDescription made optional; property descriptions adjusted to remove "optional" wording.
Measurement schema
lexicons/org/hypercerts/claim/measurement.json
Added optional measurementMethodType (string, maxLength 30) alongside existing measurementMethodURI; required list unchanged.
Evaluations linkage
(ERD + relevant lexicons)
Evaluations schema reworked to include evaluators[], evidence[], and measurements[] linking to evidence and measurements records; removed prior subject-evaluations linkage (evaluations[]).
Rights schema
lexicons/org/hypercerts/claim/rights.json
Added attachment property as a union of org.hypercerts.defs#uri and org.hypercerts.defs#smallBlob; description updated to reference contributor/owner.
Documentation / README
README.md
Example data and lexicon documentation updated to reflect startDate/endDate, workScope object, measurementMethodType, rights.attachment, lexicon renames (org.hypercerts.collection → org.hypercerts.claim.collection) and related property restructurings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • activity.json: validate workScope object semantics (allOf/anyOf/noneOf) and required-list changes.
    • Cross-file renames: ensure startDate/endDate are consistently applied where referenced (examples, README, ERD).
    • Relationship rewires: confirm evaluations→evidence and →measurements links and removal of activity→evidence do not break integrations or tooling consuming the ERD/lexicons.
    • Evidence schema: ensure callers handle title now required and shortDescription optional.

Poem

🐰 I hopped through fields both new and old,
startDate told when stories unfold,
workScope set labels, neat and spry,
measurements added a method to try,
rights tuck attachments close—huzzah, bye-bye! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Lexicon review' is too vague and generic; it does not convey what specific changes or improvements are being made to the lexicon schema. Use a more descriptive title that captures the main change, such as 'Update lexicon schema with date fields and structural changes' or 'Refactor activity and evidence schemas with startDate/endDate.'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lexicon-review

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a791fa and 1ee4ebd.

⛔ 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 (7)
  • ERD.puml (7 hunks)
  • README.md (7 hunks)
  • lexicons/org/hypercerts/claim/activity.json (3 hunks)
  • lexicons/org/hypercerts/claim/contribution.json (2 hunks)
  • lexicons/org/hypercerts/claim/evidence.json (3 hunks)
  • lexicons/org/hypercerts/claim/measurement.json (1 hunks)
  • lexicons/org/hypercerts/claim/rights.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • lexicons/org/hypercerts/claim/rights.json
  • lexicons/org/hypercerts/claim/evidence.json
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~208-~208: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | ...

(ORIGINALLY_CREATED)

🔇 Additional comments (9)
lexicons/org/hypercerts/claim/contribution.json (2)

11-11: LGTM: Contribution schema decoupled from hypercert reference.

Removing hypercert from the required fields allows contributions to exist independently, which provides more flexibility in the data model.


31-40: LGTM: Field renames improve clarity.

The renaming of workTimeframeFrom/workTimeframeTo to startDate/endDate improves consistency across the schema and aligns with the changes in activity.json.

lexicons/org/hypercerts/claim/measurement.json (1)

37-41: LGTM: Non-breaking addition of measurement method identifier.

The new optional measurementMethodType field provides a convenient short identifier that complements the existing measurementMethodURI field. The 30-character limit is appropriate for a short identifier.

ERD.puml (3)

46-60: LGTM: Activity dataclass correctly reflects schema changes.

The ERD accurately represents the updated activity schema with optional workScope and required startDate/endDate fields.


62-71: No action needed. The ERD correctly represents title as required in the evidence dataclass—it is included in the required array in evidence.json.


149-162: Remove unsupported evaluation relationship edges.

The evaluations schema does not include direct evidence or measurements properties. The actual relationships are:

  • evaluations::subject → links to evaluated claim (via strongRef)
  • evaluations::location → links to location record (optional)

Remove lines 155-156 (evaluations::evidence --> evidence and evaluations::measurements --> measurements).

README.md (2)

108-122: LGTM: Activity properties table accurately reflects schema.

The table correctly documents workScope as an object with label-based conditions and startDate/endDate as required fields, matching the activity.json schema.


133-143: LGTM: Contribution properties table is accurate.

The table correctly shows startDate and endDate as optional fields, matching the contribution.json schema.

lexicons/org/hypercerts/claim/activity.json (1)

11-17: Verify migration strategy for required date fields in the consuming application.

Making startDate and endDate required fields in the schema is a breaking change for existing activity records that lack these values. Since this is a lexicon repository without application-level migration code, ensure the consuming application has a backfill migration strategy for existing records before this schema change is deployed. Document the migration plan or timeline if one exists.


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

Caution

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

⚠️ Outside diff range comments (3)
lexicons/org/hypercerts/claim/contribution.json (2)

11-11: Critical: Required field "hypercert" is not defined in properties.

The required array includes "hypercert", but there is no corresponding hypercert property defined in the properties section (lines 13-46). This will cause schema validation failures. Either:

  1. Remove "hypercert" from the required array if it was intentionally removed, or
  2. Add the hypercert property definition back to the properties section

If the field should be removed, apply this diff:

-        "required": ["hypercert", "contributors", "createdAt"],
+        "required": ["contributors", "createdAt"],

Otherwise, add the missing property definition after line 12:

         "properties": {
+          "hypercert": {
+            "type": "ref",
+            "ref": "com.atproto.repo.strongRef",
+            "description": "A strong reference to the hypercert that this contribution is for"
+          },
           "role": {

31-40: Update documentation to reflect schema field renames.

The contribution schema fields have been renamed from workTimeframeFrom/workTimeframeTo to startDate/endDate, but the README.md and ERD diagram still reference the old field names. Update both documentation files to match the current schema in lexicons/org/hypercerts/claim/contribution.json.

Note: Verification of external API consumers, database queries, and validation logic in dependent repositories is outside the scope of this lexicon repository and should be tracked separately.

lexicons/org/hypercerts/claim/activity.json (1)

11-17: Breaking change: Required fields and validation rules modified.

The required fields have changed significantly:

  • Removed from required: workTimeFrameFrom, workTimeFrameTo (now replaced by startDate, endDate)
  • Added to required: startDate, endDate
  • Changed from required to optional: workScope

This breaks backward compatibility:

  • Existing records without startDate/endDate will fail validation
  • Clients expecting workScope to be required may break
  • Old field names workTimeFrameFrom/workTimeFrameTo no longer exist

Ensure you have:

  1. A migration plan to populate startDate/endDate from old workTimeFrameFrom/workTimeFrameTo values in existing records
  2. Updated API clients to provide the new required fields
  3. Updated clients that depend on workScope being required
  4. Coordinated deployment to avoid validation failures
  5. Updated documentation (README.md is currently out of sync with the schema)
🧹 Nitpick comments (1)
lexicons/org/hypercerts/claim/measurement.json (1)

37-41: LGTM: New optional field is backward compatible.

The measurementMethodType field is a clean addition that provides a short identifier for measurement methodologies. Being optional ensures backward compatibility with existing records.

Consider whether measurementMethodType should be an enum if there's a defined set of standard methodologies (e.g., "RCT", "survey", "observational"). This would provide better validation and consistency across measurements, though the current string approach offers more flexibility.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b5d0b6 and 9a791fa.

📒 Files selected for processing (6)
  • ERD.puml (4 hunks)
  • lexicons/org/hypercerts/claim/activity.json (2 hunks)
  • lexicons/org/hypercerts/claim/contribution.json (1 hunks)
  • lexicons/org/hypercerts/claim/evidence.json (3 hunks)
  • lexicons/org/hypercerts/claim/measurement.json (1 hunks)
  • lexicons/org/hypercerts/claim/rights.json (2 hunks)
🔇 Additional comments (3)
ERD.puml (1)

46-60: LGTM: Diagram accurately reflects schema changes.

The ERD updates correctly document:

  • Date field renames (workTimeFrameFrom/To → startDate/endDate) in activity and contributions
  • New measurementMethodType field in measurements
  • New attachment field in rights

The visual documentation stays synchronized with the schema definitions.

Also applies to: 73-85, 98-108, 122-130

lexicons/org/hypercerts/claim/rights.json (2)

7-7: LGTM: Description clarification improves understanding.

The updated description better specifies that rights apply to both contributors and owners, making the field's purpose clearer.


27-34: The referenced types uri and smallBlob are properly defined in org.hypercerts.defs.

Both type definitions exist in lexicons/org/hypercerts/defs.json and are correctly referenced. No schema validation issues will occur.

Comment on lines 44 to 73
"workScope": {
"type": "string",
"description": "Scope of the work performed",
"maxLength": 5000,
"maxGraphemes": 1000
"type": "object",
"description": "Logical scope of the work using label-based conditions. All labels in `allOf` must apply; at least one label in `anyOf` must apply if provided; no label in `noneOf` may apply.",
"properties": {
"allOf": {
"type": "array",
"description": "Labels that MUST all hold for the scope to apply.",
"items": {
"type": "string"
},
"maxLength": 100
},
"anyOf": {
"type": "array",
"description": "Labels of which AT LEAST ONE must hold (optional). If omitted or empty, imposes no additional condition.",
"items": {
"type": "string"
},
"maxLength": 100
},
"noneOf": {
"type": "array",
"description": "Labels that MUST NOT hold for the scope to apply.",
"items": {
"type": "string"
},
"maxLength": 100
}
}
},

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 | 🔴 Critical

Breaking change: workScope type changed from string to complex object.

The workScope field changed from a simple string to a complex object with allOf/anyOf/noneOf label-based conditions. This is a major breaking change:

  1. Existing records with string workScope values will fail validation
  2. All client code must be updated to construct the new object format
  3. The object allows all properties to be undefined or empty arrays, which may not be semantically useful

Consider adding validation to prevent empty workScope objects:

           "workScope": {
             "type": "object",
             "description": "Logical scope of the work using label-based conditions. All labels in `allOf` must apply; at least one label in `anyOf` must apply if provided; no label in `noneOf` may apply.",
+            "anyOf": [
+              { "required": ["allOf"] },
+              { "required": ["anyOf"] },
+              { "required": ["noneOf"] }
+            ],
             "properties": {

This ensures at least one of the three arrays is explicitly provided, preventing completely empty workScope objects.

Regarding the breaking change: Implement a data migration to convert existing string workScope values. A common approach:

  • Parse comma-separated strings into allOf array
  • Or map to a default label structure

Comment thread lexicons/org/hypercerts/claim/activity.json
Comment thread lexicons/org/hypercerts/claim/evidence.json
@aspiers
aspiers marked this pull request as ready for review December 5, 2025 00:27
@aspiers
aspiers merged commit c1d85a9 into main Dec 5, 2025
2 checks passed
@aspiers
aspiers deleted the lexicon-review branch December 5, 2025 00:31
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