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 198d75d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(csharp): consume shared dependency models at build time (#508)
* feat(csharp): consume a shared model at build time (FR-023 S6)
dotnet meta reads `dependencies` from .metaobjects/config.json at every rung of
its source ladder, verifies the committed snapshot against deps.lock.json
offline, and loads the snapshots ahead of the project's own files under
`dep:<name>/<artifact>` source ids. Same ERR_DEPENDENCY_* codes as TypeScript
and Python; the Node `meta deps sync` stays the only writer of lock and snapshot.
Imported nodes load but are not generated: the codegen runner, report rows,
shared enums, API-docs model, template scope walk, the verify --codegen
regeneration and the requirement gate's coverage denominator all leave them out
unless scope.include names their package. An imported value object a generated
entity holds is still emitted, since the entity's property type needs it.
C# runs all 23 cases of fixtures/dependency-conformance/ on the neutral ladder
and the explicit metadata-directory rung, plus codegen, CLI and unit tests.
* no-mistakes(review): Emit imported value shapes reached by local shapes, templates
* fix(csharp): run only the dependency corpus's resolution arm after rebasing onto main
main's corpus now carries 11 deps-check cases (expectCheck) beside the 24
resolution cases; C# has no check yet, so its runner skips them. Update the
Phase 2 prose and the changelog count to match.
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(document): Docs now say C# consumes shared models (FR-023 S6); stale "C# doesn't read dependencies" claims fixed in README, cli, metadata-sources, metadata-dependencies, spec/roadmap, and the agent-context codegen reference plus its five mirrored fixture copies.
`_PACKAGE_NOT_OWNED`), and a load error in a dependency's file names `dep:<name>/<artifact>`.
118
+
Imported nodes load but are not generated: every C# generator, the `verify --codegen`
119
+
regeneration and the requirement gate's coverage denominator leave them out unless
120
+
`scope.include` names their package. C# runs the 26 resolution cases (the 11 check cases pin the Node `meta deps check`) of `fixtures/dependency-conformance/`.
121
+
The Node `meta deps sync` stays the only writer of the lock and the snapshot.
122
+
See [docs/features/metadata-dependencies.md](docs/features/metadata-dependencies.md).
123
+
111
124
- **Own your generators, and give back the ones you did not change.** A team is expected to
112
125
write generators of its own, because a generator it owns is what keeps output from drifting.
113
126
Two things now help it carry fewer copies than it needs. `meta gen` prints one line naming
|[`fixtures/dependency-conformance/`](../fixtures/dependency-conformance/)| 37 cases (26 resolution + 11 check) + 14 transport cases | ✓ (reference implementation; all three arms) | ✓ (resolution arm, all 26; no check, so the 11 check cases are not run) | inherits via Java |— (Phase 2) | ✓ (resolution arm, all 26 identically; no check yet, so the 11 check cases are not run; the transport arm is Node-only) |
51
+
|[`fixtures/dependency-conformance/`](../fixtures/dependency-conformance/)| 37 cases (26 resolution + 11 check) + 14 transport cases | ✓ (reference implementation; all three arms) | ✓ (resolution arm, all 26; no check, so the 11 check cases are not run) | inherits via Java |✓ (resolution arm, all 26; no check, so the 11 check cases are not run) | ✓ (resolution arm, all 26 identically; no check yet, so the 11 check cases are not run; the transport arm is Node-only) |
Copy file name to clipboardExpand all lines: docs/features/cli.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
@@ -33,7 +33,7 @@ command surface splits in two:
33
33
|**Template/prompt drift** (`verify --templates`) |**Node `meta`**|`meta verify --templates`| TS reference (ADR-0021 D2) — `{{field}}`↔payload; part of the bare-`verify` default |
34
34
|**Vocabulary upgrade** (`upgrade`) |**Node `meta`**|`meta upgrade [--to <version>] [--apply]`|**any backend** — rewrites RETIRED metadata vocabulary (`@violation` → `@counterexample`, `@readOnly` → `@mutability`, dropping `@verifiedBy`) and resolves ATTRIBUTE CONTRADICTIONS (`@fields` beside `@expr` on an index key). Node-only because it edits the metadata documents themselves, which every port shares; a non-TS project runs `npx meta upgrade` against its own `metaobjects/`. **Canonical JSON and YAML alike.** Previews by default. Retirements needing a human decision are refused and the run exits non-zero, so CI cannot record a partial migration as finished |
35
35
|**Vocabulary search** (`types`) |**Node `meta`**|`meta types [query]`|**any backend** — apropos/`kubectl explain` over the live metamodel registry (names + descriptions + when-to-use); the vocabulary is cross-port identical (registry-conformance) |
36
-
|**Dependency sync** (`deps`) |**Node `meta`**|`meta deps sync \| check \| list`|**any backend** — resolves a declared metadata dependency (`path`, or an installed `npm` / `python` package) into a committed snapshot + lock (FR-023), so `sync`/`check`/`list` themselves stay Node-only regardless of your server language. TypeScript, Python and Java then LOAD that snapshot at every rung of their own source ladder (Kotlin loads through Java's loader and Maven plugin); C# doesn't read `dependencies` yet (Phase 2). On a project whose own metadata Node `meta` cannot read (a Maven `src/main/resources/metadata` directory, a C# metadata directory, or another port's vocabulary), `sync` and `check` prove the locked dependencies load together and say that the port's own `verify` is the full check. See [`metadata-dependencies.md`](metadata-dependencies.md)|
36
+
|**Dependency sync** (`deps`) |**Node `meta`**|`meta deps sync \| check \| list`|**any backend** — resolves a declared metadata dependency (`path`, or an installed `npm` / `python` package) into a committed snapshot + lock (FR-023), so `sync`/`check`/`list` themselves stay Node-only regardless of your server language. TypeScript, Python and Java then LOAD that snapshot at every rung of their own source ladder (Kotlin loads through Java's loader and Maven plugin); C# loads the snapshot through `dotnet meta`(Phase 2 S6). On a project whose own metadata Node `meta` cannot read (a Maven `src/main/resources/metadata` directory, a C# metadata directory, or another port's vocabulary), `sync` and `check` prove the locked dependencies load together and say that the port's own `verify` is the full check. See [`metadata-dependencies.md`](metadata-dependencies.md)|
37
37
| **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` |
38
38
| 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)|
39
39
| 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 = "<json>", TemplateRoot = "<dir>" }`; `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 |
0 commit comments