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 ffa0806
Browse filesBrowse the repository at this point in the historyBrowse files
docs: ADR-0056 across the ports' docs, the skills, the ADRs and the changelog
- CHANGELOG [Unreleased]: the breaking generated-output change, plus Fixed
entries for #388, the Python render engine reading model payloads, Python
value-object module collisions, and the Python api-docs import paths.
- New migration guide:
docs/features/migrations/value-object-types-are-generated-once.md.
- ADR-0056 gains Amendment 1, which corrects three statements the
implementation proved wrong:
- C# needs collision naming, because its default binding flattens every
namespace. Python had none before this branch.
- Rule 3's mirror placement differs by port. TypeScript and Python keep the
mirror module-local; Java has no mirror type.
- Rule 6 is enforced, advisorily, in TypeScript, Python and C#.
The amendment also retracts rule 6's claim that the codegen-compile gates
prove the pair: their corpus declares no templates.
- ADR-0044 is marked as having its payload-tier half superseded. The decisions
index gains an ADR-0056 row.
- Port docs (Java, Kotlin, C#, Python), templates-and-payloads.md, the
codegen-kotlin README, the root README's capability row, the render corpus's
naming contract (per-port expected names), and the prompts, codegen and
audit skill references: all of them now describe the value object's own type
in place of SpringPayloadGenerator, KotlinPayloadGenerator, the C#
`.payload.cs` record and payload_vo_generator. The Kotlin docs now describe
the Jackson parser in place of kotlinx.serialization. The C# prompts
reference's `dotnet meta gen` examples now pass `--generators`, which codegen
has required since opt-in.
- agent-context conformance corpus regenerated.
Part of #387.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ghY6h6CaGzZcmpHJ7msWQ
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-audit/references/kotlin.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The active generator list is declared in `pom.xml` under the plugin `<configurat
53
53
| Hand-written `data class` with same fields as a modeled entity |`KotlinEntityGenerator` should own this (`<Entity>.kt`) |
54
54
| Hand-written `object ... : Table(`|`KotlinExposedTableGenerator` should own this (`<Entity>Table.kt`) |
55
55
| Hand-written `@RestController` on a CRUD entity |`KotlinSpringControllerGenerator` should own this |
56
-
|`@Serializable` on a payload class not in generated sources|`KotlinPayloadGenerator` should own this; check `pom.xml`generator list|
56
+
|A hand-written data class mirroring a template's `@payloadRef` / `@responseRef` value object|`KotlinEntityGenerator` emits that value object's data class, and it IS the payload type (ADR-0056); check `pom.xml`wires it|
57
57
|`// keep in sync with` / `// mirrors the`| second-source-of-truth comment — always a finding |
58
58
|`transaction(db) {` bodies that duplicate every CRUD operation | hand-written Exposed transactions are expected (see Calibration), but if they duplicate generated-CRUD logic exactly, audit further |
59
59
| a table/column string in `exec("…")` raw SQL or a Flyway script | reference `<Entity>Names` (`KotlinNamesGenerator`, opt-in); `AuthorTable.name` inside the Exposed DSL is the typed handle — correct, not a finding |
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/csharp.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,13 +46,12 @@ in `--output-dir`.
46
46
47
47
| Stable name | Output |
48
48
|---|---|
49
-
|`entity`|`<Entity>.g.cs` — an EF Core entity class per `object.entity` / projection: PascalCase props mapped via `[Column]`, `[Table]`, `[Key]` (or class-level `[PrimaryKey]` for composites), `[MaxLength]`/validators, nullability from `@required`. Enum fields → a nested (or shared) C# `enum`; object fields → owned-type navigations; value objects → POCOs. A TPH `@discriminator` base is emitted `abstract` with `: Base` subtypes (single-table). |
49
+
|`entity`|`<Entity>.g.cs` — an EF Core entity class per `object.entity` / projection: PascalCase props mapped via `[Column]`, `[Table]`, `[Key]` (or class-level `[PrimaryKey]` for composites), `[MaxLength]`/validators, nullability from `@required`. Enum fields → a nested (or shared) C# `enum`; object fields → owned-type navigations; every concrete value object and sourceless projection → a POCO, which is also the template tier's payload/response type (ADR-0056; package-qualified, e.g. `AcmeAlphaNote`, when another object shares its short name). A TPH `@discriminator` base is emitted `abstract` with `: Base` subtypes (single-table). |
50
50
|`db-context`| one `AppDbContext` — a `DbSet<T>` per entity + `OnModelCreating`: `.HasConversion<string>()` (enums), `.OwnsOne(...)`/`.ToJson(...)` (owned/jsonb object fields), `.HasPrecision(p,s)` (decimals), `.UsingEntity<>(...)` (M:N), `.HasDiscriminator(e => e.Type).HasValue<Sub>(...)` (TPH). |
51
51
|`routes`|`<Entity>Routes.cs` — ASP.NET **Minimal API** CRUD per writable entity (`source.rdb @kind="table"`) on the cross-port REST contract (`?filter[field][op]=`, `?sort=field:asc`, `?limit`/`?offset`, `?withCount=1` envelope, 400/404 envelopes). A TPH base emits polymorphic `GET /<base>(+/{id})` + a per-subtype CRUD set at `/<base>/<discriminatorValue lowercased>` (create injects the discriminator, cross-subtype get/update/delete → 404). |
52
52
|`filter-allowlist`| per-entity `<Entity>FilterAllowlist` (FR-009 — the server-side field+operator allowlist the routes validate against). |
53
53
|`callable`|`<Entity>.callable.g.cs` — an FR-015 calling method for a `source.rdb @kind="storedProc"|"tableFunction"`, via EF `FromSqlInterpolated` (args from the `@parameterRef` value object in declaration order). |
54
-
|`payload`|`<Payload>.payload.cs` — the strict typed payload `record` (+ any nested element records) per `template.prompt``@payloadRef` / `@responseRef` (each an `object.value`): `@payloadRef` types the REQUEST, `@responseRef` the REPLY the parser/extractor bind to. |
55
-
|`output-parser` / `extractor` / `output-prompt` / `render-helper`| the prompt-pillar artifacts for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: these tiers are INBOUND; `template.output` is outbound only and emits no parser). The strict parser, the tolerant `extract`, the **output-format prompt fragment** (`output-prompt`; presentation via `@promptStyle: guide`/`inline`/`exampleOnly`), and the typed render helper. See the **prompts** reference. |
54
+
|`output-parser` / `extractor` / `output-prompt` / `render-helper`| the prompt-pillar artifacts for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: these tiers are INBOUND; `template.output` is outbound only and emits no parser). The strict parser, the tolerant `extract`, the **output-format prompt fragment** (`output-prompt`; presentation via `@promptStyle: guide`/`inline`/`exampleOnly`), and the typed render helper. They reference the value objects' POCOs from `entity` and declare no payload type — wire `entity` too (`--list` says so). See the **prompts** reference. |
56
55
| `names` | `<Entity>Names.g.cs` — `public abstract class <Entity>Names` of `const` physical database names, MIRRORING THE METADATA TREE: the object's own `Type`/`SubType`/`Name` (`Name` is the OBJECT's name, never a physical one), then per `source.rdb` keyed by `@role` — `SourcePrimaryType`/`SubType`/`Kind`, `SourcePrimarySchema` when declared, and the physical name under the alias for its `@kind` (`SourcePrimaryTable` / `SourceReplicaView` / `SourcePrimaryProc` / `…Function` / `…MaterializedView`) — then a `<Field>Field`/`<Field>Column` pair per field, then each identity and index (`IdentityPkName`, and `IdentityUqCustEmailIndex` / `IndexIxCustStatusIndex` — the DATABASE name, carried for `identity.secondary` and `index.lookup` only), then a complete `ColumnsByField`. There is no `ReadOnly`: it is a derivation over `@kind`, so ask `SourcePrimaryKind`. Emitted for every object with a declared or inherited primary source, PLUS a fragment for any abstract base such an object extends (its own identity + columns, and NO source members — it has no table). A class whose object extends another one **inherits** it (`class CopayAuthNames : AuthNames`) rather than restating its constants — a C# `const` is inherited, so `CopayAuthNames.IdColumn` and `CopayAuthNames.SourcePrimaryTable` resolve through the base (`Type`/`SubType`/`Name` are redeclared with `new`, since every artifact carries its own). `abstract`, not `static`, precisely so it can be inherited; it still cannot be instantiated. In the run, `entity` and `db-context` reference the constants (`[Table(OrderNames.SourcePrimaryTable)]`, `[Column(OrderNames.StatusColumn)]`, `.ToView(OrderNames.SourceReplicaView)`); a `--generators` selection omitting `names` falls back to literals. |
57
56
|`template`| the generic Mustache `templateGenerator()` primitive. |
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/java.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,8 +121,7 @@ separate `metaobjects-codegen-base` module instead.)
121
121
|`SpringControllerGenerator`|`<Entity>Controller.java` per writable entity (`source.rdb``@kind="table"`) — Spring Web MVC, five CRUD endpoints on the cross-port REST contract (`?filter[field][op]=`, `?sort`, `?limit`/`?offset`, `?withCount=1` envelope, 404/400 envelopes). A TPH `@discriminator` base emits ONE controller: polymorphic `GET /<base>(+/{id})` plus a per-subtype CRUD set at `/<base>/<discriminatorValue lowercased>` — create injects the discriminator from the URL (never the body); get/update/delete scoped to the subtype (cross-subtype → 404); discriminator immutable. |
122
122
|`SpringDtoGenerator`|`<Entity>Dto.java` as a Java 21 `record`; wrapped primitives (`Long`/`Integer`/`Boolean`) so missing JSON props deserialise to `null`; currency = `Long` (integer minor units). A TPH `@discriminator` base's DTO is the **union** of every subtype's columns (subtype-only fields folded nullable, validation dropped), so one wire shape backs the polymorphic + per-subtype endpoints. |
123
123
|`SpringRepositoryGenerator`|`<Entity>Repository.java` — a hand-stubbed `interface` the consumer implements with their persistence layer (Spring Data JPA / jOOQ / JDBC). For a TPH base the interface is polymorphic + per-subtype-scoped (`listByType`/`findByIdAndType`/`createWithType`/`updateByIdAndType`/`deleteByIdAndType`) over the single table; subtype entities emit no own controller/DTO/repository — they fold into the base. |
124
-
|`SpringValueObjectGenerator`| a Java 21 `record` per `object.value` reached through a `field.object @storage: jsonb` column (single or `@isArray`, transitively through nested VOs) — the typed component the Jackson jsonb codec serializes to/from (carries jakarta validation, unlike a plain payload record). Program D typed-jsonb VOs. |
125
-
|`SpringPayloadGenerator`| a Java 21 `record` per `template` payload VO |
124
+
|`SpringValueObjectGenerator`| a Java 21 `record` per concrete `object.value` and sourceless `object.projection`, in the value object's own package — THE Java type for it (ADR-0056): the typed component the Jackson jsonb codec serializes to/from (with jakarta validation), the render helper's payload and the parser's return type. Wire it with any template-tier generator. |
126
125
|`SpringOutputParserGenerator`| the strict parser-on-receipt for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: INBOUND; a `template.output` emits no parser). See the prompts reference. |
127
126
|`SpringOutputPromptGenerator`| the FR-010 output-format prompt fragment for a responding `template.prompt` (presentation via `@promptStyle: guide`/`inline`/`exampleOnly`) |
128
127
|`SpringRenderHelperGenerator`| the typed render helper for a `template.prompt` payload |
@@ -201,8 +200,8 @@ fails on the `MetaObject` back-reference** — the inherited `getMetaData()` get
201
200
leads a bean-style mapper into the metadata graph, and on a modular JVM into
202
201
`InaccessibleObjectException`. This is expected, not a bug to work around. If you
203
202
want a type that serializes cleanly with a bare default mapper, use the
204
-
`codegen-spring` record surface (`SpringDtoGenerator` / `SpringPayloadGenerator` /
205
-
`SpringValueObjectGenerator`) instead — never `pojoAware`.
203
+
`codegen-spring` record surface (`SpringDtoGenerator` / `SpringValueObjectGenerator`)
204
+
instead — never `pojoAware`.
206
205
207
206
Serialize any `MetaObjectAware` instance through the MetaObjects JSON layer's
208
207
`JsonObjectWriter`/`JsonObjectReader`, not a bare mapper — it applies the temporal
0 commit comments