feat(spec): allow custom_metadata extension carrier in permit-v1 (v1.5.0)#9
Merged
Merged
Conversation
…5.0) The Keel authorization migration (keel-api 2026-06-02) adds a permit-level custom_metadata field carrying issuer-defined extensions, initially shadow_override audit annotations. Without this spec update, conforming third-party verifiers would reject permits containing the new field per §12's closed semantics. This update: - Adds custom_metadata to AuditExportPermitSource in all three schemas with additionalProperties: true (escape hatch for additive issuer extensions) - Documents the closed-with-escape-valve semantics in spec §12 - Reserves the shadow_override key under custom_metadata - Bumps spec version to 1.5.0 (additive minor, backward compatible) Refs: keel-api auth migration (AUTHORIZATION_MIGRATION_STATUS_2026-06-01.md) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3ac76dc to
3027497
Compare
The repo-integrity check requires README spec version to match the latest CHANGELOG entry. PR #9 bumped CHANGELOG to 1.5.0 but missed updating the two README references. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Keel API authorization migration (keel-api 2026-06-02) ships
Permit.custom_metadata, a JSON field carrying issuer-defined extensions. The first shipped key isshadow_override, which carries audit annotation when the issuer's shadow override layer blocks a dispatch.Without this spec update, third-party validators built against the published
permit-v1.schema.json,audit-export-bundle.schema.json, oraudit-export-record.schema.jsonschemas would reject any permit containingcustom_metadata— because all three schemas hadadditionalProperties: falseonAuditExportPermitSourcewith no escape valve.What changed
3 schema files (
schemas/permit-v1.schema.json,schemas/audit-export-bundle.schema.json,schemas/audit-export-record.schema.json):custom_metadataas an optional property onAuditExportPermitSourcein every schema'spropertiesblockcustom_metadatausestype: ["object", "null"],default: null, andadditionalProperties: true— the escape hatch for issuer-defined keysAuditExportPermitSourceobject retainsadditionalProperties: false— the closed-with-escape-valve pattern is intentionalspec/permit-v1.md:custom_metadatarow to §2.3 optional fields tablecustom_metadatashadow_overrideundercustom_metadatawith its sub-field inventorySpec version: 1.5.0header to top of documentCHANGELOG.md: added[1.5.0] — 2026-06-02entrytools/export_schemas.py: added_PERMIT_EXTENSION_FIELDSconstant and injected it alongside_PERMIT_CHAIN_FIELDSin_add_permit_chain_fields()so future schema re-generations from keel-api preservecustom_metadatatest-vectors/vectors/cat-01-baseline/01-02-permit-with-custom-metadata/: new scaffolded conformance vector requiring validators toPASSon a permit carryingcustom_metadata: {"shadow_override": {"outcome": "blocked"}}Backward compatibility
Fully additive.
custom_metadatais optional withdefault: null. Every existing v1.4.x permit validates unchanged — no required fields added, no fields removed or renamed. Validators that accepted v1.4.x records are still correct for records that omitcustom_metadata.Forward design
additionalProperties: trueinsidecustom_metadatameans future issuer extension keys (beyondshadow_override) can be added without a spec version bump. Future spec versions will reserve additionalcustom_metadatakeys as needed; consumers are instructed to ignore unknown keys gracefully.Test plan
python3 -c "import json; json.load(open(f))"on all three schemas)additionalProperties: falseverified still present on outerAuditExportPermitSourcein all three schemasadditionalProperties: trueverified present oncustom_metadatain all three schemasgit diff --checkpasses (no whitespace issues)🤖 Generated with Claude Code