Skip to content

ci: validate registry schema + type-list consistency on PR#86

Merged
kurtseifried merged 1 commit into
mainfrom
ci/validate-registry-data
May 28, 2026
Merged

ci: validate registry schema + type-list consistency on PR#86
kurtseifried merged 1 commit into
mainfrom
ci/validate-registry-data

Conversation

@kurtseifried

Copy link
Copy Markdown
Collaborator

Summary

Adds two data-quality CI checks for the spec repo and a workflow to run them. Part of Phase 0 of the testing-maturity initiative.

What the checks do

`scripts/validate-registry-schema.py`

Validates every `registry/**/*.json` against `schemas/registry-namespace.schema.json`. Currently all 1,768 registry files pass; the check is preventive going forward — catches malformed entries (missing required fields, wrong types, invalid enums) before they reach production KV.

`scripts/validate-type-list.py`

Verifies the schema's `type` enum matches SecID-Service's canonical `TYPE_REGISTRY` in `src/type-registry.ts`. These are independent hardcoded sources of truth (per CLAUDE.md's WARNING block), so drift is possible. The script catches it at PR time rather than at production.

By default fetches `type-registry.ts` from `main`; `--type-registry-path` for offline testing.

Combined coverage

Together with the existing `validate-subtypes.py`, the three checks form the spec-side test surface:

  • validate-registry-schema.py — every entry structurally valid
  • validate-type-list.py — types consistent across repos
  • validate-subtypes.py — subtypes consistent across repos

Verified locally

  • `validate-registry-schema.py` — `OK: all 1768 registry files validate`
  • `validate-type-list.py` — `OK: 10 types match`

Security review

  • No `github.event.*` interpolation
  • Zero `${{ ... }}` expansions in `run:` commands
  • `permissions: contents: read`

🤖 Generated with Claude Code

Two new data-quality checks running on every PR that touches registry
data or the schema.

1. scripts/validate-registry-schema.py — validates every registry/**/*.json
   against schemas/registry-namespace.schema.json. Catches malformed
   entries (missing required fields, wrong types, invalid enums) before
   they reach production KV. Current state: all 1,768 registry files
   already pass; the script is preventive going forward.

2. scripts/validate-type-list.py — verifies the JSON Schema's `type` enum
   matches SecID-Service's canonical TYPE_REGISTRY in type-registry.ts.
   These two files are independent hardcoded sources of truth (per
   CLAUDE.md's WARNING block); the script catches drift between them at
   PR time rather than in production. Fetches type-registry.ts from
   main branch by default; --type-registry-path for offline testing.

3. .github/workflows/validate-registry.yml — wires both into CI on PRs
   that modify registry data, the schema, or the scripts themselves.

Together with validate-subtypes.py (existing), the three checks form the
spec-side test surface: schema validity for entries, type consistency
across repos, subtype consistency across repos.

Verified locally: both scripts exit 0 against current main.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@kurtseifried kurtseifried merged commit 3aa51c4 into main May 28, 2026
@kurtseifried kurtseifried deleted the ci/validate-registry-data branch May 28, 2026 19:55
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.

1 participant