Repository navigation
Description
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
sha256digest, and itsuidandgidare 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, andnpm run lint:codespasses. - 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.
Activity