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
docs(codegen): the template-spec is discovered, and the gap notes are retracted
Documents the fix in the two commits before this, and RETRACTS the three "known gap" notes
shipped earlier in this same session — they described the defect as permanent because at the
time it was, and leaving them would be worse than never having written them.
WHAT THE NOTES SAID AND WHY THEY GO. own-your-codegen.md, codegen-concepts.md and the
metaobjects-codegen skill each carried a warning that --template-spec was accepted by `gen`
only, that neither port auto-discovered a spec, and that adopters should therefore keep
template output OUTSIDE the directory verify --codegen diffs. All three are now false, and
the workaround they recommended is actively bad advice: output kept out of the diffed
directory is output the drift gate does not cover.
They are replaced by the convention rather than deleted silently, because the reason to
prefer the conventional path over the flag is the same fact that made the bug: `verify
--codegen` accepts no --template-spec, so discovery is the ONLY channel by which the drift
gate learns your template generators exist. That is worth stating positively at every site an
adopter reaches — a flag-only setup still works for `gen` and still leaves `verify`
resolving a different generator list.
ONE CORRECTION I OWE. The retracted notes claimed Python "convicts their committed output"
unconditionally. That was true only for a spec emitting .py — the one extension the old
*.py-scoped comparison could see. For every other extension it was the opposite failure,
silence, and the CHANGELOG entry now states both halves with the reproduction for each. I
had verified the .py case and generalised from it.
Per-port pages get the worked form: the conventional path, the anchor (the metadata dir's
parent, which is what .metaobjects/ already uses), the flag-overrides rule, and a two-line
gen/verify pair showing both verbs resolving the same file. python.md additionally documents
the declarative-config-mode refusal, and notes the flag-name asymmetry that trips people:
`gen` spells the templates dir --templates, while on `verify` that name is the SUBVERB, so
the directory flag there is --templates-root.
cli.md's C# and Python rows say the flag is auto-discovered and why the conventional path is
the one to use.
The roadmap entry moves from Planned to the SP-3 shipped block — carrying the C# jurisdiction
gap forward as explicitly still open, since that is the one thing here that was found and
NOT fixed, and it must not disappear with the entry that named it.
Fixture churn: all five agent-context-conformance corpora regenerated from tracked source.
Verified: doc-example gate 0 (91 examples), site-payload fresh, site-reference fresh (16
pages), sdk 300/0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSCgs7z19w8aGXGiceCohC
Copy file name to clipboardExpand all lines: docs/features/cli.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,10 @@ command surface splits in two:
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
36
| 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)|
37
-
| C# codegen |`dotnet meta`|`dotnet meta 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`). `gen` also accepts `--template-spec <json>` (+ `--template-root <dir>`, default `templates`) — the declarative Mustache template-codegen surface (the cross-port JSON contract shared with Python); see [declarative template scopes](codegen-concepts.md#declarative-template-scopes)|
37
+
| C# codegen |`dotnet meta`|`dotnet meta 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`). `gen` also accepts `--template-spec <json>` (+ `--template-root <dir>`, default `templates`) — the declarative Mustache template-codegen surface (the cross-port JSON contract shared with Python), **auto-discovered at `<projectRoot>/template-spec.json`** when the flag is absent. Prefer the conventional path: `verify --codegen` takes no `--template-spec`, so discovery is how the drift gate sees your template generators at all; see [declarative template scopes](codegen-concepts.md#declarative-template-scopes)|
38
38
| Java/Kotlin codegen | Maven plugin |`mvn metaobjects:generate` (`metaobjects:generate`) | Kotlin generators run through the same goal — see below. **No `--template-spec` flag, deliberately** — `<generator>` already loads a consumer class from the project classpath, so the declarative surface is `com.metaobjects.generator.template.TemplateScopeGenerator` wired as an ordinary `<generator>` with `<template>` / `<scope>` / `<outputPattern>` / `<templatesDir>` / `<format>` args (covers BOTH Java and Kotlin); see [declarative template scopes](codegen-concepts.md#declarative-template-scopes). The `generate`/`verify`/`docs` goals are declared `threadSafe` and support parallel multi-module reactor builds (`mvn -T`) (#233) |
39
39
| Java/Kotlin verify | Maven plugin |`mvn metaobjects:verify -Dmeta.verify.mode=codegen\|templates` (`metaobjects:verify`) | parameter-driven ADR-0021 D2 modes (one goal covers BOTH Java + Kotlin): `codegen` (default, back-compat — regen + fail on drift vs committed output, generator-neutral) / `templates` (`{{field}}`↔payload drift via the render `Verify` engine). `db` rejected ("schema verify is the migrate engine, ADR-0015") |
40
-
| Python codegen | console-script |`metaobjects gen` / `verify --codegen` / `verify --templates`|`[project.scripts] metaobjects` — **not**`meta` (that's the Node schema CLI); ships the ADR-0021 D2 subverbs (`--db` rejected, exit 2). `gen` also accepts `--template-spec <json>` (+ `--templates <dir>`, default `templates`) — the declarative Mustache template-codegen surface (the cross-port JSON contract shared with C#); see [declarative template scopes](codegen-concepts.md#declarative-template-scopes)|
40
+
| Python codegen | console-script |`metaobjects gen` / `verify --codegen` / `verify --templates`|`[project.scripts] metaobjects` — **not**`meta` (that's the Node schema CLI); ships the ADR-0021 D2 subverbs (`--db` rejected, exit 2). `gen` also accepts `--template-spec <json>` (+ `--templates <dir>`, default `templates`) — the declarative Mustache template-codegen surface (the cross-port JSON contract shared with C#), **auto-discovered at `<projectRoot>/template-spec.json`** when the flag is absent (and REFUSED in declarative-config mode, where a spec has no target to write into). Prefer the conventional path: `verify --codegen` takes no `--template-spec`, so discovery is how the drift gate sees your template generators at all; see [declarative template scopes](codegen-concepts.md#declarative-template-scopes)|
41
41
42
42
## `verify` is one verb with explicit subverbs (ADR-0021 D2)
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/SKILL.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,12 +361,11 @@ reach for it here.) Use `--template-spec <json>` — plus `--templates <dir>` on
361
361
`--template-root <dir>` on C# — and your entries are appended to the default suite. Worked
362
362
examples with the full JSON: `docs/ports/python.md` and `docs/ports/csharp.md`.
363
363
364
-
**One caveat to plan around on those two ports:**`--template-spec` is accepted by `gen`
365
-
only. `verify` does not take it and neither port auto-discovers a spec file, so
366
-
`verify --codegen` regenerates WITHOUT your template generators and reports their
367
-
committed output as stale — Python prints `extra: <path>` and exits 1, and the remedy it
368
-
prints is a loop. Emit template-spec output somewhere other than the directory
369
-
`verify --codegen` diffs, and do not "fix" the failure by deleting the files.
364
+
**The spec is auto-discovered, and that is load-bearing.** With no `--template-spec`, both
365
+
ports read `<projectRoot>/template-spec.json` — projectRoot being the metadata dir's parent.
366
+
Keep it there: `verify --codegen` accepts no `--template-spec` flag, so the conventional path
367
+
is how the drift gate learns your template generators exist. Put the spec somewhere else and
368
+
reach it only by flag, and `verify` regenerates without it and reports its output as stale.
370
369
371
370
So on C#/Python, "I need a shape the built-ins do not emit" is answered by a template, not
372
371
by writing generator code. Do not conclude the port cannot be customized.
0 commit comments