Skip to content

Keep the metamodel to what JSON Schema can state #223

Description

@ExtraToast

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 switchover requires its cutover, and must be a switchover that cutover allows. z.toJSONSchema silently 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, preprocess and pipe.

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

  • The regenerated Resolved Deployment and resolved Application schemas refuse a switchover without a cutover, and a switchover its cutover does not allow; a test proves both against the committed schemas.
  • Every committed Resolved Deployment oracle still validates.
  • The metamodel contains none of refine, superRefine, transform, preprocess, pipe; a rule refuses them, with its ledger row and a failing fixture.
  • spec/v1 and the model-driven implementation are unchanged in meaning, or changed together in this pull request.

Blocked by

None (can start immediately).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: deployhomelab-deploy, deploy-v2, manifests, and rollout flow.component: configConfiguration schema, defaults, or repo settings.priority: P2Medium; normal planned work.type: refactorCode structure change without intended behavior change.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions