Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Extract SDK into @attest-protocol/attest-ts#70

Merged
ojongerius merged 4 commits into
mainfrom
extract-sdk
Mar 30, 2026
Merged

Extract SDK into @attest-protocol/attest-ts#70
ojongerius merged 4 commits into
mainfrom
extract-sdk

Conversation

@ojongerius
Copy link
Copy Markdown
Collaborator

Summary

  • Remove src/receipt/, src/store/, src/taxonomy/ (moved to attest-protocol/attest-ts)
  • Add @attest-protocol/attest-ts as a dependency
  • Update all proxy and CLI imports to use the SDK package
  • 51 proxy/CLI tests pass against the extracted SDK

Context

The SDK (receipt creation, signing, hashing, store, taxonomy) has been extracted into the standalone @attest-protocol/attest-ts package. This repo now contains only the MCP proxy and CLI, consuming the SDK as a dependency.

Related: attest-protocol/attest-ts@ff1d7e0, attest-protocol/spec#1

Test plan

  • pnpm run check passes (typecheck + lint)
  • pnpm run test — 51 tests pass
  • pnpm run build — clean compile
  • attest and attest-proxy binaries work end-to-end

Move receipt, store, and taxonomy modules to the standalone SDK
package. Proxy and CLI now import from @attest-protocol/attest-ts
instead of local source. 51 proxy/CLI tests pass against the SDK.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the repo to consume the newly extracted @attest-protocol/attest-ts SDK, removing the previously in-repo receipt/store/taxonomy implementation and updating the proxy/CLI to import SDK APIs directly.

Changes:

  • Remove local src/receipt/, src/store/, and src/taxonomy/ modules (and their tests) after extraction to the standalone SDK.
  • Add @attest-protocol/attest-ts as a dependency and update proxy/CLI/test imports to use it.
  • Re-export VERSION from the SDK via src/index.ts.

Reviewed changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/test-utils/receipts.ts Updates receipt factory imports to come from the extracted SDK.
src/taxonomy/types.ts Deletes local taxonomy types (moved to SDK).
src/taxonomy/index.ts Deletes local taxonomy barrel exports (moved to SDK).
src/taxonomy/config.ts Deletes local taxonomy config loader (moved to SDK).
src/taxonomy/config.test.ts Deletes taxonomy config tests (moved to SDK).
src/taxonomy/classify.ts Deletes local tool-call classifier (moved to SDK).
src/taxonomy/classify.test.ts Deletes classifier tests (moved to SDK).
src/taxonomy/actions.ts Deletes local action taxonomy constants/helpers (moved to SDK).
src/taxonomy/actions.test.ts Deletes taxonomy action tests (moved to SDK).
src/store/verify.ts Deletes local stored-chain verification helper (moved to SDK).
src/store/verify.test.ts Deletes stored-chain verification tests (moved to SDK).
src/store/store.ts Deletes local SQLite receipt store implementation (moved to SDK).
src/store/store.test.ts Deletes receipt store tests (moved to SDK).
src/store/index.ts Deletes local store exports (moved to SDK).
src/receipt/types.ts Deletes local receipt schema types/constants (moved to SDK).
src/receipt/types.test.ts Deletes receipt schema type/constant tests (moved to SDK).
src/receipt/signing.ts Deletes local signing implementation (moved to SDK).
src/receipt/signing.test.ts Deletes signing tests (moved to SDK).
src/receipt/index.ts Deletes local receipt barrel exports (moved to SDK).
src/receipt/hash.ts Deletes local hashing/canonicalization implementation (moved to SDK).
src/receipt/hash.test.ts Deletes hashing tests (moved to SDK).
src/receipt/create.ts Deletes local receipt creation helper (moved to SDK).
src/receipt/create.test.ts Deletes receipt creation tests (moved to SDK).
src/receipt/chain.ts Deletes local chain verification logic (moved to SDK).
src/receipt/chain.test.ts Deletes chain verification tests (moved to SDK).
src/proxy/main.ts Switches proxy entrypoint imports (store/taxonomy/signing) to the SDK.
src/proxy/main.test.ts Updates proxy tests to use the SDK store implementation.
src/proxy/emitter.ts Updates emitter to use SDK receipt creation/signing/hashing + taxonomy + store types.
src/proxy/emitter.test.ts Updates emitter tests to use SDK hashing/signing/store helpers.
src/index.ts Re-exports VERSION from the SDK.
src/cli/verify.ts Uses SDK verifyStoredChain and store types.
src/cli/verify.test.ts Updates verify command tests to use SDK signing/hashing/store.
src/cli/main.ts Updates CLI entrypoint store import to SDK.
src/cli/main.test.ts Updates CLI tests to use SDK helpers.
src/cli/list.ts Updates receipt/store query type imports to SDK.
src/cli/list.test.ts Updates list command tests to use SDK store.
src/cli/inspect.ts Updates inspect command to use SDK verifyReceipt and store type.
src/cli/inspect.test.ts Updates inspect tests to use SDK receipt constants/types/signing/store.
src/cli/export.ts Updates export command store type import to SDK.
src/cli/export.test.ts Updates export tests to use SDK store.
package.json Adds @attest-protocol/attest-ts dependency.
pnpm-lock.yaml Locks the new SDK dependency.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
},
"packageManager": "pnpm@10.33.0",
"dependencies": {
"@attest-protocol/attest-ts": "file:../attest-ts"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The dependency on @attest-protocol/attest-ts is declared as a local file:../attest-ts path. This makes installs/builds non-reproducible and will fail in CI or for any consumer that doesn’t have a sibling ../attest-ts directory. Prefer depending on a published semver (or a workspace: protocol entry, with the workspace configured to include the SDK package).

Suggested change
"@attest-protocol/attest-ts": "file:../attest-ts"
"@attest-protocol/attest-ts": "^0.1.0"

Copilot uses AI. Check for mistakes.
Comment thread pnpm-lock.yaml Outdated
Comment on lines +9 to +13
.:
dependencies:
'@attest-protocol/attest-ts':
specifier: file:../attest-ts
version: file:../attest-ts
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

pnpm-lock.yaml pins @attest-protocol/attest-ts to a local directory (file:../attest-ts). This will break clean checkouts/builds unless the SDK exists at that relative path. Once package.json is switched to a published/workspace dependency, regenerate the lockfile so it no longer contains a file: resolution.

Copilot uses AI. Check for mistakes.
Comment thread src/index.ts Outdated
@@ -1 +1 @@
export const VERSION = "0.1.0";
export { VERSION } from "@attest-protocol/attest-ts";
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

src/index.ts now re-exports VERSION from @attest-protocol/attest-ts, while other updated code imports RECEIPT_VERSION from the SDK and aliases it to VERSION. This is easy to misinterpret (package version vs receipt schema version) and can accidentally become a breaking API change for consumers of this package. Consider exporting an explicitly named RECEIPT_VERSION (and/or keeping a stable VERSION export with clear meaning) so callers don’t depend on an ambiguous symbol.

Suggested change
export { VERSION } from "@attest-protocol/attest-ts";
export { VERSION } from "@attest-protocol/attest-ts";
export { RECEIPT_VERSION } from "@attest-protocol/attest-ts";

Copilot uses AI. Check for mistakes.
Address Copilot review: make the distinction between package version
and receipt schema version explicit by exporting both symbols.
@ojongerius
Copy link
Copy Markdown
Collaborator Author

Addressing Copilot review:

  • file:../attest-ts dependency (package.json + lockfile): Acknowledged — this is a placeholder until @attest-protocol/attest-ts is published to npm. Will switch to ^0.1.0 and regenerate the lockfile before merging.
  • VERSION ambiguity (src/index.ts): Fixed in 5de071b — now exports both VERSION (SDK version) and RECEIPT_VERSION (receipt schema version).

Resolve conflicts: delete SDK files moved to @attest-protocol/attest-ts,
update new stats command imports to use SDK. 69 tests pass.
@attest-protocol/attest-ts@0.1.0 is now on npm. Replace the local
file: reference with ^0.1.0 for reproducible installs.
@ojongerius ojongerius merged commit cfd6de7 into main Mar 30, 2026
1 check passed
@ojongerius ojongerius deleted the extract-sdk branch March 30, 2026 20:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants