Skip to content

Java ships the trace-helper generator but no libraries loader option, so metaobjects::ai::LlmCallBase cannot be loaded at all #332

Description

@dmealing

What

The Java port has LlmTraceHelperGenerator but no way to load the metadata that generator exists to consume. There is no libraries loader option and no library/ embed on that port, so extends: metaobjects::ai::LlmCallBase cannot resolve — the documented adopter path fails with ERR_UNRESOLVED_SUPER.

A generator shipped without its input.

Evidence (against main @ 0994d6e41)

$ git ls-tree -r main --name-only | grep LlmTraceHelperGenerator.java
server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/LlmTraceHelperGenerator.java

$ git grep -l "libraries" main -- 'server/java/**/*.java' | grep -v test
(no output)

The only references to LlmCallBase in the Java tree are in a test that declares its own inline under a different package:

server/java/codegen-spring/src/test/java/com/metaobjects/generator/spring/SpringAppliesToTest.java:79:
  { "object.entity": { "name": "LlmCallBase", "abstract": true, ... } }
:87:  "extends": "acme::shop::LlmCallBase"

That is the bypass ADR-0024 already called out — "the green tests pass only because they bypass the shipped base with bespoke entities" — which is why a port can ship a generator it cannot feed and stay green.

Why it matters

This is the same defect that was just closed on the Python port (libraries=[...] + library/ + the embed generator). Until Java has the equivalent, a JVM adopter following the documented extends metaobjects::ai::LlmCallBase path cannot get past load.

Suggested shape

Mirror the Python/TypeScript design rather than inventing a third: canonical library/**/*.yaml at the repo root stays the source, each port embeds it (Python embeds as a generated source module so no build config can drop it), and the loader gains a libraries opt-in that prepends those sources.

Worth adding with it, since none of these existed on Python either:

  • a byte-comparison gate so a stale embed cannot ship,
  • an assertion that extends FAILS without the opt-in and resolves with it — the negative half is what proves the opt-in is doing the work,
  • ADR-0024 FIX fix(cli): scaffold outDir defaults to src/generated, not ./src/db #1 (the recorder's row keys equal LlmCallBase's effective fields, both directions),
  • an acceptance test that RUNS the generated helper against the SHIPPED base rather than a hand-built fixture.

Related

  • TypeScript CLI has a narrower version of this (loader has libraries, CLI does not) — filed separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions