Commit bb7eb33
A field carrying `origin.passthrough @from: "Entity.field"` forwards the source
value unchanged, so its declared `field.<subType>` and array-ness must be
identical to the resolved source field. A divergence now fails load with
`ERR_PASSTHROUGH_TYPE_MISMATCH` — catching the mismodeling where a `field.uuid`
source is surfaced by a projection/view as `field.string` (which silently leaves
the field String-typed end-to-end and forces hand-written String<->UUID
bridging, defeating a UUID migration). `verify --db` can't see this — the column
IS uuid; only the metadata model knows both ends of the passthrough.
The check compares subType + array-ness only — nullability is deliberately NOT
judged (a view over an outer join legitimately widens NOT NULL -> nullable, so a
nullability check would false-positive on valid projections).
Escape hatch: a new optional boolean attr `@convert: true` on `origin.passthrough`
acknowledges a deliberate type change and suppresses the error. It is an
acknowledgement ONLY — it does not generate a cast; the consumer owns any
coercion. Real type-converting projections remain origin.expression's job (#159),
so @convert is NOT blocked on that unbuilt feature.
This GENERALIZES and RETIRES the narrow, stored-proc-parameter-ref-only
`ERR_PARAMETER_REF_PASSTHROUGH_TYPE_MISMATCH` (FR-015) into one host-agnostic
invariant covering projections, entities, values, and parameter refs alike,
enforced once in the origin-paths validation pass.
Cross-port: implemented in all five ports (TS reference + Python / C# / Java;
Kotlin inherits Java's loader), each registering @convert on origin.passthrough
and byte-matching the shared registry-conformance manifest. Gated by three new
conformance fixtures (type-mismatch, array-mismatch, @convert opt-out) plus the
repointed parameter-ref fixture. BREAKING: adopter metadata with a divergent
passthrough now fails load (the point — it names both types + the fix).
Also fixes a pre-existing generator gap: the `index` metamodel concept was
missing from generate-embedded-metamodel.ts's CONCEPT_DIRS.
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2291ccc commit bb7eb33
46 files changed
Lines changed: 670 additions & 208 deletions
File tree
- agent-context/skills/metaobjects-authoring
- fixtures
- agent-context-conformance
- java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-authoring
- java-react/expected/.claude/skills/metaobjects-authoring
- python/expected/.claude/skills/metaobjects-authoring
- ts-react-tanstack/expected/.claude/skills/metaobjects-authoring
- conformance
- error-origin-passthrough-array-mismatch
- input
- error-origin-passthrough-type-mismatch
- input
- error-parameter-ref-passthrough-type-mismatch
- origin-passthrough-convert-optout
- input
- metamodel-docs/expected
- types
- registry-conformance
- scripts
- server
- csharp/MetaObjects
- Loader
- Persistence/Origin
- SpecMetamodel
- java/metadata/src/main/java/com/metaobjects
- loader
- origin
- python
- src/metaobjects
- loader
- meta/persistence/origin
- spec_metamodel
- typescript/packages/metadata
- src
- core/index
- loader
- persistence
- origin
- source
- test
- spec/metamodel
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments