Skip to content

Conversation

@Kzoeps
Copy link
Contributor

@Kzoeps Kzoeps commented Jan 8, 2026

  • Change HypercerClaimActivity to use start date and end date mirroring the lexicon
  • remove extra # from validation while creating hypercertRecord since otherwise it fails validation results in org.hypercerts.claim.activity##main
  • Change workScope to mirror the lexicon:
workScope?: {
    withinAllOf?: string[],
    withinAnyOf?: string[],
    withinNoneOf?: string[]
  }

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: a863387

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hypercerts-org/sdk-core Minor
@hypercerts-org/sdk-react Patch

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 8, 2026

Warning

Rate limit exceeded

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

📥 Commits

Reviewing files that changed from the base of the PR and between 21bbfb7 and a863387.

📒 Files selected for processing (7)
  • .changeset/fix-hypcertcreation-params.md
  • packages/sdk-core/src/repository/HypercertOperationsImpl.ts
  • packages/sdk-core/src/repository/interfaces.ts
  • packages/sdk-core/tests/repository/HypercertOperationsImpl.test.ts
  • packages/sdk-core/tests/repository/HypercertValidation.test.ts
  • packages/sdk-react/src/types.ts
  • packages/sdk-react/tests/hooks/useHypercerts.test.tsx
📝 Walkthrough

Walkthrough

Field renaming in hypercert creation (workTimeFrame to startDate/endDate), restructuring workScope from string to label-based conditional object with withinAllOf/withinAnyOf/withinNoneOf, updating validation routing parameter from "#main" to "main", and adjusting location type URI from "app.certified.defs#uri" to "org.hypercerts.defs#uri".

Changes

Cohort / File(s) Summary
Interface Definitions
packages/sdk-core/src/repository/interfaces.ts
Updated CreateHypercertParams interface: renamed workTimeFrameFrom/workTimeFrameTo to startDate/endDate; restructured workScope from simple string to optional object with withinAllOf, withinAnyOf, withinNoneOf label arrays
Implementation
packages/sdk-core/src/repository/HypercertOperationsImpl.ts
Updated hypercert record creation with renamed date fields; changed lexicon validation parameter from "#main" to "main"; updated location URI type URI from "app.certified.defs#uri" to "org.hypercerts.defs#uri"

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Dates march forth with names so clear,
From timeframes old to startDate here,
Scopes now dance in labels three,
Validation paths and URIs set free,
The schema hops to structure anew! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/minor bugs' is vague and generic, lacking specificity about which bugs are being fixed or what changes are being made. Provide a more descriptive title that clearly indicates the primary change, such as 'Rename hypercert fields and update scope structure' or 'Refactor field naming and validation routing in hypercert operations'.
✅ 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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

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

Caution

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

⚠️ Outside diff range comments (2)
packages/sdk-core/src/repository/HypercertOperationsImpl.ts (1)

1234-1234: Critical: Inconsistent validation parameter.

This line uses "#main" as the validation parameter, while Line 256 (and Line 186) use "main" without the hash prefix. This inconsistency will cause validation to behave differently for collection records versus other record types.

🔧 Proposed fix
-      const validation = validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "#main", false);
+      const validation = validate(result.data.value, HYPERCERT_COLLECTIONS.COLLECTION, "main", false);
packages/sdk-core/src/repository/interfaces.ts (1)

1-1: Fix Prettier formatting violations.

The pipeline failure indicates Prettier formatting issues in this file. Run prettier --write packages/sdk-core/src/repository/interfaces.ts to fix the formatting.

#!/bin/bash
# Fix formatting issues
cd packages/sdk-core
npx prettier --write src/repository/interfaces.ts
🤖 Fix all issues with AI agents
In @packages/sdk-core/src/repository/HypercertOperationsImpl.ts:
- Line 256: Update the inconsistent validate call that uses "#main" so it
matches the other calls by passing "main" instead; locate the validate
invocation referencing HYPERCERT_COLLECTIONS.CLAIM (e.g., the one assigning
hypercertValidation from validate(hypercertRecord, HYPERCERT_COLLECTIONS.CLAIM,
...)) and replace the "#main" parameter with "main" to ensure consistent
validation parameter usage across the file.
- Around line 242-243: The test fixtures use old field names
workTimeFrameFrom/workTimeFrameTo which no longer match the
CreateHypercertParams interface used by HypercertOperationsImpl; update the test
data (e.g., validParams in HypercertOperationsImpl.test.ts) to replace
workTimeFrameFrom → startDate and workTimeFrameTo → endDate so the test objects
conform to the CreateHypercertParams shape and TypeScript strict checks pass.

In @packages/sdk-core/src/repository/interfaces.ts:
- Around line 110-118: The workScope type was changed from string to an object {
withinAllOf?: string[], withinAnyOf?: string[], withinNoneOf?: string[] } but
examples, types, and tests weren’t migrated; update the JSDoc @example in
interfaces.ts for workScope to show an object shape, replace all string-style
examples in Repository.ts, HypercertOperationsImpl.ts, and interfaces.ts with
the new object format, change sdk-react/src/types.ts UpdateHypercertParams to
declare workScope?: { withinAllOf?: string[], withinAnyOf?: string[],
withinNoneOf?: string[] }, and modify test fixtures in
HypercertValidation.test.ts, HypercertOperationsImpl.test.ts, and
useHypercerts.test.tsx to use { withinAllOf: ["Testing"], withinAnyOf: [],
withinNoneOf: [] } so lexicon validation in HypercertOperationsImpl (around the
validation at line 256) accepts the new structure.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 367f9ff and 21bbfb7.

📒 Files selected for processing (2)
  • packages/sdk-core/src/repository/HypercertOperationsImpl.ts
  • packages/sdk-core/src/repository/interfaces.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use strict TypeScript with strict: true configuration
Avoid any types (warns in ESLint)
Prefix unused variables with underscore (_)
Use Zod schemas for runtime validation
Use one class/module per file
Classes should use PascalCase naming (e.g., OAuthClient, Repository)
Files should use PascalCase for classes and camelCase for utilities
Types and Interfaces should use PascalCase with descriptive names
Constants should use UPPER_SNAKE_CASE
Use the error hierarchy from sdk-core/src/core/errors.ts with base HypercertsError and specific error classes (ValidationError, AuthenticationError, NetworkError, NotFoundError, SDSRequiredError)

Files:

  • packages/sdk-core/src/repository/interfaces.ts
  • packages/sdk-core/src/repository/HypercertOperationsImpl.ts
🧠 Learnings (2)
📚 Learning: 2026-01-06T17:56:38.894Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-sdk PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T17:56:38.894Z
Learning: Applies to **/*.{ts,tsx} : Use the error hierarchy from sdk-core/src/core/errors.ts with base HypercertsError and specific error classes (ValidationError, AuthenticationError, NetworkError, NotFoundError, SDSRequiredError)

Applied to files:

  • packages/sdk-core/src/repository/interfaces.ts
  • packages/sdk-core/src/repository/HypercertOperationsImpl.ts
📚 Learning: 2026-01-06T17:56:38.894Z
Learnt from: CR
Repo: hypercerts-org/hypercerts-sdk PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T17:56:38.894Z
Learning: One record type requires: types in services/<domain>/types.ts, Zod schemas in services/<domain>/schemas.ts, lexicon registration in lexicons/<domain>/index.ts, operations in repository/<Domain>OperationsImpl.ts, tests in tests/repository/, and optional React hook in sdk-react/src/hooks/

Applied to files:

  • packages/sdk-core/src/repository/HypercertOperationsImpl.ts
🧬 Code graph analysis (1)
packages/sdk-core/src/repository/HypercertOperationsImpl.ts (3)
packages/sdk-core/src/index.ts (2)
  • validate (62-62)
  • HYPERCERT_COLLECTIONS (69-69)
packages/sdk-core/src/services/hypercerts/types.ts (2)
  • validate (31-31)
  • HYPERCERT_COLLECTIONS (42-42)
packages/sdk-core/src/lexicons.ts (1)
  • HYPERCERT_COLLECTIONS (125-190)
🪛 GitHub Actions: PR Check
packages/sdk-core/src/repository/interfaces.ts

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.

🔇 Additional comments (2)
packages/sdk-core/src/repository/interfaces.ts (1)

125-132: Field renames look correct.

The renames from workTimeframeFrom/workTimeframeTo to startDate/endDate improve naming consistency and align with the implementation changes.

packages/sdk-core/src/repository/HypercertOperationsImpl.ts (1)

823-823: Namespace correctly updated to org.hypercerts.defs#uri.

The type identifier has been properly updated to the org.hypercerts namespace at line 823. This identifier is consistently used throughout the codebase, including in the test file (HypercertOperationsImpl.test.ts:96), confirming the schema recognizes this type definition.

Copy link
Contributor

@aspiers aspiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@aspiers aspiers merged commit a9c3890 into hypercerts-org:develop Jan 8, 2026
3 checks passed
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.

2 participants