Skip to content

fix: use Ajv 2020 for trust schemas#44

Merged
GsCommand merged 1 commit into
mainfrom
codex/fix-ajv-2020-schema-test-runtime-failure
May 18, 2026
Merged

fix: use Ajv 2020 for trust schemas#44
GsCommand merged 1 commit into
mainfrom
codex/fix-ajv-2020-schema-test-runtime-failure

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Trust schema JSON files declare $schema: "https://json-schema.org/draft/2020-12/schema", and runtime validation fails with no schema with key or ref "https://json-schema.org/draft/2020-12/schema" when using the default Ajv export.
  • The change aligns the validator with the schemas' draft version without modifying the schema files or changing receipt/proof behavior.

Description

  • Replace the default Ajv import with Ajv2020 from ajv/dist/2020 and instantiate it via new Ajv2020({ allErrors: true, strict: false }) in src/trust.ts.
  • Update the AddFormats typing to accept Ajv2020 and preserve ajv-formats wiring by calling addFormats(ajv) as before.
  • Keep the trust schema JSON files unchanged and preserve existing schema registration and compile calls (ajv.addSchema and ajv.compile).
  • Only src/trust.ts was modified to perform the switch to Ajv 2020.

Testing

  • Ran npm install which failed with a registry error 403 Forbidden - GET https://registry.npmjs.org/ajv, so dependency installation did not complete and prevented further automated steps from running.
  • npm run build was not executed because npm install failed.
  • npm test was not executed because npm install failed.

Codex Task

@GsCommand GsCommand merged commit 49e1c47 into main May 18, 2026
1 check failed
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