Skip to content

feat(metadata): move reporting and requirements into vocabulary packs - #632

Merged
dmealing merged 25 commits into
mainfrom
fm/mo-130-reporting-requirements-packs
Nov 25, 2026
Merged

dmealing merged 25 commits into
mainfrom
fm/mo-130-reporting-requirements-packs

Conversation

@dmealing

@dmealing dmealing commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Reporting and requirements leave core vocabulary, becoming opt-out provider packs. The reporting vocabulary (object.report, dimension.*, measure.* incl. measure.derived/@expr, segment.filter, the entity's dimension/measure/segment children, @segment on origin.aggregate/origin.first) is registered by metaobjects-reporting, and requirement.functional/requirement.architectural (plus the root's requirement.* child) by metaobjects-requirements, in every port (TS, C#, Java, Python, Rust). Both stay in the default bundle so existing models load unchanged; with a pack composed out, using its types fails the load with the unknown type/subtype error (new error-packs-left-out-*-used conformance fixtures and per-port RequirementsPackLeftOut tests). The core vocabulary pin, registry manifest and the ~100 existing reporting/requirements fixture providers.json files were updated accordingly; the root's requirement child rule is now min: 0, max: null. A pack subtype declared with extendsBase (e.g. object.report folding object.base) keeps the base provider as owner of the folded attributes instead of claiming them (ADR-0062, with a Rust registry base-ownership conformance test), and GOVERNANCE.md records that an attribute promoted from a pack into core keeps its name and meaning.
  • A template variable absent from the payload now fails the render in every render path. Mustache and Jinja (including the Rust metaobjects-render crate, via a new presence.rs pre-walk that skips falsy section bodies and checks list sections per element) raise ERR_VAR_NOT_ON_PAYLOAD (<name>) instead of silently rendering empty; a present-but-null variable still renders empty. Render and Jinja conformance fixtures may carry expected-error.txt in place of expected.txt, and new parity fixtures pin list length resolution, shadowed dotted prefixes, dotted-path lookup and zero-is-falsy behavior across ports.
  • Business rules rule P3: colliding derived permission names are refused. Two operations or transitions whose permission names resolve equal — @permission or the derived <package>.<path>, compared exactly as the policy receives it, so p::Order.open and p.Order.open are distinct — report ERR_TRANSITION_NAME_COLLISION on the later one when at least one name is derived; two equal declared names remain a legal shared permission (new error-rules-permission-name-op-* and rules-permission-name-package-separator-distinct fixtures). Java now accepts dotted operation names, matching TypeScript, C# and Python.
Validation

Validation runs and follow-ups

This PR took 4 no-mistakes runs. Run 1 found the dotted-name lookup review item; run 2 failed only on gate-provider quota; run 3 was lost at the document step when every gate agent was killed by host memory pressure (exit 137) after review and test had passed; run 4 passed every step. Runs 3 and 4 were each approved explicitly.

Follow-ups, not in this PR:

  • C# and Rust render parity. C# ledgers render-shadowed-dotted-prefix, and Rust ledgers that case plus render-list-length and render-zero-falsiness (KnownDrift, recorded in docs/CONFORMANCE.md). These go to the engine-parity follow-up task, which closes every ledger entry.
  • The KnownDrift ledgers only assert that the output still differs (run 3 review note). Pinning each ledgered case's current engine output would also catch regressions.
  • Rust ADR-0062 ownership check, residual gap. When a subtype is set to extend its base and redeclares a base attr by name, Rust exempts it by name, while TypeScript and C# refuse it (run 4 review note; the review round cap was reached). Tracked as follow-up task mo-rust-extends-base-ownership.

Risk Assessment

⚠️ Medium: The fix round is small and correct for its stated findings. This pass re-read only that round's delta, not the rest of the large 274-file change, which earlier rounds covered, so the remaining files are unverified here.

Testing

Broad regression came from the configured test command scripts/ci-local.sh --affected --strict-toolchains, which passed at the target commit before this run; no source or test files were changed this turn, so no re-run was needed. On top of that I drove three live scenarios: the SDK loader composed without each pack refuses that pack's vocabulary (report pack out gives ERR_UNKNOWN_TYPE on measure.aggregate plus ERR_UNKNOWN_SUBTYPE on object.report; requirements pack out gives ERR_UNKNOWN_TYPE on requirement.functional; both default-bundle loads are clean, oracle = committed expected-errors.json), the real meta CLI rejects the same-name permission collision with exit 1 while accepting the :: vs . distinct names clean, and meta types attributes 50 vocabulary entries to metaobjects-reporting and 32 to metaobjects-requirements with folded base attrs keeping core-types ownership. Evidence artifacts written to the evidence directory; scratch fixture project and driver script removed; worktree left clean.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Embedder composes the registry without the reporting pack: a model using measure.aggregate and object.report fails to load with ERR_UNKNOWN_TYPE/ERR_UNKNOWN_SUBTYPE; the same model under the default b… ✅ pass live local gate evidence (packs-driver-output.txt, not published)
Embedder composes the registry without the requirements pack: requirement.functional fails to load with ERR_UNKNOWN_TYPE; the default bundle loads it and it reaches the verify gate's ledger ✅ pass live local gate evidence (packs-driver-output.txt, not published)
Adversarial P3/B5 check through the real meta CLI: two permission points deriving the same name p.Order.open are refused (exit 1, ERR_TRANSITION_NAME_COLLISION), while an operation deriving p::Order.o… ✅ pass live local gate evidence (p3-cli-fmt-check.txt, not published)
meta types under the default composition lists the moved vocabulary as pack-owned: object.report and its attrs attribute to metaobjects-reporting (50 entries), requirement vocabulary to metaobjects-re… ✅ pass live local gate evidence (meta-types-report.txt, not published)
Evidence: SDK driver output: pack-out vs default loads and P3 collision/distinct checks, all PASS

report pack OUT : [ERR_UNKNOWN_TYPE, ERR_UNKNOWN_SUBTYPE] report default : [] req pack OUT : [ERR_UNKNOWN_TYPE] req default : [] P3 collision : [ERR_TRANSITION_NAME_COLLISION] P3 distinct sep : [] all PASS

report pack OUT : [ERR_UNKNOWN_TYPE, ERR_UNKNOWN_SUBTYPE]
PASS report pack out => unknown measure/report
report default  : []
PASS report default bundle => loads clean
req pack OUT    : [ERR_UNKNOWN_TYPE]
PASS requirements pack out => unknown type
req default     : []
PASS requirements default bundle => loads clean
P3 collision    : [ERR_TRANSITION_NAME_COLLISION]
PASS derived p.Order.open twice => collision
P3 distinct sep : []
PASS p::Order.open vs p.Order.open => no collision
driver done
Evidence: Real meta CLI: collision fixture refused, separator-distinct fixture loads clean and canonical

collision fixture, meta fmt --check, exit 1: operation.query "Orders.Order.open" asks the policy about the permission name "p.Order.open", which transition.action "Order.status.open" also asks about, and one of the two names is derived rather than declared; declare a distinct @permission on one, or rename it. separator-distinct fixture, meta fmt + fmt --check, exit 0: meta fmt --check — every file is already canonical.

== meta fmt --check, collision fixture (op 'Order.open' + transition 'open', both derive p.Order.open) ==
meta: this project's metadata does not currently load cleanly — fix the error(s) below, then re-run fmt:
  operation.query "Orders.Order.open" asks the policy about the permission name "p.Order.open", which transition.action "Order.status.open" also asks about, and one of the two names is derived rather than declared; declare a distinct @permission on one, or rename it.

== meta fmt --check, separator-distinct fixture (p::Order.open op vs p.Order.open transition) ==
  ok           metaobjects/meta.orders.api.json
  ok           metaobjects/meta.orders.json
meta fmt --check — every file is already canonical.
Evidence: meta types report: object.report vocabulary attributed to the reporting pack, base-folded attrs to core-types

meta types report (metamodelVersion 1.3, total 10) subtype object.report - attr object.report @collectionName metaobjects-reporting attr object.report @dimensions metaobjects-reporting attr object.report @measures metaobjects-reporting attr object.report @spine metaobjects-reporting attr object.report @segment metaobjects-reporting attr object.report @object metaobjects-core-types attr object.report @objectAdapter metaobjects-core-types

meta types report (metamodelVersion 1.3, total 10)
subtype	object.report	-
attr	object.report @collectionName	metaobjects-reporting
attr	object.report @dimensions	metaobjects-reporting
attr	object.report @filter	metaobjects-reporting
attr	object.report @from	metaobjects-reporting
attr	object.report @measures	metaobjects-reporting
attr	object.report @object	metaobjects-core-types
attr	object.report @objectAdapter	metaobjects-core-types
attr	object.report @segment	metaobjects-reporting
attr	object.report @spine	metaobjects-reporting

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - outcome: 4 findings fixed, 1 info follow-up

Fixed in this run:

  • server/typescript/packages/metadata/src/loader/rules-validation.ts - the P3 header comment now states the B5 ruling: p::Order.open and p.Order.open are different permission names and do not collide (reviewer inline fix, no behavior change).
  • docs/CONFORMANCE.md - says the TypeScript render runner checks that the expected error message is contained, matching what it does.
  • AGENTS.md / CLAUDE.md - the render corpus line now says C# and Rust carry KnownDrift render ledgers recorded in docs/CONFORMANCE.md.
  • server/rust/metaobjects/src/registry.rs - the ADR-0062 ownership exemption is limited to extends_base definitions, so a provider redeclaring a core base attr on a non-extending subtype is refused, as in TypeScript and C#, with Rust tests.

Remaining (info, follow-up task mo-rust-extends-base-ownership):

  • server/rust/metaobjects/src/registry.rs - inside an extends_base definition the exemption is still by name, so a subtype that redeclares a base attr there is accepted in Rust where TypeScript and C# refuse it. The review round cap was reached, so it is not fixed here.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Embedder composes the registry without the reporting pack: a model using measure.aggregate and object.report fails to load with ERR_UNKNOWN_TYPE/ERR_UNKNOWN_SUBTYPE; the same model under the default b… ✅ pass live local gate evidence (packs-driver-output.txt, not published)
Embedder composes the registry without the requirements pack: requirement.functional fails to load with ERR_UNKNOWN_TYPE; the default bundle loads it and it reaches the verify gate's ledger ✅ pass live local gate evidence (packs-driver-output.txt, not published)
Adversarial P3/B5 check through the real meta CLI: two permission points deriving the same name p.Order.open are refused (exit 1, ERR_TRANSITION_NAME_COLLISION), while an operation deriving p::Order.o… ✅ pass live local gate evidence (p3-cli-fmt-check.txt, not published)
meta types under the default composition lists the moved vocabulary as pack-owned: object.report and its attrs attribute to metaobjects-reporting (50 entries), requirement vocabulary to metaobjects-re… ✅ pass live local gate evidence (meta-types-report.txt, not published)
  • scripts/ci-local.sh --affected --strict-toolchains
  • scripts/ci-local.sh --affected --strict-toolchains (baseline, passed at target commit before this run)
  • SDK driver against committed fixtures error-packs-left-out-report-used, error-packs-left-out-requirement-used, error-rules-permission-name-op-dotted, rules-permission-name-package-separator-distinct via MetaDataLoader.fromDirectory with strict:true, composing coreProviders with and without the reporting/requirements packs (driver was a scratch script, executed then deleted; output retained as evidence)
  • meta fmt --check (real CLI binary) on collision fixture in a disposable $DEV_SCRATCH project — exit 1 with ERR_TRANSITION_NAME_COLLISION
  • meta fmt + meta fmt --check (real CLI binary) on the separator-distinct fixture — exit 0, model loads and is canonical
  • meta types --format json and meta types report (real CLI binary) — pack-owned vocabulary and folded-attr ownership attribution
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…raise on missing template variables; refuse permission-name collisions

- Reporting (object.report, dimension.*, measure.* incl. measure.derived/@expr,
  segment.filter, the entity's dimension/measure/segment children and @segment on
  origin.aggregate/origin.first) is registered by metaobjects-reporting; requirements
  (requirement.* and the root's requirement child) by metaobjects-requirements. Both
  are in the default bundle of every port (TS, C#, Java/Kotlin, Python, Rust), so
  existing models load and generate identically. A model that uses a left-out pack's
  vocabulary gets a loader error (new error-packs-left-out-*-used fixtures). The
  verify requirements gate reads through the pack.
- A pack subtype declared with extendsBase may fold a base another provider
  registered (object.report folds object.base); folded attributes keep the base's
  owner under ADR-0062.
- Core vocabulary pin, registry manifest (root requirement child gains min 0 /
  max null), metamodel docs, site reference and payload regenerated.
- GOVERNANCE.md: an attribute promoted from a pack into core keeps its name and
  meaning.
- B4: Mustache and Jinja raise ERR_VAR_NOT_ON_PAYLOAD for a variable or dotted path
  absent from the payload, in every port that renders; render runners learn
  expected-error.txt.
- B5: rules rule P3 refuses two permission points whose names resolve equal when at
  least one name is derived (ERR_TRANSITION_NAME_COLLISION), in every port.
- C3: Python checks @union shape and @Grain views at load; both must-fail fixtures
  leave its expected-failures ledger.
…not one name

The P3 collision check rewrote '::' to '.' before comparing, so a derived
p::Order.open counted as a collision with the transition's p.Order.open. They
are different names in the metadata and the policy receives them as written.
Removed the rewrite in TS, C#, Java, Python and Rust. The former
error-rules-permission-name-op-package fixture becomes
rules-permission-name-package-separator-distinct, which every port's
conformance runner now loads clean.
…raise on missing template variables; refuse permission-name collisions

- Reporting (object.report, dimension.*, measure.* incl. measure.derived/@expr,
  segment.filter, the entity's dimension/measure/segment children and @segment on
  origin.aggregate/origin.first) is registered by metaobjects-reporting; requirements
  (requirement.* and the root's requirement child) by metaobjects-requirements. Both
  are in the default bundle of every port (TS, C#, Java/Kotlin, Python, Rust), so
  existing models load and generate identically. A model that uses a left-out pack's
  vocabulary gets a loader error (new error-packs-left-out-*-used fixtures). The
  verify requirements gate reads through the pack.
- A pack subtype declared with extendsBase may fold a base another provider
  registered (object.report folds object.base); folded attributes keep the base's
  owner under ADR-0062.
- Core vocabulary pin, registry manifest (root requirement child gains min 0 /
  max null), metamodel docs, site reference and payload regenerated.
- GOVERNANCE.md: an attribute promoted from a pack into core keeps its name and
  meaning.
- B4: Mustache and Jinja raise ERR_VAR_NOT_ON_PAYLOAD for a variable or dotted path
  absent from the payload, in every port that renders; render runners learn
  expected-error.txt.
- B5: rules rule P3 refuses two permission points whose names resolve equal when at
  least one name is derived (ERR_TRANSITION_NAME_COLLISION), in every port.
- C3: Python checks @union shape and @Grain views at load; both must-fail fixtures
  leave its expected-failures ledger.
…not one name

The P3 collision check rewrote '::' to '.' before comparing, so a derived
p::Order.open counted as a collision with the transition's p.Order.open. They
are different names in the metadata and the policy receives them as written.
Removed the rewrite in TS, C#, Java, Python and Rust. The former
error-rules-permission-name-op-package fixture becomes
rules-permission-name-package-separator-distinct, which every port's
conformance runner now loads clean.
The rebase onto main brought in the metaobjects-render crate (#630), whose
corpus runner read expected.txt for every render case. This branch adds two
render-conformance cases that expect a missing-variable error instead, so the
Rust renderer now refuses an interpolated name the payload lacks, with the
same message and the same rules as the reference (sections over an absent
name stay legal, null is present, only rendered bodies are checked), and the
runner learns the expected-error.txt convention.
…634

Main's #634 added render-conformance cases and two corpora while this branch
added two render error cases and a Jinja error case; the counts and the
showcase payload are recomputed from the fixtures on disk.
…d branch

The branch was rebased onto main after the first no-mistakes run pushed PR 632,
so that run's commits were replayed rather than kept. This merge records them as
ancestors so the pushed history stays reachable and the next push is a
fast-forward; the tree is the rebased one, unchanged.
…lookup in every port

The B4 missing-variable check follows TypeScript on mustache.js: a dotted
name is tried whole against each context from the innermost outward, and a
list's length is a property. Python and C# now resolve that way; the Java
check pass falls back to a whole-path lookup before raising; the Rust check
pass counts a list's length as present. So no port raises
ERR_VAR_NOT_ON_PAYLOAD on a name TypeScript renders. What the C#, Java and
Rust engines then print for those names is a separate parity question.
…equirements-packs

# Conflicts:
#	AGENTS.md
#	CHANGELOG.md
#	docs/CONFORMANCE.md
#	examples/showcase/site-payload.json
#	server/python/src/metaobjects/loader/validation_passes.py
…s, as mustache.js does

An empty list's length now resolves, so {{#items.length}} on an empty list
rendered its body in Python. mustache.js tests sections with JavaScript
falsiness, where 0 and NaN are falsy; Python's section test and the C#
check pass now do the same. Adds a Python test pinning the shadowed-prefix,
length, zero and null-mid-path cases against the TypeScript output.

Also tidies the Java whole-path fallback (imports, a named length constant,
loop-invariant work hoisted) and the C# lookup (using, a redundant assignment).
@dmealing
dmealing merged commit 9c99e9d into main Nov 25, 2026
10 checks passed
@dmealing
dmealing deleted the fm/mo-130-reporting-requirements-packs branch November 25, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant