forgetproof Try the button

Rendered from schemas/README.md; raw Markdown.

The schemas#

This directory holds the JSON Schemas for everything ForgetMe and ForgetProof put on the wire: nine schemas for the ForgetMe v1 contract with valid and invalid fixtures, two for the older 0.2 provider surface, and the Poppy 1.0 kit's schemas vendored unmodified. This page says what each schema describes and how to validate a document against it with ajv or with Python's jsonschema.

Status: served under /schemas/ on the demo site; not yet packaged on PyPI or npm.

A receipt is one holder's signed statement about one erasure; a holder is one store of one party. The index is the document a server answers at its ForgetMe endpoint, with its name and keys. The glossary has the rest; the wire contract says where each document is used.

The ForgetMe v1 schemas#

Under forget-me/v1/, one schema per shape of the contract:

SchemaDescribes
common.schema.jsonThe shared definitions the others reference: references, operation ids, the six outcome words, the approval offer.
discovery.schema.jsonThe stellarminds.ai/forget-me fragment a Company merges into its poppy.json.
index.schema.jsonThe index at GET {endpoint}: issuer, keys, routes, scopes, limits, approval, identity.
preview-request.schema.jsonThe body of POST {endpoint}/preview.
preview.schema.jsonA Preview: item, holders, exceptions, exact terms.
submit-request.schema.jsonThe body of POST {endpoint}/submit: terms, approvals, idempotency key.
operation.schema.jsonAn Operation: state, terms, outcome per holder, log.
evidence.schema.jsonAn Evidence document: one portable receipt per holder, plus observations.
receipt.schema.jsonA portable receipt, forget-me-receipt/1: counts, timestamps, vocabulary words, the Ed25519 public_key and signature.
error.schema.jsonEvery non-2xx answer: error, error_description and the fields some codes add.

The fixtures#

forget-me/v1/fixtures/<shape>/valid/ holds documents each schema must accept and …/invalid/ documents it must refuse; fixtures/poppy/ holds the operation and approval documents the reference Company exchanges over Poppy. The receipt fixtures are real, signed receipts for four of the six outcome words. fixtures/content-rules/ holds receipts that pass the schema and must still be refused: one tampered after signing, one whose coverage names a host path. A schema checks shape, never truth.

The 0.2 schemas#

At the root, for the 0.2 provider surface:

SchemaDescribes
receipt.schema.jsonAn engine receipt, forgetproof-receipt/0.1 or /0.2: before and after scan counts, actions, canary results, copies, file hashes, and the Ed25519 public_key and signature. 0.2 adds issuer, subject_values and copies, requires every scan field, and allows no extra top-level keys.
well-known.schema.jsonThe document a hosted provider serves at GET /.well-known/forgetproof.json: its receipt-signing key and rotated predecessors under keys, the stores a forget request covers, the forget, status and receipts endpoints, and its capabilities. The schema carries an example.

The Poppy kit#

poppy-1.0-kit/ is the Personal Agent Protocol's Company kit schemas, copied unchanged; its README says where from and under which licence. The reference Company's poppy.json, OAuth metadata, Session JWTs and operations are checked against them in the tests.

Validate with ajv#

Any stack with Node 18 or later. Fetch the schema and its shared definitions, then the document:

v1=https://forget.stellarminds.ai/schemas/forget-me/v1
curl -sO $v1/common.schema.json -O $v1/index.schema.json
curl -s https://company.forget.stellarminds.ai/forget-me/v1 > index.json
npx --yes -p ajv-cli@5 -p ajv-formats@3 ajv validate -c ajv-formats --spec=draft2020 --strict=false \
  -s index.schema.json -r common.schema.json -d index.json

The last command prints index.json valid. An invalid document prints index.json invalid and the failing path. Every v1 schema takes -r common.schema.json. -c ajv-formats supplies the date-time and uri-template format checks; without it ajv ignores format and warns.

A 0.2 engine receipt, with the signed fixtures in the verify package as examples:

npx --yes ajv-cli@5 validate -c ajv-formats --spec=draft2020 \
  -s schemas/receipt.schema.json -d "packages/forgetproof-verify/test/fixtures/*.json"

It prints one valid line per fixture.

Validate in Python#

jsonschema 4.18 or later:

import json, httpx
from jsonschema import Draft202012Validator
from referencing import Registry, Resource

v1 = "https://forget.stellarminds.ai/schemas/forget-me/v1/"
common = httpx.get(v1 + "common.schema.json").json()
schema = httpx.get(v1 + "index.schema.json").json()
registry = Registry().with_resource(common["$id"], Resource.from_contents(common))
validator = Draft202012Validator(schema, registry=registry, format_checker=Draft202012Validator.FORMAT_CHECKER)
validator.validate(httpx.get("https://company.forget.stellarminds.ai/forget-me/v1").json())
print("valid")

It prints valid; an invalid document raises ValidationError naming the failing path.

Limits#

Next steps#