Commit 659c7a4
docs(agent-context): document TPH/discriminator inheritance in all ports + Kotlin snapshot gate
An AI session reading the codegen skill references concluded discriminator-based
(TPH — table-per-hierarchy) inheritance persistence "isn't supported" — because
only references/csharp.md documented it. TPH is fully supported and codegen-
emitted in all 5 ports (single shared table + discriminator + polymorphic
subtype CRUD, conformance-gated), but the Kotlin/Java/Python/TS codegen skill
references had ZERO mentions, so an agent saw no support and wrongly said so.
Root-cause doc fix:
- Add source-grounded TPH coverage to metaobjects-codegen/references/{kotlin,java,
python,typescript}.md (each port's real idiom: Kotlin Exposed single-table +
polymorphic controller, Java Spring-JPA, Python SQLAlchemy-polymorphic + FastAPI,
TS Drizzle single-table + Fastify) — grounded in the actual generators (KotlinTphPlan
/ TphPlan / tph_plan.py / tph-discriminator.ts + runtime-ts/src/tph.ts).
- Add a "Discriminator inheritance (TPH)" note to metaobjects-authoring/SKILL.md.
- Add a "Discriminator-based inheritance (TPH) with persistence" section to
docs/features/abstracts-and-inheritance.md (YAML example + per-port ORM mapping +
runtime subtype contract).
- Regenerate fixtures/agent-context-conformance/ goldens (agent-context-conformance
test green). NOTE: the all-or-nothing regen also corrects PRE-EXISTING stale
verify/AGENTS/CLAUDE goldens (the live-DB-warning content from 49269da was never
regenerated) — unrelated to TPH, swept in because goldens regenerate as a set.
Kotlin snapshot ("finish that work off"): add the entity-with-tph byte-level
snapshot fixture to codegen-kotlin so the generated AuthTable.kt (single table,
discriminator col, nullable subtype cols) + polymorphic AuthController.kt
(discriminator inject-from-URL, subtype-scoped CRUD, cross-subtype 404, immutable
discriminator) are gated at the unit level, not just integration.
KotlinCodegenSnapshotTest 13/0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ew1XfYSbEAezxjs9opynAe1 parent 8b4378c commit 659c7a4
57 files changed
Lines changed: 1601 additions & 50 deletions
File tree
- agent-context/skills
- metaobjects-authoring
- metaobjects-codegen/references
- docs/features
- fixtures/agent-context-conformance
- java-kotlin-react-tanstack/expected
- .claude/skills
- metaobjects-authoring
- metaobjects-codegen/references
- metaobjects-verify
- .metaobjects
- java-react/expected
- .claude/skills
- metaobjects-authoring
- metaobjects-codegen/references
- metaobjects-verify
- .metaobjects
- python/expected
- .claude/skills
- metaobjects-authoring
- metaobjects-codegen/references
- metaobjects-verify
- .metaobjects
- ts-react-tanstack/expected
- .claude/skills
- metaobjects-authoring
- metaobjects-codegen/references
- metaobjects-verify
- .metaobjects
- server/java/codegen-kotlin/src/test/resources
- fixtures/entity-with-tph
- snapshots/entity-with-tph/acme/auth
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 | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
583 | 621 | | |
584 | 622 | | |
585 | 623 | | |
| |||
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
| |||
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
79 | 97 | | |
80 | 98 | | |
81 | 99 | | |
| |||
0 commit comments