Changelog

Contents

Changelog#

Each release is a tag, and each entry is a fragment under .changes/ in the repository. moneta works out which release holds each entry from the tags, and this page is rendered from its output on every docs build.

The generator and the Go runtime are released separately, on their own tags, so each has its own changelog.

model#

The model command and Python package, tagged v1.2.0.

Unreleased#

Added

  • kotlin, cli: A [tool.model.kotlin] table, with out and package, generates a Kotlin client of the Go server: kotlinx.serialization types for the model’s structs, enums and unions, each with a validate() returning its FieldErrors, and a Client whose suspend methods call its routes, root endpoints and REST resources over Ktor, a merge patch taking a generated Patch, and a row’s URLs kept as its urls. The runtime it imports, dev.omniblack.model:model-runtime, is the flake’s kotlin-runtime package, a Maven repository directory. A foreign model takes a kotlin package and an external type a languages.kotlin.

  • kotlin: Add wrkModules.default, a wrk module setting a consumer’s MODEL_AUTH (model.auth.enable), MODEL_KOTLIN_RUNTIME (model.kotlin.enable) and MODEL_AUTH_KOTLIN (model.kotlin.auth.enable)

v0.6.7 — 2026-11-15#

Added

  • models, python, typescript, go: Add an opaque field type: any JSON value, which the model neither validates nor looks inside, for data a client decodes with its own model while the server only stores it. It is Any in Python, unknown in TypeScript and any in Go, and has no PostgreSQL column. null is no value, so a required opaque field holding it is missing, and a JSON merge patch replaces the value whole.

  • models, go, typescript: A PATCH route can set merge_patch: true to take a JSON merge patch of its request: a field the patch sets replaces, null clears it, and one it leaves out is unchanged, a nested struct merging field by field. Its Go handler takes a generated Patch, whose Apply merges it into a value, and the wrapper answers a body that is not a JSON object fitting the request with 400. The Go client takes the patch as JSON bytes, and TypeScript as a MergePatch. Route metadata gains merge_patch.

Fixed

  • postgres: Write an enum’s display function a member per line, which failed to format once its members ran past one line

  • typescript: @omniblack/model-runtime takes its libnerd_font from the flake’s libnerd_font input through pnpm-nix, as a nix: dependency, rather than from a nix/libnerd_font link the dev shell made, so pnpm no longer needs that link to install it.

v0.6.6 — 2026-11-12#

Added

  • go, postgres: The Go postgres feature now gives each table the bulk writes Insert<Name>All and Upsert<Name>All, which validate a batch of values and write it in the request transaction with one COPY per table.

Fixed

  • go, postgres: The Go postgres feature’s Upsert of a value that was never read, over a stored row whose file it leaves unchanged, now keeps the file instead of failing the table’s check pairing the content with its digest.

v0.6.5 — 2026-11-10#

Fixed

  • go-runtime, typescript: A Go REST listing’s page links now keep the other parameters of its URL, so a listing they choose pages through itself, and the TypeScript client adds a page to a path with a query of its own with &, not a second ?.

v0.6.4 — 2026-11-09#

Added

  • postgres, models: Find every match of a paged query before sorting it with plan: filter_first, so a rare match sorting late never walks the order_by index

v0.6.3 — 2026-11-09#

Added

  • go, go-runtime: Serve a path root’s files and directory listings from a root_endpoint model type, registered by RegisterAllEndpoints; the router now takes {name…}/{$} patterns

  • typescript: Call a root endpoint from the TypeScript Client: build its file and directory URLs, list a directory, and fetch a file

  • postgres: Give a field a declared query matches by LIKE or ILIKE a pg_trgm trigram index

  • postgres: Keep a field out of its table’s search index with searchable: false

Fixed

  • go, go-runtime, postgres: A Go PostgreSQL write now copies each list or map table’s items with one COPY, so a statement trigger on the table, such as the search index’s, runs once per write, and a write no longer prepares a new statement for each number of items it holds. A table with a column of a type without binary input, such as an ISBN, is copied in text format.

v0.6.2 — 2026-11-07#

Changed

  • go, postgres: A Go PostgreSQL write now inserts each list or map table’s items in one INSERT, or as few as PostgreSQL’s parameter limit allows, so a statement trigger on the table, such as a search index’s, runs once per write rather than once per item.

v0.6.1 — 2026-11-06#

Fixed

  • go, go-runtime: Deny a PUT or PATCH naming a field the request may neither read nor update before validating it. A PATCH into a hidden embed answered 403 when the embed was set and 422 when it was not, which showed whether it was set, and a PATCH of a required field with null was a 422.

v0.6.0 — 2026-11-06#

Added

  • go, go-runtime, typescript, models: End users can query a struct in a small text language: status = open AND due < 2026-01-01 AND "emma" ORDER BY due DESC. The new find Go feature gives each table Find<Name>, FindSummaries<Name> and a QUERY taking text/vnd.omniblack.model.query, and the Go and TypeScript clients a find method. A field opts out with queryable: false, and every field’s TypeScript metadata says whether a query can name it.

  • go, typescript: A row now says whether each field the request may write but not read is set, in $present, and its ETag covers that answer. TypeScript reads it as $present, and the Go client gives each such field a <Field>Present method. A struct’s TypeScript metadata lists the read: false fields a request may write in writeOnly, so a form can label them.

Changed

  • Breaking: typescript: A field’s metadata now has guaranteed, which is what narrows its type, and required means what the YAML says: code narrowing by field.required must move to field.guaranteed. A required field with a read perm is required and not guaranteed. A struct’s summary is now declared, as the Summary type, and names its fields rather than holding a copy of them. unique is now true on a sole primary key.

  • Breaking: go, typescript: Enforce perms at every depth: a field of an embedded struct is guarded exactly as a direct field in a row’s body, its entity tag, searches, queries, referenced_by and related, file reads and writes, and a field’s guards now include the perm of the struct it embeds. So a top_level struct with perms that is embedded elsewhere now guards those embeds. A denied write’s 403 names a data path such as billing.card or items.2.note. A hidden union value in a list or map is sent as a null, or an empty table or mapping in YAML and TOML. In TypeScript, FieldPerms’ actions are now lists of RowPerm, a struct a row reaches carries its perms, and mayField takes an optional root struct.

  • go, python: A required list or map that is absent, null or empty now decodes to an empty value in Go and Python, and validation reports it as required: an absent one no longer fails to decode, and [] and {} no longer pass validation. In Go that value is non-nil and checked Fyne setters report it too, and an optional list given as [] decodes to nil, as an absent one does

Fixed

  • go: A Go PUT now keeps a list or map the request may not read when the body sends it empty, as it does one left out or null, so a client writing back the [] it holds for a field it never received no longer clears the stored value or gets a 403

  • go: Keep a field a request may not read through a PUT that sends it as a blank string

  • go, go-runtime: Deny a PUT or PATCH that provides a value for a field the request may neither read nor update, even the stored value, so the answer no longer confirms a guess at it. A PATCH naming such a field with null is denied too, whether or not it is set, and so is a hidden file sent in a body.

v0.5.23 — 2026-10-27#

Added

  • go, go-runtime, typescript: Serve each REST row’s listing item alone at .../summary, guarded by the summarize perm, and linked from every row as rel="summary". The Go client gains Summary, and the TypeScript client summary() and a summary URL on each row.

Fixed

  • typescript: Generated TypeScript no longer breaks when a model declares a type named like a runtime import, such as a Link struct: the runtime name is imported renamed, as Link as Link_, and the model keeps its own name. The model’s Model type is now imported as Model rather than Model as RuntimeModel.

v0.5.22 — 2026-10-26#

Added

  • cli: Add model --check, which writes nothing and diffs each output that is missing or out of date, exiting with status 1 if any are

  • typescript: The TypeScript REST client gets related(id, { page }), listing a row’s related rows as a Page<RelatedItem>: a ListItem plus its relation, "refers_to" or "referenced_by". Page takes its item type as a parameter, ListItem by default.

  • go, go-runtime, typescript: The REST server sends each row’s URLs: a response carrying a row has a Link header for the row itself (rel="self") and for each endpoint it serves below it (related, referenced_by, file), and each listing item that has a url has the same URLs in a urls object. go-runtime/gen/rest gains Endpoint and Endpoints, which the generated code names the endpoints with. The TypeScript client keeps them on each row and item it decodes: client.follow(row, "related") fetches one by name, typed by the generated <Name>Urls, client.urls(row) reads them, and client.get(link) fetches a Link in hand; a FileLink builds a file’s URL. Rows are now Linked<T, <Name>Urls>, which is still a T; the URLs sit under an enumerable symbol, so a test comparing a decoded row with toEqual sees them. restRow, restRowOrPage, listItemSchema and relatedItemSchema take the urls decoder, and the client follows an absolute URL as it is.

  • typescript: A REST client method taking a row’s keys, such as read, related or fileUrl, also takes a row or listing item the client decoded, and calls the URL the server sent with it

Changed

  • typescript: The TypeScript REST client decodes each listing item’s fields and types it: a struct with a summary gets a generated <Name>Summary and <Name>SummarySchema, and lists them as ListItem<<Name>Summary>; one without lists an object of its key fields. ListItem and RelatedItem take their fields type as a parameter. rest.search, referencedBy and related list a union of TypedItems (SearchItem, <Name>ReferencedByItem, <Name>RelatedItem) that an item’s type narrows. An item that does not decode throws an HttpError. The runtime’s restPage and restRowOrPage now take the items’ schema.

v0.5.21 — 2026-10-20#

Added

  • models, go, typescript, python, postgres: A ref can now be a primary key, alone or beside other key fields: its column holds the target’s key under a foreign key, and a REST path names it by that key (/api/tag-note/7). A ref can also refer to a struct keyed by a ref; it holds that reference (ProfileRef{Key: UserRef{...}}) and is written as the key at the end of the chain. A chain of key references may not cycle, and such a chained reference cannot be a map key yet.

Fixed

  • go: Build a Go REST listing item for a struct keyed by a ref its summary does not list

v0.5.20 — 2026-10-20#

Added

  • go, postgres: Compare and order by rooted paths in declared queries, resolving a parameter compared with one as its field resolves

  • go, go-runtime, typescript: Run a struct’s declared queries over REST: a QUERY of its collection with a JSON body naming the query and its params lists the rows it selects, or redirects to the one row a query by a unique key finds; the Go and TypeScript clients call each query by name

v0.5.19 — 2026-10-20#

Added

  • go, postgres: Declare SQL queries on a persisted struct, each read by a generated Go function

  • postgres: Generate an index for each declared query

  • models, postgres, go: Give a field marked unique: true a PostgreSQL unique index, and have a declared query finding one row by it, or by the primary key, return an mdl.Optional instead of a slice

Changed

  • postgres, go-runtime: Store a secret field as its plaintext, removing secret.SetStorageKey, Seal and Open; open any sealed secrets before upgrading

v0.5.18 — 2026-10-19#

Added

  • models, go, python, typescript, postgres, go-runtime: Add a uuid field type, with an optional version

v0.5.17 — 2026-10-19#

Added

  • go, typescript, go-runtime: The Go REST endpoints now serve a struct with several primary_key fields, with one path segment for each key in field order, each wildcard named after its field (/api/seat/{hall}/{seat_no}). The Go and TypeScript clients take one parameter per key. A multi-key struct cannot have a path key. mdlrest.Resource.ParseKey now reads the request’s wildcards by name, so generated REST code needs this go-runtime.

v0.5.16 — 2026-10-19#

Added

  • go, go-runtime: Serve GET /{id}/related from the Go REST endpoints, and generate Related and RelatedSummaries on Go postgres structs, listing the rows a row refers to and then the rows referring to it

v0.5.15 — 2026-10-19#

Changed

  • models, go-runtime, typescript, auth: A perm can now be authenticated, for any request with a user and no particular perm, or anonymous, for any request, even one with no user; both work in flat perms, perms by class, and a route’s perm. true is no longer a perm: write anonymous where a class had true (or authenticated, which is the same in user and group). The TypeScript metadata spells perms the same way, so its Perm type is now false | string rather than boolean | string, and mdl.Perm gains Authenticated.

v0.5.14 — 2026-10-18#

Added

  • models, go, go-runtime, postgres, typescript, python: Add a file field type, for bytes a row owns, such as an avatar, stored in PostgreSQL beside the row. A row holds only the file’s metadata, its sniffed content type, size and SHA-256; the bytes are read and uploaded at <row URL>/file/<field>, and in Go with Open<Field> and Set<Field>. max_size and content_types constrain it, and an upload hook can check the content further.

  • cli: Add model edit, a browser-based editor for a model directory’s type files

Changed

  • typescript, auth: Generated TypeScript calls routes and REST resources through a Client class holding the server’s base URL, set once with new Client({ base, init }) or per call with { base }, in place of the free route functions and the rest object. A ref’s resolve takes the Client to read through.

  • go, go-runtime, typescript, auth: A perm in a struct’s group class is now held in the row’s group, through what the user’s membership of it grants, and never through their account: mdl.Owner gains HasInGroup, which the group class is checked with, and a TypeScript Principal gains hasInGroup, which principalFromPerms fills from its groupPerms option. In the auth library, an account’s groups are Memberships, each naming a group and the roles the account holds in it, and MeResponse reports the perms held in each group as group_perms. A perm that holds in every group, as an instance admin’s does, belongs in the other class.

Fixed

  • models: The build no longer warns that a required field whose create perm is false keeps its struct from being created, when the struct’s own create is false too.

  • models: Name the file in a model load error raised while reading a type, not only a YAML syntax error

v0.5.13 — 2026-10-16#

Added

  • cli, auth: Expand ${NAME} in a [tool.model.foreign.<name>] path, where an unset variable is an error, and add the flake package auth-model, so path = "${MODEL_AUTH}/models" refers into the auth library at the revision a consumer’s flake.lock pins

  • postgres: The build fails when a top_level struct, or one of its fields, is named after a PostgreSQL reserved word such as group or order, which the generated SQL cannot use unquoted

  • models, go, go-runtime: A struct can give its perms by class, as unix does: owner_field and group_field name the fields holding a row’s owner and group, user, group and other each take the struct’s perms, with true for no perm and unset for none, and create splits into self and any. The Go REST endpoints check each row, and their listings and searches keep only the rows the request may list. An mdl.Authorizer gives the user’s ID and groups by also implementing mdl.Owner; mdlrest.Perms now holds mdl.RowPerm values

  • models, go, go-runtime: A field can give its perms by class too: user, group and other each take read, create and update, and an action no class sets adds nothing to the struct’s. The Go REST endpoints check them against the row’s owner and group, the stored row’s for a write over it. mdlrest.FileField’s Read is now an mdl.RowPerm

  • typescript: The TypeScript metadata describes perms: a top_level struct’s perms, a field’s, and a route’s perm, resolved. @omniblack/model-runtime checks them against a Principal with may, mayCreate, mayField and mayCall, and principalFromPerms builds one from the perms a server reports, so a UI can grey out what its user may not do. The check is a UI hint, not a security boundary: the server still enforces every perm

v0.5.12 — 2026-10-16#

Added

  • typescript: A TypeScript route call’s result carries its HTTP status on either arm, with is_created, is_accepted and is_no_content getters; a route’s response struct can no longer declare a field of those names

v0.5.11 — 2026-10-16#

Added

  • models, cli, go, go-runtime, typescript, postgres: A ref can refer into another model with model: <name>, which [tool.model.foreign.<name>] in model.toml locates. The foreign model is loaded, not generated: Go and TypeScript import the target’s <Target>Ref from its client library, and PostgreSQL stores the key without a foreign key. The Go client and TypeScript output now declare a <Target>Ref for every top-level struct with a single key, and a Go client’s Resolve reads the row through the client WithClient puts in the context, returning the new mdlclient.ErrNoClient without one.

  • typescript: Resolve a TypeScript ref through the REST client: each Ref is now a class whose resolve() reads the row with rest..read

v0.5.10 — 2026-10-16#

Added

  • typescript, go, models: The TypeScript output calls the Go server serving the page. Each route exports a camelCase function calling it, and with [tool.model.go.rest] the module exports rest, a client of each REST resource by struct name: create, list, read, replace, patch, remove, and query, referencedBy, fileUrl and upload where the table has them, plus search across every searchable table. A GET or HEAD route, which has no body a browser can send, now reads each request field its path does not name from the query string, a list from each repeat of its key; such a field must be a string, integer, enum, or path, or a list of one, or the model fails to load

  • go, go-runtime: Generate a Go client of a model’s server with a [tool.model.go-client] table (out, package, pascal-case). It is a package of its own, holding the model’s types in the shape a response has: a field whose read is false is left out, and one whose read names a perm is an mdl.Optional. Each route is a method of its Client, returning the success body or an *mdlclient.RouteError carrying the error body. With [tool.model.go.rest], each REST resource has a <Struct>Resource whose methods create, list, read, replace, patch, remove, query, list referrers, and upload, and refuse with an *mdlclient.Problem. NewClient builds a client from a base URL, and WithCookiesFrom returns a copy sending an incoming request’s cookies. The new go-runtime/client package is what the generated client calls through.

Changed

  • typescript: Make a field with a read perm optional in TypeScript, and leave one with read: false out

Fixed

  • go: The fyne feature’s binding of an optional integer field compiles

v0.5.9 — 2026-10-15#

Fixed

  • go, go-runtime: Insert a row whose path is relative_to a source field before the source’s file exists, as a new row’s file is only staged: generated Go resolves it with mdl.ResolveBeside rather than looking the file up

v0.5.8 — 2026-10-14#

Added

  • typescript: Give a list’s values, and a map’s keys and values, a schema and compare in field metadata

  • typescript, cli: Generate a .svelte.ts module of Svelte classes with $state fields, set by [tool.model.typescript]’s svelte key, and export a reactive ModelMap from @omniblack/model-runtime/svelte

  • go, go-runtime: Upload a row’s file with POST …/file/{field…}?path=…, set the path and write the file with fsedit, into a root whose opener returns an mdl.DirFS such as mdl.RootFS

  • typescript: A Svelte struct class has blank(), one not yet filled in for a form to edit: list and map fields empty, other optional fields null, and required ones unset

Fixed

  • go: Leave net/http out of a Go model with REST endpoints and no routes

  • models: Load a model’s files in name order, so generated output no longer depends on the filesystem’s listing order

v0.5.7 — 2026-10-14#

Added

  • models, go, go-runtime: Allow several {name...} wildcards in a route path, with a literal segment between each two, and {name...?} for one that matches lazily

  • go: Serve the files of rooted paths in lists, maps and embedded structs at …/file/{field…}

Changed

  • typescript: A route’s TypeScript URL builder now returns a template literal, not a string concatenation, so Biome’s useTemplate rule passes on generated code

  • go, go-runtime: RegisterAllEndpoints and RegisterRestEndpoints take a *mdl.Router instead of an *http.ServeMux, and every generated endpoint is routed by it. Serve the router, or mount it with mux.Handle("/", router). Its 404 and 405 answers are application/problem+json

  • models, go, go-runtime: A {name...} wildcard matches at least one segment and a {name} a non-empty one, and a route path may not end in /. A REST path key no longer ignores a trailing /, and the collection is listed at /api/t, not /api/t/

  • typescript: A route URL builder throws a RangeError for an empty path value, which no {name...} wildcard can carry

  • go, go-runtime: A Go document giving a string field “” reads it as no value: a required field reports “is required”, an optional one is None, and a blank list item or map entry is “is required” at its path. Password, Secret and ISBN UnmarshalText read “” as their zero value.

  • python: A Python document giving a string field “” reads it as no value: a required field fails as an absent one does, an optional one is None, and a blank list item, map key or map value is required at its path.

Fixed

  • go: Put the generated Go file’s // Code generated … DO NOT EDIT. line before its package clause, so tools such as golangci-lint recognise the file as generated

v0.5.6 — 2026-10-11#

Added

  • go: Generate a Destroy method on every Go struct and union variant, wiping its secrets and passwords, and destroy each route’s request once its response is written

  • go: Destroy wipes the secrets in lists and maps

  • models, typescript, go: Let a route leave out success_response, for one with no model success body

Changed

  • go: A required field is a pointer in a Go <Struct>Raw, as an optional one is, so that FromRaw can tell it absent.

  • go, go-runtime: Report a Go constraint violation with the message Python reports, and quote a string map key in its data path, as prices.'usd'.amount

  • models: Reject a secret or password as a map key, or a ref to a struct keyed by one

  • models: Reject a secret or password anywhere in a primary key

Fixed

  • go, go-runtime: Reject a Go JSON, YAML or TOML document that leaves out a required field, or sets it to null, instead of decoding it as its zero value. FromRaw returns a *mdl.ValidationError of kind required; REST answers 422 and a route 400. A PUT may still leave out a field its request may not read, and a route body a field its URL names. A route with path placeholders and an empty body is checked too, so it is answered 400 when a required field the URL does not name is missing.

  • go, go-runtime: Name a missing required field by its full data path in a Go FromRaw error, and report every one

v0.5.5 — 2026-10-11#

Fixed

  • go, go-runtime: Hand FromError a request that does not decode or a path parameter that does not parse as an mdl.RequestError, so it can tell the 400 from a server fault

v0.5.4 — 2026-10-10#

Added

  • go, postgres: Run Go hooks, named in [[tool.model.go.hooks]], before a top_level struct is created, saved or deleted; a hook’s error blocks the write

  • go, go-runtime: Wrap each route’s handler in middleware passed to RegisterAllEndpoints

  • go, go-runtime: Let installed extensions claim a YAML key on routes, enabled per model under [tool.model] extensions. In Go, RegisterAllEndpoints then takes a generated RouteExtensions, with one mdl.ExtMiddleware field per extension, which wraps each route that sets the key, given its value in the extension’s own Go type. A route key that nothing claims now loads with a warning.

  • go, go-runtime, models, postgres: Guard structs, their fields, and routes with perms. A top_level struct sets perms (summarize, read, create, update, delete, falling back to one another), a field its own read, create and update, and a route a perm; each is a perm’s name, false for one nobody holds, or null. With the new Go auth feature, RegisterRestEndpoints and RegisterAllEndpoints take an mdl.Authorizer and enforce them: a denied request gets a 404 without a user and a 403 with one, rows a request may not summarize drop out of referenced_by and other summaries, as do rows referring only through a field it may not read, a search needs both summarize and read, and a field it may not read is left out of the row. A field that sets read is left out of the PostgreSQL search index, so a search cannot reveal what it holds.

  • models, go, go-runtime, postgres, typescript: Add password and secret field types. In Go they are held in guarded memfd_secret memory by go-secret, which needs GOEXPERIMENT=runtimesecret. A password writes and stores its Argon2id hash, and a secret is stored sealed with a key set through secret.SetStorageKey.

  • go, go-runtime: Generated Go structs, enums and union variants get Equals; secret.Secret and secret.Password get a constant-time Equals

Fixed

  • go, go-runtime: Merge a REST PATCH into the stored row in memory, so a field the patch does not name keeps its value and patching a row no longer rehashes its password

  • go, go-runtime: Compute a REST row’s entity tag from the fields the request may read, without copying a secret’s plaintext out of guarded memory

  • go, go-runtime: Compare a REST write’s field-perm values without copying a secret’s plaintext out of guarded memory

v0.5.3 — 2026-10-09#

Added

  • go, postgres: Generate ReferencedBy and ReferencedBy on Go postgres structs a reference names, finding the rows that refer to one

  • postgres: Index the columns of every reference, so deleting a row and finding the rows that refer to it no longer read every referring table

  • go, postgres: Generate ReferencedBySummaries on Go postgres structs a reference names, reading the summaries of the rows that refer to one in the same query

  • go, go-runtime: Serve GET /{id}/referenced_by from the Go REST endpoints, listing the rows that refer to a row by their summaries

v0.5.2 — 2026-10-09#

Added

  • go, postgres: Search every table with a search index at once with the Go postgres feature’s Search, which returns a Hit per matching row, best match first

  • go, go-runtime: Read every search hit’s summary at once with SearchSummaries, and search every table over REST with a QUERY of the base path

v0.5.1 — 2026-10-08#

Added

  • go, go-runtime: A REST listing item gains title_html and subtitle_html, its summary lines rendered as HTML, and mdlsummary.Markdown gains HTML to render one

v0.5.0 — 2026-10-08#

Added

  • models, go, go-runtime, sphinx: A summary can declare a subtitle, a second template over its fields; Go gains RenderSubtitle and SummarySubtitle, and a REST listing item a subtitle, left out when it renders empty

Changed

  • Breaking: models, go, go-runtime, sphinx: A summary’s template key is now title, and its rendered line is a title: Summary’s Render is RenderTitle, a struct’s Summary is SummaryTitle, and a REST listing item’s summary key, and mdlrest.Item’s Summary field, are title

v0.4.2 — 2026-10-08#

Added

  • models, go, go-runtime, sphinx: A summary’s image names a url or rooted path field; a REST listing item links to it as its image: the url’s absolute URL, or the row’s …/file/ URL

v0.4.1 — 2026-10-08#

Added

  • go, go-runtime: Serve the file a row’s rooted path field names over REST at …/file/, with ranged GETs

v0.4.0 — 2026-10-07#

Added

  • postgres, go, cli: Index every top_level table’s text for full-text search, searching an enum by its display, and generate a Go SearchT; [tool.model.postgres] search-config picks the text search configuration

  • postgres: Search a date by its ISO spelling, month, day, year and weekday

  • models, go, go-runtime, postgres: A struct can declare a summary: a Go text/template over the fields it names, rendered as one line of inline Markdown. Go gets a <Name>Summary type holding those fields, with Render(), and Summary() and SummaryData() on the struct; with the postgres feature, GetSummaryT and SearchSummariesT read a summary and every row its references name in one query. Each Go enum gains a Display() method returning its value’s display.

  • go, go-runtime, postgres: A REST QUERY /api/t searches the rows of T: its text/plain body is a search in the web search syntax of SearchT, and the response lists the rows that match, best match first, as items and pages like the GET /api/t listing. Only a table with a search index takes QUERY, and its GET /api/t response has an Accept-Query: text/plain header.

Changed

  • go, go-runtime, python, typescript, postgres: A datetime keeps its IANA zone: RFC 9557 on the wire, Temporal.ZonedDateTime in TypeScript, and a _zone column in PostgreSQL.

  • postgres, go: Search a row by the items and keys of its lists and maps, which a stored model_search column holds

  • Breaking: go, go-runtime, postgres: A REST GET /api/t lists the rows of T in key order, and a GET of a path with no row lists the rows under it as before, now both as items: {"fields": ..., "summary": ..., "url": ...}, where fields is the wire form of the row’s summary fields, or of its key alone when the struct has no summary, and summary is the rendered summary. That replaces the bare list of URLs a path listing returned, and its TOML urls key is now items. Listings come 100 items to a page, linked by Link headers with rel="next" and rel="prev". Each <Name>Summary gains ToRaw() and MarshalJSON(), and the postgres feature adds ListSummariesT(ctx, limit, offset).

v0.3.0 — 2026-10-06#

Added

  • typescript: Generated TypeScript describes the model itself. Each struct’s const carries its metadata, and its fields hold each field’s type, constraints and own valibot schema by name. A model constant holds every top-level type, including each enum’s values, each union’s variants and each route. The metadata types it satisfies, exported by @omniblack/model-runtime, narrow a field’s schema when you check its type: a map field’s gives a ModelMap, a ref field’s a Ref.

  • typescript: Give each field on a struct’s const a type-only Type, so typeof Struct.fields.name.Type is the field’s TypeScript type

  • typescript: Name each field type’s struct field in @omniblack/model-runtime: StringField, IntegerField, ModelField and so on, which Field is the union of

  • typescript: Give a model type’s metadata the kind of type it names, and type ModelType and ModelField by that name and kind

  • typescript: Give each generated struct field a compare function in its TypeScript metadata, for types with an ordering

  • typescript: Type field metadata as FieldOf<T> and ComparableFieldOf<T>, and each field type, such as DecimalField<R>, as generic over its required, so generic code can tie a field’s schema, Type and compare together

  • typescript, models: Give generated TypeScript field metadata a constraint_help list: one sentence for each constraint set on the field, worded by the field-type catalog

  • go, go-runtime: Let a path root’s opener take a context.Context, which its With methods and the PostgreSQL and REST code then pass on

  • typescript: Let an external field’s TypeScript import set type: true to import its name with import type

Changed

  • go: Ignore one trailing / in the URL of a REST path key

  • typescript: Parse an integer field from an integer number or a string of digits, not only a bigint

  • Breaking: typescript: Generated TypeScript imports its runtime from a new package, @omniblack/model-runtime, instead of copying it into every module, so it is now a dependency of generated code. The flake builds it as packages.<system>.model-runtime, for pnpm-nix to install; its peer dependency is valibot, plus decimal.js and libnerd_font as optional ones. It holds ModelMap, Ref, Resp and the schema helpers, and a module imports only the ones it uses. Every model now shares one ModelMap and Ref, so a map built for one model passes another’s map schemas, where it used to be rejected.

  • typescript: Declare an optional list or map field as always present on a struct’s interface, since validate always gives it

  • typescript: A scalar field’s valibot schema reads "", a form’s cleared input, as missing. A field that is not required gives undefined for it instead of failing its type check, as an empty integer input did with “must be an integer”. A required field reports is required for "", null or undefined. This includes string and path, so an empty string no longer passes as a required string or path.

  • typescript: An estimate field’s valibot schema reads a string of decimal digits ("4.5", "-2", ".5"), so an estimate typed into a form parses, as an integer field’s already did. It reports must be a number for any other value, including text Number would read loosely, like " 4 ", "0x4" or "Infinity". EstimateField’s schema input is now string | number.

  • Breaking: go, go-runtime: A Go REST listing of a path no row has now holds the URL of each row, not its key, and a TOML listing puts them under a urls key, not paths.

Fixed

  • typescript: Type an optional list or map field’s schema in ModelMeta.Field as always giving a value, as it does, not null or undefined

  • typescript: Type a struct that holds itself, directly or through another, instead of letting TypeScript infer it as any, and type an external field’s schema output as its declared type

  • typescript: Report each field’s own message from a TypeScript schema instead of a bare type mismatch, report text a decimal cannot read as an issue instead of throwing, and reject non-finite decimals

  • typescript: Report only the format message for a malformed TypeScript date, not also “must be a day that exists”

  • typescript: Report a missing required enum field as “is required”, and read “” in an enum field as missing

  • cli: Replace generated files atomically, so a file watcher never reads a partial file and a failed formatter leaves the old file in place

v0.2.4 — 2026-10-02#

Added

  • go, go-runtime: List the keys under a path that a REST GET finds no row for, in JSON, YAML, or TOML

Fixed

  • go: Get, and a REST URL naming a row, resolve a rooted path key the way its field does: against relative_to, or else from the top of the root. A relative or unnormalized spelling now finds the row instead of 404ing.

v0.2.3 — 2026-10-01#

Added

  • models, python, typescript, go: Add an external field type for types the model doesn’t generate

v0.2.2 — 2026-10-01#

Changed

  • go, go-runtime: Write an edited TOML string that holds a newline as a multi-line """ string, rather than one line with \n escapes.

v0.2.1 — 2026-10-01#

Fixed

  • cli: Put ruff, sqlfluff, and biome on the exported model binary’s PATH so generated output is formatted outside the dev shell

v0.2.0 — 2026-10-01#

Added

  • models, go, go-runtime, typescript, python, postgres: A ref can now be a map key. It is written as its target’s key text, and two refs are the same key when their keys are equal. mdl.KeyType admits every generated reference type whose target’s key is itself a KeyType, and PostgreSQL gets a foreign key on the map’s key column. A ref to a struct keyed by an enum cannot be a map key yet.

  • models, go, go-runtime, typescript, python, postgres: A nerd_font_glyph can now be a map key. It is written as the glyph’s full name, as in md:folder, and two keys are the same when they are the same glyph. mdl.KeyType admits nerdfont.Glyph, and a reference to a struct keyed by one.

  • models, go, go-runtime, typescript, python, postgres: A url can now be a map key. A key is written as a url value is, relative to its base where it can be, and a map’s keys and values each take their own base. Two keys are the same when their absolute URLs are. mdl.KeyType admits url.URL, and a reference to a struct keyed by one.

  • models: Give a path field a root and relative_to

  • go, go-runtime: Open a rooted path field through an opener named in model.toml

  • postgres, go, go-runtime: Store a rooted path field’s resolved form beside it in PostgreSQL, and key a rooted primary key and its refs on it

  • go: Generate Get<Name>ForUpdate, which reads a row and locks it until the transaction ends

  • go: A value read with Get<Name> remembers its primary key, so Update moves the row when the key changes, and resolves rooted paths once

  • postgres, go: Store a rooted path held as a list item, map key or map value in two columns, as written and resolved, and key a map on the resolved key

  • go: Allow a rooted path in a struct-valued primary key; Get<Name> takes its resolved path

  • models, sphinx, docs: Declare the top_level struct a nested struct lives under with root_type

  • sphinx: Show each struct’s meta values in the automodel docs

  • models, python, typescript, go, postgres: Resolve a url base or a path relative_to against a field of the struct’s root_type, with {kind: root, field: <dot path>}

  • models, python, typescript, go, postgres, go-runtime, sphinx: Add a constant field type: a field that always holds one integer, string, or enum member, named by subtype, value and, for an enum, enum_name. Python gets Literal[...], defaulted to the constant on a required field, and TypeScript the literal type ("circle", 2n, typeof Priority.high). Go, which has no literal types, gets the base type and refuses another value in FromRaw and Validate(), which reports it with the new constant validation kind. PostgreSQL stores the base type with a CHECK that it equals the constant.

  • models, python, typescript, go, go-runtime, sphinx: A union variant holding a struct can set inline_value: true to write the struct flat, its fields beside the tag, instead of under “value”. Its validation errors are then at the struct’s own paths. A tag_name of “value” is allowed when every variant is inlined. go-runtime gains gen.TaggedJSON, yamlx.Tagged and tomlx.Tagged for the generated codecs.

  • models, go, go-runtime, docs: A path field can set source: true to hold the file its top-level struct was read from. In Go the struct gets <Name>RawFile, its Raw without that field, and ReadFile and MarshalFile methods, which pick the format from the file’s media type with the new mdl.FormatOf. The field is not written to the file, and REST and PostgreSQL keep it.

  • models, go, docs: A union can set file: true to be read from a file of its own, its variant named by the tag in the file. Every variant is an inlined top-level struct with a source path. In Go the union gets Read<Union>File and Marshal<Union>File. A struct with a source path can no longer be a field, list item or union variant of another type, except as a variant of a file union.

  • go, go-runtime: Keep a decoded TOML document’s comments, key order and value styles: MarshalTOML on a decoded struct now edits the document it was read from, rewriting only the keys whose values changed.

Changed

  • Breaking: postgres, go: Store each list and map in its own child table, one row per item, in place of an array or composite column. Struct and union items are flattened into real columns, so they can be indexed and constrained. Maps, lists of paths, and lists of lists are now supported. A deferred constraint trigger enforces a list or map’s length rules, and the Go postgres feature writes and reads the items with their row. A list or map can no longer be part of a primary key, and a top_level struct can no longer be a list or map item.

  • models, go, postgres, python, typescript: A ref field now holds its target’s primary key instead of naming separate key fields: drop its fields key and the key fields it named. The target must have exactly one primary key field. On the wire a ref is that bare key; in memory it is the target’s generated Ref type, whose resolve reads the row with the Go postgres feature. The Go Load options, Load methods and Get’s load argument are gone. A ref may now be a field of any struct and a list or map value, and each becomes a FOREIGN KEY on its column.

  • Breaking: go, go-runtime, models: A Go map field is now an mdl.Map[K, V], not a map[K]V. It compares keys by value, so big.Int, decimal, time.Time and Path keys work, and it keeps insertion order like a Python dict. Get returns an Optional; Set, SetDefault, Delete, Pop, Has, Len, All, Keys and Values replace indexing, len and range. mdl.FromMap builds one from a map literal. It has a JSON codec; the generated Raw form of a model with YAML or TOML enabled wraps it in one that adds those codecs, so encode a map through the struct that holds it. A map key must be a single value: a list, map, struct or union key is now rejected.

  • Breaking: typescript, models: A TypeScript map field is now a ModelMap<K, V>, not a Map<K, V>. It has the Map API and keeps insertion order, and it compares keys by value, so equal Decimal and Temporal keys are one key. It encodes with JSON.stringify as an object keyed by each key’s text, where a Map encoded as {}. Decoding a plain object now reads integer, estimate, boolean and integer enum keys from their text, so a JSON object with such keys decodes. Check for it with instanceof ModelMap, not instanceof Map.

  • Breaking: models, python, typescript, go, go-runtime, postgres: A nerd_font_glyph’s full name is now spelled with a colon, md:folder, not md-folder, following libnerd_font. Every language reads and writes only the new spelling, so wire data and PostgreSQL columns holding md-folder no longer decode; rewrite the first - of each stored name to a :.

  • Breaking: models, python, typescript, go, go-runtime, sphinx: A union variant’s inner_type is now a nested type, so a variant can hold any type: an enum, a list, a string, another union. A bare name is still shorthand for a model type. Every variant is now written as {tag, value}: the discriminator and the variant’s value under “value”, where a struct variant used to be flattened next to the tag. Validation errors sit under “value” too. In Go a variant that holds neither a struct nor a union is a defined type (type ReadingLabels []string), and every variant has a Validate method. A union’s tag_name cannot be “value”. go-runtime’s tomlx.Tagged is replaced by tomlx.Envelope.

  • go: A top-level struct with the postgres feature has an unexported field for its stored key, which == and reflect.DeepEqual compare

Fixed

  • python: Encode and decode boolean, date, time and datetime map keys in JSON, YAML and TOML, and normalize isbn map keys

  • go: REST endpoints compare a rooted path key by the path it resolves to, so a PUT or PATCH of a row as written is accepted, and Location names the row

  • go: Import fmt and errors in Go code with the postgres feature, which failed to build when nothing else in the file used them

  • go: Report a TOML union document with no discriminator as missing it, not as an unknown empty tag

  • go, go-runtime: Keep map key order, and union field order, in TOML

  • go, go-runtime: Write an integer field to TOML as a TOML integer (sequence = 1), not a string. A value beyond 64 bits, which TOML integers cannot hold, is still written as a string of its digits, as in YAML.

  • go, go-runtime: Write date and time fields to TOML as native local dates and times (due_on = 2026-09-30, when = 12:34:56), not strings, and read a hand-written native date or time, which was rejected. The quoted form earlier versions wrote still loads.

v0.1.0 — 2026-09-28#

Added

  • models, go, typescript: Route paths take {name} placeholders that fill the request’s string, integer, or enum field of that name from the URL. Go answers 400 for a segment that does not parse; TypeScript exports each route’s <Name>Path and a <camelName>Url builder.

  • go, typescript: Fill a request path field from a {name...} rest-of-path route wildcard

  • go, go-runtime: Serve REST endpoints for a table whose primary key is a path, at {id...}

  • go, go-runtime: Allow a route’s {name…} wildcard in any position of its path; Go serves such routes through a generated matcher

  • models, python, typescript, go, postgres, go-runtime: Add a date field type for calendar days: datetime.date in Python, Temporal.PlainDate in TypeScript, the new Date in go-runtime, and date in PostgreSQL

  • models, python, typescript, go, postgres, go-runtime: Add an isbn field type: it reads an ISBN-10 or ISBN-13, with or without hyphens and spaces, and holds the compact ISBN-13, as mdl.ISBN in Go and the isn extension’s isbn13 in PostgreSQL

  • models, python, typescript, go, postgres: Add a ref field type for foreign keys: it names a row in another top_level struct through key fields you declare, becomes a FOREIGN KEY with on_delete and on_update actions in PostgreSQL, and holds the resolved row as a virtual field in Python, TypeScript and Go, where generated Load methods fill it

  • python: Encode Python structs to JSON, YAML, and TOML with encode_json, encode_yaml, and encode_toml

  • go: Generate an exported <Name>Raw wire struct for every Go struct and union, with FromRaw and ToRaw on structs and <Union>FromRaw/<Union>ToRaw for unions. The JSON, YAML and TOML codecs now decode into and encode from it through encoding/json, yaml.v3 and go-toml/v2, so generated code no longer imports tidwall/gjson or tidwall/sjson. The toml feature needs go-toml/v2 v2.4.3 or later.

  • models, python, typescript, go, postgres, go-runtime: Add a url field type: an absolute URL, held as yarl.URL in Python, the global URL in TypeScript, url.URL in Go and text in PostgreSQL. A base, either a literal URL or another url field, resolves relative references on decode, and Go and Python write a URL relative to its base again on encode

  • models, python, typescript, go, postgres, go-runtime, sphinx: Add a nerd_font_glyph field type: one Nerd Font glyph, written and stored as its full name (md-folder) and held as the libnerd_font client’s glyph object: Glyph in Python and TypeScript, nerdfont.Glyph in Go, and text in PostgreSQL. Decoding rejects a name that is not a glyph. Generated code needs libnerd_font at run time: the model[nerd_font] extra in Python, the libnerd_font npm package in TypeScript, and the C library in Go.

  • models, python, typescript, go, sphinx, docs: Add struct meta values: model.toml names a meta and a top_level_meta struct, each struct declares values for them, and every language emits them as typed constants (a Python ClassVar, a TypeScript property, a Go method)

Changed

  • typescript: Generated TypeScript now requires valibot 1.x; it no longer works with 0.x

  • go: Generated Go decoding follows the Raw struct: an explicit JSON null for an optional field is None rather than the zero value, an optional field absent from the input is reset to None when decoding into a used value, and a JSON value of the wrong type is an error rather than coerced. YAML now quotes decimals, times of day, and integers beyond 64 bits, and TOML writes a union as an inline table; both forms still decode.

  • Breaking: go, sphinx, docs: Prefix each generated Go enum constant with its enum’s name (Direction member ltr is now DirectionLtr), so a member can no longer collide with a type of the same name. pascal-case no longer affects enum constants, which are exported exactly when their enum is.

Fixed

  • python: Generated Python no longer breaks when a struct or field shares a name with an import (such as a date field, or a struct named Context): the import is renamed instead. A decimal field with min or max no longer raises NameError in validate()

  • python: A violated min_length or max_length raises LengthError in generated Python, not RangeError

  • python: Decode nested structs and unions through their own from_raw, so a struct holding a union decodes, and a nested empty list sent as null becomes []

  • python, go: Validate referenced structs and unions, and report nested failures under a dotted data path (lead.name, items.0.name) in Python as in Go

go-runtime#

The Go module generated code imports, gitlab.com/terryp/model/go-runtime, tagged go-runtime/v1.2.0.

go-runtime/v0.6.3 — 2026-11-10#

Fixed

  • go-runtime, typescript: A Go REST listing’s page links now keep the other parameters of its URL, so a listing they choose pages through itself, and the TypeScript client adds a page to a path with a query of its own with &, not a second ?.

go-runtime/v0.6.2 — 2026-11-09#

Added

  • go, go-runtime: Serve a path root’s files and directory listings from a root_endpoint model type, registered by RegisterAllEndpoints; the router now takes {name…}/{$} patterns

Fixed

  • go, go-runtime, postgres: A Go PostgreSQL write now copies each list or map table’s items with one COPY, so a statement trigger on the table, such as the search index’s, runs once per write, and a write no longer prepares a new statement for each number of items it holds. A table with a column of a type without binary input, such as an ISBN, is copied in text format.

go-runtime/v0.6.1 — 2026-11-06#

Fixed

  • go, go-runtime: Deny a PUT or PATCH naming a field the request may neither read nor update before validating it. A PATCH into a hidden embed answered 403 when the embed was set and 422 when it was not, which showed whether it was set, and a PATCH of a required field with null was a 422.

go-runtime/v0.6.0 — 2026-11-06#

Added

  • go, go-runtime, typescript, models: End users can query a struct in a small text language: status = open AND due < 2026-01-01 AND "emma" ORDER BY due DESC. The new find Go feature gives each table Find<Name>, FindSummaries<Name> and a QUERY taking text/vnd.omniblack.model.query, and the Go and TypeScript clients a find method. A field opts out with queryable: false, and every field’s TypeScript metadata says whether a query can name it.

Changed

  • Breaking: go, typescript: Enforce perms at every depth: a field of an embedded struct is guarded exactly as a direct field in a row’s body, its entity tag, searches, queries, referenced_by and related, file reads and writes, and a field’s guards now include the perm of the struct it embeds. So a top_level struct with perms that is embedded elsewhere now guards those embeds. A denied write’s 403 names a data path such as billing.card or items.2.note. A hidden union value in a list or map is sent as a null, or an empty table or mapping in YAML and TOML. In TypeScript, FieldPerms’ actions are now lists of RowPerm, a struct a row reaches carries its perms, and mayField takes an optional root struct.

Fixed

  • go, go-runtime: Deny a PUT or PATCH that provides a value for a field the request may neither read nor update, even the stored value, so the answer no longer confirms a guess at it. A PATCH naming such a field with null is denied too, whether or not it is set, and so is a hidden file sent in a body.

go-runtime/v0.5.21 — 2026-10-27#

Added

  • go, go-runtime, typescript: Serve each REST row’s listing item alone at .../summary, guarded by the summarize perm, and linked from every row as rel="summary". The Go client gains Summary, and the TypeScript client summary() and a summary URL on each row.

go-runtime/v0.5.20 — 2026-10-26#

Added

  • go, go-runtime, typescript: The REST server sends each row’s URLs: a response carrying a row has a Link header for the row itself (rel="self") and for each endpoint it serves below it (related, referenced_by, file), and each listing item that has a url has the same URLs in a urls object. go-runtime/gen/rest gains Endpoint and Endpoints, which the generated code names the endpoints with. The TypeScript client keeps them on each row and item it decodes: client.follow(row, "related") fetches one by name, typed by the generated <Name>Urls, client.urls(row) reads them, and client.get(link) fetches a Link in hand; a FileLink builds a file’s URL. Rows are now Linked<T, <Name>Urls>, which is still a T; the URLs sit under an enumerable symbol, so a test comparing a decoded row with toEqual sees them. restRow, restRowOrPage, listItemSchema and relatedItemSchema take the urls decoder, and the client follows an absolute URL as it is.

go-runtime/v0.5.19 — 2026-10-20#

Added

  • go, go-runtime, typescript: Run a struct’s declared queries over REST: a QUERY of its collection with a JSON body naming the query and its params lists the rows it selects, or redirects to the one row a query by a unique key finds; the Go and TypeScript clients call each query by name

go-runtime/v0.5.18 — 2026-10-20#

Changed

  • postgres, go-runtime: Store a secret field as its plaintext, removing secret.SetStorageKey, Seal and Open; open any sealed secrets before upgrading

go-runtime/v0.5.17 — 2026-10-19#

Added

  • models, go, python, typescript, postgres, go-runtime: Add a uuid field type, with an optional version

go-runtime/v0.5.16 — 2026-10-19#

Added

  • go, typescript, go-runtime: The Go REST endpoints now serve a struct with several primary_key fields, with one path segment for each key in field order, each wildcard named after its field (/api/seat/{hall}/{seat_no}). The Go and TypeScript clients take one parameter per key. A multi-key struct cannot have a path key. mdlrest.Resource.ParseKey now reads the request’s wildcards by name, so generated REST code needs this go-runtime.

go-runtime/v0.5.15 — 2026-10-19#

Added

  • go, go-runtime: Serve GET /{id}/related from the Go REST endpoints, and generate Related and RelatedSummaries on Go postgres structs, listing the rows a row refers to and then the rows referring to it

go-runtime/v0.5.14 — 2026-10-19#

Changed

  • models, go-runtime, typescript, auth: A perm can now be authenticated, for any request with a user and no particular perm, or anonymous, for any request, even one with no user; both work in flat perms, perms by class, and a route’s perm. true is no longer a perm: write anonymous where a class had true (or authenticated, which is the same in user and group). The TypeScript metadata spells perms the same way, so its Perm type is now false | string rather than boolean | string, and mdl.Perm gains Authenticated.

go-runtime/v0.5.13 — 2026-10-18#

Added

  • models, go, go-runtime, postgres, typescript, python: Add a file field type, for bytes a row owns, such as an avatar, stored in PostgreSQL beside the row. A row holds only the file’s metadata, its sniffed content type, size and SHA-256; the bytes are read and uploaded at <row URL>/file/<field>, and in Go with Open<Field> and Set<Field>. max_size and content_types constrain it, and an upload hook can check the content further.

Changed

  • go, go-runtime, typescript, auth: A perm in a struct’s group class is now held in the row’s group, through what the user’s membership of it grants, and never through their account: mdl.Owner gains HasInGroup, which the group class is checked with, and a TypeScript Principal gains hasInGroup, which principalFromPerms fills from its groupPerms option. In the auth library, an account’s groups are Memberships, each naming a group and the roles the account holds in it, and MeResponse reports the perms held in each group as group_perms. A perm that holds in every group, as an instance admin’s does, belongs in the other class.

go-runtime/v0.5.12 — 2026-10-16#

Added

  • models, go, go-runtime: A struct can give its perms by class, as unix does: owner_field and group_field name the fields holding a row’s owner and group, user, group and other each take the struct’s perms, with true for no perm and unset for none, and create splits into self and any. The Go REST endpoints check each row, and their listings and searches keep only the rows the request may list. An mdl.Authorizer gives the user’s ID and groups by also implementing mdl.Owner; mdlrest.Perms now holds mdl.RowPerm values

  • models, go, go-runtime: A field can give its perms by class too: user, group and other each take read, create and update, and an action no class sets adds nothing to the struct’s. The Go REST endpoints check them against the row’s owner and group, the stored row’s for a write over it. mdlrest.FileField’s Read is now an mdl.RowPerm

go-runtime/v0.5.11 — 2026-10-16#

Added

  • models, cli, go, go-runtime, typescript, postgres: A ref can refer into another model with model: <name>, which [tool.model.foreign.<name>] in model.toml locates. The foreign model is loaded, not generated: Go and TypeScript import the target’s <Target>Ref from its client library, and PostgreSQL stores the key without a foreign key. The Go client and TypeScript output now declare a <Target>Ref for every top-level struct with a single key, and a Go client’s Resolve reads the row through the client WithClient puts in the context, returning the new mdlclient.ErrNoClient without one.

go-runtime/v0.5.10 — 2026-10-16#

Added

  • go, go-runtime: Generate a Go client of a model’s server with a [tool.model.go-client] table (out, package, pascal-case). It is a package of its own, holding the model’s types in the shape a response has: a field whose read is false is left out, and one whose read names a perm is an mdl.Optional. Each route is a method of its Client, returning the success body or an *mdlclient.RouteError carrying the error body. With [tool.model.go.rest], each REST resource has a <Struct>Resource whose methods create, list, read, replace, patch, remove, query, list referrers, and upload, and refuse with an *mdlclient.Problem. NewClient builds a client from a base URL, and WithCookiesFrom returns a copy sending an incoming request’s cookies. The new go-runtime/client package is what the generated client calls through.

go-runtime/v0.5.9 — 2026-10-15#

Added

  • go-runtime: Resolve a path against the directory holding a file that need not exist with mdl.ResolveBeside

Fixed

  • go, go-runtime: Insert a row whose path is relative_to a source field before the source’s file exists, as a new row’s file is only staged: generated Go resolves it with mdl.ResolveBeside rather than looking the file up

go-runtime/v0.5.8 — 2026-10-14#

Added

  • go, go-runtime: Upload a row’s file with POST …/file/{field…}?path=…, set the path and write the file with fsedit, into a root whose opener returns an mdl.DirFS such as mdl.RootFS

  • go-runtime: Stream a file into an fsedit transaction with fsedit.WriteFrom, or with Receive and then WriteReceived once its path is known, holding no directory lock while it is read

  • go-runtime: Stream an uploaded file to disk rather than holding it in memory, receiving it before the row is locked, and answer a body over mdl.UploadLimit (32 MiB unless SetUploadLimit or WithUploadLimit says otherwise) with 413

go-runtime/v0.5.7 — 2026-10-14#

Added

  • models, go, go-runtime: Allow several {name...} wildcards in a route path, with a literal segment between each two, and {name...?} for one that matches lazily

  • go-runtime: Add PathSegments, which unescapes each segment of a {name…} wildcard on its own

Changed

  • go, go-runtime: RegisterAllEndpoints and RegisterRestEndpoints take a *mdl.Router instead of an *http.ServeMux, and every generated endpoint is routed by it. Serve the router, or mount it with mux.Handle("/", router). Its 404 and 405 answers are application/problem+json

  • models, go, go-runtime: A {name...} wildcard matches at least one segment and a {name} a non-empty one, and a route path may not end in /. A REST path key no longer ignores a trailing /, and the collection is listed at /api/t, not /api/t/

  • go, go-runtime: A Go document giving a string field “” reads it as no value: a required field reports “is required”, an optional one is None, and a blank list item or map entry is “is required” at its path. Password, Secret and ISBN UnmarshalText read “” as their zero value.

  • go-runtime: Replace mdlrest Resource.File with Files, which serves every file below a row’s fields

go-runtime/v0.5.6 — 2026-10-11#

Changed

  • go, go-runtime: Report a Go constraint violation with the message Python reports, and quote a string map key in its data path, as prices.'usd'.amount

Fixed

  • go, go-runtime: Reject a Go JSON, YAML or TOML document that leaves out a required field, or sets it to null, instead of decoding it as its zero value. FromRaw returns a *mdl.ValidationError of kind required; REST answers 422 and a route 400. A PUT may still leave out a field its request may not read, and a route body a field its URL names. A route with path placeholders and an empty body is checked too, so it is answered 400 when a required field the URL does not name is missing.

  • go, go-runtime: Name a missing required field by its full data path in a Go FromRaw error, and report every one

  • go-runtime: Password.Destroy no longer hashes the plaintext before wiping it; a Password destroyed unhashed has no hash

go-runtime/v0.5.5 — 2026-10-11#

Fixed

  • go, go-runtime: Hand FromError a request that does not decode or a path parameter that does not parse as an mdl.RequestError, so it can tell the 400 from a server fault

go-runtime/v0.5.4 — 2026-10-10#

Added

  • go, go-runtime: Wrap each route’s handler in middleware passed to RegisterAllEndpoints

  • go, go-runtime: Let installed extensions claim a YAML key on routes, enabled per model under [tool.model] extensions. In Go, RegisterAllEndpoints then takes a generated RouteExtensions, with one mdl.ExtMiddleware field per extension, which wraps each route that sets the key, given its value in the extension’s own Go type. A route key that nothing claims now loads with a warning.

  • go, go-runtime, models, postgres: Guard structs, their fields, and routes with perms. A top_level struct sets perms (summarize, read, create, update, delete, falling back to one another), a field its own read, create and update, and a route a perm; each is a perm’s name, false for one nobody holds, or null. With the new Go auth feature, RegisterRestEndpoints and RegisterAllEndpoints take an mdl.Authorizer and enforce them: a denied request gets a 404 without a user and a 403 with one, rows a request may not summarize drop out of referenced_by and other summaries, as do rows referring only through a field it may not read, a search needs both summarize and read, and a field it may not read is left out of the row. A field that sets read is left out of the PostgreSQL search index, so a search cannot reveal what it holds.

  • models, go, go-runtime, postgres, typescript: Add password and secret field types. In Go they are held in guarded memfd_secret memory by go-secret, which needs GOEXPERIMENT=runtimesecret. A password writes and stores its Argon2id hash, and a secret is stored sealed with a key set through secret.SetStorageKey.

  • go, go-runtime: Generated Go structs, enums and union variants get Equals; secret.Secret and secret.Password get a constant-time Equals

Fixed

  • go, go-runtime: Merge a REST PATCH into the stored row in memory, so a field the patch does not name keeps its value and patching a row no longer rehashes its password

  • go, go-runtime: Compute a REST row’s entity tag from the fields the request may read, without copying a secret’s plaintext out of guarded memory

  • go, go-runtime: Compare a REST write’s field-perm values without copying a secret’s plaintext out of guarded memory

go-runtime/v0.5.3 — 2026-10-09#

Added

  • go, go-runtime: Serve GET /{id}/referenced_by from the Go REST endpoints, listing the rows that refer to a row by their summaries

go-runtime/v0.5.2 — 2026-10-09#

Added

  • go, go-runtime: Read every search hit’s summary at once with SearchSummaries, and search every table over REST with a QUERY of the base path

go-runtime/v0.5.1 — 2026-10-08#

Added

  • go, go-runtime: A REST listing item gains title_html and subtitle_html, its summary lines rendered as HTML, and mdlsummary.Markdown gains HTML to render one

go-runtime/v0.5.0 — 2026-10-08#

Added

  • models, go, go-runtime, sphinx: A summary can declare a subtitle, a second template over its fields; Go gains RenderSubtitle and SummarySubtitle, and a REST listing item a subtitle, left out when it renders empty

Changed

  • Breaking: models, go, go-runtime, sphinx: A summary’s template key is now title, and its rendered line is a title: Summary’s Render is RenderTitle, a struct’s Summary is SummaryTitle, and a REST listing item’s summary key, and mdlrest.Item’s Summary field, are title

go-runtime/v0.4.2 — 2026-10-08#

Added

  • models, go, go-runtime, sphinx: A summary’s image names a url or rooted path field; a REST listing item links to it as its image: the url’s absolute URL, or the row’s …/file/ URL

go-runtime/v0.4.1 — 2026-10-08#

Added

  • go, go-runtime: Serve the file a row’s rooted path field names over REST at …/file/, with ranged GETs

go-runtime/v0.4.0 — 2026-10-07#

Added

  • models, go, go-runtime, postgres: A struct can declare a summary: a Go text/template over the fields it names, rendered as one line of inline Markdown. Go gets a <Name>Summary type holding those fields, with Render(), and Summary() and SummaryData() on the struct; with the postgres feature, GetSummaryT and SearchSummariesT read a summary and every row its references name in one query. Each Go enum gains a Display() method returning its value’s display.

  • go, go-runtime, postgres: A REST QUERY /api/t searches the rows of T: its text/plain body is a search in the web search syntax of SearchT, and the response lists the rows that match, best match first, as items and pages like the GET /api/t listing. Only a table with a search index takes QUERY, and its GET /api/t response has an Accept-Query: text/plain header.

Changed

  • go, go-runtime, python, typescript, postgres: A datetime keeps its IANA zone: RFC 9557 on the wire, Temporal.ZonedDateTime in TypeScript, and a _zone column in PostgreSQL.

  • Breaking: go, go-runtime, postgres: A REST GET /api/t lists the rows of T in key order, and a GET of a path with no row lists the rows under it as before, now both as items: {"fields": ..., "summary": ..., "url": ...}, where fields is the wire form of the row’s summary fields, or of its key alone when the struct has no summary, and summary is the rendered summary. That replaces the bare list of URLs a path listing returned, and its TOML urls key is now items. Listings come 100 items to a page, linked by Link headers with rel="next" and rel="prev". Each <Name>Summary gains ToRaw() and MarshalJSON(), and the postgres feature adds ListSummariesT(ctx, limit, offset).

go-runtime/v0.3.0 — 2026-10-06#

Added

  • go-runtime: SetPublicURL sets the public URL a server is reached at, WithPublicURL overrides it for a context, and AbsoluteURL writes a root-relative path as a URL under it. A REST listing and the Location of a new row are absolute when there is a public URL, and root-relative otherwise.

  • go, go-runtime: Let a path root’s opener take a context.Context, which its With methods and the PostgreSQL and REST code then pass on

Changed

  • Breaking: go, go-runtime: A Go REST listing of a path no row has now holds the URL of each row, not its key, and a TOML listing puts them under a urls key, not paths.

go-runtime/v0.2.2 — 2026-10-02#

Added

  • go, go-runtime: List the keys under a path that a REST GET finds no row for, in JSON, YAML, or TOML

Fixed

  • go-runtime: Include the children of / in Path.DescendantRange

go-runtime/v0.2.1 — 2026-10-01#

Changed

  • go, go-runtime: Write an edited TOML string that holds a newline as a multi-line """ string, rather than one line with \n escapes.

go-runtime/v0.2.0 — 2026-10-01#

Added

  • models, go, go-runtime, typescript, python, postgres: A ref can now be a map key. It is written as its target’s key text, and two refs are the same key when their keys are equal. mdl.KeyType admits every generated reference type whose target’s key is itself a KeyType, and PostgreSQL gets a foreign key on the map’s key column. A ref to a struct keyed by an enum cannot be a map key yet.

  • models, go, go-runtime, typescript, python, postgres: A nerd_font_glyph can now be a map key. It is written as the glyph’s full name, as in md:folder, and two keys are the same when they are the same glyph. mdl.KeyType admits nerdfont.Glyph, and a reference to a struct keyed by one.

  • models, go, go-runtime, typescript, python, postgres: A url can now be a map key. A key is written as a url value is, relative to its base where it can be, and a map’s keys and values each take their own base. Two keys are the same when their absolute URLs are. mdl.KeyType admits url.URL, and a reference to a struct keyed by one.

  • go, go-runtime: Open a rooted path field through an opener named in model.toml

  • postgres, go, go-runtime: Store a rooted path field’s resolved form beside it in PostgreSQL, and key a rooted primary key and its refs on it

  • models, python, typescript, go, postgres, go-runtime, sphinx: Add a constant field type: a field that always holds one integer, string, or enum member, named by subtype, value and, for an enum, enum_name. Python gets Literal[...], defaulted to the constant on a required field, and TypeScript the literal type ("circle", 2n, typeof Priority.high). Go, which has no literal types, gets the base type and refuses another value in FromRaw and Validate(), which reports it with the new constant validation kind. PostgreSQL stores the base type with a CHECK that it equals the constant.

  • models, python, typescript, go, go-runtime, sphinx: A union variant holding a struct can set inline_value: true to write the struct flat, its fields beside the tag, instead of under “value”. Its validation errors are then at the struct’s own paths. A tag_name of “value” is allowed when every variant is inlined. go-runtime gains gen.TaggedJSON, yamlx.Tagged and tomlx.Tagged for the generated codecs.

  • models, go, go-runtime, docs: A path field can set source: true to hold the file its top-level struct was read from. In Go the struct gets <Name>RawFile, its Raw without that field, and ReadFile and MarshalFile methods, which pick the format from the file’s media type with the new mdl.FormatOf. The field is not written to the file, and REST and PostgreSQL keep it.

  • go-runtime: On unix, go-runtime loads the shared MIME-info database from $XDG_DATA_HOME and $XDG_DATA_DIRS when it starts, so mime.TypeByExtension and mdl.FormatOf find the types of a system that keeps the database outside /usr/share, such as NixOS. The types are added to the process’s mime table.

  • go, go-runtime: Keep a decoded TOML document’s comments, key order and value styles: MarshalTOML on a decoded struct now edits the document it was read from, rewriting only the keys whose values changed.

Changed

  • Breaking: go, go-runtime, models: A Go map field is now an mdl.Map[K, V], not a map[K]V. It compares keys by value, so big.Int, decimal, time.Time and Path keys work, and it keeps insertion order like a Python dict. Get returns an Optional; Set, SetDefault, Delete, Pop, Has, Len, All, Keys and Values replace indexing, len and range. mdl.FromMap builds one from a map literal. It has a JSON codec; the generated Raw form of a model with YAML or TOML enabled wraps it in one that adds those codecs, so encode a map through the struct that holds it. A map key must be a single value: a list, map, struct or union key is now rejected.

  • Breaking: models, python, typescript, go, go-runtime, postgres: A nerd_font_glyph’s full name is now spelled with a colon, md:folder, not md-folder, following libnerd_font. Every language reads and writes only the new spelling, so wire data and PostgreSQL columns holding md-folder no longer decode; rewrite the first - of each stored name to a :.

  • Breaking: models, python, typescript, go, go-runtime, sphinx: A union variant’s inner_type is now a nested type, so a variant can hold any type: an enum, a list, a string, another union. A bare name is still shorthand for a model type. Every variant is now written as {tag, value}: the discriminator and the variant’s value under “value”, where a struct variant used to be flattened next to the tag. Validation errors sit under “value” too. In Go a variant that holds neither a struct nor a union is a defined type (type ReadingLabels []string), and every variant has a Validate method. A union’s tag_name cannot be “value”. go-runtime’s tomlx.Tagged is replaced by tomlx.Envelope.

Fixed

  • go, go-runtime: Keep map key order, and union field order, in TOML

  • go-runtime: Keep map key order through a JSON merge patch

  • go, go-runtime: Write an integer field to TOML as a TOML integer (sequence = 1), not a string. A value beyond 64 bits, which TOML integers cannot hold, is still written as a string of its digits, as in YAML.

  • go, go-runtime: Write date and time fields to TOML as native local dates and times (due_on = 2026-09-30, when = 12:34:56), not strings, and read a hand-written native date or time, which was rejected. The quoted form earlier versions wrote still loads.

go-runtime/v0.1.2 — 2026-09-28#

Added

  • go, go-runtime: Serve REST endpoints for a table whose primary key is a path, at {id...}

  • go, go-runtime: Allow a route’s {name…} wildcard in any position of its path; Go serves such routes through a generated matcher

  • models, python, typescript, go, postgres, go-runtime: Add a date field type for calendar days: datetime.date in Python, Temporal.PlainDate in TypeScript, the new Date in go-runtime, and date in PostgreSQL

  • models, python, typescript, go, postgres, go-runtime: Add an isbn field type: it reads an ISBN-10 or ISBN-13, with or without hyphens and spaces, and holds the compact ISBN-13, as mdl.ISBN in Go and the isn extension’s isbn13 in PostgreSQL

  • go-runtime: Add txn, the unit of work a request’s other resources commit or roll back with after its database transaction, and fsedit, which makes an edit to several files atomic and crash-recoverable and commits it only after the database does. Call fsedit.Recover at start, before serving.

  • go-runtime: Add Integer, the wire form of a model integer on a generated Raw struct: a big.Int that reads any integer-valued number (30, 30.0, 1e2) and writes its exact digits in JSON, YAML and TOML.

  • models, python, typescript, go, postgres, go-runtime: Add a url field type: an absolute URL, held as yarl.URL in Python, the global URL in TypeScript, url.URL in Go and text in PostgreSQL. A base, either a literal URL or another url field, resolves relative references on decode, and Go and Python write a URL relative to its base again on encode

  • models, python, typescript, go, postgres, go-runtime, sphinx: Add a nerd_font_glyph field type: one Nerd Font glyph, written and stored as its full name (md-folder) and held as the libnerd_font client’s glyph object: Glyph in Python and TypeScript, nerdfont.Glyph in Go, and text in PostgreSQL. Decoding rejects a name that is not a glyph. Generated code needs libnerd_font at run time: the model[nerd_font] extra in Python, the libnerd_font npm package in TypeScript, and the C library in Go.

go-runtime/v0.1.1 — 2026-09-22#

No changes recorded.

go-runtime/v0.1.0 — 2026-09-18#

No changes recorded.