diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e77df87..c74c54af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,17 @@ here.** ### Added +- **C# reads its generated-code directory from `.metaobjects/config.json`, so a plain + `dotnet meta verify` runs the codegen gate.** Set `"csharp": { "outDir": "Generated" }` + (relative to the directory holding `.metaobjects/`). `dotnet meta gen` writes there and + `dotnet meta verify` (bare or `--codegen`) diffs against it, so the two cannot disagree; an + explicit `--out ` still works and wins. Before this a bare `dotnet meta verify` skipped + the codegen gate unless `--out` was passed, and exited 0 on stale generated code. A project + with no setting still gets the skip note, which now names the setting. A present `csharp` + block that is not an object, has an unknown key, or has an empty or non-string `outDir` is + refused. The other ports ignore the block; the TypeScript config reader declares the key so + the shared file stays free of unknown-key warnings. + - **Report export: `GET /?format=csv|json|xml` on a served report, in all five ports.** A new standalone `report-export` catalog generator (importable as shipped, ejectable in every port, drift-checked by `verify --codegen`, never implied by a library) generates one export @@ -47,8 +58,7 @@ here.** subverb still runs only the gates named. A gate the run has no configuration for is skipped with a one-line note instead of failing: `meta verify` without a `metaobjects.config.ts` (a config that exists but fails to load exits 2), `metaobjects verify` with no `metaobjects.config.yaml` and no `--prompts`, `dotnet meta verify` - without `--out ` and `codegen/Generators.cs` (C# has no config-resolved output directory: - pass `--out ` in CI to get the codegen gate), `mvn metaobjects:verify` without + without an output directory (`csharp.outDir`, see Added) and `codegen/Generators.cs`, `mvn metaobjects:verify` without `-Dmeta.verify.templateRoot`. Pinned per port by tests that run a bare verify over drifted input. **Behaviour change:** a CI step that ran a bare `verify` and relied on the narrower default can now go red where it was green, because the gate it never ran now runs. Node diff --git a/agent-context/skills/metaobjects-codegen/references/csharp.md b/agent-context/skills/metaobjects-codegen/references/csharp.md index 6b20b40ef..e782303a8 100644 --- a/agent-context/skills/metaobjects-codegen/references/csharp.md +++ b/agent-context/skills/metaobjects-codegen/references/csharp.md @@ -91,7 +91,7 @@ build output (`codegen/bin/`, `codegen/obj/`) in `.gitignore`. A bare `dotnet meta verify` runs `--templates` (the FR-004 prompt/template drift gate, see the prompts reference) and `--codegen` (the codegen-output drift gate; -skipped with a note unless `--out ` and `codegen/Generators.cs` are present). +skipped with a note unless an output directory, `csharp.outDir` in `.metaobjects/config.json` or `--out `, and `codegen/Generators.cs` are present). **Schema migration + live-DB drift are NOT `dotnet meta`** — they run through the Node `meta` tool (see the migration reference). diff --git a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md index 2f6547716..5944aa65f 100644 --- a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md +++ b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md @@ -27,7 +27,7 @@ building block. Every generator is a reference helper an adopter selects, ejects (`server/typescript/packages/codegen-ts/src/db-emitting.ts`). - **The drift gate per port** — regenerate into a temp tree and diff: `meta verify --codegen` (TS); `mvn metaobjects:verify` (Java/Kotlin; `codegen` is the default mode); `dotnet meta - verify --codegen` (C#; bare `verify` runs it when `--out` and `codegen/Generators.cs` are present); + verify --codegen` (C#; bare `verify` runs it when `csharp.outDir` (or `--out`) and `codegen/Generators.cs` are present); `metaobjects verify` (Python; `--codegen` is part of the default). Source: `docs/features/cli.md`. - **Generated code compiles**: a codegen-compile gate compiles every port's emitted model tier with its real compiler in CI (`docs/CONFORMANCE.md`, "Split coverage"). diff --git a/docs/features/cli.md b/docs/features/cli.md index 963644148..c964f93e0 100644 --- a/docs/features/cli.md +++ b/docs/features/cli.md @@ -36,7 +36,7 @@ command surface splits in two: | **Dependency sync** (`deps`) | **Node `meta`** | `meta deps sync \| check \| list` | **any backend** — resolves a declared metadata dependency's `path` transport into a committed snapshot + lock (FR-023), so `sync`/`check`/`list` themselves stay Node-only regardless of your server language. TypeScript and Python then LOAD that snapshot at every rung of their own source ladder — the two ports that implement dependency resolution in Phase 1a; Java, Kotlin, and C# don't read `dependencies` yet (Phase 2). See [`metadata-dependencies.md`](metadata-dependencies.md) | | **Canonical format** (`fmt`) | every port | `meta fmt` / `dotnet meta fmt` / `mvn metaobjects:fmt` / `metaobjects fmt` | (#304) ships in **every** port — the canonical serializer already exists in all five, so formatting is local, not Node-only. `--check` lists non-canonical files and exits non-zero without changing anything. Formats each file STANDALONE — own-mode, declared-here layer only (ADR-0039); an `extends` onto another file's base is preserved as-is, never resolved or erred on; a file declaring `overlay: true` anywhere — whether or not a same-file base exists — is reported as skipped rather than merged (merging would drop the overlay marker, a structural change fmt never makes). A YAML file is always skipped — no canonical YAML emitter exists (ADR-0006). Before writing, every port reloads the whole project with the candidate swapped in and refuses the write unless the reloaded model's canonical form is byte-identical to the untouched baseline — fmt never changes meaning. See [Fixture corpus](#meta-fmt--canonical-formatting-304) below and `fixtures/fmt-conformance/README.md` | | TS codegen | Node `meta` | `meta gen` | TS projects. **No `--template-spec` flag, deliberately** — `metaobjects.config.ts` already takes generator VALUES, so a declarative template generator is declared there (`templateGenerator()`, or `templateSpecToGenerators(parseTemplateSpec(spec))` to reuse a C#/Python spec file). Keeping it in the config is what lets `meta verify --codegen` regenerate WITH it, since that gate re-runs the config's generator list; see [declarative template scopes](codegen-concepts.md#declarative-template-scopes) | -| C# codegen | `dotnet meta` | `dotnet meta init` / `gen` / `verify --templates` / `verify --codegen` | a .NET tool (`ToolCommandName=dotnet-meta`); invoked `dotnet meta` so it never shadows the Node `meta`; ships the ADR-0021 D2 subverbs (`--db` rejected, exit 2; bare `verify` = `--templates` plus `--codegen` when `--out` and `codegen/Generators.cs` are present). **The generator list is `codegen/Generators.cs`** (ADR-0034 Amendment 9): `dotnet meta init` writes it with `codegen/Program.cs` (two lines that run it) and `codegen/Codegen.csproj`, and `gen` / `verify --codegen` always run it through `dotnet run --project codegen`. With no `codegen/Generators.cs` they exit 2 and write nothing; `--generators` only narrows the list to declared entries. Every entry may set its own output directory (`ApiDocsGenerator { OutDir = ... }`), and `verify --codegen` compares each one. A declarative Mustache template-spec (the cross-port JSON contract shared with Python) is one more entry, `TemplateSpecGenerator { Spec = "", TemplateRoot = "" }`; `gen` no longer reads `--template-spec` or a project-root `template-spec.json`, and a run that finds either with no such entry fails before writing anything; see [declarative template scopes](codegen-concepts.md#declarative-template-scopes). `dotnet meta docs` was removed in 1.1.0: it prints the line that points at [the migration section](migrations/docs-are-generators.md#c) and exits 2 | +| C# codegen | `dotnet meta` | `dotnet meta init` / `gen` / `verify --templates` / `verify --codegen` | a .NET tool (`ToolCommandName=dotnet-meta`); invoked `dotnet meta` so it never shadows the Node `meta`; ships the ADR-0021 D2 subverbs (`--db` rejected, exit 2; bare `verify` = `--templates` plus `--codegen` when an output directory (`csharp.outDir` in `.metaobjects/config.json`, or `--out`) and `codegen/Generators.cs` are present). **The generator list is `codegen/Generators.cs`** (ADR-0034 Amendment 9): `dotnet meta init` writes it with `codegen/Program.cs` (two lines that run it) and `codegen/Codegen.csproj`, and `gen` / `verify --codegen` always run it through `dotnet run --project codegen`. With no `codegen/Generators.cs` they exit 2 and write nothing; `--generators` only narrows the list to declared entries. Every entry may set its own output directory (`ApiDocsGenerator { OutDir = ... }`), and `verify --codegen` compares each one. A declarative Mustache template-spec (the cross-port JSON contract shared with Python) is one more entry, `TemplateSpecGenerator { Spec = "", TemplateRoot = "" }`; `gen` no longer reads `--template-spec` or a project-root `template-spec.json`, and a run that finds either with no such entry fails before writing anything; see [declarative template scopes](codegen-concepts.md#declarative-template-scopes). `dotnet meta docs` was removed in 1.1.0: it prints the line that points at [the migration section](migrations/docs-are-generators.md#c) and exits 2 | | Java/Kotlin codegen | Maven plugin | `mvn metaobjects:generate` (`metaobjects:generate`) | Kotlin generators run through the same goal — see below. **No `--template-spec` flag, deliberately** — `` already loads a consumer class from the project classpath, so the declarative surface is `com.metaobjects.generator.template.TemplateScopeGenerator` wired as an ordinary `` with `