Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ here.**
- **A `pydantic` extra on the Python package.** `pip install "metaobjects[pydantic]"` installs
`pydantic>=2.8`, the minimum the generated Python models need, so an adopter can get the enforced
floor with the package. The base install is unchanged.
- **A recipe for moving existing models into MetaObjects without a rewrite.**
`docs/features/adopting-existing-models.md` takes Drizzle tables, Zod schemas and Pydantic models
from writing the model through retiring the old code, and proves the generated types match first.
The proof is a test file that `tsc` or pytest runs, so nothing reads your source and there is no
new command. `examples/brownfield/` holds a runnable project for each, and the recipe ships in
the `metaobjects-authoring` skill.

### Fixed

- **Python: an array field's `default` generated a string.** A model with
`field.string[]: { default: "{}" }` generated `tags: list[str] = '{}'`, which fails on first use.
It now generates `tags: list[str] = []`, from the same four spellings TypeScript accepts, or
from a native YAML list such as `default: [a, b]`. A default Python cannot spell as a list is
left to the database.

## [1.2.0] — 2026-10-30

Expand Down
1 change: 1 addition & 0 deletions agent-context/skills/metaobjects-authoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This file covers what almost every model needs. The topics below live in
| File | Open it when |
|---|---|
| `references/adopting-existing-code.md` | working code or a populated schema already exists for what you are modeling |
| `references/adopting-existing-models.md` | moving existing Zod, Drizzle or Pydantic models into the model: the step-by-step recipe, and how to prove the generated types match before the switch |
| `references/choosing-a-shape.md` | no row of "Canonical form for common field needs" fits; you need the full UUID / timestamp / URI / `@autoSet` rule; or you are registering your own vocabulary |
| `references/json-columns.md` | a JSON column beyond the ladder below: coverage per port, `field.map` at runtime, version caveats, bag → native array |
| `references/identities-and-indexes.md` | declaring a primary, secondary or reference identity, an FK, or a non-unique `index.lookup` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ redefining it. (The metadata is still the durable spine *going forward*; only th
**The observable predicate:** does working code or a populated schema already exist for
what you're modeling? If yes, you are in adoption mode and these rules apply.

For Zod schemas, Drizzle tables or Pydantic models, `adopting-existing-models.md` is the
step-by-step recipe: generate beside them, prove the types match, move one call site at a time.

**Author metadata to match what the code ALREADY IS — not what you'd design fresh.**
Read the existing code and schema *first*, then model to reproduce them:
- The **native types the code uses** are the spec — model `field.uuid` when the code
Expand Down
Loading
Loading