-
Notifications
You must be signed in to change notification settings - Fork 2
Fix/minor bugs #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/minor bugs #72
Conversation
🦋 Changeset detectedLatest commit: a863387 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
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 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. 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughField 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ 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. Comment |
There was a problem hiding this 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.tsto 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
📒 Files selected for processing (2)
packages/sdk-core/src/repository/HypercertOperationsImpl.tspackages/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.tspackages/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.tspackages/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/workTimeframeTotostartDate/endDateimprove naming consistency and align with the implementation changes.packages/sdk-core/src/repository/HypercertOperationsImpl.ts (1)
823-823: Namespace correctly updated toorg.hypercerts.defs#uri.The type identifier has been properly updated to the
org.hypercertsnamespace 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.
aspiers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
#from validation while creating hypercertRecord since otherwise it fails validation results inorg.hypercerts.claim.activity##mainworkScopeto mirror the lexicon: