Skip to content

fix(cli): run codegen and template gates on bare verify in every port - #475

Merged
dmealing merged 7 commits into
mainfrom
fm/mo-verify-gates-parity
Oct 28, 2026
Merged

dmealing merged 7 commits into
mainfrom
fm/mo-verify-gates-parity

Conversation

@dmealing

@dmealing dmealing commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Bare verify now runs the same default gate set in every port: codegen drift and prompt-template drift, plus the requirement ledger. Node meta verify and dotnet meta verify gain the codegen gate; metaobjects verify and mvn metaobjects:verify gain the template gate. --db, --deps and --replay stay opt-in, and naming a subverb still runs only the gates named.
  • A gate with no configuration is skipped with a one-line note, not failed. Covers Node meta verify without metaobjects.config.ts, Python without a config or --prompts, C# without --out and codegen/Generators.cs, and Maven without meta.verify.templateRoot. A config file that exists but fails to load still exits 2. The Maven meta.verify.mode parameter no longer defaults to codegen; unset runs both gates.
  • Corrects two docs: docs/recipes/mysql.md (Python ships SQLite and MySQL drivers) and docs/features/api-contract.md (the in-list cap of 100 applies in all five ports). Adds a CHANGELOG entry, with the behavior change noted for CI scripts that relied on the narrower bare default.
Validation

Risk Assessment

✅ Low: Change matches intent and recorded decisions in all four ports: bare verify gate sets, skip notes, TS broken-config exit 2 and doc fixes all trace correctly. The remaining behaviour change, previously green CI going red, is documented in the CHANGELOG.

Testing

TS bare verify codegen gate driven live: stale output fails (exit 1), broken config fails (exit 2), missing config skips with note (exit 0). Transcripts in the evidence dir. cli package suite passes (1753 tests, 0 failures). Doc claims checked against source only, not a live scenario. Python bare verify ran live, but the codegen gate needs a YAML config, so its drift path was not exercised. C# bare verify was not driven live. Full server suite not run (exceeds the 5-minute scoped limit).

  • Live validation: ✅ go - 4 of 7 scenarios driven live against the product
Scenario Result Live Evidence
TS bare verify passes on a clean generated project ✅ pass live proj-ok: meta gen then meta verify exit 0
TS bare verify fails when generated code is stale (codegen gate in bare run) ✅ pass live stale-verify.out/err: exit 1, codegen gate reports 1 file differs
TS bare verify fails loudly when metaobjects.config.ts exists but is broken ✅ pass live broken-verify.err: exit 2, load error; broken-codegen.err: verify --codegen exit 2
TS bare verify with no config skips codegen with a note and exits 0 ✅ pass live noconfig-verify.err: skip note; exit 0
Python bare verify runs codegen and template gates by default ⏸️ untested no The live run reached the default gate set, but the Python drift-detection path needs a metaobjects.config.yaml project shape that was not built, so it was not exercised.
C# bare dotnet meta verify gate behavior matches the docs (needs --out for codegen) ⏸️ untested no dotnet is present but the C# CLI was not built or run in this phase; the change was checked only by reading and the existing CliSurfaceTests/VerifySubverbTests.
Docs: mysql.md Python drivers and api-contract in-list cap statements are accurate ⏸️ untested no Only checked by reading source (drivers.py, MAX_IN_LIST constants in each port). No live scenario was driven for this docs claim.
Evidence: TS stale bare verify stdout
verify[6]{gate,ran,ok}:
  templates,true,true
  schema,false,true
  codegen,true,false
  deps,false,true
  requirements,true,true
  replay,false,true
exitCode: 1
summary: 1 of 3 gate(s) failed (codegen)
help[1]: the failing gate's drift DETAIL is printed as text on stderr — this payload carries the verdict only
antiPatterns:
  status: ran
  total: 0
  rows: []
requirements:
  status: ran
  total: 0
  rows: []
overlays:
  status: ran
  total: 0
  rows: []
names:
  status: ran
  total: 0
  rows: []
deprecations:
  status: ran
  total: 0
  rows: []
fields:
  status: ran
  total: 0
  rows: []
notRepresented[2]: "per-gate drift detail for every gate but schema (which template variable drifted, which generated file differs, which migration failed to replay) — printed as text on stderr; this payload carries each gate's pass/fail verdict, and the schema gate's differences in schemaDrift",the loader's own warnings and the agent-context/manifest advisories — printed as text on stderr
Evidence: TS stale bare verify stderr
meta: meta verify — running --codegen --templates (default). Explicit subverbs: --templates (prompt drift), --db/--dialect d1 (schema drift), --codegen (drift of everything `generators` declares, documentation included), --deps (dependency drift), --replay/--replay-snapshot (the committed migration chain replays from empty).
meta: meta verify — no template.* nodes found; the template gate had nothing to check.
meta: meta verify — codegen drift (1 file(s) differ from a fresh regen):
meta:   ~ ../proj-ok/generated/db/Order.ts (committed content differs from a fresh regen)
meta: Run 'meta gen' to regenerate, then commit the result.
meta: meta verify — not run: schema (--db <url>), deps (--deps), replay (--replay) — a bare 'meta verify' runs the codegen and template gates (plus the requirement ledger); name each gate to run it
Evidence: TS broken-config bare verify stderr
meta: meta verify — running --codegen --templates (default). Explicit subverbs: --templates (prompt drift), --db/--dialect d1 (schema drift), --codegen (drift of everything `generators` declares, documentation included), --deps (dependency drift), --replay/--replay-snapshot (the committed migration chain replays from empty).
meta: meta verify: metaobjects.config.ts exists but failed to load, so the codegen gate cannot run: ParseError: Unexpected token  
 ~/.no-mistakes/evidence/01M60J3F76VGWC9YW2163Z86TB/proj-broken/.metaobjects-config-proc-dbd183c8.ts:2:0
Evidence: TS no-config bare verify stderr
meta: meta verify — running --codegen --templates (default). Explicit subverbs: --templates (prompt drift), --db/--dialect d1 (schema drift), --codegen (drift of everything `generators` declares, documentation included), --deps (dependency drift), --replay/--replay-snapshot (the committed migration chain replays from empty).
meta: meta verify — codegen gate skipped: no metaobjects.config.ts found, so there is no generated output to diff against
meta: meta verify — no template.* nodes found; the template gate had nothing to check.
meta: meta verify — not run: schema (--db <url>), codegen (--codegen), deps (--deps), replay (--replay) — a bare 'meta verify' runs the codegen and template gates (plus the requirement ledger); name each gate to run it

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 7 scenarios driven live against the product
Scenario Result Live Evidence
TS bare verify passes on a clean generated project ✅ pass live proj-ok: meta gen then meta verify exit 0
TS bare verify fails when generated code is stale (codegen gate in bare run) ✅ pass live stale-verify.out/err: exit 1, codegen gate reports 1 file differs
TS bare verify fails loudly when metaobjects.config.ts exists but is broken ✅ pass live broken-verify.err: exit 2, load error; broken-codegen.err: verify --codegen exit 2
TS bare verify with no config skips codegen with a note and exits 0 ✅ pass live noconfig-verify.err: skip note; exit 0
Python bare verify runs codegen and template gates by default ⏸️ untested no The live run reached the default gate set, but the Python drift-detection path needs a metaobjects.config.yaml project shape that was not built, so it was not exercised.
C# bare dotnet meta verify gate behavior matches the docs (needs --out for codegen) ⏸️ untested no dotnet is present but the C# CLI was not built or run in this phase; the change was checked only by reading and the existing CliSurfaceTests/VerifySubverbTests.
Docs: mysql.md Python drivers and api-contract in-list cap statements are accurate ⏸️ untested no Only checked by reading source (drivers.py, MAX_IN_LIST constants in each port). No live scenario was driven for this docs claim.
  • scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains
  • Built disposable TS project under the evidence dir; bun server/typescript/packages/cli/bin/meta.ts gen then bare verify (clean, exit 0)
  • Stale model after gen, bare verify exit 1, codegen gate reports 1 file differs (stdout + stderr captured in evidence)
  • Broken metaobjects.config.ts, bare verify exit 2 with load error; verify --codegen also exit 2
  • No metaobjects.config.ts, bare verify exit 0 with skip note
  • bun test in server/typescript/packages/cli: 1753 tests, 1750 pass, 3 skip, 0 fail
  • Doc check (code reading only): docs/recipes/mysql.md Python SQLite/MySQL drivers present in server/python/src/metaobjects/runtime/drivers.py; in-list cap 100 confirmed in TS DEFAULT_MAX_IN_LIST, Python MAX_IN_LIST, Java MAX_IN_LIST, C# MaxInList, Kotlin generated MAX_IN_LIST
  • Python: PYTHONPATH=server/python/src python3 -m metaobjects.cli verify metaobjects in stale project, exit 2 with message that metaobjects.config.yaml is missing (not a silent skip)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

A bare verify now covers codegen drift, prompt templates and the requirement
ledger in all five ports; --db/--deps/--replay stay opt-in. A gate with no
configuration is skipped with a one-line note. Also corrects the mysql recipe
(Python ships SQLite and MySQL drivers) and the api-contract in-list cap note
(all five ports enforce it).
…tring, cli.md (Python and Java rows), MetaDataVerifyMojo comment and one Python test comment. The mysql.md and api-contract.md corrections were already on the branch and checked against code: Python has SQLite and PyMySQL drivers, and the in-list cap of 100 exists in all five ports. Doc edits only; no behavior or test logic changed.
@dmealing dmealing changed the title feat(cli): bare verify runs the same default gates in every port fix(cli): run codegen and template gates on bare verify in every port Oct 28, 2026
@dmealing
dmealing merged commit b146665 into main Oct 28, 2026
1 check passed
@dmealing
dmealing deleted the fm/mo-verify-gates-parity branch October 28, 2026 06:30
dmealing added a commit that referenced this pull request Oct 28, 2026
)

#475 made a bare verify run the template gate as well as the codegen gate. Two tests
still described the old behaviour: one asserted a single stderr line, the other ran a
config project with no prompt templates. They now match docs/features/cli.md and the
Unreleased CHANGELOG entry; the code was right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant