You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd48285
Browse filesBrowse the repository at this point in the historyBrowse files
The prior JVM sweep KEPT template.* attr reads own-only ("cross-port
contract reads templates own"), but that reflected the pre-sweep state.
TS + C# now RESOLVE template attrs — a template is a registered type that
can be an `extends` target, so its attrs inherit; resolving
(includeParentData=true, the default) is the ADR-0039 default.
Flipped to resolving:
- MetaTemplate / OutputTemplate / PromptTemplate / ToolcallTemplate getters
(@payloadRef/@textRef/@format/@maxChars/@owner/@since/@requiredTags/
@promptStyle/@requiredSlots/@maxTokens/@model/@responseRef/@toolname).
- Render-helper + api-model template @kind/@subjectRef/@htmlBodyRef/
@textBodyRef/@textref reads (SpringRenderHelperGenerator,
JavaApiModelBuilder, KotlinRenderHelperGenerator, KotlinApiModelBuilder).
- Root-level template-node iteration → resolving getChildren(type, true)
(Spring render/output-parser/output-prompt/payload + Kotlin
render/output-prompt/output-parser/extractor/payload/api-model).
Left own (unchanged): ValidationPhase per-subtype required-attr checks
(eager-throw validation pass, analogous to source/origin/relationship
validation own-walks); field @objectref reads already resolve.
No golden change (no template-extends fixture exists yet).
Tests: metadata 1065, codegen-spring 158, codegen-kotlin 266 — all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinOutputParserGenerator.kt
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -81,10 +81,8 @@ open class KotlinOutputParserGenerator : MultiFileDirectGeneratorBase<MetaObject
81
81
val outRoot =Paths.get(outDir.absolutePath)
82
82
83
83
// Stable name order — matches TS/C#/Python deterministic emission.
84
-
// ADR-0039: root-level declaration scan — root is never extended (matches the TS
85
-
// reference's root.ownChildren()), so own children is correct.
86
-
val outputs = loader.root.children
87
-
.filterIsInstance<OutputTemplate>()
84
+
// ADR-0039: root-scan discipline — resolving children accessor.
85
+
val outputs = loader.root.getChildren(OutputTemplate::class.java, true)
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinOutputPromptGenerator.kt
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -74,10 +74,8 @@ open class KotlinOutputPromptGenerator : MultiFileDirectGeneratorBase<MetaObject
74
74
val outRoot =Paths.get(outDir.absolutePath)
75
75
76
76
// Stable name order — matches TS/C#/Python/Java deterministic emission.
77
-
// ADR-0039: root-level declaration scan — root is never extended (matches the TS
78
-
// reference's root.ownChildren()), so own children is correct.
79
-
val outputs = loader.root.children
80
-
.filterIsInstance<OutputTemplate>()
77
+
// ADR-0039: root-scan discipline — resolving children accessor.
78
+
val outputs = loader.root.getChildren(OutputTemplate::class.java, true)
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinRenderHelperGenerator.kt
+11-13Lines changed: 11 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -79,10 +79,8 @@ open class KotlinRenderHelperGenerator : MultiFileDirectGeneratorBase<MetaObject
79
79
val provider =FilesystemProvider(Paths.get(templateRoot))
80
80
81
81
// Stable name order — matches the other ports' deterministic emission.
82
-
// ADR-0039: root-level declaration scan — root is never extended (matches the TS
83
-
// reference's root.ownChildren()), so own children is correct.
84
-
val outputs = loader.root.children
85
-
.filterIsInstance<OutputTemplate>()
82
+
// ADR-0039: root-scan discipline — resolving children accessor.
83
+
val outputs = loader.root.getChildren(OutputTemplate::class.java, true)
86
84
.sortedBy { it.name }
87
85
88
86
for (tmpl in outputs) {
@@ -299,23 +297,23 @@ open class KotlinRenderHelperGenerator : MultiFileDirectGeneratorBase<MetaObject
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/apidocs/KotlinApiModelBuilder.kt
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -77,12 +77,9 @@ class KotlinApiModelBuilder {
77
77
}
78
78
79
79
// Templates: one unit per template.output under the model root.
80
-
// ADR-0039: root-level declaration scan — root is never extended (matches the TS
81
-
// reference's root.ownChildren()), so own children is correct.
82
-
for (child in loader.root.children) {
83
-
if (child isOutputTemplate) {
84
-
units.add(buildTemplateUnit(child, loader))
85
-
}
80
+
// ADR-0039: root-scan discipline — resolving children accessor.
81
+
for (child in loader.root.getChildren(OutputTemplate::class.java, true)) {
82
+
units.add(buildTemplateUnit(child, loader))
86
83
}
87
84
88
85
returnKotlinApiModel(project, units)
@@ -437,10 +434,10 @@ class KotlinApiModelBuilder {
Copy file name to clipboardExpand all lines: server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringOutputParserGenerator.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -116,9 +116,10 @@ public void execute(MetaDataLoader loader) {
Copy file name to clipboardExpand all lines: server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringOutputPromptGenerator.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -82,9 +82,10 @@ public void execute(MetaDataLoader loader) {
0 commit comments