You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 363802e
Browse filesBrowse the repository at this point in the historyBrowse files
docs(agent-context): refresh the MetaObjects skills to 0.24.2
The scaffolded agent context was generated by 0.15.18 and had not moved since the
initial public release, so every `meta gen` / `meta verify` run printed a staleness
nudge -- and anyone cloning this repo to see how MetaObjects is used was reading
guidance nine minor lines out of date.
`meta init --docs-only --refresh-docs` rewrites all 16 scaffolded files from the
installed CLI. Nothing here was hand-edited (the context stamp records a hash per
file for exactly that reason), so this is a clean overwrite: +1209/-216 across the
six skills plus AGENTS.md/CLAUDE.md, and the stamp now reads 0.24.2.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NynrRND6ZUwGvq3ZUTCfxG
- D1 dialect: **TS-only by design** — `dialect: "d1"` in `metaobjects.config.ts` targets Cloudflare D1 via the Wrangler CLI layout. Do NOT recommend porting D1 support to other languages.
Every command's directory argument (`meta docs <project-root>`, `--cwd`) is the
79
+
PROJECT ROOT that CONTAINS the metadata — never the metadata directory itself.
80
+
70
81
## The generators
71
82
72
83
From `@metaobjectsdev/codegen-ts/generators` (server-side, framework-neutral):
@@ -78,7 +89,31 @@ From `@metaobjectsdev/codegen-ts/generators` (server-side, framework-neutral):
78
89
|`routesFile()`|`<Entity>.routes.ts` — Fastify CRUD routes on the cross-port REST contract. `routesFileHono()` is the Hono/Workers variant. A TPH `@discriminator` base mounts polymorphic `GET /<base>(+/:id)` plus a per-subtype CRUD set at `<basePath>/<discriminatorValue lowercased>` — create omits the discriminator (the URL names the subtype; the runtime injects it); get/update/delete scoped to the subtype (cross-subtype → 404); discriminator immutable via the runtime `discriminator` option. |
79
90
|`barrel()`|`index.ts` re-exporting each `<Entity>.ts` (one-shot, not per-entity) |
80
91
|`promptRender()`|`render<Name>()` per `template.prompt`|
81
-
|`outputParser()`|`<Name>.output.ts` (`parse*` / `safeParse*`) per `template.output`|
92
+
|`outputParser()`|`<Name>.response.ts` (`parse*` / `safeParse*`) per **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: this tier is INBOUND; `template.output` is outbound only and emits nothing here). Siblings: `outputPrompt()` → `<Name>.responseFormat.ts` (the FR-010 output-format fragment, presentation via `@promptStyle`), `extractor()` → `<Name>.extractor.ts` (the tolerant `extract` mapper). |
93
+
|`callableFile()`|`<Entity>.callable.ts` — an FR-015 `call<Entity>` wrapper for a `source.rdb``@kind: storedProc`/`tableFunction` (args from the `@parameterRef` value object, in declaration order) |
94
+
95
+
**Projections (read-only views).** For an `object.projection` (a read-only `source.rdb`
96
+
`@kind: view` child), `entityFile()` emits a `pgView(...)` + read-only Zod + a read-only
97
+
finder (no create/update/delete). The `CREATE VIEW` DDL is generated by `meta migrate`
98
+
from the projection's `origin.*` children — `origin.passthrough` (a forwarded column),
99
+
`origin.aggregate` (`@agg``count`/`sum`/`avg`/`min`/`max`, plus the #195`any`/`all`
100
+
predicate quantifiers over a `@filter` and `collect` array-rollup with optional
101
+
`@distinct`/`@orderBy`; any aggregate row-scoped with `@filter`),
102
+
`origin.computed` (a row-level `@expr`), `origin.first` (one related row's
103
+
column along `@via`/`@of`/`@orderBy`). An object-level `@filter` on the projection scopes
104
+
the whole view's rows (#207 — lowers to the outer `WHERE`, the metadata-managed
105
+
soft-delete/status view). **Never hand-write the view SQL** for a shape origins can
106
+
express (an unmodeled view is unmanaged and drifts silently); for a genuinely irreducible
107
+
body (recursive CTE, window function, set op), carry it in the `source.rdb`**`@sql`**
108
+
escape (#208) so the tool still owns it, or mark a Flyway-owned object `@unmanaged: true`.
109
+
110
+
**Entity read-view (write-through).** An `object.entity` that keeps its writable `table`
111
+
primary source and adds a `@role: replica``@kind: view` source is a write-through
112
+
read-view (#214): `entityFile()` routes generated **reads** through the replica `pgView`
113
+
(the read Zod carries the derived `origin.*` fields via `z.infer`), while `queriesFile()`
114
+
writes target the table with derived fields excluded from the insert/update codecs; a
115
+
create/update re-reads the row via the view by primary key (read-your-writes). The replica
116
+
view's DDL is emitted by `meta migrate` from the same origin assembly as a projection view.
82
117
83
118
## Discriminator inheritance (TPH)
84
119
@@ -98,10 +133,10 @@ cross-subtype 404. Conformance-gated by `fixtures/api-contract-conformance/tph`
98
133
(HTTP wire shape) and `fixtures/persistence-conformance/tph-*` (single-table
99
134
runtime semantics).
100
135
101
-
## Docs — `meta docs` (one door, two surfaces)
136
+
## Docs — `meta docs` (one door, three surfaces)
102
137
103
138
Documentation is NOT a `meta gen` generator. The single door is the `meta docs`
104
-
command, which emits two cross-linked **surfaces** under one output dir (default
139
+
command, which emits three cross-linked **surfaces** under one output dir (default
105
140
`./docs`):
106
141
107
142
-**model surface** (`./docs/<Entity>.md`, `./docs/<Template>.md`) — the neutral
@@ -111,11 +146,19 @@ command, which emits two cross-linked **surfaces** under one output dir (default
111
146
`./docs/api/AGENT-API.md`) — the SDK/API reference: the concrete imports,
112
147
function signatures, payload field shapes, and runnable examples for *this*
0 commit comments