-
Notifications
You must be signed in to change notification settings - Fork 0
Keep the metamodel to what JSON Schema can state #223
Copy link
Copy link
Closed
Labels
area: deployhomelab-deploy, deploy-v2, manifests, and rollout flow.homelab-deploy, deploy-v2, manifests, and rollout flow.component: configConfiguration schema, defaults, or repo settings.Configuration schema, defaults, or repo settings.priority: P2Medium; normal planned work.Medium; normal planned work.type: refactorCode structure change without intended behavior change.Code structure change without intended behavior change.
Description
Activity
Metadata
Metadata
Assignees
Labels
area: deployhomelab-deploy, deploy-v2, manifests, and rollout flow.homelab-deploy, deploy-v2, manifests, and rollout flow.component: configConfiguration schema, defaults, or repo settings.Configuration schema, defaults, or repo settings.priority: P2Medium; normal planned work.Medium; normal planned work.type: refactorCode structure change without intended behavior change.Code structure change without intended behavior change.
Parent
#221
What to build
Every rule the model states about a document's shape is also stated by that document's published JSON Schema, so a consumer validating against the schema refuses exactly what the model refuses.
Today the Resolved Deployment (and the resolved Application document) carry one rule in a zod refinement: a Process's
switchoverrequires itscutover, and must be a switchover that cutover allows.z.toJSONSchemasilently drops refinements, so the published schemas accept documents the model refuses. Move the rule into the schema's structure (for example a discriminated shape per cutover, or a conditional the generator emits), so that it appears in the generated JSON Schema. Then forbid the zod constructs a JSON Schema cannot state in the metamodel:refine,superRefine,transform,preprocessandpipe.The rule's meaning does not change. The model-driven implementation already states it in its own metamodel; keep it in step if its shape there changes.
Acceptance criteria
switchoverwithout acutover, and aswitchoveritscutoverdoes not allow; a test proves both against the committed schemas.refine,superRefine,transform,preprocess,pipe; a rule refuses them, with its ledger row and a failing fixture.spec/v1and the model-driven implementation are unchanged in meaning, or changed together in this pull request.Blocked by
None (can start immediately).