# Core Machine Contract Testing

Milestone 5 now has a machine-readable contract audit for the Phase 1 catalogue. The audit verifies that the core machine registry, dossiers, procedural blueprints, and animation definitions stay aligned and continue to provide the metadata expected by the 3D viewer and educational layer.

Run it locally with:

```bash
node scripts/audit-core-machine-contract.mjs
```

Useful options:

```bash
node scripts/audit-core-machine-contract.mjs --json
node scripts/audit-core-machine-contract.mjs --strict
node scripts/audit-core-machine-contract.mjs --expected 28
```

The contract checks:

- exactly 28 unique, URL-safe machine ids
- title, description, category, difficulty, engineering facts, and related-machine links
- component hierarchy depth and per-component descriptions
- saved camera presets with position/target vectors
- labels/callouts with anchors or positions
- catalogue thumbnail strategy availability
- dossier coverage and guided tour step depth
- procedural blueprint coverage, renderable node depth, exploded-view metadata, and GLB/GLTF replacement points
- animation module coverage for every registered machine
- cross-registry extras/missing ids and suspicious related-machine links

A dedicated GitHub Actions workflow runs the audit whenever catalogue, dossier, blueprint, or core animation files change. Warnings do not fail CI by default because some related-machine links may intentionally be directional, but `--strict` is available for release-hardening passes.
