test(codegen): pin FQN @objectRef payload codegen strips to bare names (Python + Kotlin)#190
Merged
Merged
Conversation
…s (Python + Kotlin) Cross-port coverage follow-up to the TS promptRender FQN fix (54433a0). An investigation of all four non-TS ports found the FQN-leak is TS-only — Java/C#/Kotlin/Python payload-VO codegen already strip the package (splitFqn / StripPkg / KotlinPoet ClassName(pkg,name)) — but Python and Kotlin lacked a test forcing a real package-qualified @objectref through that path. - Python: test_plain_object_field_strips_fqn_to_bare_nested_payload — a plain field.object @objectref="acme::ai::Note" isArray on a payload VO emits list[NotePayload] + class NotePayload(BaseModel), never the FQN. - Kotlin: a two-package fixture (Note in acme::ai referenced from Report in acme::demo) forces a real prefix through PackageMapping.splitFqn; asserts val notes: List<NotePayload> + data class NotePayload, no '::' in any emitted identifier. Test-only, no product-code change (all four ports were already correct). Java + C# already had equivalent FQN regression tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FaRaYFjvWVV8D6h33ejj1m
dmealing
added a commit
that referenced
this pull request
Jul 10, 2026
…nt-context skills npm-only patch, 14-package lockstep 0.15.17 -> 0.15.18. TS-only; PyPI/NuGet/Maven unchanged. Non-breaking; advances the 1.0 quiet period. - fix(codegen-ts): promptRender emits bare TS names for FQN @objectref payload refs (54433a0) - fix(agent-context): broken skill YAML front-matter, wrong C# ref, deploy-all -> stack-scoped, deprecated imports, tanstack paths, ADR-0040 index.lookup, stale Kotlin fixture (red on main) - test(codegen): cross-port Python + Kotlin FQN regression coverage (#190) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FaRaYFjvWVV8D6h33ejj1m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cross-port coverage follow-up to the TypeScript
promptRenderFQN fix (54433a0b).The TS bug: under package declaration, a nested
@objectRefin a prompt-payload value-object canonicalizes to an FQN (pkg::Name, FR-032/ADR-0041), and the TS payload generator emitted it verbatim as both the field type and the interface name → invalid TypeScript. Fixed onmainwith a regression test.I then checked all four other ports. The FQN-leak is TS-only — Java, C#, Kotlin, and Python payload-VO codegen all already strip the package (structured name construction:
splitFqn/StripPkg/ KotlinPoetClassName(pkg, name)— vs TS's string interpolation that let::leak). Java and C# already have full-FQN regression tests (C# even Roslyn-compiles the output). Python and Kotlin were correct but had no test forcing a real package-qualified@objectRefthrough that path — this PR closes those two gaps.Changes (test-only — no product code)
test_payload_vo_generator.py):test_plain_object_field_strips_fqn_to_bare_nested_payload— a plainfield.object @objectRef="acme::ai::Note" isArrayon a payload VO emitslist[NotePayload]+class NotePayload(BaseModel), and the referenced FQN never leaks. (Closes the only payload path with zero unit coverage.)KotlinPayloadGeneratorTest.kt): a two-package fixture (Noteinacme::aireferenced fromReportinacme::demo) forces a real prefix throughPackageMapping.splitFqn; assertsval notes: List<NotePayload>+data class NotePayload, and no::in any emitted identifier.Verification
pytest test_payload_vo_generator.py→ 21 passed (+1).mvn -pl codegen-kotlin test -Dtest=KotlinPayloadGeneratorTest→ 7 passed.Both pass on first run (the product code was already correct). Non-TS, so no PyPI/Maven republish needed — the shippable fix (TS
promptRender) is already onmain.Follow-ups (out of scope — surfaced during the hunt, unconfirmed, no fixture)
@payloadRefselector matches on barec.Name == payloadRef— may not match an FQN payloadRef.🤖 Generated with Claude Code
https://claude.ai/code/session_01FaRaYFjvWVV8D6h33ejj1m