Skip to content

fix: lift a record into its qualified Go type - #249

Open
arcjet-rei wants to merge 1 commit into
mainfrom
rei/fix/ENG-1489-record-lift-qualified-name
Open

arcjet-rei wants to merge 1 commit into
mainfrom
rei/fix/ENG-1489-record-lift-qualified-name

Conversation

@arcjet-rei

Copy link
Copy Markdown
Contributor

When two interfaces declare a record with the same name, gravity gives each Go type its interface's name (HostJob, OtherJob), but the code that lifts a record constructed the bare name (Job{...}), so the generated bindings failed to compile with undefined: Job. Record lifting now uses qualified_type_name, as variant and enum lifting already do.

The regressions example gains two interfaces that each declare record job, and its Go test passes one to each host.

🤖 Generated with Claude Code

@arcjet-rei
arcjet-rei requested a review from a team as a code owner October 7, 2026 19:44

@arcjet-review arcjet-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arcjet Review — 🟡 Medium Risk

Decision: Checked

Rationale: This is a meaningful but narrowly scoped code generation fix: record lifting now constructs the qualified Go type name, matching the behavior already used for other generated types. The PR includes both a focused Rust unit test for the generated host function and an end-to-end regressions example covering two interfaces with colliding record names. No security-sensitive files, dependency changes, infrastructure changes, or auth-related code paths were modified, and the security review found no issues. I am approving despite Medium risk because the change is localized, well-tested, and addresses a clear compile-time codegen failure.

Summary of Changes

Updates Gravity's Go code generation so lifted WIT records use their qualified Go type name, and adds regression coverage for two imported interfaces that both define a record named job.

Notes

The AI assessed this PR as approvable, but the trust level (1) does not allow auto-approval. A human reviewer must approve this PR.

Review: afd5ae56 | Model: openai/gpt-5.5 | Powered by Arcjet Review

@arcjet-review arcjet-review Bot added needs review Awaiting human review and removed ai-review-in-progress needs review Awaiting human review labels Oct 7, 2026
When two interfaces declare a record with the same name, gravity
declares each Go type with its interface's name (HostJob, OtherJob),
but RecordLift constructed the bare name (Job{...}), so the bindings
failed to compile with "undefined: Job". RecordLift now names the type
with qualified_type_name, as VariantLift and EnumLift already do.

The regressions example gains two interfaces that each declare
`record job`, and the guest passes one to each host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arcjet-rei
arcjet-rei force-pushed the rei/fix/ENG-1489-record-lift-qualified-name branch from ae04f21 to 12017e5 Compare October 7, 2026 20:00
@arcjet-review arcjet-review Bot added needs review Awaiting human review labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant