Skip to content

docs: align digest and signature types with the runtime - #8

Merged
EauDoon merged 1 commit into
mainfrom
devloop/cycle-02-digest-schema-types
Aug 29, 2026
Merged

docs: align digest and signature types with the runtime#8
EauDoon merged 1 commit into
mainfrom
devloop/cycle-02-digest-schema-types

Conversation

@EauDoon

@EauDoon EauDoon commented Aug 29, 2026

Copy link
Copy Markdown
Owner

What

Align protocol types with the encodings the reference runtime actually uses:

  • SHA-256 digests are unpadded base64url (43 characters)
  • Ed25519 signatures are unpadded base64url (86 characters)

JSON Schemas previously mixed that pattern with minLength: 32 and unconstrained strings. OpenAPI omitted the same constraints on action views and documented only a subset of POST /v0/bundles/verify fields.

Why

Consumers of the schemas, OpenAPI surface, and library APIs could accept encodings the rail rejects. The artifact model already specified unpadded base64url; the typed documents did not.

How tested

  • node ./scripts/check.js
  • node --test (107 tests)
  • Repository check now fails if a digest or signature schema field regresses
  • Runtime settlement and recovery artifacts are asserted against the canonical encodings

Devin Review

JSON Schemas and OpenAPI previously typed many digest fields as unconstrained
strings or minLength 32, which does not match the SHA-256 unpadded base64url
encoding the rail actually produces and verifies. Signature values were
similarly inconsistent.

Tighten those types to the canonical 43-character digest and 86-character
Ed25519 encodings, document the verifyBundle return shape, and reject
regressions in the repository check.
@EauDoon
EauDoon merged commit 68fcc00 into main Aug 29, 2026
6 of 7 checks passed
@EauDoon
EauDoon deleted the devloop/cycle-02-digest-schema-types branch August 29, 2026 20:39

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment thread scripts/check.js
Comment on lines +27 to +28
const SHA256_DIGEST_PATTERN = "^[A-Za-z0-9_-]{43}$";
const ED25519_SIGNATURE_PATTERN = "^[A-Za-z0-9_-]{86}$";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Schemas accept noncanonical encodings

The new ED25519_SIGNATURE_PATTERN accepts signatures with nonzero trailing padding bits. Schema-compliant signatures can therefore fail runtime verification; digest patterns have the same defect.

Suggested change
const SHA256_DIGEST_PATTERN = "^[A-Za-z0-9_-]{43}$";
const ED25519_SIGNATURE_PATTERN = "^[A-Za-z0-9_-]{86}$";
const SHA256_DIGEST_PATTERN = "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$";
const ED25519_SIGNATURE_PATTERN = "^[A-Za-z0-9_-]{85}[AQgw]$";
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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