Skip to content

sdk/context: add attachment, measurement, evaluation and acknowledgement creators - #16

Open
Kzoeps wants to merge 2 commits into
mainfrom
karma/tech-754-context-evidence
Open

Kzoeps wants to merge 2 commits into
mainfrom
karma/tech-754-context-evidence

Conversation

@Kzoeps

@Kzoeps Kzoeps commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Closes TECH-754.

Adds @hypercerts-org/sdk/context: createAttachment, createMeasurement, createEvaluation and createAcknowledgement (org.hypercerts.context.*).

Changes

  • Attachments take files and/or external URLs plus optional subjects; files are uploaded and references built by the SDK. Creating an attachment does not change its subjects.
  • Existing records are passed as { uri }, like the rest of the SDK.
  • Attachment descriptions are plain strings for now; documents and { uri } come once the shared description helper (TECH-761) is on main.
  • Skill reference, changeset, tests.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0febb421-890b-4645-930f-93a9dc869869
Commits

Reviewing files that changed from the base of the PR and between 3ca68ab and 1e88cc1.

Files selected for processing: 15

  • .agents/skills/hypercerts-org-sdk/SKILL.md
  • .agents/skills/hypercerts-org-sdk/references/context.md
  • .changeset/context-records.md
  • packages/sdk/package.json
  • packages/sdk/src/context-records/build-acknowledgement.ts
  • packages/sdk/src/context-records/build-attachment.ts
  • packages/sdk/src/context-records/build-evaluation.ts
  • packages/sdk/src/context-records/build-measurement.ts
  • packages/sdk/src/context-records/create-acknowledgement.test.ts
  • packages/sdk/src/context-records/create-attachment.test.ts
  • packages/sdk/src/context-records/create-evaluation.test.ts
  • packages/sdk/src/context-records/create-measurement.test.ts
  • packages/sdk/src/context-records/index.ts
  • packages/sdk/src/context-records/score.ts
  • packages/sdk/src/context-records/shared.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@changeset-bot

changeset-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e88cc1

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

This PR includes changesets to release 1 package
Name Type
@hypercerts-org/sdk Minor

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

Comment on lines +77 to +83
export const creatorOf =
<TInput extends { createdAt?: string | undefined }, TResult>(
operation: string,
kind: RecordKind<TInput>,
): StandaloneCreator<TInput, TResult> =>
(context, input) =>
createRecordTree(context, operation, kind, input);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(reply generated by Claude Sonnet via pi)

Reviewed the semantic match (jscpd --semantic, report-only in CI) against createStandalone / createRecordTree in internal/create-record.ts. Not a real duplicate: creatorOf is a curried adapter that binds an operation name and a RecordKind to createRecordTree and keeps the full result tree (TResult), while createStandalone takes all four arguments at once and discards the tree to return only { uri, cid }. They share the call to createRecordTree and a generic signature, and nothing else that could be factored out. Leaving as-is; leaving the thread open for the maintainer to confirm.

@Kzoeps
Kzoeps force-pushed the karma/tech-754-context-evidence branch 2 times, most recently from 1875d30 to e1c35b0 Compare November 11, 2026 06:01
@Kzoeps
Kzoeps force-pushed the karma/tech-754-context-evidence branch from e1c35b0 to 802ed60 Compare November 11, 2026 07:24
…ent creators

Adds createAttachment, createMeasurement, createEvaluation and createAcknowledgement at @hypercerts-org/sdk/context. New locations, tags and measurements are created in the same applyWrites as the record that points at them; existing { uri } records are reused unchanged. Attachment description is string-only until the shared long-description helper lands.
@Kzoeps
Kzoeps force-pushed the karma/tech-754-context-evidence branch from 802ed60 to 1e88cc1 Compare November 11, 2026 11:54
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

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