Commit 9db16fd
feat(metadata): FR-015 @parameterRef on source.rdb for typed callable inputs
Adds the metamodel + loader layer for FR-015 — the @parameterRef attribute
that lets a callable source (storedProc / tableFunction) reference an
object.value describing its input parameter shape. The pattern mirrors
template.@payloadRef from FR-004, reusing the existing object.value
mechanism rather than introducing a new parameter.* node type.
Implementation (server/typescript/packages/metadata):
- SOURCE_ATTR_PARAMETER_REF = "parameterRef" constant in source-constants.ts.
- AttrSchema entry on sourceRdbAttrs (string, optional).
- New validation pass validate-source-parameter-ref.ts emits:
* ERR_PARAMETER_REF_UNRESOLVED — @parameterRef names a non-existent object.
* ERR_PARAMETER_REF_NOT_VALUE_OBJECT — references object.entity not object.value.
* ERR_PARAMETER_REF_ON_NON_CALLABLE_KIND — set on table/view/materializedView.
* ERR_PARAMETER_REF_PASSTHROUGH_TYPE_MISMATCH — parameter field uses
origin.passthrough whose @from references a field of a different subtype.
- 4 new codes registered in errors.ts + the shared ERROR-CODES.json registry.
Conformance fixtures (10 under fixtures/conformance/):
- 6 positive: parameter-ref-on-stored-proc, parameter-ref-on-table-function,
parameter-ref-with-origin-passthrough, parameter-ref-shared-across-procs,
parameter-ref-optional-parameter, parameter-ref-no-args.
- 4 error: error-parameter-ref-unresolved, error-parameter-ref-not-value-object,
error-parameter-ref-on-table-kind, error-parameter-ref-passthrough-type-mismatch.
Cross-port enum parity (so other ports' enum-vs-corpus checks stay green):
- Java ErrorCode enum: added all 4 FR-015 codes (+ FR-013 codes that the
earlier FR-016 ledger update had deferred).
- C# ErrorCode enum: added all 4 FR-015 codes + FR-013 codes.
- Python ErrorCode enum: added all 4 FR-015 codes.
Conformance ledgers updated (Java / C# / Python) to defer the 4 FR-015 error
fixtures and the FR-013 error fixtures until each port ships those FRs.
Note: ERR_PARAMETER_REF_REQUIRED_FOR_CALLABLE from the FR-015 design was
dropped from load-time validation — the "does the proc take args" decision
needs DB introspection, so it belongs in migrate-ts verify, not the loader.
Tests: 12 dedicated unit tests in fr015-source-parameter-ref.test.ts plus
the 10 conformance fixtures. Full TS metadata suite: 1448 pass / 0 fail.
Out of scope for this commit (still on the plan):
- codegen-ts repo-method emission for storedProc / tableFunction sources.
- The @exposeAsRoute decision (per FR-015 §"REST exposure" follow-on).
- migrate-ts pg_proc introspection + signature drift detection (sister plan).
- Per-port FR-015 fan-out (Java / Kotlin / C# / Python).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 9a170c6 commit 9db16fd
33 files changed
Lines changed: 1280 additions & 6 deletions
File tree
- fixtures/conformance
- error-parameter-ref-not-value-object
- input
- error-parameter-ref-on-table-kind
- input
- error-parameter-ref-passthrough-type-mismatch
- input
- error-parameter-ref-unresolved
- input
- parameter-ref-no-args
- input
- parameter-ref-on-stored-proc
- input
- parameter-ref-on-table-function
- input
- parameter-ref-optional-parameter
- input
- parameter-ref-with-origin-passthrough
- input
- server
- csharp
- MetaObjects.Conformance.Tests
- MetaObjects
- java/metadata
- src/main/java/com/metaobjects
- python
- src/metaobjects
- tests/conformance
- typescript/packages/metadata
- src
- loader
- persistence/source
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
Lines changed: 15 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 | + | |
Lines changed: 33 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 | + | |
Lines changed: 15 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 | + | |
Lines changed: 30 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 | + | |
Lines changed: 15 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 | + | |
Lines changed: 49 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 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
Lines changed: 15 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 | + | |
Lines changed: 23 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 | + | |
| 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 | + | |
0 commit comments