change evidence.json to attachment.json and simplify - #118
Conversation
🦋 Changeset detectedLatest commit: 0f3055b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRenames lexicon org.hypercerts.claim.evidence → org.hypercerts.claim.attachment; converts singular subject/content to arrays, adds contentType, rich-text facets, optional location strongRef, removes relationType/contributors/locations, adds defs (weightedContributor, contributorIdentity), updates docs/ERD, and provides migration guidance. Changes
Sequence Diagram(s)(omitted — changes are schema/lexicon updates without a multi-component sequential runtime flow) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches
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. Comment |
1c738b7 to
4bd40b1
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.changeset/rename-evidence-to-attachment.md:
- Around line 23-26: The changeset claims to add `weightedContributor` and
`contributorIdentity` to `org.hypercerts.defs` but `weightedContributor` is not
present anywhere and `contributorIdentity` is only added to `activity.json` (not
`defs.json`); update the changeset text to accurately reflect reality by either
removing the entire "Common definitions (org.hypercerts.defs)" section or
rewriting it to state that `contributorIdentity` was added to the activity
schema and that no `weightedContributor` def was added, and ensure the symbols
`weightedContributor`, `contributorIdentity`, and `org.hypercerts.defs` are
referenced correctly in the updated description.
In `@lexicons/org/hypercerts/claim/attachment.json`:
- Around line 1-81: Create a new changeset markdown in .changeset (e.g.,
add-org-hypercerts-claim-attachment.md) documenting the public API change that
adds the new lexicon org.hypercerts.claim.attachment (include a short title,
description that a new lexicon/record was added, and bump type set to
minor/patch per repo conventions), then run npm run gen-api to regenerate
TypeScript types under generated/ and update generated/exports.ts so the new
lexicon types are exported.
- Line 3: ERD.puml still references the old lexicon name
org.hypercerts.claim.evidence; update the comment at the top from
org.hypercerts.claim.evidence to org.hypercerts.claim.attachment, rename the
dataclass declaration dataclass evidence to dataclass attachment, rename any
fields that include the old prefix (e.g., evidenceURI -> attachmentURI and
similar field names), and update entity relationship lines that reference
evidence (lines that currently link entities to evidence) to link to attachment
instead so all references use org.hypercerts.claim.attachment consistently.
b7ced73 to
1b063e6
Compare
and update SCHEMAS.md to include previously missing lexicons.
1b063e6 to
cbad7c5
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 354-361: Update the "Key fields" list for the attachment schema to
include the required non-facet properties `title` and `createdAt`; locate the
block describing attachments (the list containing `subjects`, `contentType`,
`content`, `location`, `shortDescription`/`description`) and add entries for
`title` (string — required) and `createdAt` (timestamp — required) so the README
documents all non-facet properties of the attachment lexicon.
In `@SCHEMAS.md`:
- Around line 211-224: The schema entry `org.hypercerts.defs` is duplicated
across the Hypercerts and Certified sections; remove the duplicate by keeping
the single authoritative definition under the Certified section and deleting the
copy under the Hypercerts section, then update the generator that produces
SCHEMAS.md so it emits each schema key (e.g., org.hypercerts.defs) only once
(deduplicate by key) and regenerate SCHEMAS.md to reflect the change.
In `@scripts/generate-schemas.js`:
- Around line 329-331: The hypercertsOrder computation currently includes
"org.hypercerts.defs", causing duplicate sections in SCHEMAS.md; update the
hypercertsOrder creation (the categories.hypercerts -> .map(...).sort() step) to
filter out the "org.hypercerts.defs" id (or remove any ids present in
certifiedOrder) so that "org.hypercerts.defs" is not present when you later
iterate to emit Hypercerts sections (refer to hypercertsOrder, certifiedOrder
and the literal id "org.hypercerts.defs").
♻️ Duplicate comments (1)
.changeset/rename-evidence-to-attachment.md (1)
23-25: Verify the changeset claim about new defs inorg.hypercerts.defs.Please confirm that
weightedContributorandcontributorIdentitywere actually added tolexicons/org/hypercerts/defs.json. If not, update this section to reflect the real changes.#!/bin/bash set -euo pipefail echo "=== defs.json presence ===" if [ -f "lexicons/org/hypercerts/defs.json" ]; then echo "defs.json found" echo "=== Search in defs.json ===" rg -n "weightedContributor|contributorIdentity" lexicons/org/hypercerts/defs.json || echo "Not found in defs.json" else echo "defs.json not found" fi echo "=== Search all lexicons ===" rg -n "weightedContributor|contributorIdentity" lexicons/ || echo "Not found in lexicons/"
- Add optional location strongRef property to attachment.json for associating location metadata - Update ERD.puml with location field and relationship arrow - Add 'Creating Attachments' section to README.md with usage examples - Create changeset for patch version bump - Update SCHEMAS.md Follows the same pattern as PR #123 for adding location to collections.
d8a186d to
9d89755
Compare
There was a problem hiding this comment.
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)
SCHEMAS.md (1)
1-4: SCHEMAS.md appears out of sync with the generator (CI diff).The pipeline reports a
git diffinSCHEMAS.mdafter generation. Please re-runnpm run gen-schemas-mdand commit the updated output so CI passes. As per coding guidelines, keep generated docs in sync with lexicon changes.
🤖 Fix all issues with AI agents
In `@scripts/generate-schemas.js`:
- Around line 310-334: generateAdditionalDefsSection is calling
extractPropertyRows without passing the local defs, so ref descriptions for
`#local` refs are not resolved; change the call to pass lexicon.data.defs (e.g.,
extractPropertyRows(defData, defData.required || [], lexicon.data.defs)) and
ensure the same local defs parameter is threaded through any other calls in this
function (and adjust extractPropertyRows signature if needed) so nested def refs
resolve correctly.
♻️ Duplicate comments (1)
.changeset/rename-evidence-to-attachment.md (1)
23-26: Changeset lists defs that don’t appear in the schema outputs.
SCHEMAS.mdshowsorg.hypercerts.defscontaining onlyuri,smallBlob,largeBlob,smallImage,largeImage. IfweightedContributorandcontributorIdentityweren’t added tolexicons/org/hypercerts/defs.json, the changeset should be corrected (or the defs added).#!/bin/bash # Verify defs in org.hypercerts.defs and search for the symbols. defs_file=$(fd -a '^defs\.json$' lexicons | head -n1) if [ -n "$defs_file" ]; then echo "defs file: $defs_file" jq '.defs | keys' "$defs_file" else echo "defs.json not found under lexicons/" fi echo "=== Searching for weightedContributor / contributorIdentity ===" rg -n "weightedContributor|contributorIdentity" lexicons -g '*.json'
9d89755 to
0f3055b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@SCHEMAS.md`:
- Around line 333-337: Add a "#### Defs" subsection to the SCHEMAS.md under the
existing `app.certified.defs` heading and render a defs table for the `did`
property matching the format used in `org.hypercerts.defs`; specifically create
a table row for `did` including its type, description, and any example or
pattern columns used in `org.hypercerts.defs`, ensuring the heading is exactly
"#### Defs" and the property name `did` is spelled the same as in the lexicon.
♻️ Duplicate comments (1)
scripts/generate-schemas.js (1)
310-336: Pass local defs so ref descriptions resolve in nested defs.
extractPropertyRowscan pull descriptions from localdefsforreffields, butgenerateAdditionalDefsSectiondoesn't pass them. This can drop descriptions for#localrefs in additional defs.🛠️ Proposed fix
- const defRows = extractPropertyRows(defData, defData.required || []); + const defRows = extractPropertyRows( + defData, + defData.required || [], + lexicon.data.defs, + );
| ### `app.certified.defs` | ||
|
|
||
| **Description:** Common type definitions used across certified protocols. | ||
|
|
||
| --- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if app.certified.defs exists and what it contains
fd -t f "defs.json" lexicons/app/certified --exec cat {} | jq '.'Repository: hypercerts-org/hypercerts-lexicon
Length of output: 349
🏁 Script executed:
#!/bin/bash
# Check how org.hypercerts.defs is rendered in SCHEMAS.md
grep -A 20 "org.hypercerts.defs" SCHEMAS.md | head -30Repository: hypercerts-org/hypercerts-lexicon
Length of output: 1061
Add defs table to app.certified.defs section in SCHEMAS.md.
The lexicon contains a did definition that should be rendered following the pattern used in org.hypercerts.defs. Add an #### Defs section with a table for the did property after the description.
🤖 Prompt for AI Agents
In `@SCHEMAS.md` around lines 333 - 337, Add a "#### Defs" subsection to the
SCHEMAS.md under the existing `app.certified.defs` heading and render a defs
table for the `did` property matching the format used in `org.hypercerts.defs`;
specifically create a table row for `did` including its type, description, and
any example or pattern columns used in `org.hypercerts.defs`, ensuring the
heading is exactly "#### Defs" and the property name `did` is spelled the same
as in the lexicon.
Summary by CodeRabbit
Breaking Changes
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.