Skip to content

feat: export the Zod schemas and fix the negotiated protocol version - #3

Merged
RentnerKev merged 1 commit into
mainfrom
rentner/feat/schema-exports
Nov 28, 2026
Merged

RentnerKev merged 1 commit into
mainfrom
rentner/feat/schema-exports

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Change

The marketplace builds part of its own validation from the contract's Zod schemas: commit, githubId, sha256, appId, target, appManifest, providerProfile, packageArtifact, catalogRelease, revocation and candidate. The npm package 1.0.0 only exports the parsers and types, so the marketplace cannot move from its copy of contracts/v1 to the published package yet. This PR closes that gap and prepares release 1.1.0.

  • @rentnerproxy/app-contracts/schemas: a new subpath export, built from contracts/v1/public-schemas.ts.
    • Documents: the schemas of the app manifest, capability request, provider profile, catalog, catalog release, package artifact, revocation, candidate, approval and publication.
    • Primitives: appId, appVersion, commit, githubId, sha256, target and timestamp.
    • The package README shows the import.
  • PROTOCOL_VERSION in rentnerproxy-app-contracts: the platform API, app protocol and UI bridge version that v1 apps negotiate (1.0.0).
    • The pipeline's candidate runtime used CONTRACT_VERSION for these. CONTRACT_VERSION is the package version, so with this release the pipeline would have offered protocol 1.1.0, while the protocol documents only accept 1.0.0.
    • It now uses PROTOCOL_VERSION. A new test binds the constant to every protocol version the JSON Schema pins.
  • Version 1.1.0: the contract, the four crates and the npm package move to 1.1.0, because the change is additive. The regenerated contracts.schema.json and openapi.json differ only in $id and info.version.

No issue: this unblocks moving the marketplace to the published SDK packages.

Verification

Run in a Rust 1.100.0 and Bun 1.4.5 container:

  • core:format:check, core:lint (Clippy with -D warnings) and core:test pass.
  • contracts:check, typecheck, lint, format:check and release:check pass; the release check confirms the single version 1.1.0.
  • bun run test passes (351 tests).
  • package:build builds the npm tarball and the four crates twice and checks that both builds are byte-for-byte identical. It then installs them into a TypeScript consumer and a Rust consumer ("Verified SDK 1.1.0 packages").

New checks:

  • a Bun test that the schema entry parses the fixture manifest exactly like parseAppManifest and rejects invalid commits;
  • a Rust test that the schema pins only PROTOCOL_VERSION;
  • smoke checks in package:build that the installed npm package resolves ./schemas and that the packaged crate exposes PROTOCOL_VERSION.

Risks

  • Additive, within contract major version 1: no wire format, schema rule or fixture changes.
  • Changed runtime behavior: the version the pipeline offers to manifests stays 1.0.0, as it was in 1.0.0.
  • Consumers on 1.0.0 keep working; the platform can move to 1.1.0 with the usual Dependabot update.
  • No secrets, real environment files or production data are included.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The app contracts package now provides public schemas for validating manifests, releases, publications, and related data. Import them from the new ./schemas entry point.
    • Runtime compatibility versions are now tracked separately from the contract package version.
  • Documentation
    • Added examples for importing and using the public schemas.

The npm package now exports the Zod schemas behind its validators at
@rentnerproxy/app-contracts/schemas: the app manifest, capability
request, provider profile, catalog, catalog release, package artifact,
revocation, candidate, approval and publication documents and the
identifier primitives. Consumers such as the marketplace can build their
own validation on the contract instead of copying it.

The crates gain PROTOCOL_VERSION, the platform API, app protocol and UI
bridge version that v1 apps negotiate. The pipeline's candidate runtime
used the contract version for that, which would have announced protocol
1.1.0 with this release although the protocol documents only accept
1.0.0. A test binds the constant to the versions the schema pins.

The additive change raises the contract, crates and npm package to 1.1.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The contract and package versions change to 1.1.0, while the Rust runtime uses protocol version 1.0.0. The TypeScript package adds a public schemas entry point, with tests and smoke checks for the exported schemas.

Changes: Contracts API and versioning

Layer / File(s) Summary
Contract versions and runtime protocol
contracts/v1/primitives.ts, core/Cargo.toml, packages/app-contracts/package.json, core/app-contracts/src/lib.rs, core/app-pipeline/src/lib.rs, core/app-contracts/tests/contracts.rs, .github/scripts/ci/package-sdk.ts
The contract, workspace, and npm package versions change to 1.1.0. Rust exposes protocol version 1.0.0, and the app pipeline uses it for runtime version fields. Tests check that schema version constants match the protocol version.
Public TypeScript schemas
contracts/v1/public-schemas.ts, packages/app-contracts/package.json, packages/app-contracts/tsconfig.json, packages/app-contracts/README.md, tests/Contracts/app-contracts.test.ts, .github/scripts/ci/package-sdk.ts
The package adds a /schemas export for public Zod schemas. The README, tests, and TypeScript smoke test cover imports and schema parsing. The tests also check commit validation and target options.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Minimal · up to 9001f · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names two changes: exporting the Zod schemas through a new subpath, and adding PROTOCOL_VERSION so the pipeline negotiates protocol 1.0.0 instead of the package version. Both appear in the d…
Description check Passed The description follows the template. It has Change, Verification and Risks sections. Change explains the problem and the fix and states that no issue is needed. Verification lists the checks run, the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes: exporting the Zod schemas through a new subpath, and adding PROTOCOL_VERSION so the pipeline negotiates protocol 1.0.0 instead of the package version. Both appear in the diff and the PR objectives. The title is specific and covers the main changes, though it omits the 1.1.0 version bump.

Full details: Description check

Explanation

The description follows the template. It has Change, Verification and Risks sections. Change explains the problem and the fix and states that no issue is needed. Verification lists the checks run, the new tests and the smoke checks. Risks states that the change is additive within contract major version 1 and confirms that no secrets, environment files or production data are included. The template's CONTRIBUTING.md comment is an HTML comment and needs no content.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 04493b1 and 9001fce.

Files ignored due to path filters: 4

  • contracts/v1/contracts.schema.json is excluded by !contracts/v1/contracts.schema.json
  • contracts/v1/openapi.json is excluded by !contracts/v1/openapi.json
  • core/Cargo.lock is excluded by !**/*.lock, !core/Cargo.lock
  • core/app-contracts/contracts.schema.json is excluded by !core/app-contracts/contracts.schema.json
Files selected for processing: 11

  • .github/scripts/ci/package-sdk.ts
  • contracts/v1/primitives.ts
  • contracts/v1/public-schemas.ts
  • core/Cargo.toml
  • core/app-contracts/src/lib.rs
  • core/app-contracts/tests/contracts.rs
  • core/app-pipeline/src/lib.rs
  • packages/app-contracts/README.md
  • packages/app-contracts/package.json
  • packages/app-contracts/tsconfig.json
  • tests/Contracts/app-contracts.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added area: automation GitHub checks, release and repository automation. area: contracts App contract schemas, fixtures and documents area: core Rust core, native protocols and safe storage. area: npm labels Nov 28, 2026
@RentnerKev
RentnerKev merged commit 344f07b into main Nov 28, 2026
17 of 18 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/schema-exports branch November 28, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: automation GitHub checks, release and repository automation. area: contracts App contract schemas, fixtures and documents area: core Rust core, native protocols and safe storage. area: npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant