Repository navigation
Commit ea57ad0
authored
feat: add exactlyOne validator, int-backed enum arrays and naming strategies (#554)
* feat: replay the C# app session's fixes, hooks and naming strategies onto main
Brings the work from a downstream C# application session onto main, minus the
reserved-vocabulary changes (they land separately, with the Java, Kotlin and
Python registry catch-up):
- C# EF model fixes: @default, assigned keys, TPH subtype fields and
references, nested value objects, constraint names and principal keys, the
int-backed enum write refusal, -sis plurals, a thread-safe node cache, a
split OnModelCreating, the index vocabulary and @description, and
@sequenceStart with a start-only change that never restarts.
- C# generator hooks: one protected virtual per emitted line on the DbContext,
entity and names generators. The golden files are main's pre-hook output
plus only the lines the EF model fixes add, each named in the test.
- The pascal column rule and application-registered naming strategies in
every port (ADR-0058 Amendment 1), with a test-only reset.
- Int-backed enum arrays load in every port.
- An enum's @default on an untouched record; generated-name collisions scoped
to what carries them; doc pages keyed by package; @Schema in the Python
runtime; Kotlin index @using/@where; Java create defaults.
- Port-scoped registry attrs ("ports"), with @dbSetName C#-only.
Completed on main for every port:
- @sequenceStart never moves the counter: meta migrate writes
ALTER SEQUENCE ... START WITH n only (no setval). New persistence migration
scenario sequence-start-change-keeps-counter.
- @Schema reaches every mapping: TS Kysely and Drizzle, Java OMDB, Kotlin
Exposed tables. The canonical model gains LedgerEntry and an archive-schema
ArchivedLedgerEntry of the same table name; new query scenario
schema-qualified-same-name (Postgres).
- Java and Kotlin create defaults: a string default is a literal unless it is
a database expression (shared isSqlExpressionDefault), escaped correctly;
the Java switch uses the subtype constants.
- New api-contract sub-corpus enum-default/, generated lane in all five ports.
- Java/Kotlin api docs default to the package layout in the eject test.
- Kotlin compile gates leave out the IntEnumArray controller and repository
until enum arrays get an Exposed array column (KNOWN_GAPS.md).
- Docs: CHANGELOG upgrade notes, CONFORMANCE counts and per-port status,
api-contract "Defaults on create", regenerated metamodel docs.
Conflicts resolved toward main's reworks: validator.exactlyOne, the native
duration wire default with wire.durations "iso", the provider field in
meta types JSON, and MappedBaseClause for the entity base class (the
duplicate helper is dropped, the DbContext half is kept). The C# generator
that wrote expression indexes as SQL is left out: schema DDL stays with
meta migrate (ADR-0015).
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(review): Pin schema writes, share string escapers, fix rules
* no-mistakes(test): Share Kotlin string escaper; refresh site outputs
* fix(csharp-tests): find golden files from the repo root, not CallerFilePath
A CI build (CI=true turns on ContinuousIntegrationBuild) maps source paths
to /_/, so the [CallerFilePath]-based golden directory did not exist on the
runner and the three golden tests failed with DirectoryNotFoundException.
Use CorpusPaths.RepoRoot() like the other tests in this project.
* no-mistakes(review): Correct CHANGELOG Kotlin enum array wording
* no-mistakes(document): Docs current; removed two "Ruling:" labels from new C# doc comments.1 parent 9abd963 commit ea57ad0
367 files changed
Lines changed: 17599 additions & 1511 deletions
File tree
- .claude/rules
- agent-context/templates
- docs
- features
- migrations
- ports
- superpowers/specs
- examples
- advanced-modeling/codegen/templates
- showcase
- codegen/templates
- fixtures
- agent-context-conformance
- java-kotlin-react-tanstack/expected/.metaobjects
- java-react/expected/.metaobjects
- python/expected/.metaobjects
- ts-react-tanstack/expected/.metaobjects
- ts-requirements/expected/.metaobjects
- api-contract-conformance
- enum-default
- scenarios
- conformance
- enum-int-backed-array-inherited
- input
- enum-int-backed-array
- input
- error-enum-intvaluemap-array-inherited
- error-enum-intvaluemap-array
- error-port-scoped-attr-wrong-type
- input
- object-port-scoped-attr-dbsetname
- input
- metamodel-docs/expected
- types
- naming-conformance
- physical-names
- persistence-conformance
- canonical
- migrations
- states/program-seq-v2
- queries
- registry-conformance
- scripts
- server
- csharp
- MetaObjects.Cli.Tests
- MetaObjects.Cli
- MetaObjects.Codegen.Tests
- Golden
- pre-hooks-2
- no-shapes
- shapes
- pre-hooks
- MetaObjects.Codegen
- ApiDocs
- Generators
- MetaObjects.Conformance.Tests
- MetaObjects.IntegrationTests
- Api
- Generated
- Runner
- MetaObjects
- Config
- Core/Object
- Loader
- Meta
- Registry/Spec
- SpecMetamodel
- java
- codegen-base/src
- main/java/com/metaobjects/generator/util
- test/java/com/metaobjects/generator/util
- codegen-kotlin-exposed1x-check/src/test/kotlin/com/metaobjects/generator/kotlin/exposed1x
- codegen-kotlin/src
- main/kotlin/com/metaobjects/generator/kotlin
- apidocs
- test/kotlin/com/metaobjects
- codegen/kotlin/apidocs
- generator/kotlin
- codegen-mustache/src/test/java/com/metaobjects/generator/mustache
- codegen-spring/src
- main/java/com/metaobjects/generator
- apidocs
- spring
- test/java/com/metaobjects/generator
- apidocs
- spring
- integration-tests-kotlin/src/test/kotlin/com/metaobjects/integration/kotlin
- api
- enumdefault
- generated
- generated
- codegen
- tables
- integration-tests/src/test/java/com/metaobjects/integration
- api
- generated
- maven-plugin/src/test/java/com/metaobjects/mojo
- metadata/src
- main/java/com/metaobjects
- config
- database
- field
- loader
- parser/json
- object
- registry
- spec
- util
- test/java/com/metaobjects
- database
- field
- loader
- omdb/src
- main/java/com/metaobjects/manager/db
- codec
- test/java/com/metaobjects/manager/db/driver
- python
- src/metaobjects
- codegen
- generators
- runtime
- config
- loader
- meta
- core/object
- persistence/source
- runtime
- spec_metamodel
- tests
- codegen
- conformance
- integration
- loader
- runtime
- unit
- typescript/packages
- cli
- src
- commands
- lib
- test
- unit
- codegen-ts
- src
- generators
- naming
- reference
- templates
- test
- __snapshots__
- generators
- golden
- naming
- projection
- templates
- integration-tests
- src
- test
- metadata
- src
- core/object
- test
- migrate-ts
- src
- emit
- test
- unit
- runtime-ts
- src
- drivers
- test
- sdk
- src
- test
- test-generators/src/templates
- site-reference
- types
- spec
- decisions
- metamodel
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 | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments