Skip to content

feat(shared): add the API's contracts and the JSON forms of records - #116

Merged
PiquelChips merged 1 commit into
feat/server-shared-eventsfrom
feat/server-api-contracts
Nov 24, 2026
Merged

PiquelChips merged 1 commit into
feat/server-shared-eventsfrom
feat/server-api-contracts

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

The HTTP API needs one definition of everything it sends and receives, shared by the server and its clients so the two can't disagree, and an OpenAPI document generated from it.

JSON forms: records, events, landings and requirements serialize with serde and describe themselves with utoipa. Ids, names, paths, principals, verdicts, kind patterns and periods are JSON strings in the form they display as and parse from, one as_text! line each. An acceptance's signature is hex.

Contracts: origin_shared::api holds the rest: repository names, the requests and responses that aren't records or events themselves, and ApiError with its ErrorCode, so clients tell failures apart without reading messages. Annotation carries holds, whether a statement makes a claim that holds, so plugins count results as the server does.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 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 59 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: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bafc2e5a-9d21-4566-8cb9-241de2b3bcaf
Commits

Reviewing files that changed from the base of the PR and between 170d86e and a5c5917.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 13

  • Cargo.toml
  • apps/origin-src/src/ancestry.rs
  • crates/origin-shared/Cargo.toml
  • crates/origin-shared/src/api.rs
  • crates/origin-shared/src/event.rs
  • crates/origin-shared/src/landing.rs
  • crates/origin-shared/src/lib.rs
  • crates/origin-shared/src/object/acceptance.rs
  • crates/origin-shared/src/object/revision.rs
  • crates/origin-shared/src/object/statement.rs
  • crates/origin-shared/src/policy.rs
  • crates/origin-shared/src/target.rs
  • crates/origin-shared/src/text.rs
  • 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

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/server-api-contracts branch 3 times, most recently from a5b25f6 to 746200c Compare November 22, 2026 19:20
@PiquelChips
PiquelChips force-pushed the feat/server-api-contracts branch 2 times, most recently from 2d72ae1 to 8cc7073 Compare November 23, 2026 12:30
@PiquelChips
PiquelChips force-pushed the feat/server-api-contracts branch 3 times, most recently from 5dd88c2 to 39094be Compare November 23, 2026 21:39
The HTTP API needs one definition of everything it sends and receives,
shared by the server and its clients so the two can't disagree, and an
OpenAPI document generated from it.

Records, events, landings and policy requirements now serialize with
serde and describe themselves with utoipa. Ids, names, paths,
principals, verdicts, kind patterns and periods are JSON strings in the
form they display as, and parse from: one `as_text!` line each. An
acceptance's signature is hex.

`origin_shared::api` holds the rest of the contract: repository names,
the requests and responses that aren't records or events themselves,
such as `Annotation`, which says whether a statement's claim holds, and
`ApiError` with its `ErrorCode`, so clients tell failures apart without
reading messages.
@PiquelChips
PiquelChips force-pushed the feat/server-api-contracts branch from 39094be to a5c5917 Compare November 23, 2026 22:51
@PiquelChips
PiquelChips merged commit ea95c49 into main Nov 24, 2026
6 checks passed
@PiquelChips
PiquelChips deleted the feat/server-api-contracts branch November 24, 2026 22:46
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.

1 participant