Skip to content

Commit 5de4623

Browse files
dmealingclaude
andcommitted
docs(render): the JVM derives has<Field> in its engine now, not on a generated record
Two TS render comments and one Python test comment still described the removed payload tier: the JVM emitting has<Field>() onto every SpringPayloadGenerator record, and resolve_payload_vo living in payload_vo_generator. Since ADR-0056 the JVM engine derives the accessors from the value object's own record, and the resolver lives in metaobjects.codegen.value_objects. Part of #387. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ghY6h6CaGzZcmpHJ7msWQ
1 parent ffa0806 commit 5de4623

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎server/python/tests/codegen/test_extract_tier_collision.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ def test_no_churn_non_colliding_nested_vo_keeps_bare_names() -> None:
310310
#
311311
# Fix round 2 (#228 Important, fable-adjudicated in-scope) — this originally
312312
# authored each `@payloadRef` as an FQN to sidestep a SEPARATE bug found while
313-
# writing this test: `payload_vo_generator.resolve_payload_vo` (the BUILD-TIME
313+
# writing this test: `resolve_payload_vo` (then in `payload_vo_generator`, now in
314+
# `metaobjects.codegen.value_objects`; the BUILD-TIME
314315
# `@payloadRef` -> object.value resolver — the loader's own `_validate_templates`
315316
# pass ALREADY resolves this exact ref package-local, so codegen silently
316317
# emitting a DIFFERENT object than the loader validated was in-charter) was not

‎server/typescript/packages/render/src/payload-accessors.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// `hasAbilities` follows from it. Declaring both would let them disagree.
77
//
88
// THE RULE IS SHARED ON PURPOSE. The JVM has carried this since 7.7.7
9-
// (`com.metaobjects.render.PayloadAccessors`, emitted by `SpringPayloadGenerator`
10-
// onto every generated payload record and accepted by `render.Verify`), and its
11-
// comment says the emitter and the verifier share one rule so they "can never drift
12-
// apart". TypeScript had neither half, which is why the same template verified clean
9+
// (`com.metaobjects.render.PayloadAccessors`, accepted by `render.Verify`; it was once
10+
// emitted as `has<Field>()` methods on every generated payload record, and since
11+
// ADR-0056 the JVM engine derives it from the record instead), and its comment says
12+
// the two sides share one rule so they "can never drift apart". TypeScript had neither half, which is why the same template verified clean
1313
// on the JVM and reported drift here — and, worse, RENDERED WRONG rather than
1414
// failing: `{{#hasAbilities}}` resolved to nothing on a populated payload, so the
1515
// section silently vanished. This module is the TS half of that shared rule.

‎server/typescript/packages/render/test/payload-accessors.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Derived `has<Field>` accessors — the TS half of a rule the JVM has carried since 7.7.7.
22
//
33
// A prompt needs conditional sections, and the payload contract answers that with a
4-
// DERIVED accessor: declare `abilities`, get `hasAbilities`. The JVM emits
5-
// `has<Field>()` onto every generated payload record (SpringPayloadGenerator) and
6-
// accepts `{{#has<Field>}}` in its static drift check (render.Verify), sharing one
7-
// naming rule so the two can never disagree.
4+
// DERIVED accessor: declare `abilities`, get `hasAbilities`. The JVM derives
5+
// `has<Field>` for a payload in its render engine (it used to emit `has<Field>()` onto
6+
// every generated payload record, until ADR-0056 removed that copy) and accepts
7+
// `{{#has<Field>}}` in its static drift check (render.Verify), sharing one naming rule
8+
// so the two can never disagree.
89
//
910
// TypeScript had NEITHER half, and the consequence was not a loud one. Verify reported
1011
// ERR_VAR_NOT_ON_PAYLOAD for a template the JVM verified clean — and render silently

0 commit comments

Comments
 (0)