Skip to content

feat: publish versioned receipt JSON Schema - #38

Open
codekongdev wants to merge 1 commit into
msertdev:mainfrom
codekongdev:feat/receipt-json-schema-34
Open

codekongdev wants to merge 1 commit into
msertdev:mainfrom
codekongdev:feat/receipt-json-schema-34

Conversation

@codekongdev

Copy link
Copy Markdown

What changed

Closes #34.

Publish a draft 2020-12 JSON Schema for receipt format version 1 at schemas/v1/receipt.schema.json, exported from the npm package as grounded-json/receipt.schema.json. External tools can resolve and validate the receipt structure without depending on the SDK's internal Zod parser.

Add deterministic product, job, and article receipts. Tests discover example receipts, validate them with Ajv, and regenerate and replay the three fixtures against their local sources. The package smoke test also reads the schema from a clean tarball installation.

The receipt wire format and runtime behavior remain unchanged. Documentation distinguishes structural validation from timestamp parsing, byte limits, cross-field consistency, extraction-schema safety, cryptographic checks, and evidence replay.

Evidence and security

  • Every newly supported value remains deterministically replayable.
  • Ambiguous, missing, and hostile inputs fail closed.
  • No untrusted HTML, schema, receipt, or terminal content is executed.
  • The change does not add hidden network access or telemetry.
  • Documentation describes provenance without implying factual truth.

Ajv is a development dependency used by the tests; it is not added to the runtime verification path.

Verification

  • Tests added or updated: 43 new cases; 72 tests pass overall.
  • npm run check: package build, tests, lint, formatting, and site build pass.
  • npm run pack:smoke: packaged schema resolution, SDK import and replay, and CLI demo pass.

Validated locally with Node.js 22.22.1 and npm 11.19.0 on Linux.

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.

Publish receipt format as a JSON Schema (receipt.schema.json)

1 participant