Repository navigation
feat(metadata): reference facet targetType list in every port - #710
Merged
Merged
Conversation
…le.token @heldBy names an organization or a system TypeScript reader, resolver, manifest and tests; spec text and definition schema; three shared conformance fixtures; registry and metamodel-docs corpora regenerated.
…ython and Rust; docs and counts Every port's spec reader, typed lookup (ambiguity across listed types -> ERR_REF_UNRESOLVED), wrong-kind message and registry manifest (sorted list) match the TypeScript reference. ERROR-CODES descriptions, conformance counts 596 -> 599, Rust minPassing, site payload, the V1 changelog note on @heldBy, and one new changelog fragment.
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
targetTypeaccepts a list of two or more distinct types in every port (TypeScript, C#, Java/Kotlin, Python, Rust), andreferenceTargetTypes(facet)returns it as a list. A single type stays a plain string. The registry manifests write the list sorted.errorCode, otherwiseERR_REF_UNRESOLVED. A value naming another kind of node still raisesERR_REF_WRONG_KIND.spec/metamodel-definitions.mdand the definition schema describe the list.role.token @heldBywidens fromorganizationto[organization, system], so a token held by a system now loads. New conformance fixturesref-target-type-list-heldby,error-ref-wrong-kind-heldbyanderror-ref-ambiguous-heldbypin these cases, and the registry-conformance, metamodel-docs and role reference outputs are regenerated.Validation
Risk Assessment
✅ Low: The type-list facet is implemented the same way in all six ports. Single-type lookup behaves as before, apart from the article in the wrong-kind message ("a organization" now reads "an organization"). New conformance fixtures and the registry manifest pin the cross-port contract, and the only gap found is one weak, misnamed test in TypeScript and Python.
Testing
Derived three scenarios: a valid org+system @heldBy load, a wrong-kind rejection, and an unresolved-target rejection. All three ran live through the real TS meta CLI against disposable projects under /mnt/scratch, and they behaved as the intent requires. Focused TS reference-facet tests also pass (35/35). The configured affected suite passed at baseline. Python, Rust, Java, Kotlin and C# ports were not driven live in this turn, so their parity relies on the baseline lanes and the committed conformance fixtures. Scratch projects removed; worktree clean.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/typescript/packages/metadata/test/reference-facet.test.ts:442- The TypeScript testtargetSubTypes narrows whichever listed type the value resolves to(and its Python twintest_target_sub_types_narrows_whichever_listed_type_the_value_resolves_to, server/python/tests/unit/test_reference_facet.py:784) uses theusesattr, whose facet is{ targetType: ["role", "resource"] }with notargetSubTypes. It only checks that a role and two resources load clean, so it never exercises subtype narrowing under a type list, despite its name. Java'stargetSubTypesNarrowsWhicheverListedTypeWasFounddoes it properly: it expectsholder: Jobs(aresource.mqagainst subtypesweb/pg) to raise ERR_REF_WRONG_KIND. Point the TypeScript and Python tests atholder(types system/app, subtypes software/service) and assert that a listed type with an unlisted subtype, such as anapp.clientor asystemwith another subtype, raises ERR_REF_WRONG_KIND. The oracle is spec/metamodel-definitions.md step 2. A wrong implementation that skips the subtype check when targetType is a list passes both tests as written.scripts/ci-local.sh --affected --strict-toolchainscd server/typescript && bun test packages/metadata/test/reference-facet.test.ts (35 pass, 0 fail)bun server/typescript/packages/cli/bin/meta.ts verify in disposable project /mnt/scratch/mo140-*/ok: role.token @heldBy acme::common::Tidewell (organization.company) and acme::feeds::Feeds (system.software) loads, exit 0bun ...meta.ts verify in disposable project bad: @heldBy "db" naming resource.rdb -> ERR_REF_WRONG_KIND, exit 1bun ...meta.ts verify in ok project: @heldBy to unknown target -> ERR_REF_UNRESOLVED, exit 1bun ...meta.ts types role.token --format json: heldBy description documents org-or-system target and error codesBaseline: scripts/ci-local.sh --affected --strict-toolchains passed at target commit (not re-run; no source changed in this turn)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.