Skip to content

Commit 7ad6a9e

Browse files
Trinity Agentclaude
andcommitted
fix(codegen): VIBEE emits undefined Field type - breaks 2 specs
- Add Field struct definition in codegen_engine_final_upgrade.zig - Add Field struct definition in codegen_full_automation.zig - Add eqlPrimitive helper function for string comparison - Fix StringHashMap usage (takes 1 param, not 2) Fixes #114 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c16ed8f commit 7ad6a9e

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

trinity-nexus/output/lang/zig/codegen_engine_final_upgrade.zig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ pub const NamingConvention = struct {
121121
private_prefix: string,
122122
};
123123

124+
/// Field definition for struct generation
125+
pub const Field = struct {
126+
name: []const u8,
127+
vibee_type: []const u8,
128+
default_value: ?[]const u8,
129+
};
130+
124131
// ═══════════════════════════════════════════════════════════════════════════════
125132
// [CYR:A] WASM
126133
// ═══════════════════════════════════════════════════════════════════════════════
@@ -197,6 +204,11 @@ fn generate_phi_spiral(n: u32, scale: f64, cx: f64, cy: f64) u32 {
197204
// BEHAVIOR FUNCTIONS - Generated from behaviors
198205
// ═══════════════════════════════════════════════════════════════════════════════
199206

207+
/// Helper function for comparing primitive type strings
208+
fn eqlPrimitive(a: []const u8, b: []const u8) bool {
209+
return std.mem.eql(u8, a, b);
210+
}
211+
200212
pub fn resolveTypeFull(vibee_type: []const u8, allocator: Allocator, resolver: *TypeResolver) ![]const u8 {
201213
// in[CYR:I] to
202214
if (resolver.generic_cache.resolved.get(vibee_type)) |cached| {
@@ -235,7 +247,7 @@ fn generate_phi_spiral(n: u32, scale: f64, cx: f64, cy: f64) u32 {
235247
const value_type = try resolveTypeFull(params[1], allocator, resolver);
236248
// in[CYR:I] andport std.hash_map
237249
try resolver.import_tracker.stdlib_imports.put("std.hash_map");
238-
const result = try std.fmt.allocPrint(allocator, "std.StringHashMap({s}, {s})", .{key_type, value_type});
250+
const result = try std.fmt.allocPrint(allocator, "std.StringHashMap({s})", .{value_type});
239251
return result;
240252
}
241253

trinity-nexus/output/lang/zig/codegen_full_automation.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ pub const ImportResolver = struct {
7373
is_stdlib: bool,
7474
};
7575

76+
/// Field definition for struct generation
77+
pub const Field = struct {
78+
name: []const u8,
79+
vibee_type: []const u8,
80+
default_value: ?[]const u8,
81+
};
82+
7683
// ═══════════════════════════════════════════════════════════════════════════════
7784
// [CYR:A] WASM
7885
// ═══════════════════════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)