Skip to content

feat: merge main (1.3.0) into the 1.2.x release line — metamodel 1.3 vocabulary, C# codegen hooks, contract emitters - #596

Merged
dmealing merged 52 commits into
fix/rc19from
fm/mo-pr593-takeover
Nov 18, 2026
Merged

dmealing merged 52 commits into
fix/rc19from
fm/mo-pr593-takeover

Conversation

@dmealing

@dmealing dmealing commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Takeover of #593: merge of origin/main (1.3.0 and later) into the 1.2.x line

This PR's base is fix/rc19, not main. Merging it makes #593 conflict-free. It is one merge commit plus the review's in-run fixes; it adds no features.

Decisions to know about

  • Scalar aggregate in origin.computed @expr (line behaviour kept). The line allows it; main refuses it. The line's rule is a permissive superset: every model valid under main stays valid, and models written on 1.2.x keep loading.
  • Where the sides disagreed, main's released 1.3.0 behaviour won: flat output layout is the default (the line's package layout and namespaces are opt-in); validator.atLeastOne takes no @max (validator.exactlyOne replaces it); @dbSetName is removed (@collectionName is the vocabulary); Postgres view and report relations are qualified only when @schema is declared; a flattened value-object field has no own _COLUMN constant; gen-skip is ADR-0064 (the line's ADR-0062 skip text is dropped); duration wire, validation envelope and pagination follow main. The line's security fixes (fail-closed C# credential stripping, server-owned input dropped on create routes) are kept and still pass under main's api.unknownFields: reject default.
  • Open version question (not part of this PR). No release version was chosen or stamped. All version fields follow main (npm, PyPI, NuGet 1.3.0; Maven 8.3.0). The [1.2.4] CHANGELOG section carries a marked PENDING line. Both sides claim metamodel 1.3, and the registry metamodelVersion stays 1.3.
  • CHANGELOG overlap. [1.2.4] and [Unreleased] describe some of the same items (main's post-1.3.0 items were folded into [1.2.4]). The later release step must consolidate them. The dated [1.3.0] section (2026-11-11) predates any registry publish (chore: prep the 1.3.0 npm release — date the changelog and drop the personal author from manifests #595 still preps the npm release), so it must be dated against the actual publish.
  • Follow-up, not done here: declaredCollectionName in server/typescript/packages/metadata/src/naming.ts returns { name: string } | undefined; the C# twin returns a plain string. Narrowing it is optional and code from the line's own design, not a merge defect.
  • Left for the release step: spec/roadmap.md still names 1.2.1 as the FR-022 (JSON Schema and OpenAPI emitters) target, and says protobuf ships "1.3" (also in contract-emitters.md). Both are stale and need the version decision.
  • Pre-existing, left alone: docs/CONFORMANCE.md counts 16 yaml-conformance fixtures; the corpus has 19 directories on both parents. It needs a maintainer ruling.
  • Known gaps carried from the line: the rc.21 view vocabulary (origin.function, @union, @grain, cast) is implemented in TypeScript and C# only. The Java and Python fixtures for it are recorded in each port's expected-failures ledger (with staleness guards); they fail the same way on the line's parent.

What ran (before the pipeline)

  • TypeScript workspace: build and typecheck; package suites sdk 488, cli 2086, migrate-ts 1238, metadata 4267, codegen-ts 3786; integration-tests 63 files; scripts/ci-local.sh --quick.
  • C#: Conformance, Render, Cli, Codegen, and the Docker-backed IntegrationTests (510 of 510).
  • Python: 4814 passed, 1 expected failure.
  • Java: full reactor passed.
  • Generated artifacts (registry manifest, metamodel docs, canonical schemas, goldens, agent-context corpus, owned template copies, showcase output) were regenerated with the repo scripts. The agent-context skills now document gen-skip and the C# single property-naming resolver.
  • The no-mistakes gate took 2 runs. Run 1's document step edited the adoption recipe to the flat-default wording but not its agent-context mirror, so hosted ts-unit failed; run 2 carries the sync fix (the recipe comment in four recipes, the mirror and the agent-context conformance corpus).

CI diagnostics

  • Hosted csharp failed PropertyNamingGoldenTests.Default_output_matches_the_output_captured_before_the_property_naming_fix in run 1 and could not be reproduced locally (same toolchain as main's green runs). That test now prints the file, first differing line and both spellings on a mismatch, and scripts/ci-local.sh runs the C# tests with the minimal console logger so the message reaches the log. If it fails again, the log shows why.

Test-only changes

  • C# host-variant credential tests run their servers under api.unknownFields: drop, because they post deliberately forged keys and pin credential stripping, not unknown-field handling.
  • EfModelGapsTests asserts only the tables its input model declares (the check-constraint expected file covers every input model).

What Changed

  • Merge main (1.3.0 and later) into the 1.2.x release line, resolving ~680 conflicted paths. Where the two sides disagree, main's shipped 1.3.0 behavior wins and the line's variant stays available as an opt-in: the flat default output layout (the line's package layout and namespaces are opt-in), exactlyOne replacing @max on validator.atLeastOne, @collectionName replacing @dbSetName, Postgres view/report relations qualified only when @schema is declared, and no own column constant for a flattened value object's field.
  • Regenerate every generated artifact affected by the merge (registry manifest, metamodel docs, canonical schemas, golden files, agent-context corpus, owned template copies, showcase output) and realign versions to main (npm/PyPI/NuGet 1.3.0, Maven 8.3.0); the release version and the line's 1.2.4 CHANGELOG heading stay pending.
  • Post-merge follow-ups: apply reviewer inline fixes (drop dead naming-strategy code in the TypeScript and Python ports), sync the adoption recipe mirrors and stale docs to the flat-default wording, make a C# naming golden mismatch readable in CI, and fix stale 1.2.1 release-target references in the contract-emitter docs.
Validation

Risk Assessment

✅ Low: Third-round pass over the 1.2.x/main merge: duplicate-definition, conflict-marker, dropped-side, version-lockstep, metamodelVersion-parity and security-fix-survival checks are all clean, the round-1 merge artifacts stay fixed, and the remaining behavioral verification is owned by the pipeline's test step running every port's conformance suites.

Testing

Drove the real Node meta CLI end-to-end in throwaway projects under $DEV_SCRATCH (torn down after): contract emitters reproduced the committed goldens byte-for-byte, physical naming strategies matched the cross-port cases.json oracle on every generated table and column (including override-wins, frozen pluralizer, and flattened-member prefixes), the unknown-naming-strategy guard refused at config read without touching generated output, and the OpenAPI name-collision guard refused with the exact committed error. Focused contract corpus test with external Ajv/OpenAPI validators passed (105 tests). One pre-existing note: the all-fields fixture declares @storage on field.map, which the loader warns is unregistered — identical fixture and registry exist on origin/main, so the merge did not introduce it. Broad regression is covered by the configured baseline command, which passed at this commit; no source or test files were changed in this turn, so it was not re-run.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
User runs meta gen with jsonSchemaFile() + openApiFile() on the all-fields model; the emitted JSON Schema (canonical + strict) and openapi.json are byte-identical to the committed FR-022 goldens ✅ pass live s1-contract-emitters.txt (diff -r identical) + s1-openapi.json; focused corpus test 105 pass with Ajv strict / OpenAPI 3.1 validators
User sets naming {columns: pascal, tables: literal} in .metaobjects/config.json and runs meta gen with entityFile(); every generated Drizzle table and column name matches the naming-conformance case… ✅ pass live s2-naming-strategies.txt + s2-orderitem.ts (OrderItems table; Id/CreatedAt/UnitPriceCents/SKU_CODE columns; ShipTo_Street, bill_PostalCode prefixes)
Adversarial: config naming an unregistered strategy (columns: camelCase) is refused when the config is read — nonzero exit, error naming naming.columns and the valid built-ins, and no generated file i… ✅ pass live s2-naming-strategies.txt guard section: exit=2, refusal message listing built-ins and 'registered by the application: none'; output mtimes unchanged by the refused run
Adversarial: the contract emitters refuse metadata whose object name collides with another object's create shape — exit 1 with the exact committed ERR_CONTRACT_NAME_COLLISION message and no output tre… ✅ pass live s3-contract-refusal.txt: CLI stderr matches fixtures/contract-conformance/error-name-collision/expected-error.txt byte-for-byte; out/ absent after the run
Evidence: S1: contract emitters via meta gen — 13 files, byte-identical to goldens
== S1: meta gen (jsonSchemaFile + openApiFile) on all-fields fixture, disposable project /mnt/scratch/mo-gate-contract ==
command: cd disposable-project && bun <worktree>/server/typescript/packages/cli/bin/meta.ts gen
output tree:
out/openapi.json
out/schemas/acme/contract/Address.create.schema.json
out/schemas/acme/contract/Address.schema.json
out/schemas/acme/contract/Address.strict.schema.json
out/schemas/acme/contract/AllFields.create.schema.json
out/schemas/acme/contract/AllFields.schema.json
out/schemas/acme/contract/AllFields.strict.schema.json
out/schemas/acme/contract/AllFields.update.schema.json
out/schemas/acme/contract/Bag.create.schema.json
out/schemas/acme/contract/Bag.schema.json
out/schemas/acme/contract/Bag.update.schema.json
out/schemas/acme/contract/Tree.create.schema.json
out/schemas/acme/contract/Tree.schema.json

diff vs committed goldens fixtures/contract-conformance/all-fields/expected:
IDENTICAL (byte-for-byte)
Evidence: S1: generated openapi.json (FR-022 output artifact)
{
  "openapi": "3.1.0",
  "info": {
    "title": "all-fields",
    "version": "1.0.0"
  },
  "paths": {
    "/api/all_fields": {
      "get": {
        "operationId": "listAllFields",
        "tags": [
          "AllFields"
        ],
        "parameters": [
          {
            "name": "filter[id]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "filter[id][eq]",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "filter[id][ne]",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "filter[id][in]",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated values."
            }
          },
          {
            "name": "filter[id][isNull]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[title]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[title][eq]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[title][ne]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[title][in]",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated values."
            }
          },
          {
            "name": "filter[title][like]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[title][isNull]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[email]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[email][eq]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[email][ne]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[email][in]",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated values."
            }
          },
          {
            "name": "filter[email][like]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[email][isNull]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[quantity]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][eq]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][ne]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][gt]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][gte]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][lt]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][lte]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter[quantity][in]",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated values."
            }
          },
          {
            "name": "filter[quantity][isNull]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[views]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][eq]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][ne]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][gt]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][gte]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][lt]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][lte]",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "filter[views][in]",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated values."
            }
          },
          {
            "name": "filter[views][isNull]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[ratio]",
            "in": "query",
            "description": "Sugar for the eq operator.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filter[ratio][eq]",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filter[ratio][ne]",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filter[ratio][gt]",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filter[ratio][gte]",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filter[ratio][lt]",
            "i

... [48067 bytes truncated] ...

eger",
              "null"
            ],
            "format": "int64"
          },
          "ratio": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "score": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "amount": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?$",
            "description": "A decimal, as a string in JSON-number grammar or a JSON number. Precision 10, scale 2."
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "startsOn": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "startsAt": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?$"
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?$",
            "description": "An instant. A value with no offset is read as UTC."
          },
          "wallClock": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?$"
          },
          "priceCents": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Integer minor units of USD."
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "early",
              "late",
              null
            ]
          },
          "homepage": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "looseLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "anyOf": [
              {
                "format": "ipv4"
              },
              {
                "format": "ipv6"
              }
            ]
          },
          "holdFor": {
            "type": [
              "string",
              "null"
            ],
            "description": "A span of time, in the serving language's own form. Set wire.durations to \"iso\" to fix ISO-8601 across server languages."
          },
          "shipTo": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressCreate"
              },
              {
                "type": "null"
              }
            ]
          },
          "stops": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AddressCreate"
            },
            "minItems": 1,
            "maxItems": 5
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApiError": {
        "title": "ApiError",
        "description": "The error envelope. `error` is the stable code; `message` is free prose.",
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string",
            "description": "The rejected filter or sort field, on the four codes that name one."
          }
        }
      },
      "Bag": {
        "title": "Bag",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "counters": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "places": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/Address"
            }
          },
          "tree": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Tree"
              },
              {
                "type": "null"
              }
            ]
          },
          "open": {}
        },
        "required": [
          "id",
          "counters",
          "places",
          "tree",
          "open"
        ]
      },
      "BagCreate": {
        "title": "BagCreate",
        "type": "object",
        "properties": {
          "counters": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "places": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/AddressCreate"
            }
          },
          "tree": {
            "$ref": "#/components/schemas/TreeCreate"
          },
          "open": {}
        }
      },
      "BagList": {
        "title": "BagList",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Bag"
        }
      },
      "BagPage": {
        "title": "BagPage",
        "type": "object",
        "required": [
          "rows",
          "total"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bag"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "BagUpdate": {
        "title": "BagUpdate",
        "type": "object",
        "properties": {
          "counters": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "places": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/AddressCreate"
            }
          },
          "tree": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TreeCreate"
              },
              {
                "type": "null"
              }
            ]
          },
          "open": {}
        }
      },
      "Tree": {
        "title": "Tree",
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "children": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Tree"
            }
          }
        },
        "required": [
          "label"
        ]
      },
      "TreeCreate": {
        "title": "TreeCreate",
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TreeCreate"
            }
          }
        },
        "required": [
          "label"
        ]
      }
    }
  }
}
Evidence: S2: naming strategies — generated names vs cases.json oracle + camelCase refusal
== S2: meta gen (entityFile) with naming {columns: pascal, tables: literal} on naming-conformance model ==
Oracle: fixtures/naming-conformance/physical-names/cases.json, case 'pascal columns, literal tables'

/mnt/scratch/mo-gate-naming/out/OrderItem.ts:5:import { bigint, integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/OrderItem.ts:8:export const orderItems = pgTable("OrderItems", {
/mnt/scratch/mo-gate-naming/out/Person.ts:5:import { bigint, pgTable, text } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/Person.ts:8:export const persons = pgTable("people", {
/mnt/scratch/mo-gate-naming/out/Category.ts:5:import { bigint, pgTable, text } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/Category.ts:8:export const categories = pgTable("Categories", {
/mnt/scratch/mo-gate-naming/out/AuditEntry.ts:5:import { bigint, pgTable, text } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/AuditEntry.ts:8:export const auditEntries = pgTable("AuditLog", {
/mnt/scratch/mo-gate-naming/out/Shipment.ts:5:import { bigint, pgTable, text } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/Shipment.ts:8:export const shipments = pgTable("Shipments", {
/mnt/scratch/mo-gate-naming/out/HTTPRequest.ts:5:import { bigint, pgTable, text } from "drizzle-orm/pg-core";
/mnt/scratch/mo-gate-naming/out/HTTPRequest.ts:8:export const hTTPRequests = pgTable("HTTPRequests", {

export const orderItems = pgTable("OrderItems", {
  id: bigint("Id", { mode: "number" }).primaryKey(),
  createdAt: timestamp("CreatedAt", { mode: "string", withTimezone: true }),
  unitPriceCents: integer("UnitPriceCents"),
  sku: text("SKU_CODE"),
});
export type OrderItem = InferSelectModel<typeof orderItems>;
export const persons = pgTable("people", {
  id: bigint("Id", { mode: "number" }).primaryKey(),
  firstName: text("FirstName"),
  lastName: text("family_name"),
  npi: text("NPI"),
  ssn: text("Ssn"),
});
export const shipments = pgTable("Shipments", {
  id: bigint("Id", { mode: "number" }).primaryKey(),
  shipToStreet: text("ShipTo_Street"),
  shipToPostalCode: text("ShipTo_PostalCode"),
  shipToCountry: text("ShipTo_CTRY"),
  billToStreet: text("bill_Street"),
  billToPostalCode: text("bill_PostalCode"),
  billToCountry: text("bill_CTRY"),
  returnToStreet: text("Street"),
  returnToPostalCode: text("PostalCode"),
  returnToCountry: text("CTRY"),
  giftToStreet: text("g_Street"),
  giftToPostalCode: text("g_PostalCode"),
  giftToCountry: text("g_CTRY"),

== S2 guard: naming {columns: camelCase} refused at config read ==
exit=2; message:
meta: /mnt/scratch/mo-gate-naming/.metaobjects/config.json is not a valid MetaObjects config:
  naming.columns: "naming.columns" names "camelCase", which no column-naming strategy registered in the TypeScript port answers (built in: snake_case, literal, kebab-case, pascal; registered by the application: none). Register it before .metaobjects/config.json is read, or correct the name.
Evidence: S2: generated OrderItem.ts (Drizzle, pascal columns / literal tables)
// @generated by @metaobjectsdev/codegen-ts — hand edits are kept by a three-way merge on regeneration; meta verify --codegen checks only the generated parts.
// Source metadata: OrderItem (OrderItem)
// Extend in your own module (e.g. OrderItem.extra.ts) — nothing imports it for you.
import type { InferInsertModel, InferSelectModel } from "drizzle-orm";
import { bigint, integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
import { z } from "zod";

export const orderItems = pgTable("OrderItems", {
  id: bigint("Id", { mode: "number" }).primaryKey(),
  createdAt: timestamp("CreatedAt", { mode: "string", withTimezone: true }),
  unitPriceCents: integer("UnitPriceCents"),
  sku: text("SKU_CODE"),
});
export type OrderItem = InferSelectModel<typeof orderItems>;
export type OrderItemInsert = InferInsertModel<typeof orderItems>;
export type OrderItemUpdate = Partial<OrderItemInsert>;
/** A field.timestamp instant in UTC (`YYYY-MM-DDTHH:MM:SS[.fff]Z`): a value already spelled so is kept
 *  as sent, an offset is applied, a zoneless value is UTC and a date alone is midnight UTC.
 *  SQLite/D1 compare timestamps as text, so instants are stored in UTC. Generated. */
function utcIsoTimestamp(v: string): string {
  if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(v)) {
    return v;
  }
  const m =
    /^(\d{4}-\d{2}-\d{2})(?:[Tt ](\d{2}:\d{2})(?::(\d{2})(?:\.(\d+))?)?(?:([Zz])|([+-]\d{2}):?(\d{2})?)?)?$/.exec(
      v,
    );
  if (m === null) {
    return v;
  }
  const t = Date.parse(
    `${m[1]}T${m[2] ?? "00:00"}:${m[3] ?? "00"}.${(m[4] ?? "").slice(0, 3).padEnd(3, "0")}${
      m[6] === undefined ? "Z" : `${m[6]}:${m[7] ?? "00"}`
    }`,
  );
  return Number.isNaN(t)
    ? v
    : new Date(t).toISOString().replace(/\.?0+Z$/, "Z");
}

export const OrderItemInsertSchema = z.object({
  id: z.number().int(),
  createdAt: z
    .string()
    .regex(
      /^(?:\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|02-(?:0[1-9]|1\d|2[0-8]))|(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)(?:[Tt ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:[Zz]|[+-](?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?$/,
      "must be an ISO 8601 timestamp (YYYY-MM-DD[THH:MM[:SS[.fff]]][Z|±HH:MM])",
    )
    .transform(utcIsoTimestamp)
    .optional(),
  unitPriceCents: z.number().int().optional(),
  sku: z.string().optional(),
});

export const OrderItemUpdateSchema = z.object({
  createdAt: z
    .string()
    .regex(
      /^(?:\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|02-(?:0[1-9]|1\d|2[0-8]))|(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)(?:[Tt ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:[Zz]|[+-](?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?$/,
      "must be an ISO 8601 timestamp (YYYY-MM-DD[THH:MM[:SS[.fff]]][Z|±HH:MM])",
    )
    .transform(utcIsoTimestamp)
    .optional()
    .nullable(),
  unitPriceCents: z.number().int().optional().nullable(),
  sku: z.string().optional().nullable(),
});

/** Typed create shape for OrderItem: the insert schema's INPUT (pre-transform) type. A
 * renamed/dropped/misspelt field is a compile error at every `createOrderItem` call site;
 * the schema still validates at runtime. */
export type OrderItemCreate = z.input<typeof OrderItemInsertSchema>;

/** Typed patch shape for OrderItem: every settable field, optional (FR-035 PATCH). A
 * renamed/dropped field is a compile error at every `updateOrderItem` call site. */
export type OrderItemPatch = z.input<typeof OrderItemUpdateSchema>;
/**
 * Metadata constants for OrderItem.
 *
 * Use these instead of magic strings so TS catches typos and refactors stay
 * coherent. Each non-dollar-prefixed key is a per-field object carrying
 * name, label, view, an htmlType where the field's view maps to one, and the
 * RHF-shaped validation rules derived from the field's validator children.
 *
 * placeholder and helpText are NOT emitted — no provider registers an attribute
 * for them, so nothing here could derive one. (htmlType is emitted, but derived
 * from the view subtype; the @htmlType override was removed for the same reason.)
 * useEntityForm still honours placeholder if you add it: this file is generated,
 * hand edits inside it survive regeneration through the three-way merge, and the
 * consumers read this const rather than the metadata. That is the intended way
 * to set it.
 *
 * Typical usage with the metaobjects React form helper:
 *
 *   import { useEntityForm } from '@metaobjectsdev/react';
 *   const form = useEntityForm(OrderItem, OrderItemInsertSchema);
 *   <input {...form.input.id} />
 */
export const OrderItem = {
  $entity: "OrderItem",
  $table: "OrderItems",
  $path: "/order_items",
  id: { name: "id", label: "Id", view: "number", htmlType: "number" },
  createdAt: {
    name: "createdAt",
    label: "Created At",
    view: "date",
    htmlType: "datetime-local",
  },
  unitPriceCents: {
    name: "unitPriceCents",
    label: "Unit Price Cents",
    view: "number",
    htmlType: "number",
  },
  sku: { name: "sku", label: "Sku", view: "text", htmlType: "text" },
} as const;
import type { FilterAllowlist } from "@metaobjectsdev/runtime-ts/drizzle-fastify";

export const OrderItemFilterAllowlist = {} as const satisfies FilterAllowlist;
import type { SortAllowlist } from "@metaobjectsdev/runtime-ts/drizzle-fastify";

export const OrderItemSortAllowlist = {} as const satisfies SortAllowlist;
export type OrderItemFilter = {
  limit?: number;
  offset?: number;
  sort?: string;
  or?: OrderItemFilter[];
  and?: OrderItemFilter[];
};
Evidence: S3: contract name-collision refusal, exit 1, matches expected-error.txt
== S3: contract emitter refuses OpenAPI component name collision ==
exit=1; stderr:
meta: gen failed: [openapi] [ERR_CONTRACT_NAME_COLLISION] the OpenAPI component 'OrderCreate' is both 'acme::contract::Order' (create shape) and 'acme::contract::OrderCreate' (read shape). Rename one, or leave one out with the generator's filter option.

Committed oracle fixtures/contract-conformance/error-name-collision/expected-error.txt:
[ERR_CONTRACT_NAME_COLLISION] the OpenAPI component 'OrderCreate' is both 'acme::contract::Order' (create shape) and 'acme::contract::OrderCreate' (read shape). Rename one, or leave one out with the generator's filter option.

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 4 scenarios driven live against the product
Scenario Result Live Evidence
User runs meta gen with jsonSchemaFile() + openApiFile() on the all-fields model; the emitted JSON Schema (canonical + strict) and openapi.json are byte-identical to the committed FR-022 goldens ✅ pass live s1-contract-emitters.txt (diff -r identical) + s1-openapi.json; focused corpus test 105 pass with Ajv strict / OpenAPI 3.1 validators
User sets naming {columns: pascal, tables: literal} in .metaobjects/config.json and runs meta gen with entityFile(); every generated Drizzle table and column name matches the naming-conformance case… ✅ pass live s2-naming-strategies.txt + s2-orderitem.ts (OrderItems table; Id/CreatedAt/UnitPriceCents/SKU_CODE columns; ShipTo_Street, bill_PostalCode prefixes)
Adversarial: config naming an unregistered strategy (columns: camelCase) is refused when the config is read — nonzero exit, error naming naming.columns and the valid built-ins, and no generated file i… ✅ pass live s2-naming-strategies.txt guard section: exit=2, refusal message listing built-ins and 'registered by the application: none'; output mtimes unchanged by the refused run
Adversarial: the contract emitters refuse metadata whose object name collides with another object's create shape — exit 1 with the exact committed ERR_CONTRACT_NAME_COLLISION message and no output tre… ✅ pass live s3-contract-refusal.txt: CLI stderr matches fixtures/contract-conformance/error-name-collision/expected-error.txt byte-for-byte; out/ absent after the run
  • scripts/ci-local.sh --affected --strict-toolchains
  • scripts/ci-local.sh --affected --strict-toolchains (configured baseline, passed at target commit before this step)
  • bun <worktree>/server/typescript/packages/cli/bin/meta.ts gen in disposable project with jsonSchemaFile() + openApiFile() on fixtures/contract-conformance/all-fields/meta.json; diff -r vs committed expected/ = identical
  • bun test test/contract/contract-corpus.test.ts in server/typescript/packages/codegen-ts (105 pass, includes Ajv strict JSON Schema 2020-12 and OpenAPI 3.1 validation of goldens)
  • meta gen with entityFile() and naming {columns: pascal, tables: literal} on fixtures/naming-conformance/physical-names/meta.naming.json; generated table/column names checked against cases.json oracle
  • meta gen with naming.columns camelCase (unregistered) — refused at config read, exit 2, output mtimes unchanged
  • meta gen with openApiFile() on fixtures/contract-conformance/error-name-collision/meta.json — exit 1, message byte-matches expected-error.txt, no output written
⚠️ **Document** - 1 info
  • ℹ️ spec/roadmap.md:144 - spec/roadmap.md still names 1.2.1 as the target for FR-022's JSON Schema/OpenAPI emitters (line 144 status + target column; line 408 "target 1.2.1"), and line 144 plus contract-emitters.md line 22 still say protobuf ships "1.3". 1.2.1 already shipped (Python-only) without the emitters, and the merged CHANGELOG carries them under the dated but unpublished [1.3.0] and [1.2.4] sections, which contain no protobuf. Correcting the version numbers requires the release-planning decision the later release step owns (adjacent to the declined changelog-consolidation ruling), so it was left for that step.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

* fix(metadata): root-level node resolves a bare @objectref in its own package (#522); one bump rule for a new attribute (#523)

* chore(site): refresh payload fixture count
…rop-column rollback (#526)

* fix(migrate): refuse a column drop under an unowned view; SQLite down re-adds the column

A live view the tool does not own (@Unmanaged, or outside the scoped schemas) that still
reads a dropped column now blocks the drop at plan time, naming the view
(--allow drop-column-read-by-view to proceed). The SQLite/D1 down for drop-column re-adds
the column instead of writing a TODO. Docs note: edit an @SQL body when removing a column
it reads.

* no-mistakes(review): Omit non-constant defaults in SQLite drop-column rollback

* no-mistakes(test): Block drop-column read by unowned or hand-made views

* no-mistakes(test): Fix allow-hint test typecheck; unowned-view block verified live

* no-mistakes(document): Docs current; SQLite rollback default omission documented in migrations-and-drift.md.
… check (#528)

* fix(metadata): exempt @SQL views from the duplicate-column check in every port

* no-mistakes(review): Narrow SQL-view column exemption to read-only objects; gate wording

* no-mistakes(review): Refresh conformance fixture count to 426

* no-mistakes(document): Refreshed collision error-code description; other docs already current
… models (#530)

* feat: generated record models enforce cross-field validators in every port

validator.comparison/requiredWhen/presentIff/atLeastOne are now enforced by the
full create model (Zod refinement, Bean Validation, IValidatableObject, Pydantic
model_validator), mirroring the DB CHECK semantics. PATCH models and CHECK
emission are unchanged. Gated by validation-conformance cross-field cases.

* no-mistakes(review): Enforce cross-field rules on TPH subtype create in TS, Java, Kotlin

* no-mistakes(review): Fix C# inherited Validate, TS array skip, behavioral tests

* no-mistakes(review): Fix C# decimal/double comparison and Python array skip

* no-mistakes(review): Parenthesize Kotlin cross-field getter; behavioral wrap test

* no-mistakes(review): Python comparison rejects unorderable timestamps as validation error

* no-mistakes(review): Replace TS zod cross-field source-text tests with execution

* no-mistakes(review): Skip cross-field rules on server-owned fields in JVM/C#

* no-mistakes(review): Import KotlinCrossFieldRules in ejectable Kotlin generators

* no-mistakes(document): Updated stale cross-field gap note in docs/1.0-readiness.md to point at the new enforcement docs. Author already updated CHANGELOG, features/entities.md, the FR-036 spec, the authoring skill, the validation-conformance README and CONFORMANCE.md.
* feat: a project's own provider class, wired in every port and loaded by every command

A project that declares its own vocabulary (a new subtype, or attributes on a
core type) writes a provider class in each language whose tools load the
metadata and names it once in that port's config. Every metadata-loading
entry point now loads it.

- TypeScript: export, deps, fmt, types and upgrade now load the providers
  in metaobjects.config.ts; verify and prompt-snapshot report a config that
  fails to load instead of continuing without its providers.
- Python: fmt reads configured providers (and gains --config); verify's
  --provider adds to the configured list instead of replacing it. The loader
  keeps a file whose only parse errors are unknown subtypes, so its unknown
  attributes are reported too.
- C#: new csharp.providers [{assembly, type}] list in .metaobjects/config.json,
  loaded by gen, verify and fmt (ProviderLoader).
- Java/Kotlin: Maven plugin <providers> list for generate/verify/fmt/editor,
  Spring MetaDataTypeProvider beans composed into the auto-configured loader,
  LoaderOptions.setProviders, and a providers parameter on metadata-ktx.
  ERR_UNKNOWN_ATTR is reported after ERR_UNKNOWN_SUBTYPE, as in the other ports.
- Conformance: provider-custom-vocabulary-success and
  provider-custom-vocabulary-missing-provider-fails, run by every port.
- Skills: metaobjects-authoring teaches it with a worked reference per
  language; metaobjects-codegen notes how a generator reads the attribute.
- Docs: extending-with-providers.md has a worked example per language and
  drops the false SPI auto-discovery claim; port pages and recipe updated.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Dedupe export providers, refuse bad C# assemblies, tighten tests

* no-mistakes(document): Fixed three stale provider-loading docs: own-your-codegen.md provider table (Java SPI claim, C#, TypeScript command list), server/java/README.md (ServiceLoader wording), and the recipe's per-language section now points to extending-with-providers.md instead of duplicating wiring facts. No code or tests touched; nothing unresolved.
…properties (#531)

* fix(csharp-codegen): an extending entity carries its parent's properties; fix test timing flakes

A C# entity that extends another skipped the inherited fields but its class
declaration never named the base, so the parent's properties appeared nowhere.
A concrete parent is flattened onto the child (each concrete entity owns a table
with all its columns; class inheritance between mapped entities would be an EF
TPH/TPT hierarchy). An emitted abstract shape is named as the base.

Flakes fixed at the cause: DependencyCliTests changed the process-wide cwd outside
the serial collection, racing GenCommandTests; codegen-ts compile tests run under
a 30s timeout set in one helper instead of bun's 5s default.

* fix(codegen): skip cross-kind cross-field comparisons in every port; executed Patch check; TPH form rule test

A validator.comparison between fields of different kinds (e.g. date vs timestamp) is now
skipped in Java, Kotlin, TypeScript and Python as C# already did, instead of a 500
(ClassCastException), a string compare, or a TypeError. Adds the shared
comparison-across-kinds-is-skipped conformance case, replaces the Java Patch source-text
comparison with an executed check, and adds a TPH subtype form test for a cross-field rule.

* fix(codegen): eq/ne between same-subtype uuid, uri and inet fields stays enforced; review fixes

Code review of the cross-kind skip found that equality on identifier-like fields was dropped
along with ordering. Restores it in every port, adds shared uuid cases, corrects stale C#
comments, and documents the EmitClassDeclarationLine seam change.

* chore: simplify pass; sync owned template copies; C# date eq no longer rejects across kinds

* no-mistakes(review): Per-file compile timeout; @localtime temporals skip cross-field comparison

* no-mistakes(review): Apply compile timeout to tph-cross-field test

* no-mistakes(review): Skip C# eq/ne across differing CLR types

* no-mistakes(document): Updated entities.md cross-field section for kind-based comparison rule; one follow-up left.

* no-mistakes(document): Document comparison kind rule in authoring skill

* fix(codegen-kotlin): cross-field rules no longer depend on KotlinTypeMapper

An ejected copy of KotlinCrossFieldRules compiles standalone, so it cannot
reference KotlinTypeMapper. Decide the native shape from @localtime and
@lenient directly.
…inputs (#532)

* feat(explorer): the explorer.json data spine (P0)

The data a model explorer reads, built from port-neutral inputs only:

- `meta export --effective` writes the effective canonical JSON: every member and
  attribute a node inherits through `extends` is materialized on it.
- `meta verify --format json` carries `requirementLedger`, one row per requirement:
  digest, each @implementedBy link with the node the gate resolved it to, the
  findings against its path, and a clean/warn/error verdict from the gate.
- `meta gen` records the node a per-entity file was rendered from on its
  `.hashes.json` entry ({ hash, generatedBy, sourceNode }); `perEntity` stamps
  `EmittedFile.sourceNode`. Not named `generator`, which on the JVM is an
  ownership claim the orphan sweep acts on; JVM owner fields are preserved.
- `@metaobjectsdev/docs-site` exports `buildExplorer` / `serializeExplorer`:
  nodes, typed edges, ledger, generated files per node, derived slices
  (package, requirement subtree, prompt). Deterministic bytes.

Gated by the new fixtures/explorer-conformance/ corpus (expected.json checked
byte for byte; the committed inputs re-derived from the CLI). No metamodel
vocabulary change; metamodelVersion does not move.

* no-mistakes(review): Fix explorer id collisions and per-node ledger diagnostic matching

* no-mistakes(review): Keep diagnostic requirement node in WeakMap side table

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Resolve ::Name refs in explorer builder; compact seed
* feat(metadata): refuse two providers claiming one attribute name on a node type (#527)

The registry now records which provider registered each attribute and refuses a
second provider's claim at composition, in TypeScript, Python, C#, Java and Kotlin.

- Same (type, subType): ERR_PROVIDER_ATTR_CONFLICT, message now names the owner.
- Shared <type>.base root or a descendant subtype: new ERR_PROVIDER_ATTR_SHADOW,
  checked in both directions so registration order does not matter.
- The same provider repeating its own name, sibling subtypes, and registration
  outside a provider's turn stay legal. A refusal leaves nothing in the registry.
- The rule is scoped to one node type so the JVM registry's metadata.base chain
  does not make Java stricter than the other ports; the shipped core has no collision.
- meta types --detail prints the registering provider; JSON carries `provider`.
- ADR-0062, extending-with-providers docs, authoring skill, CHANGELOG, and shared
  provider-composition fixtures (attr-shadow-*, attr-ownership/).

No wire-name attribute is added.

Fixes #527

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Close Java extend shadow gap; refuse duplicate common attrs

* no-mistakes(review): Refuse common-vs-per-type attr collisions; Java @description single owner

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(document): Fixed three stale doc spots: Java manifest comment, provider-composition README code count, stray CHANGELOG blank line. Docs state the full ADR-0062 rule. No unresolved findings.
* feat(docs-site): the model explorer site, built by docsSiteFile()

docsSiteFile() now builds a model explorer by default: a main page that says what
the software does (count tiles, feature and quality cards with roll-ups), a model
map with slices and colour-by, a page per object, projection, report, prompt and
requirement with a one-hop mini-map, the traceability matrix, a trace from a
requirement to its generated files, the API index and a gaps page. Every page is
drawn from explorer.json, which the generator builds in the same run from the
loaded model, the requirement gate's ledger, the files the run wrote and the
routes it mounts (it runs after the other generators wherever it is listed).

Declared status is a filled chip with its glyph, gate verdicts are outlines,
roll-ups are bars, and no colour reports a test result. Pages carry Pagefind
markup, work at phone width, depend on the model alone so verify --codegen holds
them, and are link-checked. meta eject docs-site copies the explorer theme beside
the classic one. site: "classic" keeps the earlier site.

* fix(docs-site): explorer review fixes: narrowed runs, unrecorded routes, page-path collisions, textRef guard

- ctx.runOutput widens a run narrowed to some entities with the manifest, and drops
  records for generators no longer declared or files no longer on disk.
- No routes in the run leaves explorer.json's api section out, so the site says the run
  recorded none instead of claiming none are mounted.
- A requirement ledger that throws warns and leaves the ledger out.
- An object named index gets index.node.html; the empty package's pages live under -root;
  writing one page twice throws.
- readPromptTexts refuses an absolute or .. @textref.
- Named constants for the disposition and dataGrid attributes.

* refactor(docs-site): share the scratch build and owned-theme lookup between the two sites

simplify pass: one buildInScratch()/ownedSiteDirs() for the classic and explorer paths,
one requirementLedger closure in verify, body templates read once per build, and the
explorer's edge sort keys each edge once. Output is byte-identical.

* docs(explorer-site): name the page path for an object called index and for no package

* no-mistakes(review): Fix explorer anchors, out-of-tree runOutput, structured unclaimed node

* no-mistakes(test): Allow structured node key on unclaimed-object ledger rows

* no-mistakes(document): Docs checked against the P1 explorer change. One stale fact fixed in docs/features/explorer-data.md: the builder now takes an optional fourth input (routes), so "three inputs" no longer holds. Every other doc touched by the change (CHANGELOG, cli.md, own-your-codegen.md, requirements.md, explorer-site.md, docs-site README, the typescript-docs skill reference, docs/README.md) already matches the code. Spot-checked the classic-theme warning, the Pagefind filter markup, the `/` shortcut, the URL params, and the `node` field in requirement-payload.ts.

* docs(explorer-site): say why Pagefind results resolve under a sub-path

Pagefind 1.x derives its base URL from where pagefind.js loads; the explorer loads it from the
site root, so result links carry the serving path. Checked by serving an indexed site from a
sub-path: results link under it and load.

* no-mistakes(review): Scope explorer gate findings per node, split lint, match undecided count

* test(cli): type explorer fixture ledger diagnostics with message

The typecheck gate failed: the local LedgerRow diagnostics type lacked
message, which the verdict assertion expects. Test-only fix.

* no-mistakes(document): Docs current; explorer-site.md updated for verdict, advisory and out-of-tree rules.
…onventions (#535)

* feat(metadata): schema-naming, duration and cross-field vocabulary in every port (metamodelVersion 1.3)

Registers the 1.3 vocabulary in all five ports, with the loader checks and
registry-conformance coverage:

- field.duration, a fixed-length span of time.
- validator.exactlyOne (@fields, two or more). It replaces atLeastOne @max,
  which is removed with no shim.
- @condition (attr.expression) on all five cross-field validators.
- @constraintName on validators and on field.enum.
- @flattenedColumnPrefix on a flattened field.object.
- @sequenceStart and @sequenceName on identity.primary.
- @maxlength on field.enum, plus the enums.maxLength project setting.
- The upperFirst column naming rule.

Every port's config reader also reads wire.durations (native by default, or iso)
beside decimals and nullMembers.

ADR-0023 Amendment 1 records why each new attribute cannot be computed, and
each registered description points to it. The loader now checks flattened
member columns for collisions.

* feat(migrate-ts): schema conventions, named CHECKs and key renames

- migrate.conventions names the database objects no code addresses. efcore
  is a reference preset.
- migrate.checks.skipRedundant leaves out CHECKs the column type already
  enforces.
- Validators emit CHECKs:
  - with a declared @constraintName
  - with a @condition, as NOT (cond) OR rule
  - for exactlyOne, as num_nonnulls(...) = 1, or a sum of presence tests on
    SQLite and D1
- Identity sequences (@sequenceStart / @sequenceName) are emitted and read
  back. A failure to read them is reported instead of being swallowed.
- A constraint or index whose only change is its name is renamed in place on
  Postgres.
- A key that changes both its name and its kind is renamed first, then
  promoted or demoted, in the same migration (#285).
- An FK whose target is not a unique key:
  - Postgres and D1 refuse it.
  - SQLite only warns, because it accepts the CREATE TABLE. `meta verify --db`
    reports the same.
- An enum column whose members are longer than its length is refused by name.

* feat(codegen): duration wire, exactlyOne and @condition in every port's generated code

- field.duration is mapped natively in every port: TimeSpan, java.time.Duration,
  timedelta, and a string in TypeScript.
- wire.durations=iso makes every port write one ISO-8601 form, and accept it
  as filter operands.
- A malformed duration filter operand now returns 400 invalid_filter_value in
  Java and Python, where it used to throw.
- The generated create models enforce validator.exactlyOne, and check any rule
  that has an @condition only when the condition is TRUE under SQL
  three-valued logic. Ports:
  - Zod superRefine
  - IValidatableObject
  - Bean Validation
  - KotlinCrossFieldRules
  - Pydantic model_validator
- Names artifacts carry a flattened value object's member columns, and no
  longer carry a column for the field itself.

New conformance:
- fixtures/duration-wire vectors
- an api-contract duration/ sub-corpus, generated lane, in all five ports
- a Shift entity in the cross-field validation corpus: 14 cases for
  exactlyOne and @condition

* docs: schema conventions, duration and cross-field validators

- CHANGELOG entries for metamodelVersion 1.3.
- Updated feature docs: entities, field types, migrations and drift, metadata
  sources, api-contract, physical naming.
- Updated conformance counts.
- Agent-context skill references.
- Regenerated site reference and example payloads.
- The requirements ledger pin rises to 150 for the two new requirement nodes
  (fieldDuration, validatorExactlyOne).

This lands the work from feat/schema-conventions on main as a few logical
commits, with the review fixes applied, and supersedes that branch.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Refit FKs under their renamed names during key demotion

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Refuse non-ISO duration literals in conditions and @equals at load

* no-mistakes(review): Anchor C# duration literal regex with \z

* no-mistakes(review): Correct metamodel fixture count to 449

* no-mistakes(test): Assert loader refuses non-ISO duration literal in migrate test

* no-mistakes(document): Fixed stale duration wire docs and agent-context mirrors. The 449 fixture count was already correct. Unaudited: smaller CR docs.
…erify gains the deps mode (FR-023 S4+S5) (#536)

* feat(java): Spring runtime loads the committed dependency snapshot; verify gains the deps mode

FR-023 Phase 2 slices S4 and S5. metaobjects:generate ships the lock and snapshot on the
classpath, the Spring application loader loads them with build-time scoping and error codes,
and metaobjects:verify -Dmeta.verify.mode=deps runs the shared expectCheck corpus arm.

* no-mistakes(review): Load snapshot for deps-only Spring apps; single artifact read

* no-mistakes(test): Add stale-lock Spring test and Node-synced snapshot e2e test

* no-mistakes(document): Docs updated for Java/Kotlin deps verify mode and Spring snapshot load; one gap left in agent-context skills.
…ue objects (#538)

* fix(codegen-ts): bind flattened field.object to per-member Drizzle columns (#524)

* no-mistakes(review): Flatten sibling surfaces; keep TPH subtype jsonb; skip value objects

* no-mistakes(review): Flatten OpenAPI, doc shapes, UI descriptor for flattened fields

* no-mistakes(review): Propagate parent write protection to flattened members

* no-mistakes(review): Flatten form and grid; keep derived member columns

* no-mistakes(review): Use flat fields in agent/ui.md lookup

* no-mistakes(review): Compare TPH base fields via flat surface

* no-mistakes(review): Add flattened.ts to eject engine surface manifest

* no-mistakes(review): Name flattened int-enum codecs from flat key

* chore: sync owned template copies for flattened storage (#524)

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(document): Updated three owner docs for flattened storage: source-kinds, api-contract, field-types. No unresolved gaps.
… C# (#537)

* feat(python,csharp): check a shared model against its publisher (FR-023 Phase 2, S2+S7)

metaobjects deps check / verify --deps (Python) and dotnet meta verify --deps (C#)
re-resolve each dependency's path, hash the publisher's artifact and compare with
deps.lock.json: current, drifted or unresolved, with ERR_DEPENDENCY_UPSTREAM_DRIFT.
Both run the 11 expectCheck cases of fixtures/dependency-conformance.

* no-mistakes(review): Fix C# deps docs/test exit; Python non-UTF-8 manifest unresolved
#539)

* fix(codegen-ts): derived flattened parent produces no flat member keys

* no-mistakes(document): Updated field-types.md TypeScript flattened section: derived flattened field owns no columns and exposes no flat keys. CHANGELOG already covered the fix. No other stale docs found.
* feat: publish a shared model from Java, Kotlin and C# (FR-023 S8, S9)

Adds a shared-model generator to the Java/Kotlin Maven goals and to the C# CLI,
each ejectable, byte-identical to the TypeScript publisher and gated by the
shared-model publish corpus. The registry now lists java, kotlin and csharp.

* fix: address review of shared-model publishers

C#: read the project <Version> property only (not a PackageReference's), resolve Files against an input root so verify --codegen matches gen, and classify any re-load failure as non-core-vocabulary. Java/Kotlin: a blank version arg falls back to the project version.

* refactor: simplify shared-model plumbing in the Java publishers

The Maven mojo supplies the project version as a default 'version' arg, so the ProjectVersionAware hook goes away; path resolution and closure check tidied.

* no-mistakes(review): Reject MSBuild-expression versions; cover mojo version/files args

* no-mistakes(document): Fixed publish-scope docs; agent-context skill left for S10.
* feat: maven and nuget dependency transports for meta deps sync/check (FR-023)

A shared model published as a jar or nupkg is now a declared dependency:
{ name, maven: groupId:artifactId, version, dir? } and { name, nuget, version, dir? }.
Resolution reads the local Maven repository (honouring MAVEN_REPO_LOCAL,
maven.repo.local and settings.xml) or the NuGet global packages folder
(NUGET_PACKAGES), never downloads, and names the GAV or package id plus the
fetch command when the package is missing. Java, C# and Python config and lock
readers accept the new keys.

* no-mistakes(review): Harden zip-slip guard, normalize packaged dir, update deps help

* no-mistakes(test): Use PACKAGED_MODEL_DIR constant in deps help text

* no-mistakes(document): Updated README dependency transport row and roadmap FR-023 line; llms mirrors left for release cut

* no-mistakes(document): Fixed stale npm/python-deferred claim in spec/roadmap.md FR-023 line; README, CLI doc, metadata-dependencies and CHANGELOG already match the change.
* docs: close out FR-023 Phase 2 (shipped matrix, skills, agent-context fixtures)

Rewrite the feature page's Phase 2 section as the shipped per-port matrix, name what stays deferred, fix stale transport wording in the port docs, and teach the Java/Kotlin/C# publish paths, the deps checks and the maven/nuget transports in the verify, codegen, authoring, audit and capability-sheet skills. Agent-context expected copies regenerated with the repo generator.

* no-mistakes(review): apply reviewer inline fixes
…d that adopted artifacts are used (#550)

The metaobjects-audit skill asked whether a verify gate was wired, never whether it
blocked, and it did not join unused generated artifacts to the hand-written pages that
replaced them. Add the checks and the remedy for each gap:

- Axis F: does the gate block (exit code propagates, green now with a ratchet for a
  tolerated count, every deploy path passes it); score BLOCKING / RUNS BUT DOES NOT
  BLOCK / ABSENT; no CI is NO whatever untracked hooks exist, with a per-port snippet.
- Axis F2: consumed / emitted per generator kind, and a generated-and-bypassed finding.
- Prompts: unlinked payload fields, linked / (linked + unlinked copies).
- Requirements: ledger staleness from git, --require-implementers, unwired implementers.
- Owned-copy check in the Java, Kotlin, C# and Python references, one total.
- Phase 1b shape-coverage census; scorecard 'used as described' line; re-runs mark
  earlier findings fixed / open / deferred; JSON top-level fields documented.

Conformance fixture copies of the skill are updated to match.
…d check, stale-copy and include-only fixes (#551)

Four fixes from the audit skill's first run on an adopter project:
- drift signature 13: an enum member or event name typed as a hand string beside the generated constant
- axis G3: every write to a status-like enum column is conditional on the current value; the fix uses the port's ORM with generated constants, never raw SQL
- an owned generator copy with lines of its own is not proof of a customization: DIFFERS also marks a copy stale by version, so check history and report lines behind and lines of the project's own separately
- exempt include-only templates from the byte-identical template duplication rule

Per-port files and the regenerated agent-context conformance goldens updated to match.
…hem by consumer key (#553)

* feat: let a shared-model publisher include its requirements

A publisher can now opt in to exporting the selected requirement.*
nodes alongside its shapes (`requirements: true` in TypeScript, the
`requirements` arg in Java and Kotlin, `Requirements` in C#). The
default is unchanged: shapes only. template.* is never exported.

The closure check now follows a selected requirement's @implementedBy
claims (owner segment, in the requirement's effective package), so an
exported requirement cannot claim a node the export leaves out.

The shared-model corpus gains four cases and a pinned artifact,
acme-common-v1-requirements.json, which the dependency corpus will
consume. Python has no publisher; its serializer arm now takes every
node the manifest lists, not only objects.

* feat: let a consumer inherit a dependency's requirements (TS, Python)

A new `requirements.inherit` key in .metaobjects/config.json names the
dependencies whose requirements join this project's ledger. A pattern
counts only when it names the dependency's package (the scope.include
rule; `**` names nothing). It is a separate key from scope.include
because that one also selects a package for code generation.

An imported requirement not named there is loaded, so an overlay of it
resolves, and is otherwise left alone: the requirement gate, its
summary and lint, and the requirement-tests generator skip it. An
imported requirement, inherited or not, never switches object coverage
on, the rule a shipped library already follows.

A new top-level requirement declared into a dependency's package is
now refused with ERR_DEPENDENCY_PACKAGE_NOT_OWNED, as an object is.

The dependency corpus gains seven cases and a ledger arm
(expectLedger, expectCoverageMeasured).

* feat: let a consumer inherit a dependency's requirements (Java, C#), docs

Java and C# read `requirements.inherit` and apply the same ledger rule
as TypeScript and Python: a dependency's requirement joins the ledger
only when the key names its package, an imported requirement never
switches object coverage on, and a new requirement declared into a
dependency's package is refused with ERR_DEPENDENCY_PACKAGE_NOT_OWNED.
Both read the ledger from the dependency set already on the loaded
root, so the requirement gate and the requirement-tests generators
(JUnit, Kotlin, C#) need no new arguments. Kotlin uses Java's gate.

Every port's dependency-conformance runner asserts the ledger arm
through the gate's scan and through the requirement-tests walk.

The `meta gen --list --probe` count for requirement-tests now uses the
ledger too.

Docs: the publisher's `requirements` option, a new "Inheriting a
dependency's requirements" section, the corpus case schema and counts,
and a CHANGELOG entry.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Filter requirement docs and test identities by ledger

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(document): Docs: publish requirements opt-in, inherit key in port pages
…ategies (#554)

* feat: replay the C# app session's fixes, hooks and naming strategies onto main

Brings the work from a downstream C# application session onto main, minus the
reserved-vocabulary changes (they land separately, with the Java, Kotlin and
Python registry catch-up):

- C# EF model fixes: @default, assigned keys, TPH subtype fields and
  references, nested value objects, constraint names and principal keys, the
  int-backed enum write refusal, -sis plurals, a thread-safe node cache, a
  split OnModelCreating, the index vocabulary and @description, and
  @sequenceStart with a start-only change that never restarts.
- C# generator hooks: one protected virtual per emitted line on the DbContext,
  entity and names generators. The golden files are main's pre-hook output
  plus only the lines the EF model fixes add, each named in the test.
- The pascal column rule and application-registered naming strategies in
  every port (ADR-0058 Amendment 1), with a test-only reset.
- Int-backed enum arrays load in every port.
- An enum's @default on an untouched record; generated-name collisions scoped
  to what carries them; doc pages keyed by package; @Schema in the Python
  runtime; Kotlin index @using/@where; Java create defaults.
- Port-scoped registry attrs ("ports"), with @dbSetName C#-only.

Completed on main for every port:

- @sequenceStart never moves the counter: meta migrate writes
  ALTER SEQUENCE ... START WITH n only (no setval). New persistence migration
  scenario sequence-start-change-keeps-counter.
- @Schema reaches every mapping: TS Kysely and Drizzle, Java OMDB, Kotlin
  Exposed tables. The canonical model gains LedgerEntry and an archive-schema
  ArchivedLedgerEntry of the same table name; new query scenario
  schema-qualified-same-name (Postgres).
- Java and Kotlin create defaults: a string default is a literal unless it is
  a database expression (shared isSqlExpressionDefault), escaped correctly;
  the Java switch uses the subtype constants.
- New api-contract sub-corpus enum-default/, generated lane in all five ports.
- Java/Kotlin api docs default to the package layout in the eject test.
- Kotlin compile gates leave out the IntEnumArray controller and repository
  until enum arrays get an Exposed array column (KNOWN_GAPS.md).
- Docs: CHANGELOG upgrade notes, CONFORMANCE counts and per-port status,
  api-contract "Defaults on create", regenerated metamodel docs.

Conflicts resolved toward main's reworks: validator.exactlyOne, the native
duration wire default with wire.durations "iso", the provider field in
meta types JSON, and MappedBaseClause for the entity base class (the
duplicate helper is dropped, the DbContext half is kept). The C# generator
that wrote expression indexes as SQL is left out: schema DDL stays with
meta migrate (ADR-0015).

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Pin schema writes, share string escapers, fix rules

* no-mistakes(test): Share Kotlin string escaper; refresh site outputs

* fix(csharp-tests): find golden files from the repo root, not CallerFilePath

A CI build (CI=true turns on ContinuousIntegrationBuild) maps source paths
to /_/, so the [CallerFilePath]-based golden directory did not exist on the
runner and the three golden tests failed with DirectoryNotFoundException.
Use CorpusPaths.RepoRoot() like the other tests in this project.

* no-mistakes(review): Correct CHANGELOG Kotlin enum array wording

* no-mistakes(document): Docs current; removed two "Ruling:" labels from new C# doc comments.
* feat(registry): vocabulary only some ports implement is cross-port, marked implementedIn

The 13 generic view.* controls (with view.textarea @rows and the view.image
attrs) and object.* @object used to be carved out of the registry manifest as
presentation-only or native-binding vocabulary. They are now in the shared
contract in every port, marked rather than removed:

- implementedIn names the ports that act on an entry so far (["typescript"]
  for the view controls, ["java"] for @object). Every other port registers it,
  loads it strictly and ignores it; an unregistered attr on it still fails.
- ports names the ports a language-specific attr belongs to: @dbSetName
  ["csharp"] and @objectadapter ["java", "kotlin"].

All five ports register the metaobjects-ui-web provider and @object /
@objectadapter, emit implementedIn in their manifests, and byte-match
expected-registry.json. Java and Python gain the ui-web provider and the
spec-reader support for implementedIn; Java's extends-value mapping accepts
a double-valued attr. Three conformance fixtures gate the loading behaviour
(view-kind1-controls, object-kind1-jvm-binding-attrs,
error-kind1-view-unregistered-attr).

meta types marks these entries in its text output and carries implementedIn
and ports in --format json. The json tsOnly field is kept, derived from
implementedIn, and deprecated; it is removed in 1.4.

The metamodel docs, site reference pages and agent-context fixtures are
regenerated, and docs/CONFORMANCE.md and the fixture counts are updated.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Restore CI-safe golden path in GeneratorGoldenTests

* no-mistakes(document): Docs already updated on branch for implementedIn, tsOnly, counts (454) and carve-out removal. One stale historical sentence in registry README fixed. No unresolved gaps.
* chore(release): 1.3.0 (Maven 8.3.0) across npm, PyPI, NuGet and Maven Central

Bump the 14 npm publish candidates, PyPI, NuGet and the Maven reactor in
lockstep, regenerate bun.lock and the site payload, restamp the llms
mirrors, and promote the CHANGELOG [Unreleased] section to [1.3.0] with an
upgrade summary. @sequenceStart is described as not moving an existing
counter in 1.3.0, with a forward-only move planned for a later release.

* no-mistakes(document): Scope @sequenceStart counter promise to 1.3 in C# port doc
…it --dialect (#557)

* feat(agent-context): working loop first, universal requirements pages, init --dialect

The always-on file meta init scaffolds now opens with the whole loop for the declared
stack: generate (one step per declared server, plus the web client), schema (first
migration, apply-pending, rename and allow flags), requirements, and the verify commands.
It drops from about 19 KB to about 5 KB; the principles move verbatim to
metaobjects-codegen/references/principles.md and the port-sync and upgrade text to
metaobjects-verify/references/upgrading.md. It no longer tells agents to read SKILL.md by
path.

- Requirements reference pages install in every stack (the concern gate observed nodes at
  init time, before a new project had any). meta gen and meta verify say when a scaffolded
  context lacks them.
- meta gen advises wiring requirementTests() when requirements exist and nothing tests them.
- meta init --dialect sqlite|postgres|mysql|d1, dialect-aware next steps, and a shorter
  scaffolded config comment carrying the generator import line.
- migration.md documents --rename-column, --rename-table and --allow.
- Skill trigger evals gain mid-task cases.
- meta gen --list off a terminal is unchanged: its TOON default is parsed by tools and skills.

* no-mistakes(document): docs: document init/gen advisories, fix conformance count

* docs(agent-context): move the renames section after the migration workflow list

The section split the numbered workflow, leaving step 3 (Apply) detached after it.
Conformance fixtures regenerated.

* no-mistakes(document): Document init --dialect in CLI README
… across all five ports (#558)

* feat(metadata): rename @dbSetName to @collectionName and add the naming.collections pluralizer

Renames the unreleased @dbSetName to @collectionName (no alias) and registers it in
every port on object.entity, object.projection and object.report, marked
implementedIn csharp: the generated C# context takes it as the DbSet property name.
A project chooses the pluralizer an object without one takes its name from with
naming.collections in .metaobjects/config.json (standard by default, none, or one
the application registers); every port reads the key and refuses an unknown name.

The shared fixture object-port-scoped-attr-dbsetname becomes object-collection-name,
and object-port-scoped-attr-object-adapter keeps the port-scoped marker covered.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Read naming.collections in TS, keep it in probes, add tests

* no-mistakes(document): Document @collectionName implementedIn and pluralizer
…ify (#559)

* fix: uuid input on Postgres routes, renamed-column view warning, quieter advisories

Building one large app on the generated stack turned up six defects:

- Generated routes on Postgres answered 500 for ordinary bad uuid input.
  `?search=` ILIKEd a uuid FK (no `uuid ~~* text` operator); a malformed uuid
  `:id` reached Postgres as a literal. The search now skips formatted string
  rules, `coerceIdForColumn` rejects a malformed uuid (400 invalid_id), and
  the generated Zod schemas check a field.uuid's shape (400 validation).
  A new integration test runs the stock `routesFile()` output against
  Postgres with uuid keys and a uuid FK.
- `meta migrate` now warns when a view still names a column the migration
  renames, since the recreate then fails at apply.
- The index-name examples are table-scoped and say names are schema-wide;
  the list-hook name rule is stated correctly everywhere.
- `meta verify` advisories: comments are skipped, money-float needs a
  money-named operand, UI `.reduce` sums are not aggregates, unindexed FKs
  are one finding, and a structured run does not repeat findings on stderr.

* no-mistakes(document): Sync docs for 1.3.0 smoke-test fixes
…#560)

* feat(metadata): walk an identity.reference backwards in an origin @via hop

An origin @via hop may now walk an identity.reference backwards, from the entity it
targets to the entity holding it, named by the holder's collection name in lower
camel case (@collectionName when declared, else the project's pluralizer). The hop
is to-many, and two references answering one name are refused with
ERR_AMBIGUOUS_PATH; a declared relationship or reference of the same name still
wins. TypeScript, C#, Java (Kotlin through it) and Python implement it, gated by the
shared fixtures origin-reverse-reference-hop, origin-reverse-hop-collection-name and
error-origin-reverse-hop-ambiguous.

* no-mistakes(review): Fix reverse-hop message, doc and Java isAbstract dup

* no-mistakes(review): apply reviewer inline fixes
…ct aggregates (#561)

* docs(agent-context): route report wording to object.report before @SQL

The meta init agent guide gains one rule: a grouped total, dashboard number or
read-only report view is an object.report over dimension.* / measure.*, with a
hand-written @SQL view body as the last resort. The metaobjects-authoring
routing table sends report, dashboard, totals, GROUP BY and per-month wording to
declaring-reports.md first, and the @SQL sections of read-views-and-projections.md
and sources.md point an aggregating body at it and say what @SQL is for.

* fix(codegen-ts): emit view columns fed by a reverse identity.reference @via hop

An origin @via hop that walks an identity.reference backwards (#560) loaded, but the
projection view emitter resolved hops only through relationships and forward references
and silently dropped the aggregate and first columns from CREATE VIEW. It now falls back
to the same reverse-hop lookup the loader uses and joins from the reference holder.
Gated by a Postgres test that migrates, inserts and reads the view.

* fix(metadata): refuse origin.aggregate sum/avg/min/max over a value-object field

@Of naming a field.object (flattened or jsonb) loaded and emitted SUM(<field>), a column
that does not exist. All four loaders (Kotlin through Java) now refuse it with
ERR_INVALID_ORIGIN: a value object is several columns or a document, and summing a
Money-shaped value would add amounts in different currencies. count is unaffected.
Gated by the new error-origin-aggregate-value-object conformance fixture.

* chore: declare non-production paths for no-mistakes triage

Fixtures, the metamodel spec and its generated per-port copies, the generated reference
site and the showcase payload.

* fix(java): guard a missing @agg before the value-object aggregate check

List.of(...).contains(null) throws, so an origin.aggregate with no @agg over a
resolvable @Of crashed the loader instead of reporting the missing attribute.

* no-mistakes(document): regenerate showcase payload fixture count
…rs (#562)

* feat(metadata): relative dates and case/now expressions in every loader

Load and validate, in TypeScript, C#, Java (Kotlin through it) and Python:

- a relative date ({ now: ... }) in a projection's and an origin.first /
  origin.aggregate's @filter, shape-checked where it is declared;
- case and now in an origin.computed expression, and a ref in it that names
  another of the projection's own fields (never itself, never an aggregate)
  before a base field.

error-relative-date-origin-host and error-relative-date-wrong-host are
removed: those hosts now accept the value. New fixtures:
projection-filter-relative-now, origin-filter-relative-now,
origin-computed-case-over-joined, error-origin-computed-case-mixed-types.

* no-mistakes(review): Fix case/now expression checks in all loaders

* no-mistakes(review): Tighten expression keys and relative-date types

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Reject fractional literals beside integer-backed fields

* no-mistakes(document): Fixed stale expression-grammar docs: error-code entry and @condition refusal note.
* feat(reporting): read a flattened value-object member in @Of, never mixing its units (FR-044 R12)

A dimension's or aggregate measure's @Of may name Entity.field.member, a member
of a value object stored with @storage: flattened. The report reads the member's
own column (amount_amount, amount_currency). A report that sums, averages or
takes the min or max of a numeric member must group by every non-numeric member
of the same value object, so amounts in different currencies are never combined.
jsonb members, unknown members and deeper paths are refused at load. The Cube
exporter refuses member references.

Loader rules and report-shape derivation in TypeScript, C#, Java and Python,
with shared conformance fixtures for the positive case and each refusal.

* feat(reporting): add measure.derived arithmetic over measures and grouped dimensions (FR-044 R13, TypeScript)

* feat(reporting): measure.derived in C#, Java and Python; docs and gates (FR-044 R13)

Ports measure.derived (M11 @expr validation, R13 dimension operands, the
nullable-decimal column type) to the C#, Java and Python loaders, so all four
loader ports pass the shared derived and value-object fixtures.

Also:
- docs: reporting.md, the authoring skill references, the FR-044 spec (R11
  amendment) and an FR-037 R5 note; CHANGELOG under Unreleased.
- a measureDerived requirement, with the requirement harness regenerated.
- fixture counts (490) in AGENTS.md and CONFORMANCE.md, the site payload and
  the site reference regenerated.
- cube-members.ts: imports moved above valueObjectMemberError, so the eject
  scanner sees every import and the ejected cube template compiles.
- Java: a measure whose @agg is outside the closed set no longer throws an NPE
  in the value-object unit check.
- test typecheck fixes for the derived and value-object Cube tests.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Fix MySQL derived divide parentheses; reword CHANGELOG

* no-mistakes(document): Cube docs: derived measure, value-object refusal
…all (#564)

* fix(codegen-ts-*): drop the @biomejs/biome peer so the CLI stops installing the native binary

codegen-ts-react, codegen-ts-tanstack and codegen-ts-angular declared @biomejs/biome as a
peer, which npm auto-installs, putting the ~94 MB native @biomejs/cli-<platform> binary into
every CLI install. Nothing shipped uses it: formatting goes through @biomejs/wasm-nodejs.
The devDependency stays for the repo's lint gate. check-peer-ranges.ts now rejects a
publishable package that requires the native formatter. Fresh CLI install: 245 MB -> 151 MB.

* fix(cli): make the libSQL driver an optional peer so a Postgres-only install skips it

@libsql/kysely-libsql was a direct dependency of @metaobjectsdev/cli, so every install
carried it and its native addon. The CLI already imports it lazily, only for a sqlite URL on
Node, and prints a package-manager-specific install command when it is missing. It is now an
optional peer bounded like migrate-ts's, kept as a devDependency for the CLI's own tests.
Fresh CLI install with the Biome change: 245 MB -> 101 MB.

* no-mistakes(review): Revert libSQL optional-peer change; keep Biome removal

* no-mistakes(document): Fix CLI README Biome backend claim
…cross ports (#565)

* feat(metadata): origin @segment and correlated filters in every loader

Load and validate, in TypeScript, C#, Java (Kotlin through it) and Python:

- @segment on origin.first / origin.aggregate, naming a segment.filter of the
  related entity, ANDed with @filter (ERR_INVALID_ORIGIN otherwise);
- a correlated @filter operand { field: "<base field>" } and the null-safe
  isDistinctFrom / isNotDistinctFrom ops (ERR_BAD_ATTR_FILTER for an unknown
  base field or another op).

The refusal of a passthrough across a reverse @via hop now names the hop as
the path wrote it, and Java's and Python's to-many passthrough wording matches
the other ports'. error-origin-passthrough-reverse-hop (new) and
error-origin-passthrough-to-many pin the message.

* feat(metadata): projection filter paths, flattened members and inherited filters in every loader

A projection @filter key may now name a field of its base entity the view does not
output, or a path of to-one hops from the base. A projection that extends another
projection is checked against the effective (ANDed) filter of its chain. An origin
@from/@Of may name a member of a flattened value object. A report dimension's
required flag now treats an unenforced reference, or a hop onto a TPH subtype, as
possibly missing. validator.atLeastOne refuses @max under the default load too.

Eleven new shared fixtures; every port runs them.

* fix(codegen-ts): refuse view shapes the lowering cannot express, and read flattened reference members

The view extractor skipped any origin it could not lower, so a projection loaded clean and
then created a view missing a column its generated type declares. Every such shape now
throws, naming the projection and field: an origin @segment, a correlated (base-row)
operand in an origin @filter, a computed node the lowering does not support, an unknown
origin subtype or aggregate.

A reference over a member of a flattened value object (`@fields: "address.countryId"`) now
resolves to the member's real column everywhere it is read: the foreign key meta migrate
emits, a view's join, a passthrough @from onto the member, and the Drizzle key the
reverse finder and relations() block read. Two references onto one target now read the
join their own @via walked instead of the first join to that entity.

* feat(codegen): name collection symbols from @collectionName and naming.collections in TS and C#

An object's collection name (its own @collectionName, else the project's naming.collections
pluralizer over its name) now names what the generators derive from it:

- the REST collection segment, snake_cased with an acronym-aware split (FAQs serves /faqs),
  in TypeScript and C#, shared by fixtures/naming-conformance/collection-segments.json;
- the reverse finders in both ports;
- the C# DbSet, which now also takes a configured pluralizer;
- the TypeScript list function, list hook and Drizzle table variable.

A project that declares neither keeps every name and URL byte for byte. The collision check
refuses two objects whose collection names meet. @collectionName is now implementedIn
csharp and typescript.

* feat(metadata): check a computed expression's literals against the field they meet

A literal compared with a field in an origin.computed @expr, as a simple case's when
against a field operand or on either side of a comparison, must now be of that field's
kind and, for a field.enum, one of its @values. This is the rule a validator @condition
already followed, and every port's loader now applies it to both through one shared
check (ERR_INVALID_ORIGIN for a computed expression). Two new shared fixtures,
error-origin-computed-literal-not-enum-member and error-origin-computed-literal-wrong-kind,
run in every port.

The CHANGELOG now also records the projection filter paths, the view-extractor refusals,
flattened-member references and the collection-name wiring.

* docs(site): regenerate the type reference for the @collectionName description

* docs: recount the metamodel conformance corpus after the rebase (508 fixtures)

* test(integration-tests): start the MySQL container with async, bounded docker calls

Under `bun test --parallel` on a heavily loaded machine, the MySQL helper's blocking
spawnSync calls (the readiness poll runs `docker logs` every half second) could miss the
child's exit: the test worker then spun at full CPU with a defunct docker child, the
beforeAll hook timed out, and the integration lane stayed open until it was killed. Every
docker call made during startup is now an async execFile with a timeout, so a killed or
stuck call rejects and the hook fails on its own deadline. Teardown keeps one synchronous
`docker rm`, now with a timeout, as the Postgres helper does.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Refuse inherited views, drop columnless derived

* no-mistakes(review): Skip derived fields in table reads (Python, OMDB)

* no-mistakes(review): Document why derived-field guards cover all entities

* no-mistakes(document): Updated docs/features/source-kinds.md: derived-field no-read-source rule now notes the projection-reach exception. Other doc surfaces (CONFORMANCE, physical-naming, metamodel-docs, CHANGELOG, naming fixture README) already match the change.
… work (#567)

* feat: bring every port to parity with the rc19 work

Codegen and migrations, across the five ports:

- @sequenceStart is honoured forward-only: a changed start sets START WITH and
  moves the counter to GREATEST(n, max(id)+1) only when it is below, never back
  (TypeScript migrate, the Drizzle identity column, C# design-time services,
  Kotlin Exposed). Java and Python write no DDL.
- Output paths keyed by metadata package: Python's package layout, C#'s opt-in
  csharp.outputLayout / csharp.packageNamespaces, and a Java/Kotlin refusal when
  two metadata packages map to one directory. meta init, metaobjects init and
  dotnet meta init scaffold the package layout; engine defaults stay flat.
- A value object is never renamed. One claim registry per run in TypeScript,
  C# and Python refuses a real clash with ERR_NAME_COLLISION; a collection-name
  clash is ERR_COLLECTION_NAME_COLLISION in every port.
- @collectionName and the naming.collections pluralizer drive REST segments in
  Java, Kotlin and Python too.
- TypeScript view lowering: every join LEFT OUTER, @schema-only qualification,
  declared-type casts, multi-operator origin filters, projection-extends-
  projection, filter paths, multi-hop origin.first, TPH scope, and the view
  vocabulary (entity-derived fields, origin @segment, base-row operands,
  relative dates, case).
- C#: the EF context declares meta migrate's CHECKs (new check-constraint
  corpus), JSON-column comments, entity-derived fields are no column, and
  framework references are global::-qualified under package namespaces.
- Gates run in both output layouts; ADR-0015, ADR-0044 and ADR-0056 amended.

* fix: close the pre-gate review findings

C# design-time HasDifferences counts a JSON-column comment change; the
framework qualifier leaves global using and preprocessor lines alone.
TypeScript and Python refuse two shared enums with one name instead of
dropping one; Python refuses a package tree it cannot import. An inlined
origin.first with no outer alias is refused, short-name counts are cached
per root, and the init scaffold says a barrel still claims every name.

* refactor(csharp): reuse the companion and global:: helpers in CSharpNaming

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): read NeutralConfig once per gen/verify invocation

* no-mistakes(review): Restore C# duplicate physical-address guard

* no-mistakes(review): Restore obsolete C# ValueObjectNames.Names shim

* no-mistakes(review): Advance new identity sequence past max(id)

* no-mistakes(review): merge CHANGELOG headings; fix using-statement lexer

* no-mistakes(review): Verify round-7 fixes; no further changes needed

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(test): apply changes made during test validation

* no-mistakes(document): Docs: LEFT OUTER joins, layout and naming parity

* no-mistakes(document): Docs: claim-registry guidance in generator recipe
#569)

* docs+agent-context: language-differences page, Node-for-schema callouts, assistant-neutral agent file

Docs truth pass (1.3.0 plan PR 8):
- Every port page and the README getting-started path now say that schema
  migrations and database checks run in the Node `meta` tool.
- New docs/features/language-differences.md: one table of what differs by
  port (list default and cap, validation body, filter errors, field naming,
  data access, migrations, hand edits), linked from the port pages.
- Docs that still described .metaobjects/CLAUDE.md are corrected.

Assistant-neutral agent context (1.3.0 plan PR 36):
- `meta init --skills-dir <dir>` / `meta agent-docs --skills-dir` installs
  skills for any assistant (e.g. .agents/skills); the choice is recorded in
  the manifest and kept on refresh, and old copies are pruned on a move.
- The duplicate .metaobjects/CLAUDE.md is no longer written (pruned on
  refresh); root wiring creates AGENTS.md and CLAUDE.md importing
  .metaobjects/AGENTS.md.
- The always-on text gains a "Calling the generated REST API" block
  (filter[f][op]=v, operators, sort, paging, error shapes) and drops
  stack-specific catalogs in favour of skill pointers.
- Staleness nudges in C#, Java and Python use the neutral wording.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Fix agent-context default-page wording; add Kotlin

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(test): init: first init creates root AGENTS.md when only CLAUDE.md exists; refresh advises

* no-mistakes(document): Verify new per-language docs against code; fix api-contract default-page contradiction

* no-mistakes(document): Fix last Claude-only mention in codegen skill
…3.0 PRs 6-7) (#577)

* feat: fail verify on hand edits and index foreign keys on request (1.3.0 PRs 6-7)

verify.handEdits in .metaobjects/config.json: "fail" makes `meta verify --codegen`
exit 1 on a hand-edited generated file, naming the file and both remedies;
--allow-hand-edits relaxes it for one run, --forbid-hand-edits still forces it.
A project without the key keeps the notice and exit 0; `meta init` writes
"fail". The C#, Java, Kotlin and Python gates already byte-compare and fail;
the docs now say so.

migrate.foreignKeyIndexes: every foreign key nothing already leads with gets a
plain <table>_<columns>_idx index, separate from the efcore preset (which
indexes them already and so adds nothing). Honoured by meta migrate / verify
--db, the Drizzle reference template, the C# DbContext generator and the Kotlin
Exposed table generator; Java OMDB and Python map no indexes. `meta init`
writes it on; projects without it are unchanged and keep the advisory, which
now names the option. Persistence corpus gains two migration scenarios.
C# gen and both verify --codegen paths pass foreignKeyIndexes and conventions.

* no-mistakes(review): Document that custom schemaConventions reach only the TS toolchain

* no-mistakes(document): docs: note FK-index option in conventions table

* no-mistakes(document): docs: link conventions note to FK-index option
* fix(cli): stop installing dprint-node with every CLI install

ts-poet requires dprint-node (about 25 MB of platform binaries) at module
load. Vendor ts-poet's printer as codegen-ts/src/poet.ts (Apache-2.0,
licence kept) and format with the same dprint TypeScript plugin, 0.87.1,
through its WebAssembly build (@dprint/typescript + @dprint/formatter).
Output is byte-identical: every codegen golden and conformance fixture
is unchanged.

poet.ts is an engine module, so owned and ejected templates take Code
from @metaobjectsdev/codegen-ts/engine and class identity holds. The
config loader still maps a legacy bare ts-poet import to that entry.

check-peer-ranges now refuses dprint-node, ts-poet and @types/* in a
published package's dependencies or required peers unless allowlisted.
No published package declared @types/*; @types/node arrives only
through the libSQL driver, which is out of scope.

Fresh CLI install: 151 MB (134,525,165 bytes) -> 133 MB (115,177,311 bytes).

* docs(changelog): note the standalone binary no longer crashes on dprint-node

* fix(codegen-ts): address review of the vendored printer

- A formatter that fails to load now throws instead of silently
  emitting unformatted code; only a format error falls back.
- The CLI pins @metaobjectsdev/codegen-ts/engine to the same build
  (dist vs src) as the package root, so both reach one poet.ts.
- The engine entry re-exports only code/imp/joinCode/Import/Code from
  the printer, as it did from ts-poet.
- Restore ts-poet's toString() call for non-plain placeholders.
- Refresh the index.ts comment and narrow the CHANGELOG claims about
  legacy ts-poet imports and the standalone binary.

* refactor: drop unused printer helpers; reuse the workspace walk in the peer guard

Remove asOneline/oneline, Import.fromMaybeString and arrayOf from the
vendored printer (no callers). check-peer-ranges enumerates packages
through publish-set.mjs's enumerateWorkspacePackages instead of its own
readdir walk.

* fix(codegen-ts): import-path.ts takes the vendored printer; refresh install numbers after #567

* no-mistakes(review): guard: refuse install-only deps via optionalDependencies; add real-check tests

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): wire peer-ranges guard test into gate_peer_ranges lane

* no-mistakes(test): apply changes made during test validation

* no-mistakes(document): Doc sync: ts-poet printer, guard, binary
…rt (#580)

* fix(python): pass only validated input to the repository in generated routes (#566)

* fix(python): generated routes hand the repository only the validated input (1.2.1)

The generated FastAPI create, PATCH and PUT handlers validated the body against
<Entity>Create / <Entity>Patch and then passed the RAW body to the repository.
Pydantic ignores undeclared keys and the input models leave out server-owned
fields, so a client-sent id, a readOnly field and a made-up field such as
isAdmin all reached the write. Security fix.

Each handler (plain and TPH per-subtype) now rebinds dto to the keys the input
model validated, at every depth, before any repository call, as the TypeScript
routes do. Undeclared and non-settable keys are dropped silently, never 400'd,
so a client sending an extra harmless field keeps working; values stay the
body's own, so repositories see the same value types as in 1.2.0.

Python package version 1.2.1 only; CHANGELOG entry under Security.
Regression gate: tests/integration/test_generated_router_validated_input.py.

* no-mistakes(document): python routes pass only validated input

* no-mistakes(lint): regenerate showcase site payload for PyPI 1.2.1

* fix(codegen): generated routes drop server-owned and undeclared input in every port

An audit after the Python 1.2.1 fix found the same request-input hole in the
other ports' generated create handlers. Each port now drops, silently and before
the write, a server-generated key, readOnly and derived fields, and on a TPH
per-subtype route the discriminator and sibling-subtype columns; undeclared keys
are dropped everywhere.

- Python: forward-port of the 1.2.1 fix; TPH create drops a body discriminator.
- Java: create nulls the dropped DTO components; DTOs ignore unknown properties.
- Kotlin: create writes only settable columns; entity classes ignore unknown keys.
- C#: create resets the generated key, discriminator and M:N navigations; every
  readOnly property gets a private setter.
- TypeScript: an assigned primary key leaves the update schema.

Shared api-contract scenarios input-server-owned-dropped (core) and
tph-input-server-owned-dropped, a readOnly column in secret-fields, and an
`absent` assertion in every runner gate it.

* feat(codegen): a validation 400 lists every issue in every port

The same model answered a failed create or update differently by language:
TypeScript listed each problem, while C#, Java, Kotlin and Python returned a
bare {"error":"validation"}. Every port's generated routes and its hand-rolled
reference servers now answer 400 {"error":"validation","issues":[{code,path,
message}]} with every failure, codes in Zod's vocabulary and path as an array of
wire names.

- C#: ValidationIssues runtime file (ejected with routes); create reads the
  body itself so an unbindable body lists its issue; PATCH collects instead of
  returning on the first failure.
- Java: ValidationIssues runtime helper; a Patch binds every field before it
  throws. Kotlin: per-package MetaValidationIssues.kt; create lists every
  absent required value.
- Python: every Pydantic error mapped in constraint_errors; decimal failures
  carry their wire path.

Shared scenarios validation-lists-issues and tph-validation-lists-issues, with a
new `issues` assertion in every runner, gate it in both lanes.

* feat(api): a page size for generated list routes, api.pagination (TypeScript)

List endpoints had no hard cap: a TypeScript or C# list with no `limit`
returned the whole table and `?limit=100000` was accepted everywhere. A project
can now set `"api": { "pagination": { "defaultLimit": N, "maxLimit": M } }` in
.metaobjects/config.json: a generated entity or projection list with no
`limit` answers the default page, and a `limit` above the cap answers
400 {"error":"limit_too_large","maxLimit":M}. Reports keep their own row cap
and opaque views their 1000.

- sdk reads and validates the block; the loaded root carries it
  (apiPaginationOf), as it carries the wire format.
- runtime-ts mounts take a `pagination` option (pageLimit); the packaged and
  reference Fastify and Hono routes emit it. Owned copies re-synced.
- meta init writes 50 / 1000 for a new project; `--force` over an existing
  config does not add it. A project without the setting behaves as before, and
  meta verify advises (rule unbounded-list-pages) when routes are wired.
- New api-contract `pagination/` sub-corpus, run in the TypeScript generated
  lane. The C#, Java, Kotlin and Python routes do not read it yet: their REST
  generators are under the non-TS freeze, pending that ruling.

A config key, not vocabulary: metamodelVersion does not move.

* feat(api): api.pagination in every port, and api.unknownFields (reject by default)

api.pagination (default page size and hard cap on generated list routes)
now reaches the C#, Java, Kotlin and Python generators as well as
TypeScript: no limit answers the default page, a limit over the cap is
400 limit_too_large. No setting keeps today's behaviour. verify advises
when routes are generated without it (TypeScript, Python, Java/Kotlin,
and C# under verify --codegen).

api.unknownFields (reject | drop, default reject): a generated create,
PUT or PATCH body carrying a key the entity does not declare answers
400 {"error":"unknown_fields","fields":[...]} in every port, before
validation, and writes nothing. drop keeps the old silent behaviour.
Declared server-owned keys (id, readOnly, @autoset, writeOnce on update,
the TPH discriminator, a sibling subtype's column) are still dropped, not
refused, so a client echoing back a row keeps working. Java and Kotlin
check the raw body, so the answer does not depend on the host's Jackson
mapper; a test proves it under both FAIL_ON_UNKNOWN_PROPERTIES values.

The pagination sub-corpus becomes api-settings/ and runs in every port's
generated lane; the core and tph corpora gain reject scenarios. meta init
writes both settings into a fresh config.

* chore(showcase): regenerate for api.unknownFields

* fix(api): code-point order for unknown_fields, every distinct validation issue, a negative limit refused under api.pagination

- unknown_fields lists keys in code-point order in every port (TypeScript and
  C# sorted by UTF-16 code unit, which put a key outside the BMP first).
- A validation 400 keeps two distinct failures of one rule kind on one field
  (Python and C# de-duplicated on path and code); a type error still lists once.
- Under api.pagination a negative limit answers 400 pagination.invalid_value in
  every port instead of reaching the store (SQLite reads LIMIT -1 as no limit).
  New api-settings/limit-negative scenario.
- Python validated-input tests follow api.unknownFields; advanced-modeling
  example regenerated; C# routes generator header names the current contract.

* fix: generated create routes drop server-owned input across ports (1.2.x security) (#568)

* fix: generated create routes store only client-settable fields (1.2.x security)

Python 1.2.1 stopped its generated routes from handing raw request input to
the repository. The same audit found related create-path holes in 1.2.0 in
the other four ports; this closes each in its own idiom. Server-owned values
are dropped silently, never answered with 400.

- Java (codegen-spring): create strips a generated id, readOnly and derived
  fields; a TPH per-subtype create also strips the body discriminator and
  sibling-subtype fields.
- Kotlin (codegen-kotlin): create skips readOnly/derived columns; a TPH
  per-subtype create writes only the route subtype's own columns.
- C# (MetaObjects.Codegen): every readOnly property shape gets a private
  setter; create resets a generated id, the TPH discriminator and M:N
  navigations before Add.
- TypeScript (codegen-ts): the update schema omits primary-key fields, so
  PUT/PATCH can no longer re-key a row with an assigned key.

Proof: new shared api-contract scenarios (core + TPH input-server-owned,
TPH foreign discriminator) and a readOnly `role` field in secret-fields, run
in every port's generated lane and the reference lanes; a new `unset`
assertion key in all five harnesses. In-memory test repositories now store
what they are handed, so the scenarios fail on the 1.2.0 generators.

Proposed versions (not published): npm 1.2.2, NuGet 1.2.2, Maven 8.2.2;
PyPI unchanged at 1.2.1. metamodelVersion unchanged.

* fix: keep a @required readOnly field creatable in C# and Java generated create

Pre-gate review follow-ups to the 1.2.x create-input patch:

- C#: the required-key check skips readOnly fields (the private setter
  never binds them), and create validation ignores a violation naming
  only a @required readOnly member, as Java's SERVER_OWNED_ON_CREATE does.
- Java: the create-validation server-owned set covers every DTO component,
  so a nulled readOnly or derived value-object column no longer 400s.
- TypeScript: drop the now-dead PK guard in the update-schema nullable arm
  and list the PK rule in updateSchemaFields' doc comment.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Kotlin readOnly create fix + C# reset skip

* no-mistakes(document): docs: finish stale corpus counts from input fix

* fix(cli): prune emptied skill directories after a --skills-dir move; install every module the Kotlin integration lane needs

meta init --refresh-docs --skills-dir <new> removed the untouched skill files at
the old path but left their directories behind, which read as the old copy still
being there. Walk up from each pruned file and remove the directories it left
empty, stopping at the first that still holds anything and never removing the
skills directory itself.

scripts/integration-test.sh kotlin installed only metadata and codegen-kotlin, so
on an .m2 without the other metaobjects artifacts integration-tests-kotlin failed
to resolve core-spring and om, and codegen-kotlin-exposed1x-check metadata-ktx.

* test(render): hold the email helper in the runtime-drift corpus case

Every generated render path in the five ports already raises
ERR_VAR_NOT_ON_PAYLOAD for a template variable not on the payload
(1.3.0, #520), and runtime-drift/ held the document and prompt helpers.
The @kind: email helper was not in the case. Add WelcomeEmail plus
email-subject/, email-html/ and email-text/ drift directories, one
drifted part each, and check every part raises in the TS, Python, C#,
Java and Kotlin runners.

* feat(init): dotnet meta init and metaobjects init write the api block TypeScript meta init writes

A new project gets api.pagination 50/1000 and api.unknownFields reject in
.metaobjects/config.json from every port's init; an existing config is never edited.

* feat(init): dotnet meta init and metaobjects init also write migrate.foreignKeyIndexes and verify.handEdits

The same new-project keys TypeScript meta init writes since #577.

* feat(api): drop undeclared value-object members everywhere and share the api config cases

- New jsonb scenario jsonb-nested-undeclared-key-dropped: api.unknownFields judges the top
  level only, so a member a value object does not declare is dropped on create and PATCH and
  never stored, while the open jsonb bag keeps every key. The reference servers in every port
  drop such members; the Java generated value-object record now carries
  @JsonIgnoreProperties(ignoreUnknown = true) (it answered 400 invalid_type).
- New shared config corpus api-settings/config-blocks.json (valid and refused api blocks), run
  by the TypeScript, C#, Java and Python config readers. A page size is a positive whole number
  however JSON spells it, at most 2147483647: C# now reads 50.0, TypeScript and Python refuse
  anything above the int32 range.
- CHANGELOG: an Upgrading section (api.unknownFields reject as the one deliberate default change,
  the C# readOnly private setter), init parity across ports, the nested-member rule. Counts,
  READMEs, api-contract.md and the migration guide updated; showcase Java regenerated.

* fix(api): close the code-review findings on the input and page-size work

- C#: with api.pagination set, `limit=0` served the default page; it is now a page of zero rows,
  as in every other port. New shared scenario api-settings/limit-zero (all five ports green).
- C#: the unknown-field check matches a key the way the route binds the body (the app's
  System.Text.Json options; the ASP.NET web default ignores case), so `Title` is the declared
  `title`, not a 400. The verify advisory matches the routes generator by type or exact name,
  not by a "routes" substring.
- Python: a rejected decimal's text is no longer echoed into the 400 issue message; the
  unbounded-list-pages advisory fires only when the routes generator is wired; the dead
  _DECIMAL_COERCE constant is gone.
- Java: UnreadableBody's Javadoc describes the issues envelope it returns.
- Docs: M:N traversal routes take no limit and are not paged by api.pagination (stated as the
  boundary); the C# port doc no longer says dotnet meta init writes no config. Counts updated.

* refactor: read the project config once in the Maven mojo; drop a no-op path coercion in Python issues

Simplify pass: AbstractMetaDataMojo maps its four project settings from one read of
.metaobjects/config.json, and pydantic_issues copies loc as-is (its entries are already int or str).

* no-mistakes(review): Scope ignoreUnknown to request bodies; fix review items

* no-mistakes(review): Drop discriminator on Python TPH update; fix scenario text

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Fix doc counts, dead guard, stale comments, vacuous assertion

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Fix stale routes comment in C# api-settings factory

* no-mistakes(review): Fix stale eject docs, vacuous C# check, assertion messages

* no-mistakes(review): Refuse non-numeric C# page bounds with 400

* no-mistakes(review): Refuse out-of-range or negative C# offset

* no-mistakes(review): Drop source-grepping Python router tests

* no-mistakes(review): apply reviewer inline fixes

* test(ts): re-sync the owned zod-validators copy after the pkFields reference change

The input-handling change edited the codegen-ts reference source but not the
owned copy under test-generators, so cli/test/owned-copies-current.test.ts
(the 'owned copies are what meta eject writes' gate) failed: the copy on
disk kept the pre-change update-shape text. bun scripts/sync-owned-template-copies.ts
re-synced 1 of 128 owned copies; no other copy drifted.

* no-mistakes(test): Validate re-synced zod-validators owned copy

* no-mistakes(test): apply changes made during test validation

* no-mistakes(document): Correct init config docs for C# and Python

* test(kotlin): expect table-qualified columns in the TPH create autoSet tests

The TPH per-subtype create now writes every column through the table object
(it[AuthTable.autoCreatedAt]), so a column named body, issues or unknownKeys
cannot be shadowed by the handler's locals. Two KotlinAutoSetStampingTest
cases still asserted the unqualified form and failed the java-slow lane.
…ry port (#581)

* fix: cut long foreign-key index names on Postgres; verify refuses what generate refuses

- migrate.foreignKeyIndexes: a <table>_<columns>_idx name over 63 bytes is cut
  to the 63 bytes Postgres stores (SQLite and D1 keep it whole), in migrate-ts,
  the C# EF context and the Kotlin Exposed tables, so a converged schema
  proposes nothing. The diff also keys a Postgres foreign key by its stored
  name, so a long <table>_<column>_fk is not proposed as a rename every run.
- New shared corpus fixtures/foreign-key-index-conformance/, passed by the
  TypeScript, C# and Kotlin rules; two Postgres migration scenarios with a
  long table and column name.
- mvn metaobjects:verify runs the generate goal's model refusals (output
  package clash, collection-name clash), with a test; Kotlin gets its own
  collection-name clash test.
- docs/CONFORMANCE.md: the clash is per-port unit tests, not the segments
  corpus; the Drizzle identity start is string-tested only.
- ADR-0060 records verify.handEdits as Node-CLI only by design.
- The migration docs say what the code does with view grants (#574).

* feat(release): cut a patch from a release/<major>.<minor> branch; gate a minor on the previous one being merged

Forward-ports #578 from release/1.2: release.mjs and finish-release.mjs accept a
maintenance branch for a patch on its own line, refuse a version that would move npm's
latest backwards, and RELEASING documents the path. A minor or major cut is now refused
while the previous release/<M>.<m> holds a commit that is not on main, and RELEASING
Step 0 carries the same check.

* docs: one owner for the page-size, unknown-field and validation-issue rules; site gate timeout; ts-poet names

- docs/features/api-contract.md owns api.pagination, api.unknownFields and the
  validation issue list; language-differences, the five port pages and the
  CHANGELOG point to it instead of restating them.
- The site-payload gate runs its tests with a 60 s per-test timeout, so a busy
  machine does not read as a red release gate.
- CHANGELOG names def, literalOf, arrayOf, asOneline and Import.fromMaybeString
  among the ts-poet names the vendored printer does not carry.
- site-payload.json counts the new shared foreign-key-index corpus.

* no-mistakes(review): Restore changelog bullets; cut long index names

* no-mistakes(review): Rename case-only layout-collision test resources

* no-mistakes(document): docs: document the declared-index name cut

* fix: generated tables declare a long declared index name as Postgres stores it

meta migrate creates and compares a declared index.lookup / identity.secondary name over 63
bytes under the name Postgres stores (its first 63 bytes). The Drizzle tables, the EF Core
context and the Exposed tables now declare that cut name on Postgres (SQLite and D1 keep the
whole name; MySQL is exempt), so the mapping names the index the database holds. The names
artifacts keep the declared, dialect-neutral name.

The shared corpus fixtures/foreign-key-index-conformance/ gains a long index.lookup and
identity.secondary and declared.<dialect>.json, written by migrate-ts and read by the
TypeScript, C# and Kotlin generator tests. C# ForeignKeyIndexes joins the eject engine
surface, as the schema contract CheckConstraints already is.

* no-mistakes(document): docs: stored index names and verify-goal refusals
The ts-fast lane (and so --quick, --only ts and the no-mistakes Test step)
ran the full Stryker pass over all six metadata files on every run: 10-45
minutes of CPU per gate round on a loaded host, most of that step's wall time.

The step now diffs the stryker.conf.mjs `mutate` list against the merge base
with the base branch (MO_CI_MUTATION_BASE, else origin/$GITHUB_BASE_REF, else
whichever of origin/main and origin/release/* HEAD is closest to) and runs
`stryker run --mutate` on only the changed files. When none changed it prints
a SKIP naming the base. When no base resolves, or stryker.conf.mjs itself
changed, it says so and runs the full pass. Thresholds and concurrency are
unchanged; the list stays in stryker.conf.mjs only.

The full pass stays: the flagless run's mutation lane, a new
`--only mutation` section for release prep and on demand, and conformance.yml
(tags, nightly, dispatch) via MO_CI_MUTATION_SCOPE=full. Stryker's sandbox goes
under DEV_SCRATCH when that names a directory, and is removed afterwards.
… once per gen run (#584)

* fix(codegen): write the manifest once, keep whole-model files whole, load metadata once

- TypeScript, Python and C# hold .gen-state/.hashes.json in memory for a gen run and
  write it once at the end (Java already did); an unchanged run writes nothing.
  Python gen no longer lists unchanged files as written.
- A run narrowed to some entities (meta gen <Entity>, metaobjects gen --entities)
  writes only those entities' own files; every generator still sees the whole model
  (ctx.entities), with the narrowing as ctx.selected. Whole-model files are now
  byte-identical to a full run's. A Python target's declared entities still bound
  its model.
- meta gen reuses its generation load for the unknown-attribute warning, re-parsing
  strictly only when a bare unknown key was reported.
- meta gen no longer imports a database driver: CLI modules on the gen path read the
  new @metaobjectsdev/migrate-ts/offline subpath. Gated by an import-graph test.
- Under Node the config file loads from its own path, so jiti's cache hits instead of
  filling with randomly named entries.

* test: keep throwaway test databases in RAM and remove them when a run ends

Database test containers mount a size-capped tmpfs at the image's VOLUME path, Postgres runs
with fsync, synchronous_commit and full_page_writes off, and every docker-CLI launcher also
removes its containers on exit and SIGTERM (covering a disabled Ryuk). The CI sidecar and
workflow services get the same treatment. The Stryker sandbox moves to a RAM scratch dir and
its runners stop with it. Work in progress: AGENTS.md section, CHANGELOG and suite proof follow.

* fix(codegen): keep a failed run's own error when the manifest write fails too

A run that throws still writes the manifest for the files it wrote, but a
failed write no longer replaces the run's error (TypeScript, Python, C#).
Also: Python's gen summary counts skip-existing files as left as they
were, not unchanged; a Postgres image tag that names no major takes the
Postgres 18 data directory; CHANGELOG notes what a narrowed run now
checks and what an owned per-object generator must do.

* refactor: name the Python write statuses, share the per-object selection, remove containers in one call

* no-mistakes(review): Behaviour-test gen import graph; scope Hono/grid warnings; restore config rewrite

* no-mistakes(review): Narrow jsonSchemaFile to named entities on gen runs

* no-mistakes(document): narrowed-run and test-storage docs

* no-mistakes(document): Document drive-wear test changes and Disk I/O rules

* no-mistakes(document): Export selectedEntities for owned generators
…0063) (#587)

* feat(codegen-ts): code writer, writer contract and corpus, layout ratchet (ADR-0063)

Generators own their layout; formatters become test oracles only (ADR-0063).
This change lands the foundation and converts no generator, so generated
output is unchanged.

- spec/code-writer.md: the shared writer contract (lines and blocks,
  blank-line requests, snippets, fit-or-break lists, output form, and the
  TypeScript dialect's import collection).
- fixtures/writer-conformance/: 40 cases (30 core, 10 TypeScript), the 35th
  shared corpus.
- CodeWriter and TsWriter (codegen-ts/src/writer/), at 120 columns, exported
  from the package root and the engine entry and listed in
  eject.engineSurface. TsWriter accepts ts-poet Code fragments and collects
  their imports, so generators can convert one function at a time.
- Layout ratchet: an AST walk (ts.createSourceFile) over generator source
  that flags newline and indentation literals, newline joins and repeat-built
  indentation, resolving same-file constants. It has its own catch/pass
  cases. The allowlist names all 74 unconverted files with reasons, fails on
  stale entries and may only shrink against the merge base.

* feat(codegen-ts): writer and reference generators are extended by subclassing (ADR-0063)

CodeWriter and TsWriter keep no private members: their steps are protected
methods (piece, breakAt, fits, writeHeader, writeImports, writeImport,
orderModules), so a subclass overrides one and keeps the rest. ADR-0063 item 7
and spec/code-writer.md state that reference generators take the same shape,
one overridable method per piece of output, and that these methods are not a
stability contract. A test shows a subclass overriding orderModules.

* no-mistakes(review): refuse trailing newline in writer line()

* fix(codegen-ts): adapt the writer foundation to main (vendored poet, ratchet allowlist, counts)

TsWriter reads Code from src/poet.ts (the ts-poet copy main vendored in
#579), so a generator's imp() imports are collected again. The layout
ratchet's allowlist gains the six main files that type layout (one
unconverted helper, four JSON document writers and the vendored printer,
exempt). Corpus count 41.

* no-mistakes(document): docs: name CodeWriter/TsWriter in engine surface
…n gate (#589)

* ci: run only the lanes a change affects in the gate's Test step

Add scripts/ci-lane-map.txt, one path-to-lane table, and scripts/ci-select-lanes.sh,
which reads it. ci-local.sh --affected lists the change since the merge base, prints the
lanes it selected and skipped and the rule each path matched, and runs the selected ones;
several ports run as parallel lanes like the full run, one stays serial. Unknown paths, an
unreadable map and an unresolvable base all select every lane. ci-affected-ports.sh reads
the same map, so the gate and the hosted workflows agree. docs/recipes is executed by port
tests and no longer counts as docs.

.no-mistakes.yaml: the test command is --affected, and test.instructions and
test.path_instructions scope the evidence agent by the paths a change touches.

* ci: treat docs pages as test inputs, share the base-ref rule, read the lane map once

Review follow-ups for affected-lane selection: docs/ maps to every lane because port
tests read those pages (only the root prose files select none), the selector CLI uses the
same base rule as the gate, the map is parsed once per selection without per-line forks,
and the selected-port lanes call the shared step functions directly.

* no-mistakes(review): fix(ci): add --no-renames to port mapper; correct pr-ci docs comment

* no-mistakes(test): apply changes made during test validation

* no-mistakes(document): fix stale CI lane-selection doc claims
…a metadata loader (#588)

* feat: Java loader handles large models; even out object selection across ports

Java loader (also Kotlin):
- Remove the quadratic child-key check (list -> set) and resolve references
  through the per-type name index. 20 copies of the canonical model
  (1,160 objects) load in about 2 s CPU; it previously exceeded the 30 s timeout.
- The 30 s init timeout is now a setting: LoaderOptions.setInitTimeoutMs, loader
  arg initTimeoutMs, -Dmeta.loaderTimeoutMs on the Maven plugin, or
  -Dmetaobjects.loader.initTimeoutMs. LargeModelLoadTest holds a CPU budget.

Selection parity:
- codegen-spring and codegen-kotlin generators now honour <filters>
  (confirmed by running that they ignored them before).
- mvn metaobjects:generate -Dmeta.entities=A,B narrows per-object output for
  Java and Kotlin; whole-model files still render from the whole model, a
  narrowed run sweeps no orphans, and blank or unknown names fail the goal.
- C# dotnet meta gen/verify --codegen --entities, with the same semantics.
- Python gen lists only the files it changed and counts the rest unchanged.
- Selection documented on every port page; CHANGELOG under [Unreleased].

* feat(cli): meta gen refuses a positional name that matches no object

Every other port refuses an unknown --entities / meta.entities name; TypeScript
dropped it silently when another name matched and only warned when none did.
Now exit 2 with the same wording, before anything is written.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Narrow template scopes; keep C# shared files whole

* no-mistakes(document): Fix stale entity-selection references in docs
…anged (ADR-0064) (#590)

* feat(codegen): skip gen when nothing changed, in every port (ADR-0064)

Forward-port of #585 from release/1.2 (b9bc9c7) onto main, merged with the
manifest written once per run (#584) and the uniform entity selection (#588).
The skip ADR is numbered ADR-0064 here: ADR-0062 and ADR-0063 are taken on main.

- gen builds a key from the loaded model (each root node in canonical effective
  form), the generators' identity (built engine code, config, owned generators,
  templates, declared extra inputs, project config) and the output-changing
  flags, before anything renders. A match with the last successful run, with
  every generated file still holding that run's bytes, renders and writes
  nothing. --force (Maven: -Dmetaobjects.force=true) turns it off; a generator
  that cannot declare its inputs opts out.
- A run that names entities (positional, --entities, -Dmeta.entities) forces
  exactly those: it never skips, never stores a key and leaves the stored
  full-run key alone, in every port.
- verify --codegen may answer "no drift" locally from the key; CI and --full
  always render, and every port compares in memory.
- The hash manifest stays loaded once and written once, and only when an entry
  changed; identical bytes are never rewritten; TypeScript runs git merge-file
  only for a hand-edited file.
- fixtures/codegen-skip-conformance/cases.json: the shared case table.

Hand-resolved: TypeScript runner, overwrite-policy, gen/verify/args/index and
codegen-drift; Python cli, runner, overwrite_policy; C# CodegenRunner,
CodegenCli, CodegenDrift, Generator, Program; Java generate and verify mojos;
docs, changelog and the ADR index.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): warn unknown attrs before gen skip; add regression test

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(review): Carry warnings in skipped gen json/toon document

* no-mistakes(test): Align C# agent-context fixture wording; sdk suite green

* no-mistakes(document): align codegen-skip docs with ADR-0064
…t job (#592)

pr-ci's ts job checked out at depth 1, so origin/$GITHUB_BASE_REF was not fetched,
git merge-base failed, and gate_completeness_diff fell back to the FULL mutation
pass. fetch-depth: 0 (as the gates job already sets) gives it a merge base.

local-ci's java-fast job ran java+kotlin conformance classes that java-slow's
`mvn clean install` (the full reactor, tests on) already runs. Remove the job and
its mentions in the ports-to-run map, its test and the lane docs. The
`--only java-fast` selector stays: conformance.yml still uses it.
Resolves the ~680 conflicted paths between the release line and main, keeping both
sides' behaviour. Where the two disagree, main's shipped 1.3.0 behaviour wins and
the line's variant stays as an opt-in where it had one:

- the default output layout is flat (the line's package layout and namespaces are opt-in)
- validator.atLeastOne takes no @max (exactlyOne replaces it)
- @dbSetName is not vocabulary (@collectionName replaces it)
- Postgres view and report relations are qualified only when @Schema is declared
- a flattened value object's field has no own column constant

Generated artifacts (registry manifest, metamodel docs, canonical schemas, golden
files, agent-context corpus, owned template copies, showcase output) are regenerated.
Versions follow main (npm/PyPI/NuGet 1.3.0, Maven 8.3.0); the release version and the
CHANGELOG heading for the line's 1.2.4 section are left pending.
…make a C# golden mismatch readable in CI

- docs/features/adopting-existing-models.md (edited by the gate's document step) and the same
  outputLayout comment in four recipes, the agent-context mirror and the agent-context
  conformance corpus now say `"package"` is the opt-in layout, matching the flat default.
  Fixes the sdk recipe-mirror test that failed in CI.
- PropertyNamingGoldenTests names the file, the first differing line and both spellings on a
  mismatch, and compares file names ordinally. It failed in CI only, with no message.
- ci-local's C# lane adds the minimal console logger, so a failing test's message reaches the log.
@dmealing dmealing changed the title feat: merge the 1.2.x release line with main (metamodel 1.3, C# codegen hooks, contract emitters) feat: merge main (1.3.0) into the 1.2.x release line — metamodel 1.3 vocabulary, C# codegen hooks, contract emitters Nov 18, 2026
…o root

A CI build (CI=true turns on ContinuousIntegrationBuild) maps source paths to /_/, so
the [CallerFilePath]-derived Golden directory did not exist and the test threw
DirectoryNotFoundException on hosted runners. The neighbouring golden test already
finds its files from the repo root; this one now does too.
@dmealing
dmealing merged commit c549bcb into fix/rc19 Nov 18, 2026
9 checks passed
@dmealing
dmealing deleted the fm/mo-pr593-takeover branch November 18, 2026 16:52
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