Skip to content

Commit 8bcf4b7

Browse files
committed
Merge main into fm/mo-1-1-0-rc5-pl-fixes
2 parents 92a2334 + df08643 commit 8bcf4b7

45 files changed

Lines changed: 792 additions & 194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 182 additions & 149 deletions
Large diffs are not rendered by default.

‎agent-context/skills/metaobjects-codegen/SKILL.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ exact config, generator names and commands for this project; read it. The other
4747
| `references/typescript-templates.md` | declarative Mustache template-codegen in a TypeScript project |
4848
| `references/typescript-docs.md` | the docs generators (`docsFile`, `apiDocsFile`, `agentDocsFile`, `requirementsFile`, `metamodelDocsFile`, `docsSiteFile`) in a TypeScript project |
4949

50+
## Upgrading a project from 1.0 to 1.1
51+
52+
Read both guides before the first `gen` of an upgrade, for every port the project uses; the
53+
build can stay green while the result is wrong.
54+
55+
- https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md: the default column and table names are now `snake_case` in every
56+
port (C#, Java, Kotlin's runtime and Python defaulted to the field names). A database whose
57+
columns are named like its fields needs `"naming": { "columns": "literal" }` in
58+
`.metaobjects/config.json`, or regenerated code queries columns that do not exist. The
59+
per-port naming flags and generator args are removed.
60+
- https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/docs-are-generators.md: documentation is a generator in the project's list, and the docs
61+
commands are removed.
62+
- **Resync the generators you own.** An ejected copy keeps the logic it was copied with, and a
63+
plain `gen` does not refresh it. `meta eject --list` (`dotnet meta eject`, `metaobjects eject`,
64+
`mvn metaobjects:eject`) reports each copy that differs from the reference;
65+
`eject <name> --force` takes the new reference for a copy you never edited, and a copy you
66+
edited is three-way merged instead. Steps for 1.0.x: https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/upgrading-within-1.0.md.
67+
5068
## Need an output? Write the generator — this is the primary path
5169

5270
**When.** You need an output the model fully describes and no reference generator emits —

‎agent-context/skills/metaobjects-codegen/references/java.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ All artifacts share `groupId` `com.metaobjects` and one version property:
2828
| `metaobjects-maven-plugin` | the build-time codegen plugin |
2929
| `metaobjects-core-spring` | optional Spring wiring |
3030

31+
## Column and table names
32+
33+
**Column and table names come from `naming` in `.metaobjects/config.json`, the one setting
34+
every port reads** (ADR-0058): `meta migrate`, every port's codegen, and the OMDB runtime. The
35+
default is `snake_case`, what `meta migrate` creates. Through 1.0 this port defaulted to the
36+
field names; a database whose columns are named exactly like the fields declares it once:
37+
38+
```json
39+
{ "schema_version": 1, "naming": { "columns": "literal" } }
40+
```
41+
42+
There is no per-generator or runtime naming: the `columnNaming` generator arg fails
43+
`mvn metaobjects:generate`, and `SimpleMappingHandlerDB.setColumnNaming` throws. A Spring
44+
application that loads its metadata from the classpath points `metaobjects.physical-naming-config`
45+
at the project's `.metaobjects/config.json` packaged as a resource (for example
46+
`classpath:.metaobjects/config.json`). Details and the 1.0 to 1.1 steps:
47+
<https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md>.
48+
3149
## Plugin config in `pom.xml`
3250

3351
The plugin's `generate` goal binds to the `generate-sources` phase. Point its

‎agent-context/skills/metaobjects-codegen/references/kotlin.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ plugin does not bring:
4545
Keep all four Exposed artifacts on one version. The port guide's `pom.xml` lists them
4646
with versions.
4747

48+
## Column and table names
49+
50+
**Column and table names come from `naming` in `.metaobjects/config.json`, the one setting
51+
every port reads** (ADR-0058): `meta migrate`, every port's codegen, and the Exposed tables the Kotlin generators write. The
52+
default is `snake_case`, what `meta migrate` creates. Through 1.0 the Kotlin runtime's JDBC side defaulted to the
53+
field names; a database whose columns are named exactly like the fields declares it once:
54+
55+
```json
56+
{ "schema_version": 1, "naming": { "columns": "literal" } }
57+
```
58+
59+
There is no per-generator or runtime naming: the `columnNaming` generator arg fails
60+
`mvn metaobjects:generate`, and `SimpleMappingHandlerDB.setColumnNaming` throws (the Exposed
61+
tables and the names generator already read the setting). A Spring
62+
application that loads its metadata from the classpath points `metaobjects.physical-naming-config`
63+
at the project's `.metaobjects/config.json` packaged as a resource (for example
64+
`classpath:.metaobjects/config.json`). Details and the 1.0 to 1.1 steps:
65+
<https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md>.
66+
4867
## Plugin config in `pom.xml`
4968

5069
The plugin's `generate` goal binds to the `generate-sources` phase. Point its

‎agent-context/templates/always-on.md.mustache‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ MetaObjects ships as separate packages per language on DIFFERENT version lines (
8282

8383
`metamodelVersion` is also the number that tells you whether YOUR METADATA needs work, separately from the package version, which tells you whether your BUILD does. A package major means imports/CLI/generated-code shape may need attention; a metamodel major means your model may. A release can move one without the other — so when you upgrade, read the changelog for a metamodel-version move, not just the package number. For a 1.0.x → 1.0.x upgrade, follow https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/upgrading-within-1.0.md: it covers resyncing the generators you own (`meta eject --list`), which a plain `meta gen` does not do.
8484

85+
**Upgrading from 1.0 to 1.1:** read both guides before you run `gen`, because the build can stay green while the result is wrong. https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md: the default column and table names are now `snake_case` in every port, so a C#, Java, Kotlin or Python database whose columns are named like its fields needs `"naming": { "columns": "literal" }` in `.metaobjects/config.json`, or the regenerated code queries columns that do not exist. https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/docs-are-generators.md: documentation is a generator in the project's list, and the docs commands are removed. Then resync every generator you own (`meta eject --list` reports each copy that differs from the reference; `meta eject <name> --force` takes the new one, and a plain `meta gen` does not): an owned copy keeps the logic it was copied with.
86+
8587
## Going deeper (Claude Code)
8688
For authoring, codegen, runtime/UI, prompts, verify, or adoption-audit work, use the
8789
matching `metaobjects-*` skill — its body links the `references/<lang>.md` fragment

‎docs/features/cli.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ one-time fix.
232232
|---|---|---|
233233
| `--baseline=default` | all | the above: refuse what cannot be proved to be generated output |
234234
| `--baseline=adopt` | TS · Python · C# | record the files you HAVE as the merge base and **write nothing** |
235-
| `--baseline=fresh` | TS only | overwrite the refused files from fresh output and re-baseline (**discards** hand edits) |
235+
| `--baseline=fresh` | TS only | overwrite the refused files from fresh output and re-baseline (**discards** hand edits). A local snapshot body for a path the manifest has no record of is ignored, not merged against, so stale content from an earlier checkout is not kept as a hand edit |
236236

237237
**`adopt` exists because the refusal's own remedy was unreachable.** It told you to commit
238238
`.hashes.json` — but nothing writes a manifest until a `gen` succeeds, and a run where

‎docs/features/migrations/docs-are-generators.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,12 @@ to the same paths as the 8.0 pom above:
629629
| the page header's project label, which was the module's `artifactId` | `projectName`, default `project`; set `${project.artifactId}` to keep 8.0's pages byte for byte |
630630
| `-Dmetaobjects.docs.*` properties | none; use Maven properties inside `<args>` if you need to override from the command line |
631631

632+
**Remove any `columnNaming` generator arg from the same pom.** 8.1.0 refuses it, and the
633+
refusal points here because this is the pom you are editing. Column and table names are one
634+
setting now, `naming` in `.metaobjects/config.json`; if your database's columns are named
635+
exactly like your fields, add `"naming": { "columns": "literal" }` there. See
636+
[physical-naming.md](physical-naming.md), section "Java and Kotlin".
637+
632638
**Give each api-docs entry an `outputDir` that holds generated files only.**
633639
`metaobjects:verify` now checks the pages, as it checks code: it regenerates each entry's
634640
`outputDir` and compares the whole tree, so a hand-written file there reads as stale.

‎docs/features/migrations/physical-naming.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Changed in:** 1.1.0 (Maven 8.1.0) · **Ports affected:** all five
44
**Automatic fix:** none. Each section below is written so you, or a coding agent working in
55
your repository, can make the change by hand. Decision record:
6-
[ADR-0058](../../../spec/decisions/ADR-0058-one-physical-naming-setting.md).
6+
[ADR-0058](https://github.com/metaobjectsdev/metaobjects/blob/main/spec/decisions/ADR-0058-one-physical-naming-setting.md).
77

88
## What changed
99

@@ -92,7 +92,7 @@ regenerate.
9292
| 1.0 | 1.1.0 |
9393
|---|---|
9494
| `metaobjects gen --column-naming <strategy>`, `metaobjects verify --codegen --column-naming <strategy>` | `"naming": { "columns": "<strategy>" }` in `.metaobjects/config.json`. The flag is refused (exit 2) |
95-
| `ObjectManager(..., column_naming="<strategy>")` | `ObjectManager(...)`. The manager reads the rule from the loaded root; the argument raises. A model loaded outside the project directory gets the project's rules with `attach_naming(root, project_dir)` from `metaobjects.naming`, which reads that project's `.metaobjects/config.json` |
95+
| `ObjectManager(..., column_naming="<strategy>")` | `ObjectManager(...)`. The manager reads the rule from the loaded root; the argument raises. A model loaded outside the project directory gets the project's rules with `attach_naming(root, project_dir)` from `metaobjects.naming`, which reads that project's `.metaobjects/config.json` and returns the root, so `root = attach_naming(root, project_dir)` |
9696
| no flag: `*_names.py` and the `ObjectManager` used the field names (`literal`) | no setting: snake_case. Add `"naming": { "columns": "literal" }` to keep 1.0's column names |
9797

9898
`metaobjects verify --codegen` reports drift that another column rule, another table rule, or

‎fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/SKILL.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ exact config, generator names and commands for this project; read it. The other
4747
| `references/typescript-templates.md` | declarative Mustache template-codegen in a TypeScript project |
4848
| `references/typescript-docs.md` | the docs generators (`docsFile`, `apiDocsFile`, `agentDocsFile`, `requirementsFile`, `metamodelDocsFile`, `docsSiteFile`) in a TypeScript project |
4949

50+
## Upgrading a project from 1.0 to 1.1
51+
52+
Read both guides before the first `gen` of an upgrade, for every port the project uses; the
53+
build can stay green while the result is wrong.
54+
55+
- https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md: the default column and table names are now `snake_case` in every
56+
port (C#, Java, Kotlin's runtime and Python defaulted to the field names). A database whose
57+
columns are named like its fields needs `"naming": { "columns": "literal" }` in
58+
`.metaobjects/config.json`, or regenerated code queries columns that do not exist. The
59+
per-port naming flags and generator args are removed.
60+
- https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/docs-are-generators.md: documentation is a generator in the project's list, and the docs
61+
commands are removed.
62+
- **Resync the generators you own.** An ejected copy keeps the logic it was copied with, and a
63+
plain `gen` does not refresh it. `meta eject --list` (`dotnet meta eject`, `metaobjects eject`,
64+
`mvn metaobjects:eject`) reports each copy that differs from the reference;
65+
`eject <name> --force` takes the new reference for a copy you never edited, and a copy you
66+
edited is three-way merged instead. Steps for 1.0.x: https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/upgrading-within-1.0.md.
67+
5068
## Need an output? Write the generator — this is the primary path
5169

5270
**When.** You need an output the model fully describes and no reference generator emits —

‎fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/java.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ All artifacts share `groupId` `com.metaobjects` and one version property:
2828
| `metaobjects-maven-plugin` | the build-time codegen plugin |
2929
| `metaobjects-core-spring` | optional Spring wiring |
3030

31+
## Column and table names
32+
33+
**Column and table names come from `naming` in `.metaobjects/config.json`, the one setting
34+
every port reads** (ADR-0058): `meta migrate`, every port's codegen, and the OMDB runtime. The
35+
default is `snake_case`, what `meta migrate` creates. Through 1.0 this port defaulted to the
36+
field names; a database whose columns are named exactly like the fields declares it once:
37+
38+
```json
39+
{ "schema_version": 1, "naming": { "columns": "literal" } }
40+
```
41+
42+
There is no per-generator or runtime naming: the `columnNaming` generator arg fails
43+
`mvn metaobjects:generate`, and `SimpleMappingHandlerDB.setColumnNaming` throws. A Spring
44+
application that loads its metadata from the classpath points `metaobjects.physical-naming-config`
45+
at the project's `.metaobjects/config.json` packaged as a resource (for example
46+
`classpath:.metaobjects/config.json`). Details and the 1.0 to 1.1 steps:
47+
<https://github.com/metaobjectsdev/metaobjects/blob/main/docs/features/migrations/physical-naming.md>.
48+
3149
## Plugin config in `pom.xml`
3250

3351
The plugin's `generate` goal binds to the `generate-sources` phase. Point its

0 commit comments

Comments
 (0)