Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Legal catalog — cross-package refusal fixture

Area: Vocabulary & packages Teaches: the negative companion to legal_catalog_v0 — pointing an imported directed_obligation’s creditor endpoint at a norm concept instead of a party is refused with OE0631 across the package boundary. Run: ox check examples/legal_catalog_bad_v0 --codes (must print OE0631 and exit non-zero)

Conformance fixture, not a tutorial. This package is designed to be refused. It exists so CI can prove a metarel-endpoint violation is caught across a package boundary — the constraint lives in the imported vocabulary, not in this file. For the well-formed consumer, read legal_catalog_v0; for the vocabulary, legal_vocab_v0.

The imported directed_obligation metarel constrains both endpoints to be party-sorted. This fixture points the creditor endpoint at PayRent, a norm concept (an obligation) — a directed obligation cannot run to a norm:

pub directed_obligation owesBad(debtor: Tenant, creditor: PayRent);

ox check must refuse this with OE0631 and exit non-zero — the endpoint check fires on the dependency-declared metarel:

$ ox check examples/legal_catalog_bad_v0 --codes
OE0631
$ echo $?
1

The full diagnostic names the offending position and both metatypes:

× OE0631: in `root::owesBad`, position 1 of relation `owesBad` is `PayRent`
│ (a `obligation`), but its classifying metarel `directed_obligation`
│ declares that position as `party` — an endpoint must be (a sub-metatype
│ of) the metarel's position metatype.

A corpus test (oxc-runtime/tests/examples_corpus.rs) asserts this package is refused with OE0631 — proving the metarel endpoint constraint survives the package join. If it regressed, this fixture would start building and CI would fail.