Conversation
SemVer allows for breaking changes when the major version is 0.
Include proper compilation checks, and @atcute/leaflet for pub.leaflet lexicon references. Also add eslint.
Avoid a 39MB index.d.ts file!
It was somehow massively bloating dist/exports.d.ts before.
Without this patch, the package.json has an empty repository.url field, which causes npm publish to fail with a provenance verification error. This is a problem because when publishing with --provenance flag, npm validates that the repository URL in package.json matches the provenance statement generated by GitHub Actions. An empty URL causes the validation to fail with error E422. This patch solves the problem by setting the repository.url to the correct GitHub repository URL (https://github.com/hypercerts-org/hypercerts-lexicon), allowing provenance verification to succeed during publishing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This is automatically run via prepublishOnly anyway.
Without this patch, beta packages were published directly using npm publish --tag beta, bypassing the changeset system which manages versioning and tagging. This patch uses npm run release instead, which leverages changeset publish to automatically handle beta tags and git tagging for prerelease versions. The change also updates the logging to include information for beta releases. Co-authored-by: opencode <opencode@noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move org.hypercerts.claim.collection to org.hypercerts.collection. Collections are not claims themselves — they are organizational groupings of activities and other collections, so they belong at the top level alongside other non-claim records. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ibutionDetails descriptions
…to-top-level refactor: move collection to org.hypercerts namespace
Allows context to be either a lightweight URI reference or a content-hash-pinned strong reference, giving consumers flexibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The command `npm changeset pre exit` in the diagram was incorrect and would fail. Also, npx guarantees to use the versions from package.json, so `npx changeset` is fine and more convenient to type than `npm run changeset`.
🦋 Changeset detectedLatest commit: 8a0baf0 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 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR merges develop into main to prepare the Hypercerts lexicon package for a v1-ready release workflow by introducing a new build/test toolchain, expanding and refactoring lexicons (including new namespaces), and updating documentation/CI to enforce generation and style checks.
Changes:
- Add Rollup-based build outputs (
dist/), a generated export surface (generated/exports.ts), and a Vitest test setup. - Introduce/refactor multiple lexicons (collections moved to
org.hypercerts.collection, neworg.hypercerts.context.*, CEL workscope lexicons, hyperboards, certified actor sidecars). - Add automation and docs for schema generation (
SCHEMAS.md), lexicon style checks, publishing, and contribution workflows.
Reviewed changes
Copilot reviewed 105 out of 113 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest configuration including coverage reporters. |
| tsconfig.json | Adds TS compiler configuration and path mappings for generated/shim types. |
| tsconfig.build.json | Adds build-only TS config for emitting declaration-only outputs. |
| tests/validate.test.ts | Adds a basic validation test suite for lexicon validation behavior. |
| scripts/setup-merge-driver.sh | Adds local git merge driver setup to auto-regenerate SCHEMAS.md on conflicts. |
| scripts/generate-schemas.js | Adds SCHEMAS.md generator from lexicon JSON files. |
| scripts/generate-exports.js | Adds generator for generated/exports.ts to provide a clean public API surface. |
| scripts/create-shims.sh | Adds type shims for external lexicon references (Leaflet + richtext facet). |
| scripts/check-lexicon-style.js | Adds a lexicon style guide checker for schema hygiene and best practices. |
| rollup.config.js | Adds Rollup build configuration for ESM/CJS bundles per entrypoint. |
| package.json | Updates packaging (exports/dist), scripts (check/build/test), and dependencies/devDependencies. |
| opencode.json | Adds command permission configuration for opencode. |
| lexicons/org/hypercerts/workscope/tag.json | Adds workscope tag record for CEL-based scope composition. |
| lexicons/org/hypercerts/workscope/cel.json | Adds CEL expression object schema for structured scopes. |
| lexicons/org/hypercerts/funding/receipt.json | Tightens constraints and clarifies descriptions for receipt fields. |
| lexicons/org/hypercerts/defs.json | Adds shared description and introduces smallVideo; adjusts uri constraints. |
| lexicons/org/hypercerts/context/measurement.json | Adds new context measurement record (subjects, unit, date ranges, locations, facets). |
| lexicons/org/hypercerts/context/evaluation.json | Moves evaluation into context namespace and reorganizes defs; updates references. |
| lexicons/org/hypercerts/context/attachment.json | Adds attachment record for contextual/evidence materials with rich text + location refs. |
| lexicons/org/hypercerts/context/acknowledgement.json | Adds acknowledgement record for bidirectional inclusion confirmation across repos. |
| lexicons/org/hypercerts/collection.json | Introduces top-level collection record supporting recursive nesting and media fields. |
| lexicons/org/hypercerts/claim/rights.json | Clarifies rights field semantics and adds constraints for descriptions. |
| lexicons/org/hypercerts/claim/project.json | Removes legacy project lexicon. |
| lexicons/org/hypercerts/claim/measurement.json | Removes legacy claim measurement lexicon in favor of context measurement. |
| lexicons/org/hypercerts/claim/evidence.json | Removes legacy evidence lexicon in favor of context attachment. |
| lexicons/org/hypercerts/claim/contributorInformation.json | Adds contributor information record for reusable identity/display metadata. |
| lexicons/org/hypercerts/claim/contribution.json | Refactors contribution schema (field renames and required fields). |
| lexicons/org/hypercerts/claim/collection.json | Removes legacy claim collection lexicon (replaced by top-level collection). |
| lexicons/org/hypercerts/claim/activity.json | Refactors activity schema (contributors structure, workScope union, locations array, rich text). |
| lexicons/org/hyperboards/displayProfile.json | Adds hyperboards contributor display defaults record (singleton). |
| lexicons/org/hyperboards/board.json | Adds hyperboard configuration record and contributor-level overrides. |
| lexicons/app/certified/location.json | Extends location type registry, adds inline string location option, improves descriptions. |
| lexicons/app/certified/defs.json | Changes did def to object form for union compatibility. |
| lexicons/app/certified/badge/response.json | Switches response from enum to knownValues and adds constraints. |
| lexicons/app/certified/badge/definition.json | Adds constraints and improves descriptions for badge definition. |
| lexicons/app/certified/badge/award.json | Adds optional url field and constraints for note. |
| lexicons/app/certified/actor/profile.json | Adds certified actor profile singleton record. |
| lexicons/app/certified/actor/organization.json | Adds organization sidecar singleton record for actor metadata. |
| eslint.config.mjs | Adds ESLint config for scripts/TS with generated output ignores. |
| docs/PUBLISHING.md | Updates publishing instructions (Trusted Publishers + changeset commands). |
| docs/AUTO_GENERATION.md | Documents how generated/exports.ts is produced and how to regenerate it. |
| bun.lockb | Adds Bun lockfile artifact. |
| STRING_CONSTRAINTS.md | Documents the rationale for string/array constraints across lexicons. |
| README.md | Reworks package usage docs, examples, and references to generated schema docs. |
| LEXICON_STYLE_GUIDE.md | Adds a local summary of the ATProto lexicon style guide and checker scope. |
| ERD.puml | Updates ERD to match new/renamed lexicons and relationships (context, collections, workscope, hyperboards). |
| CONTRIBUTING.md | Adds contributor workflow guidance and quality standards. |
| AGENTS.md | Updates AI agent guidance for new generation/build workflow and changeset requirements. |
| .prettierignore | Updates ignore patterns for generated outputs and tool directories. |
| .husky/pre-commit | Adds pre-commit checks to ensure SCHEMAS.md is up-to-date and run full npm run check. |
| .gitignore | Updates ignored outputs (dist/, generated/, etc.). |
| .github/workflows/test.yml | Expands CI triggers and adds SCHEMAS.md regeneration/diff check before running npm run check. |
| .github/workflows/style.yml | Adds CI job to run lexicon style guide checker. |
| .github/workflows/release.yml | Updates release pipeline for trusted publishing, beta version commits, and changesets action version. |
| .github/workflows/pr-check.yml | Expands PR checks to develop + adds prerelease-mode exit/enter policy enforcement. |
| .github/workflows/lint.yml | Updates runner selection. |
| .gitattributes | Adds custom merge driver mapping for SCHEMAS.md. |
| .coderabbit.yaml | Updates review criteria to require SCHEMAS.md sync and clarify README/ERD expectations. |
| .claude/skills/writing-changesets/SKILL.md | Adds guidance/skill docs for creating changesets. |
| .changeset/update-contributor-lexicon.md | Adds changeset describing contributor-related schema changes (currently has incorrect IDs). |
| .changeset/update-collection-lexicon.md | Adds changeset describing collection schema changes. |
| .changeset/unify-projects-collections.md | Adds changeset describing project/collection unification. |
| .changeset/unbundle-type-declarations.md | Adds changeset describing declaration output strategy change. |
| .changeset/style-guide-compliance.md | Adds changeset describing lexicon style compliance changes. |
| .changeset/sparkly-doors-bet.md | Adds changeset for multiple locations support in activity claim. |
| .changeset/simplify-workscope-to-strongref-or-string.md | Adds changeset describing workScope simplification. |
| .changeset/rollup-build-system.md | Adds changeset describing Rollup build migration and exports changes. |
| .changeset/require-createdAt-in-profile.md | Adds changeset for requiring createdAt in certified profile schema. |
| .changeset/rename-evidence-to-attachment.md | Adds changeset describing evidence→attachment rename/migration guidance. |
| .changeset/rename-contribution-details.md | Adds changeset for contributionDetails rename. |
| .changeset/remove-collection-project.md | Adds changeset for removing a project-related lexicon. |
| .changeset/remove-bidirectional-project-link.md | Adds changeset describing project/activity link removal. |
| .changeset/refactor-measurement-schema.md | Adds changeset describing measurement schema refactor. |
| .changeset/refactor-contributions-structure.md | Adds changeset describing activity contributors structure refactor. |
| .changeset/pre.json | Adds Changesets prerelease exit intent and enumerates pending changesets. |
| .changeset/move-schema-docs-to-autogenerated-file.md | Adds changeset describing SCHEMAS.md auto-generation move. |
| .changeset/move-profile-to-actor-namespace.md | Adds changeset describing profile namespace move. |
| .changeset/move-evaluation-attachment-context.md | Adds changeset describing moving evaluation/attachment to context namespace. |
| .changeset/move-collection-namespace.md | Adds changeset describing collection namespace move. |
| .changeset/moody-regions-begin.md | Adds changeset describing acknowledgement schema improvements. |
| .changeset/make-activity-dates-optional.md | Adds changeset describing optional start/end dates for activity. |
| .changeset/initial-version-post-repo-migration.md | Updates migration changeset release type. |
| .changeset/include-changelog-in-distribution.md | Adds changeset describing CHANGELOG distribution inclusion. |
| .changeset/improved-exports-structure.md | Adds changeset describing new export mappings and rename of ids export. |
| .changeset/flat-llamas-crash.md | Adds changeset describing Leaflet rich text adoption and attachment tweaks. |
| .changeset/fix-union-string-types.md | Adds changeset describing union compliance conversion of primitive variants to objects. |
| .changeset/fix-certified-did-type.md | Adds changeset describing converting did def to object type. |
| .changeset/fix-camelcase-exports.md | Adds changeset describing export naming fixes. |
| .changeset/extend-location-schema.md | Adds changeset describing inline string support in location schema. |
| .changeset/expand-location-type-known-values.md | Adds changeset describing expanded locationType registry. |
| .changeset/drop-helper-prefix.md | Adds changeset describing renaming workScopeTag constants. |
| .changeset/document-location-sidecar-pattern.md | Adds changeset documenting location sidecar pattern. |
| .changeset/badge-award-url.md | Adds changeset for optional badge award URL. |
| .changeset/allow-empty-collections.md | Adds changeset allowing empty collections. |
| .changeset/add-vitest-suite.md | Adds changeset describing Vitest adoption. |
| .changeset/add-richtext-facets-to-activity.md | Adds changeset describing rich text facet support for activities. |
| .changeset/add-project-sidecar.md | Adds changeset describing project representation changes. |
| .changeset/add-profile-lexicon.md | Adds changeset describing profile lexicon introduction. |
| .changeset/add-org-metadata-lexicon.md | Adds changeset describing org metadata sidecar addition. |
| .changeset/add-locations-to-collections.md | Adds changeset describing collection location support. |
| .changeset/add-location-to-attachment.md | Adds changeset describing attachment location support. |
| .changeset/add-hyperboards-lexicons.md | Adds changeset describing hyperboards lexicon additions. |
| .changeset/add-collection-item-weights.md | Adds changeset describing collection item weights refactor. |
| .changeset/add-collection-avatar-coverimage.md | Adds changeset describing collection avatar/banner fields. |
| .changeset/add-cel-work-scope-expressions.md | Adds changeset describing CEL workscope lexicon additions. |
| .changeset/add-acknowledgement-lexicon.md | Adds changeset describing acknowledgement lexicon addition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // OR a strongRef to a single work scope tag: | ||
| // workScope: { uri: "at://did:plc:alice/org.hypercerts.workscope.tag/abc123", cid: "..." }, | ||
| // OR a simple string: workScope: { $type: "org.hypercerts.claim.activity#workScopeString", scope: "Environmental conservation" }, |
There was a problem hiding this comment.
This README example claims workScope can be a strongRef to a org.hypercerts.workscope.tag record, but the org.hypercerts.claim.activity schema currently defines workScope as a union of org.hypercerts.workscope.cel and org.hypercerts.claim.activity#workScopeString (no com.atproto.repo.strongRef variant). Update the example/comment to only show valid variants, or update the schema if the strongRef form is intended.
| // Validate before creating | ||
| const validation = validate(ACTIVITY_NSID, activityRecord); | ||
| if (!validation.valid) { | ||
| console.error("Validation failed:", validation.errors); | ||
| } |
There was a problem hiding this comment.
The validate() usage here doesn’t match the API used elsewhere in this repo (e.g., the Vitest suite asserts result.success and passes a record + schema ID). This example calls validate(ACTIVITY_NSID, activityRecord) and expects { valid, errors }, which is likely incorrect. Update the README to use the actual validate signature/return shape exported by this package so the snippet is copy/paste correct.
| "@hypercerts-org/lexicon": minor | ||
| --- | ||
|
|
||
| Update `org.hypercerts.claim.contributor` lexicon to support individual contributor profiles and roles. |
There was a problem hiding this comment.
This changeset refers to a non-existent lexicon ID (org.hypercerts.claim.contributor). In this PR the related lexicons are org.hypercerts.claim.contribution and org.hypercerts.claim.contributorInformation (and contributor identity is modeled in org.hypercerts.claim.activity). Please correct the IDs and description so the release notes reflect the actual schema changes users must migrate to.
| - Renamed `description` to `contributionDescription`. | ||
| - Updated `required` fields to only include `createdAt`. | ||
|
|
||
| Also corrected incorrect references to `org.hypercerts.claim.contribution` across the codebase to use the correct ID `org.hypercerts.claim.contributor`. |
There was a problem hiding this comment.
This sentence claims the “correct ID” is org.hypercerts.claim.contributor, but there is no lexicon with that ID in the current tree. This should reference the actual lexicon(s) being updated so consumers can follow the migration guidance.
| "subject": { | ||
| "type": "ref", | ||
| "ref": "com.atproto.repo.strongRef", | ||
| "description": "Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes." | ||
| }, |
There was a problem hiding this comment.
The subject description references org.hypercerts.claim.collection, but this PR moves collections to the top-level org.hypercerts.collection lexicon (and deletes the old claim namespace). Update this description to reference the correct collection NSID so implementers don’t follow an outdated ID.
| declaration: true, | ||
| declarationMap: true, | ||
| rootDir: resolve(__dirname), | ||
| outDir: resolve(__dirname, "dist"), | ||
| }), |
There was a problem hiding this comment.
Rollup is configured to emit TypeScript declarations (declaration: true, declarationMap: true) even though npm run build also runs tsc --project tsconfig.build.json to emit declarations. This can create duplicate/overlapping .d.ts outputs (e.g., dist/generated/... vs dist/...) and cause confusion or CI diffs. Consider disabling declaration output in the Rollup TypeScript plugin (or removing the separate build:types step) so declarations are produced by exactly one pipeline.
| function pathToImportName(filePath) { | ||
| const parsed = parse(filePath); | ||
| const baseName = parsed.name; | ||
| const parentDir = dirname(filePath); | ||
|
|
There was a problem hiding this comment.
pathToImportName() relies on filePath.startsWith("com/") and parentDir.split("/"), but findJsonFiles() uses path.relative(), which returns OS-specific separators ("\" on Windows). On Windows this will mis-detect namespaces and can generate incorrect or colliding constant names. Normalize filePath to POSIX separators (or use path.posix) before doing any startsWith/split checks.
| const lines = []; | ||
|
|
||
| // Auto-generation warning header | ||
| const timestamp = new Date().toISOString(); |
There was a problem hiding this comment.
The generated exports file includes a build timestamp (new Date().toISOString()), which makes outputs non-deterministic and can cause unnecessary diffs in emitted .d.ts/bundles and reduce build reproducibility. Consider removing the timestamp (or gating it behind an env flag) so repeated generations are byte-for-byte identical when inputs haven't changed.
Superseded by generateAdditionalDefsSection which was added in 0f3055b to handle all lexicons uniformly (including defs-only lexicons like org.hypercerts.defs) through the same generation pipeline, rather than special-casing them. The call was removed in that refactor but the function definition was left behind.
The eslint script was targeting generated/exports.ts which is gitignored and absent in CI, causing lint failures on PRs to main. Run eslint against the whole repo with proper ignores for generated/, tmp/, and type-aware rule overrides for files outside tsconfig. Also fix pre-existing unused catch variable in check-lexicon-style.js.
changesets uses "mode": "exit" not "exit": true to signal prerelease exit intent.
…prerelease branches Changesets' prerelease mode (pre.json) is designed for single-branch workflows. Using a long-lived develop branch caused state conflicts on merge (see changesets#239). Replace with: - main: sole long-lived branch for stable releases - prerelease/*: ephemeral branches for beta cycles - All CI workflows now target main only - Release workflow accepts main (stable) or prerelease/* (beta) - PR check verifies prerelease mode is exited before merging to main
…ode checks
Without this patch, the CI workflows check whether Changesets is in
prerelease mode by using grep to search for the literal string
'"mode": "pre"' in .changeset/pre.json. This approach is
whitespace-sensitive and brittle—if JSON formatting changes (e.g., via
prettier or manual editing), the grep fails even though the JSON is
semantically identical.
This is a problem because it creates spurious CI failures when JSON
formatting changes, and it doesn't follow best practices for parsing
structured data.
This patch solves the problem by replacing grep with proper JSON parsing
using Node.js: `node -e "console.log(require('./.changeset/pre.json').mode)"`.
This approach correctly parses the JSON regardless of whitespace or
formatting, making the checks robust and maintainable.
Changes:
- .github/workflows/pr-check.yml: Replace grep with JSON parsing
- .github/workflows/release.yml: Replace grep in both stable and beta checks
Co-authored-by: Claude Code <noreply@anthropic.com>
No description provided.