@@ -24,6 +24,7 @@ pub const Paths = struct {
2424 cycle_log_dir : []const u8 ,
2525 alerts_file : []const u8 ,
2626 history_dir : []const u8 ,
27+ ideas_dir : []const u8 ,
2728 allocator : Allocator ,
2829
2930 /// Free all allocated paths
@@ -35,6 +36,7 @@ pub const Paths = struct {
3536 self .allocator .free (self .cycle_log_dir );
3637 self .allocator .free (self .alerts_file );
3738 self .allocator .free (self .history_dir );
39+ self .allocator .free (self .ideas_dir );
3840 }
3941};
4042
@@ -71,6 +73,9 @@ pub fn initDirectories(project_dir: []const u8, allocator: Allocator) !Paths {
7173 const history_dir = try std .fs .path .join (allocator , &.{ opencoder_dir , "history" });
7274 errdefer allocator .free (history_dir );
7375
76+ const ideas_dir = try std .fs .path .join (allocator , &.{ opencoder_dir , "ideas" });
77+ errdefer allocator .free (ideas_dir );
78+
7479 // Create directories with better error context
7580 ensureDir (opencoder_dir ) catch | err | {
7681 if (@import ("builtin" ).is_test == false ) {
@@ -90,6 +95,7 @@ pub fn initDirectories(project_dir: []const u8, allocator: Allocator) !Paths {
9095 try ensureDir (logs_dir );
9196 try ensureDir (cycle_log_dir );
9297 try ensureDir (history_dir );
98+ try ensureDir (ideas_dir );
9399
94100 return Paths {
95101 .opencoder_dir = opencoder_dir ,
@@ -99,6 +105,7 @@ pub fn initDirectories(project_dir: []const u8, allocator: Allocator) !Paths {
99105 .cycle_log_dir = cycle_log_dir ,
100106 .alerts_file = alerts_file ,
101107 .history_dir = history_dir ,
108+ .ideas_dir = ideas_dir ,
102109 .allocator = allocator ,
103110 };
104111}
@@ -252,6 +259,7 @@ test "Paths construction" {
252259 try std .testing .expectEqualStrings ("/tmp/opencoder_test_paths/.opencoder/state.json" , paths .state_file );
253260 try std .testing .expectEqualStrings ("/tmp/opencoder_test_paths/.opencoder/current_plan.md" , paths .current_plan );
254261 try std .testing .expectEqualStrings ("/tmp/opencoder_test_paths/.opencoder/history" , paths .history_dir );
262+ try std .testing .expectEqualStrings ("/tmp/opencoder_test_paths/.opencoder/ideas" , paths .ideas_dir );
255263
256264 // Clean up
257265 fs .cwd ().deleteTree ("/tmp/opencoder_test_paths" ) catch {};
0 commit comments