Repository navigation
fix: lift a record into its qualified Go type - #249
arcjet-rei wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
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>
ae04f21 to
12017e5
Compare
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 withundefined: Job. Record lifting now usesqualified_type_name, as variant and enum lifting already do.The
regressionsexample gains two interfaces that each declarerecord job, and its Go test passes one to each host.🤖 Generated with Claude Code