Skip to content

Commit 634bce0

Browse files
committed
no-mistakes(document): docs: sync origin.passthrough type-preservation docs
1 parent bb7eb33 commit 634bce0

4 files changed

Lines changed: 50 additions & 14 deletions

File tree

docs/1.0-readiness.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ Status legend: ✅ done · 🔶 in progress · ⬜ not started · ❓ **[RATIFY]
4444
-**B2. `0.x → 1.0` migration guide written**
4545
[`docs/features/migrations/0.x-to-1.0.md`](features/migrations/0.x-to-1.0.md):
4646
version re-baseline + verify strict-default, jsonb parsed-value, timestamp
47-
instant-default, `@dbColumnType` slim, `index.*`/`@unique` removal, deprecated-export
48-
removal. FR-024 deferred → no declared-API vocab to migrate.
47+
instant-default, `@dbColumnType` slim, `index.*`/`@unique` removal, passthrough
48+
type-preservation (`@convert`), deprecated-export removal. FR-024 deferred → no
49+
declared-API vocab to migrate.
4950

5051
## C. Metamodel freeze (the durable spine)
5152

@@ -57,12 +58,16 @@ Status legend: ✅ done · 🔶 in progress · ⬜ not started · ❓ **[RATIFY]
5758
timestamps + `@localTime`, the `@dbColumnType` slim, reverse-nav finders — and
5859
ADR-0037 now gives a durable framework for any future addition. Only A2 (FR-024)
5960
remains open. Audit the registry for anything still experimental.
60-
- 🔶 **C3. The last breaking metamodel/wire move landed in `0.15.1`/`7.7.1`** — the
61-
`index.*` type + `identity.secondary` key-purity (ADR-0040; `@unique` removed →
62-
`ERR_UNKNOWN_ATTR`). It followed `0.15.0`/`7.7.0` (the metamodel-1.0 vocabulary
63-
program + the ADR-0039 own-accessor fix) and `0.14.0`/`7.6.0` (verify strict-default,
64-
jsonb parsed-value). `index.*` **reset the quiet-period clock** — the first
65-
no-breaking coordinated release must come *after* `0.15.1`/`7.7.1` (see G3).
61+
- 🔶 **C3. The last breaking metamodel/wire move landed in the `0.15.x` line**
62+
`origin.passthrough` is now type-preserving (#185; a divergent `field.<subType>` or
63+
array-ness fails load with `ERR_PASSTHROUGH_TYPE_MISMATCH`, generalizing/retiring the
64+
FR-015 `ERR_PARAMETER_REF_PASSTHROUGH_TYPE_MISMATCH`; opt out with the acknowledgement-only
65+
`@convert` on `origin.passthrough`). It followed `0.15.1`/`7.7.1` — the `index.*` type +
66+
`identity.secondary` key-purity (ADR-0040; `@unique` removed → `ERR_UNKNOWN_ATTR`) — which
67+
followed `0.15.0`/`7.7.0` (the metamodel-1.0 vocabulary program + the ADR-0039 own-accessor
68+
fix) and `0.14.0`/`7.6.0` (verify strict-default, jsonb parsed-value). The passthrough move
69+
**reset the quiet-period clock** — the first no-breaking coordinated release must come
70+
*after* it (see G3).
6671
-**C4. `metamodelVersion` marker SHIPPED** (PR #145, all 5 ports, `"0.9"`). A single **rolled-up**
6772
spec-version string the loader/**registry** exposes and every port emits, asserted by
6873
the conformance matrix — the artifact that lets packages version independently while
@@ -138,14 +143,15 @@ Status legend: ✅ done · 🔶 in progress · ⬜ not started · ❓ **[RATIFY]
138143
`→8.0.0`, freeze the spec version at `Metamodel 1.0` (C4). Both forward; no
139144
backwards move on any registry.
140145
-**G2. Remove the deprecated export** if A3=remove (one-time).
141-
-**G3. A quiet period** — at least one coordinated release after `0.15.1`/`7.7.1`
142-
(the last breaking move, C3) with **no metamodel-breaking changes**, to prove the
143-
rate has actually dropped. Requires A2/FR-024 to land additively or defer.
146+
-**G3. A quiet period** — at least one coordinated release after the last breaking
147+
move (C3, the `0.15.x` passthrough type-preservation move) with **no
148+
metamodel-breaking changes**, to prove the rate has actually dropped. Requires
149+
A2/FR-024 to land additively or defer.
144150
-**G4. Cut Metamodel 1.0** through the `releasing` skill (RC → smoke → confirm →
145151
promote), with the migration guide (B2) + compat policy (B1) published alongside.
146152

147153
---
148154

149-
_Last updated 2026-07-02 (post `0.15.1`/`7.7.1` + `0.15.2`; A1 ratified — decouple).
155+
_Last updated 2026-07-08 (post `0.15.1`/`7.7.1` + `0.15.2`; the `0.15.x` passthrough type-preservation move (#185) reset the quiet-period clock — C3/G3; A1 ratified — decouple).
150156
Owner: maintainer. Update the status marks as items land; ratify the remaining §A
151157
decisions (A2–A4) to unblock the rest._

docs/features/migrations/0.x-to-1.0.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,27 @@ the new **`index.lookup`** type.
7777
- **Full mechanical rewrite + the no-DDL-churn guarantee:**
7878
[identity.secondary → index.lookup](identity-secondary-to-index-lookup.md).
7979

80-
## 6. Deprecated `codegen-ts/generators` export removed (at the 1.0 cut)
80+
## 6. `origin.passthrough` is type-preserving (shipped 0.15.x)
81+
82+
A field carrying `origin.passthrough @from: "Entity.field"` forwards the source value
83+
unchanged, so its declared `field.<subType>` and array-ness must be **identical** to the
84+
resolved source field. A divergence now fails load with `ERR_PASSTHROUGH_TYPE_MISMATCH`
85+
(e.g. a `field.uuid` source surfaced by a projection as `field.string` — the exact
86+
mismodeling that leaves a view `String`-typed over a `uuid` column and forces hand-written
87+
`String↔UUID` coercion). The check compares **subType and array-ness only — nullability is
88+
deliberately not judged** (a view over an outer join legitimately widens `NOT NULL`
89+
nullable). This generalizes and retires the narrow, stored-proc-parameter-ref-only
90+
`ERR_PARAMETER_REF_PASSTHROUGH_TYPE_MISMATCH` (FR-015) into one host-agnostic invariant
91+
covering projections, entities, values, and parameter refs alike.
92+
93+
- **If load newly fails:** the error names both the declared type and the source type.
94+
Declare the source's type (usually the fix — the projection was wrong), or set
95+
`@convert: true` on the `origin.passthrough` if the divergence is intentional.
96+
- **`@convert` is an acknowledgement only — it does NOT generate a cast**; the value flows
97+
through unchanged and the consumer owns any coercion. Real type-converting projections
98+
remain `origin.expression`'s job (#159, post-1.0).
99+
100+
## 7. Deprecated `codegen-ts/generators` export removed (at the 1.0 cut)
81101

82102
Importing the built-in generators from `@metaobjectsdev/codegen-ts/generators`
83103
(`entityFile` / `queriesFile` / `routesFile` / `barrel`) is **removed** at 1.0.

docs/features/templates-and-payloads.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ The following conformance fixtures gate this feature's behavior across ports:
446446
- [`fixtures/conformance/origin-collection-simple/`](../../fixtures/conformance/origin-collection-simple/) — `origin.collection` for repeated-row payloads
447447
- [`fixtures/conformance/error-origin-bad-via-path/`](../../fixtures/conformance/error-origin-bad-via-path/) — unresolvable `@via` rejected
448448
- [`fixtures/conformance/error-origin-bad-aggregate-fn/`](../../fixtures/conformance/error-origin-bad-aggregate-fn/) — unknown `@agg` rejected
449+
- [`fixtures/conformance/error-origin-passthrough-type-mismatch/`](../../fixtures/conformance/error-origin-passthrough-type-mismatch/) — a `passthrough` field whose `field.<subType>` differs from its `@from` source fails with `ERR_PASSTHROUGH_TYPE_MISMATCH`
450+
- [`fixtures/conformance/error-origin-passthrough-array-mismatch/`](../../fixtures/conformance/error-origin-passthrough-array-mismatch/) — a `passthrough` field whose array-ness differs from its `@from` source fails with `ERR_PASSTHROUGH_TYPE_MISMATCH`
451+
- [`fixtures/conformance/origin-passthrough-convert-optout/`](../../fixtures/conformance/origin-passthrough-convert-optout/) — `@convert: true` acknowledges a deliberate type divergence (no cast generated)
449452

450453
**Render engine output (`fixtures/render-conformance/`)** — byte-identical Mustache output across ports
451454

spec/cross-language-porting-guide.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ warning lists, through these ordered stages. Mirror the order; the mechanism is
7474
`@db.indexed`**warning** (drift detection).
7575
4. **Origin paths**`passthrough`/`aggregate` `@from`/`@of` must resolve to
7676
`Entity.field`; `@via` must hop correctly through relationships
77-
(`ERR_INVALID_ORIGIN`).
77+
(`ERR_INVALID_ORIGIN`). A `passthrough` field must also be **type-preserving**:
78+
its declared `field.<subType>` and array-ness must match the resolved source field
79+
(nullability is not judged — an outer-join view legitimately widens `NOT NULL`
80+
nullable). A divergence fails with `ERR_PASSTHROUGH_TYPE_MISMATCH` unless the
81+
`origin.passthrough` carries `@convert: true` (an acknowledgement only — it does
82+
not generate a cast). This host-agnostic check covers projections, entities,
83+
values, and stored-proc parameter refs (it generalizes/retires the FR-015
84+
`ERR_PARAMETER_REF_PASSTHROUGH_TYPE_MISMATCH`).
7885
5. **Attribute schema** — declared attrs must match their declared value type and
7986
allowed-values; required attrs must be present (effective: own + inherited). Undeclared
8087
attrs are **not** rejected (open policy). Errors `ERR_MISSING_REQUIRED_ATTR`,

0 commit comments

Comments
 (0)