Skip to content

Add optional metadata.trace to receipts and extend shared proof schema#36

Merged
GsCommand merged 1 commit into
mainfrom
codex/implement-clas-trust-schema-updates
May 22, 2026
Merged

Add optional metadata.trace to receipts and extend shared proof schema#36
GsCommand merged 1 commit into
mainfrom
codex/implement-clas-trust-schema-updates

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Add optional metadata.trace to trust receipts to support distributed trace correlation without breaking existing receipts.
  • Extend the shared proof envelope to accept both json.sorted_keys.v1 and erc8211.merkle.v1 canonicalizations and to support solver-style multi-signature proofs while remaining backward compatible with single-signature proofs.
  • Resolve schema resolution during validation and add automated checks to ensure both legacy and new proof/trace shapes validate as intended.

Description

  • Updated 10 receipt schemas under schemas/trust-verification/*/*.receipt.schema.json to include an optional metadata.properties.trace with "$ref": "../_shared/trace.schema.json" while keeping metadata.required as ["proof"] and metadata.additionalProperties: false.
  • Modified schemas/trust-verification/_shared/proof.schema.json to change canonicalization from a const to an enum allowing json.sorted_keys.v1 and erc8211.merkle.v1, and changed signature to a oneOf that accepts the existing single-signature object or a multi-signature array where each entry requires a role from the allowed set.
  • Added schemas/trust-verification/_shared/trace.schema.json (a local copy/reference) to ensure receipt-local ../_shared/trace.schema.json references resolve during validation without altering the original schemas/trust/_shared/trace.schema.json.
  • Extended the validator script scripts/validate-trust-verification-examples.mjs to load the trace schema and to run explicit schema checks for single-signature + json.sorted_keys.v1, erc8211.merkle.v1 + signature array with role, metadata with proof only, metadata with proof+trace, and rejection of unknown extra metadata fields.

Testing

  • jq parsing check over all modified JSON files succeeded (no JSON syntax errors).
  • npm test (runs node scripts/validate-trust-verification-examples.mjs) passed and reported all trust-verification example validations and the new schema checks as PASS.
  • npm run build and npm run typecheck are not available in this repository (missing scripts) and were therefore not executed.

Files changed: 13 (including schemas/trust-verification/_shared/proof.schema.json, schemas/trust-verification/_shared/trace.schema.json, 10 receipt schemas under schemas/trust-verification/*/*.receipt.schema.json, and scripts/validate-trust-verification-examples.mjs).
Receipt schemas updated: 10.
Request schemas, OpenAPI files, and MCP tool files were not modified.


Codex Task

@GsCommand GsCommand merged commit 8eddef1 into main May 22, 2026
4 checks passed
@GsCommand GsCommand deleted the codex/implement-clas-trust-schema-updates branch May 22, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant