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 dbe156e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(agent-context): the agent-facing docs learn ADR-0052's direction split and the sources set
Two shipped-and-wrong agent-facing surfaces. The human-facing docs were correct in both
cases — only the agent context missed the pass, which is the worse half to miss, because
an agent reads it as ground truth and acts on it without a second source.
1. @PromptStyle WAS DOCUMENTED EXACTLY BACKWARDS. capability-checklist.md claimed it "is on
`template.output` ONLY; authoring it on `template.prompt` fails load with
ERR_UNKNOWN_ATTR". The registry says the opposite — @PromptStyle is registered on
`template.prompt` (spec/metamodel/template.json:120, byte-gated at
expected-registry.json:4147). An agent following the checklist would have authored the
attribute on the one subtype where it actually fails to load, then been told by the same
file that the resulting error was impossible. The claim appeared TWICE in that block (the
inventory line and the parenthetical), so deleting either alone left it standing.
ADR-0052 Phase G swept the `metaobjects-prompts` skill and its five per-port references;
`metaobjects-codegen` and `metaobjects-audit` were missed. Both now carry the ruling: a
template subtype's axis is DIRECTION — `template.prompt` owns both halves of talking to a
model (a prompt carrying @responseRef owns the parser, the tolerant extract and the FR-010
output-format fragment), while `template.output` is outbound only and emits no parser.
The audit heuristics were the load-bearing part: five of them told an auditor to flag a
hand-rolled parser "where a `template.output` node exists", which is now the wrong node to
look for — that check would miss every real finding and manufacture false ones. All
re-keyed onto a responding `template.prompt`.
Attr inventories reconciled against the registry rather than hand-inverted, which turned up
four MORE errors the report did not mention: template.prompt was missing @PromptStyle and
@responseFormat, template.output was missing @payloadRef/@textRef/@format/@maxchars, and
template.toolcall was missing @maxtokens. The emitted TS filenames were stale too
(.output.ts is now <Name>.response.ts, plus .responseFormat.ts / .extractor.ts) — verified
against the generators, not the ADR, since an accepted ADR is a decision and the emitter is
the fact. Generator CLASS names (SpringOutputParserGenerator et al) are unchanged and kept.
2. `sources` WAS ENTIRELY ABSENT from the scaffolded agent context — `grep -c sources` on
agent-docs/body.ts returned 0 — while :225 actively asserted `.metaobjects/config.json`
"is unchanged — it still holds static project state". It holds `sources`, the release's
headline feature (config.ts:132). So every project scaffolded by `meta init` got agent
docs that could not describe where its own metadata comes from, and positively said
nothing had changed.
Adds a "Where metadata comes from" section stating the rule the feature doc reserves this
very file for: `metaobjects/` IS THE DEFAULT VALUE of `sources`, never a requirement, and
must not be assumed to exist. Covers the declaration shape, that all five commands read
the same set, that a path is read in place and never installed, four-CLI-surface support,
set-not-list ordering, and strict unknown-key rejection.
This closes the wording gap no-hardcoded-metadata-dir.test.ts's own allowlist entry
recorded as known-and-open; that reason is updated rather than left describing a gap that
no longer exists.
All five byte-gated agent-context-conformance expected trees regenerated via
sdk/scripts/regen-agent-context-conformance.ts.
Verified: sdk 278 pass / 0 fail. cli 596 pass / 2 fail — both pre-existing on main
(verify-requirements-e2e "dangling reference on status=abandoned exits 0" and
requirement-check "allowedValues"), fixed in a peer's unpushed commit, neither touched here.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-audit/references/java.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ plugin `<configuration>` — that is the source of truth for which generators ru
49
49
| Hand-written `@RestController` on a CRUD entity |`SpringControllerGenerator` should own this; trust the `pom.xml``<generators>` configuration, not stale docs |
50
50
|`interface <Entity>Repository` with no `@generated` comment |`SpringRepositoryGenerator` emits the stub; compare field by field |
51
51
|`// keep in sync with` / `// mirrors the`| second-source-of-truth comment — always a finding |
52
-
|`ObjectMapper.readValue(` outside a `*Parser.java` file | check if a `template.output` node exists — output-parser codegen ships in Java |
52
+
|`ObjectMapper.readValue(` outside a `*Parser.java` file | check if a responding `template.prompt` (`@responseRef`) exists — output-parser codegen ships in Java |
53
53
|`LIMIT ?` / `OFFSET ?` assembled by hand | generated CRUD routes handle pagination; OMDB `getObjects` accepts `QueryOptions`|
54
54
55
55
---
@@ -92,7 +92,8 @@ versioning — **do not flag it** (only intra-port skew matters).
92
92
*generates* the typed `<Name>Parser` class; the Jackson `readValue` call lives inside that
93
93
generated file. It is NOT a defect to see Jackson deserialization in a generated `*Parser.java`
94
94
file. **Do not flag Jackson `readValue` calls in generated `*Parser.java` files.** DO flag a
95
-
hand-rolled parser in a *non*-generated file where a `template.output` node exists.
95
+
hand-rolled parser in a *non*-generated file where a responding `template.prompt`
96
+
(`@responseRef`) exists — per ADR-0052 a `template.output` emits no parser.
96
97
-**Core filter-operator codegen ships in Java — do NOT treat it as deferred.**
97
98
`SpringControllerGenerator` generates the `?filter[field][op]=value` grammar (all 9 operators
98
99
`eq/ne/gt/gte/lt/lte/in/like/isNull`): it parses via the runtime `FilterParser`, validates
- 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.
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/csharp.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,8 @@ or run the default set. Output lands under `--namespace` in `--output-dir`.
45
45
|`routes`|`<Entity>Routes.cs` — ASP.NET **Minimal API** CRUD per writable entity (`source.rdb @kind="table"`) on the cross-port REST contract (`?filter[field][op]=`, `?sort=field:asc`, `?limit`/`?offset`, `?withCount=1` envelope, 400/404 envelopes). A TPH base emits polymorphic `GET /<base>(+/{id})` + a per-subtype CRUD set at `/<base>/<discriminatorValue lowercased>` (create injects the discriminator, cross-subtype get/update/delete → 404). |
46
46
|`filter-allowlist`| per-entity `<Entity>FilterAllowlist` (FR-009 — the server-side field+operator allowlist the routes validate against). |
47
47
|`callable`|`<Entity>.callable.g.cs` — an FR-015 calling method for a `source.rdb @kind="storedProc"|"tableFunction"`, via EF `FromSqlInterpolated` (args from the `@parameterRef` value object in declaration order). |
48
-
|`payload`|`<Payload>.payload.cs` — the strict typed payload `record` (+ any nested element records) per `template.output``@payloadRef`(an `object.value`) that the parser/extractor bind to. |
49
-
|`output-parser` / `extractor` / `output-prompt` / `render-helper`| the `template.output` prompt-pillar artifacts — the strict parser, the tolerant `extract`, the **output-format prompt fragment** (`output-prompt`; presentation via `@promptStyle: guide`/`inline`/`exampleOnly`), and the typed render helper. See the **prompts** reference. |
48
+
|`payload`|`<Payload>.payload.cs` — the strict typed payload `record` (+ any nested element records) per `template.prompt``@payloadRef`/ `@responseRef` (each an `object.value`): `@payloadRef` types the REQUEST, `@responseRef` the REPLY the parser/extractor bind to. |
49
+
|`output-parser` / `extractor` / `output-prompt` / `render-helper`| the prompt-pillar artifacts for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: these tiers are INBOUND; `template.output` is outbound only and emits no parser). The strict parser, the tolerant `extract`, the **output-format prompt fragment** (`output-prompt`; presentation via `@promptStyle: guide`/`inline`/`exampleOnly`), and the typed render helper. See the **prompts** reference. |
50
50
|`template`| the generic Mustache `templateGenerator()` primitive. |
51
51
52
52
Metadata lives under `metaobjects/` (or wherever you point `--metadata-dir`) in the
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/java.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,8 +101,8 @@ separate `metaobjects-codegen-base` module instead.)
101
101
|`SpringRepositoryGenerator`|`<Entity>Repository.java` — a hand-stubbed `interface` the consumer implements with their persistence layer (Spring Data JPA / jOOQ / JDBC). For a TPH base the interface is polymorphic + per-subtype-scoped (`listByType`/`findByIdAndType`/`createWithType`/`updateByIdAndType`/`deleteByIdAndType`) over the single table; subtype entities emit no own controller/DTO/repository — they fold into the base. |
102
102
|`SpringValueObjectGenerator`| a Java 21 `record` per `object.value` reached through a `field.object @storage: jsonb` column (single or `@isArray`, transitively through nested VOs) — the typed component the Jackson jsonb codec serializes to/from (carries jakarta validation, unlike a plain payload record). Program D typed-jsonb VOs. |
103
103
|`SpringPayloadGenerator`| a Java 21 `record` per `template` payload VO |
104
-
|`SpringOutputParserGenerator`| the `template.output`strict parser-on-receipt (see the prompts reference)|
105
-
|`SpringOutputPromptGenerator`| the FR-010 output-format prompt fragment for a `template.output` (presentation via `@promptStyle: guide`/`inline`/`exampleOnly`) |
104
+
|`SpringOutputParserGenerator`| the strict parser-on-receipt for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: INBOUND; a `template.output` emits no parser). See the prompts reference.|
105
+
|`SpringOutputPromptGenerator`| the FR-010 output-format prompt fragment for a responding `template.prompt` (presentation via `@promptStyle: guide`/`inline`/`exampleOnly`) |
106
106
|`SpringRenderHelperGenerator`| the typed render helper for a `template.prompt` payload |
107
107
|`LlmTraceHelperGenerator`|`<Entity>TraceHelper.java` per concrete entity — the LLM-trace helper |
Copy file name to clipboardExpand all lines: agent-context/skills/metaobjects-codegen/references/kotlin.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,9 +114,9 @@ All live in `metaobjects-codegen-kotlin` under
114
114
|`KotlinSpringControllerGenerator`|`<Entity>Controller.kt` — Spring `@RestController`, five CRUD endpoints on the cross-port REST contract, for writable entities (`source.rdb``@kind="table"`). A TPH `@discriminator` base emits ONE controller: polymorphic `GET /<base>(+/{id})` plus a per-subtype CRUD set at `/<base>/<discriminatorValue lowercased>` — create injects the discriminator from the URL (never the body); get/update/delete are scoped to the subtype (cross-subtype → 404); the discriminator is immutable. |
115
115
|`KotlinRepositoryGenerator`|`<Entity>RepositoryBase.kt` — an `open class` consumer persistence seam per writable entity (the Kotlin peer of Java's `SpringRepositoryGenerator`, but with method bodies). Carries the #203`@autoSet` CRUD stamping: `onCreate` columns stamped once at insert, `onUpdate` columns re-stamped on every write, both excluded from the caller-supplied set. |
116
116
|`KotlinPayloadGenerator`|`<Template>Payload.kt` — `@Serializable` payload data class from a template's `@payloadRef`|
117
-
|`KotlinOutputParserGenerator`| the `template.output`strict parser-on-receipt (see the prompts reference)|
118
-
|`KotlinExtractorGenerator`| the FR-010 tolerant `extract` mapper for a `template.output` (all-nullable mirror → strict payload) |
119
-
|`KotlinOutputPromptGenerator`| the FR-010 output-format prompt fragment for a `template.output` (presentation via `@promptStyle: guide`/`inline`/`exampleOnly`) |
117
+
|`KotlinOutputParserGenerator`| the strict parser-on-receipt for a **responding `template.prompt`** — one carrying `@responseRef` (ADR-0052: INBOUND; a `template.output` emits no parser). See the prompts reference.|
118
+
|`KotlinExtractorGenerator`| the FR-010 tolerant `extract` mapper for a responding `template.prompt` (all-nullable mirror → strict payload) |
119
+
|`KotlinOutputPromptGenerator`| the FR-010 output-format prompt fragment for a responding `template.prompt` (presentation via `@promptStyle: guide`/`inline`/`exampleOnly`) |
120
120
|`KotlinRenderHelperGenerator`| the typed render helper for a `template.prompt` payload |
121
121
|`KotlinValidatorGenerator`|`MetadataStartupValidator.kt` + `ExposedTableValidator.kt` (once per project) |
122
122
|`KotlinSpringConfigGenerator`|`MetadataExposedConfig.kt` — `@Configuration` wiring `Database.connect()` + the startup validator (once per project) |
0 commit comments