Machine parts — refusal fixture
Area: Relations Teaches: the negative companion to
machine_parts_v0— a metarel endpoint filled with the wrong metatype is refused with OE0631 atox check, pinning the endpoint-constraint diagnostic. Run:ox check examples/machine_parts_bad --codes(must printOE0631and exit non-zero)
Conformance fixture, not a tutorial. This package is designed to be refused. It exists so CI can prove
ox checkrejects a metarel-endpoint violation, and so the diagnostic stays pinned. For the feature it guards, readmachine_parts_v0.
The attachment metarel requires its mount position (position 1) to be fitting-sorted. This fixture fills that position with Axle, a part — a component would have to mount via a bare part, not via a fitting:
pub attachment mountedVia(host: Chassis, mount: Axle);
ox check must refuse this with OE0631 and exit non-zero:
$ ox check examples/machine_parts_bad --codes
OE0631
$ echo $?
1
The full diagnostic names the offending position and both metatypes:
× OE0631: in `<anonymous>::mountedVia`, position 1 of relation `mountedVia`
│ is `Axle` (a `part`), but its classifying metarel `attachment` declares
│ that position as `fitting` — an endpoint must be (a sub-metatype of) the
│ metarel's position metatype.
The examples corpus gate (oxc-driver/tests/examples_corpus_gate.rs) asserts this package is refused with an OE code, and a driver test (oxc-driver/tests/cli/scenario.rs) pins the refusal — if the endpoint check regressed and this fixture started building, CI would fail.
Source
The package’s real Argon source, transcluded from the file this corpus compiles — what you read here is exactly what CI builds.
//! `machine_parts_bad` — the REFUSAL half of the relation-constraint proof
//! (RFD 0031 D1, #311). An `attachment` relation whose mount position is filled
//! by a `part` (not a `fitting`) is refused at `ox check`/`ox build` with the
//! feature-named OE0631 — a component must mount via a fitting, not a bare
//! part. This package MUST NOT build; the corpus gate asserts the OE0631
//! refusal. Mirrors the well-formed `machine_parts_v0`.
pub metaxis granularity for metatype { atomic, composite };
pub metatype part = { granularity: atomic };
pub metatype fitting = { granularity: composite };
pub metarel attachment(host: part, mount: fitting);
pub part Chassis;
pub part Axle;
// WRONG: position 1 (mount) requires a `fitting`, but `Axle` is a `part`.
// Refused OE0631 — the §4.3 endpoint-metatype verification.
pub attachment mountedVia(host: Chassis, mount: Axle);