Skip to content

Check the pinned inputs with OCL at parse time #558

Open

Description

@ExtraToast

Problem

In emf/, the only OCL constraint file for an authored or pinned document is emf/bundles/metamodel/model/project-intent.ocl, and it imports only the Project Intent metamodel (skeleton.ocl constrains the skeleton metamodel alone). pinned-inputs.ecore carries no constraint annotations. So the node contract, the images lock, the ClusterState snapshot and the migration proofs are checked only for shape, by their Xtext grammars.

Their content is checked only when the resolution uses it, through abort queries (for example E_UNLOCKED_IMAGE). Those carry no source location, and a malformed entry that no Project references is never flagged.

What to build

Complete OCL for the pinned-inputs metamodel, run at parse time as project-intent.ocl is, refusing with an E_ code plus the file and object path.

Candidate checks:

  • a lock entry's digest is a sha256 digest, and its uid and gid are set;
  • node names are unique, and every capability and GPU class is well formed;
  • the ClusterState snapshot names the Platform document's cluster;
  • a migration proof names a revision.

Compare with the TypeScript implementation's src/check/pinned-inputs.ts (today: E_NODE_CONTRACT_MISMATCH, E_GPU_VENDOR_AMBIGUOUS, E_NO_GPU_POLICY, E_UNLOCKED_IMAGE). Where a check is new, add it to both implementations, so they stay in parity against the same negative fixtures.

Acceptance criteria

  • An OCL constraint file over the pinned-inputs metamodel, evaluated at parse time, each invariant named after the code it reports.
  • Each refusal names the file and the object path.
  • Every check exists in both implementations, with a negative fixture under spec/v1/examples/ and its diagnostics oracle.
  • Any new E_ code is in the specification, and npm run lint:codes passes.
  • Rule ledger rows, enforcement and fixtures land together, per the repository's rule conventions.

Not on the MDE Task 3 hand-in's critical path, and not part of #544. It relates to the "clearer error messages" improvement on the presentation's reflection slide.

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: testsUnit, integration, system, or contract test concern.priority: P2Medium; normal planned work.status: ready-for-agentFully specified; an agent may take it with nobody watching.type: featureNew user-facing or operator-facing capability.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions