Repository navigation
feat(metadata): split rules and view expressions into packs - #618
Merged
Merged
Conversation
…der into packs Move the 1.3.0 business-rules vocabulary (api, operation, binding, transition) and the view-expressions vocabulary (origin.function, @union, @unionall, @Grain, @grainOrdinal) into their own providers, metaobjects-rules and metaobjects-view-expressions, composed by default in every port that carries them. Data-driven extends may now carry structural child rules so a pack owns the child rules that admit its types. Pin the core provider's vocabulary with a gate that points at GOVERNANCE.md and the pack mechanism. Add pack-omission conformance fixtures.
Rewrite 'What modularity does and does not mean' as 'Where vocabulary lives': core holds the base metamodel, other vocabulary lives in its own provider, composed by default and removable. Record honestly what still sits in metaobjects-core-types. Defer the entry rule to GOVERNANCE.md. Drop the metaobjects-forge mention from the default bundle.
One sentence each in AGENTS.md (design judgment), the auto-loading cross-language rule and the authoring skill, all pointing at GOVERNANCE.md.
…ting and requirements stay in core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
metaobjects-rules:api,operation,binding,transition, plus the child rules that admit them onmetadata.rootandfield.enum) and view expressions (metaobjects-view-expressions:origin.function,@union,@unionAll,@grain,@grainOrdinal) out of themetaobjects-core-typesprovider into their own providers. Done in TypeScript, C#, Java/Kotlin, Python and Rust (preview), with spec JSON underspec/metamodel/andserver/*/mirrored in each port. Both packs stay in the default bundle, so existing models load and generate unchanged. A model that uses their types with a pack left out gets a loader error (ERR_UNKNOWN_TYPE/ERR_UNKNOWN_SUBTYPE/ERR_UNKNOWN_ATTR).ExtendDefentries may now carry structural child rules, and theapichild rule onmetadata.rootis declared in data with cardinality (the one registry manifest row that changes;metamodelVersionstays1.3).core vocabulary is pinnedgate (scripts/check-core-vocabulary-pin.ts,scripts/test-core-vocabulary-pin.ts,fixtures/registry-conformance/core-vocabulary.pin.json, wired intoscripts/ci-local.sh). Adding a type, subtype, attribute or child rule to the core provider fails the gate with a pointer toGOVERNANCE.mdand the pack mechanism.packs-left-out-model-loadsanderror-packs-left-out-{api-used,origin-function-used,transition-used}, and refreshes the regenerated docs, site reference, agent-context goldens andexamples/showcase/site-payload.json. Docs and agent guidance (AGENTS.md,.claude/rules/cross-language-porting.md,docs/features/extending-with-providers.md, the authoring skill) now say new vocabulary goes in its own provider pack, never in core.CHANGELOG.mdrecords the change.mo-vocab-docs-fixdocs (merged into this branch so one gate run and one PR carry both).docs/features/extending-with-providers.mdwas updated to describe what the split ships.object.reportand thedimension/measure/segmentrules are woven intoobject.json, and the requirements ledger is read by theverifygate in every port. They are the next candidates for a pack. Not covered by the split, also recorded as a follow-up: thecastnode and the SQL function set ofattr.expressionare expression grammar parsed in code, so a provider cannot gate them.rules.*.docs-siteprovider list; the test step fixed onecargo fmtfinding).Validation
Risk Assessment
Testing
Baseline
scripts/ci-local.sh --affected --strict-toolchainshad already passed. I drove three scenarios live. The real CLI loaded a rules model with the packs composed by default. The real loader returned ERR_UNKNOWN_TYPE or ERR_UNKNOWN_SUBTYPE when the rules or view-expressions pack was left out, and a model using neither loaded with both packs removed. The core pin gate and its adversarial self-test passed. The docs-site fix passed its focused test. All scenarios passed, and I removed the scratch files.metaCLI (dist/bin/meta.js on repo source) in a scratch project holding the rules-purchase-request model (api.operational, operation.*, transition.action).meta fmt --checkl…bun scripts/check-core-vocabulary-pin.tspasses on the committed spec. The self-test adds an attribute or a type to core in a throwaway copy of spec/metamodel and checks t…Evidence: Core vocabulary pin guard run
Evidence: Real loader with packs composed and left out
Evidence: Real CLI with packs composed by default
Evidence: docs-site provider-extension test
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
server/typescript/packages/docs-site/src/load.ts:43- docs-site hand-picks its provider list and was not updated for the pack split.composeRegistry([coreTypesProvider, dbProvider, docProvider, promptProvider, uiProvider, ...extraProviders])used to getapi/operation/binding/transitionandorigin.functionfromcoreTypesProvider. After this changecoreTypesProvideralone no longer registers them (the CHANGELOG 'Embedders' note says so). A model that declares anapi.operational, atransition.actionor anorigin.functiontherefore fails to load in the site builder withERR_UNKNOWN_TYPEorERR_UNKNOWN_SUBTYPE. The same model still loads inmeta gen,meta verifyand the loader, which composecoreProviders. This contradicts the intent that the packs are 'registered by default'. Smallest fix: build the registry fromcoreProviders(deduped againstextraProviders), or at least add the rules and view-expressions providers. I found no other non-test TS, Python, C# or Java caller that composes core alone.🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Test** - 3 issues found → no changes applied ✅
server/typescript/packages/docs-site/src/load.ts- Pack-split intent not live-validated (rules and view-expression packs default-composed, loader error without pack, core-vocabulary pin). Needs follow-up run.scripts/ci-local.sh --affected --strict-toolchainsscripts/ci-local.sh --affected --strict-toolchains(csharp, python, java, ts passed; rust failed pre-fix)scripts/ci-local.sh --only rust --no-integrationafter fmt fix (passed)🔧 No changes applied.
✅ Re-checked - no issues remain.
metaCLI (dist/bin/meta.js on repo source) in a scratch project holding the rules-purchase-request model (api.operational, operation.*, transition.action).meta fmt --checkl…bun scripts/check-core-vocabulary-pin.tspasses on the committed spec. The self-test adds an attribute or a type to core in a throwaway copy of spec/metamodel and checks t…scripts/ci-local.sh --affected --strict-toolchainsBroad regression came from the configured baselinescripts/ci-local.sh --affected --strict-toolchains; it passed at this target commit, and I did not re-run it.bun scripts/check-core-vocabulary-pin.tsandbun scripts/test-core-vocabulary-pin.tsbun server/typescript/packages/cli/dist/bin/meta.js fmt --checkandmeta types api|transition|operationin a scratch project holding the rules-purchase-request fixtureA throwaway loader script (bun drive.ts) using composeRegistry(coreProviders) with and without the rules and view-expressions packs, on the error-packs-left-out-* and packs-left-out-model-loads fixture inputsbun test test/provider-extension.test.tsin docs-site✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.