chore(spec): re-root liveness gate on the metadata-type registry + onboard 10 core types#1936
Merged
Merged
Conversation
…ll-down) The json-schema/-based gate was structurally blind to the core authorable types: z.toJSONSchema does not emit object/field/flow/action/view/page/hook, so those — the highest-frequency surface — could never be governed. The 3 categories that worked (security/identity/ai) did so by luck. Re-root on BUILTIN_METADATA_TYPE_SCHEMAS (packages/spec/src/kernel/ metadata-type-schemas.ts) — the same registry the runtime /api/v1/meta/types/:type endpoint and Studio metadata-admin forms use, i.e. exactly the authorable types. The gate walks each Zod schema directly (version-tolerant unwrap of lazy/optional/default/pipe), classifies top-level props, and drills one level into container props (object/record/array) via a ledger `children` block so permission.objects.allowCreate stays distinguishable from a blanket objects. - New gate: packages/spec/scripts/liveness/check-liveness.mts (tsx; imports the registry — no gen:schema needed). Framework provenance/lock fields auto-live. - Ledgers re-keyed category → type. Onboards 10 types, ~295 props, all classified: object (31 live/17 dead), field (34/39), flow (29/7/1exp), action (26/5), hook (11/2), permission (23/2/3exp), role (3/1), agent (18/5/4exp), tool (13/5/1exp), skill (15/2). Seeded from the per-type liveness audits. - Supersedes the category-keyed security/identity/ai ledgers; check:liveness now runs tsx; CI no longer runs gen:schema. Not yet governed (rollout): view/page/dashboard/app/report/dataset/job/datasource/ translation/email_template/doc/book/validation/seed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 89 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
| import { readFileSync, existsSync } from 'node:fs'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { dirname, join, resolve } from 'node:path'; | ||
| import { getMetadataTypeSchema, listMetadataTypeSchemaTypes } from '../../src/kernel/metadata-type-schemas'; |
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.
Fixes a structural blind spot and expands the spec-liveness gate to the core authorable surface.
The blind spot
The previous gate read the generated
json-schema/directory. Butz.toJSONSchema()throws onobjectandaction, and most top-level authorable types (object/field/flow/action/view/page/hook) aren't emitted there at all — so the gate was structurally blind to the highest-frequency surface. The 3 categories that worked (security/identity/ai) did so only because their schemas happened to emit.The fix — root on the registry
Read
BUILTIN_METADATA_TYPE_SCHEMAS(metadata-type-schemas.ts) — the same registry the runtime/api/v1/meta/types/:typeendpoint and Studio metadata-admin forms use, i.e. exactly the authorable types. The gate walks each Zod schema directly (version-tolerant unwrap of lazy/optional/default/pipe), so it never depends on the JSON-schema converter.childrenblock, sopermission.objects.allowCreate(live) stays distinct fromallowTransfer(experimental),flow.errorHandling.fallbackNodeId(dead) from the rest, etc.live.tsx(imports the registry); CI no longer needsgen:schema.Onboards 10 types (~295 properties, all classified)
Ledgers re-keyed category → type, seeded from each type's liveness audit:
enable/capabilities + versioning/cdc tier dead;apiEnabledunenforcedrunAsunenforced; status/active gate nothingdisabledCEL ignored (renderers read non-specenabled)parentdeadSupersedes the category-keyed
security/identity/ailedgers (#1919/#1924/#1932). Not yet governed (rollout): view/page/dashboard/app/report/dataset/job/datasource/translation/email_template/doc/book/validation/seed.Gate green: all 10 types, 0 unclassified, no stale evidence.
🤖 Generated with Claude Code