Skip to content

Commit 502b266

Browse files
committed
init: Autobuild
1 parent 07139c0 commit 502b266

2 files changed

Lines changed: 116 additions & 1 deletion

File tree

build_tools/sharpy_auto_builder/state/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"project_root": "/Users/anton/Documents/github/sharpy",
3-
"task_list_path": "/Users/anton/Documents/github/sharpy/docs/implementation_planning/task_list_0_1_10_module_codegen_fix.md",
3+
"task_list_path": "/Users/anton/github/sharpy/docs/implementation_planning/task_list_0_1_10_codegen_fixes.md",
44
"backends": {
55
"claude_code": {
66
"name": "claude_code",
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"version": "1.0",
3+
"last_updated": "2026-01-16T15:27:58.377185",
4+
"phases": [
5+
{
6+
"id": "0.1.10",
7+
"name": "Code Generation Fixes",
8+
"goal": "",
9+
"status": "pending",
10+
"progress": 0.0,
11+
"tasks": [
12+
{
13+
"id": "0.1.10.CG1",
14+
"phase": "0.1.10",
15+
"title": "Fix Module Import Alias to Use `Exports` Class",
16+
"description": "**Files:**\n- `src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs` (lines 261-347 `GenerateImportUsings`)\n\n**Problem:**\nWhen importing a Sharpy module (not a .NET namespace), the generated using alias points to the wrong class:\n- Current: `using utils_helpers = Utils.Helpers.Helpers;`\n- Expected: `using utils_helpers = Utils.Helpers.Exports;`\n\nThe current code extracts the last segment of the namespace (`Helpers`) as the class name, but Sharpy modules expose their members via a class named `Exports`.\n\n",
17+
"files": [
18+
"src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs"
19+
],
20+
"status": "pending",
21+
"executions": [],
22+
"dependencies": [],
23+
"is_critical": false,
24+
"human_question": null,
25+
"human_answer": null,
26+
"notes": []
27+
},
28+
{
29+
"id": "0.1.10.CG2",
30+
"phase": "0.1.10",
31+
"title": "Track Module-Level Variable Redefinitions",
32+
"description": "**Files:**\n- `src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs` (lines 495-622 `GenerateModuleClass`, lines 2164-2259 `GenerateModuleLevelField`)\n\n**Problem:**\nSharpy allows variable redefinition at module level that changes the type:\n```python\nx: int = 1\nx: auto = \"hello\" # Redefines x as string\n```\n\nCurrently generates invalid C# with duplicate field declarations:\n```csharp\npublic static int X = 1;\npublic static string X = \"hello\"; // CS0102: Duplicate definition\n```\n\n**Fix Approach:**\n1. Add `_",
33+
"files": [
34+
"src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs"
35+
],
36+
"status": "pending",
37+
"executions": [],
38+
"dependencies": [],
39+
"is_critical": false,
40+
"human_question": null,
41+
"human_answer": null,
42+
"notes": []
43+
},
44+
{
45+
"id": "0.1.10.CG3",
46+
"phase": "0.1.10",
47+
"title": "Fix Nested Package Namespace Generation",
48+
"description": "**Files:**\n- `src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs` (lines 193-220 `GenerateProjectNamespace`)\n- `src/Sharpy.Compiler/ProjectCompiler.cs` (namespace generation logic)\n\n**Problem:**\nFor deeply nested packages like `level1/level2/level3/__init__.spy`, the namespace is generated incorrectly:\n- Current: `TestProject.Level1.Level2.Level3.Level3` (duplicated segment)\n- Expected: `TestProject.Level1.Level2.Level3.Init`\n\nThe import alias also has issues:\n- Current: `using level1_level2_level3 = ",
49+
"files": [
50+
"src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs",
51+
"src/Sharpy.Compiler/ProjectCompiler.cs"
52+
],
53+
"status": "pending",
54+
"executions": [],
55+
"dependencies": [],
56+
"is_critical": false,
57+
"human_question": null,
58+
"human_answer": null,
59+
"notes": []
60+
},
61+
{
62+
"id": "0.1.10.CG4",
63+
"phase": "0.1.10",
64+
"title": "Fix `__init__.spy` Class Name for Packages",
65+
"description": "**Files:**\n- `src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs` (lines 625-655 `GetModuleClassName`)\n\n**Problem:**\nPackage `__init__.spy` files generate a class named `Init`, but the import system expects `Exports`:\n- Generated: `namespace TestProject.Mypackage { public static class Init { ... } }`\n- Import expects: `using mypackage = TestProject.Mypackage.Exports;`\n\n**Fix Approach:**\n1. In `GetModuleClassName()`:\n - If the filename is `__init__`, return `\"Exports\"` instead of `\"Init\"`\n - This m",
66+
"files": [
67+
"src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs"
68+
],
69+
"status": "pending",
70+
"executions": [],
71+
"dependencies": [],
72+
"is_critical": false,
73+
"human_question": null,
74+
"human_answer": null,
75+
"notes": []
76+
},
77+
{
78+
"id": "0.1.10.CG5",
79+
"phase": "0.1.10",
80+
"title": "Handle Re-export Syntax in `__init__.spy`",
81+
"description": "**Files:**\n- `src/Sharpy.Compiler/Parser/Parser.cs` (import/export parsing)\n- `src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs` (re-export code generation)\n\n**Problem:**\nThe test `PackageInit_WithReExports_ExportsModuleMembers` fails with parser errors:\n```\nParser error at line 3, column 6: Expected identifier, got Dot\n```\n\nThis suggests the re-export syntax in `__init__.spy` is not being parsed correctly. The syntax likely involves:\n```python\nfrom .basic import BasicOperation\nfrom .advanced import",
82+
"files": [
83+
"src/Sharpy.Compiler/Parser/Parser.cs",
84+
"src/Sharpy.Compiler/CodeGen/RoslynEmitter.cs"
85+
],
86+
"status": "pending",
87+
"executions": [],
88+
"dependencies": [],
89+
"is_critical": false,
90+
"human_question": null,
91+
"human_answer": null,
92+
"notes": []
93+
}
94+
]
95+
}
96+
],
97+
"current_phase_id": null,
98+
"current_task_id": null,
99+
"total_attempts": 0,
100+
"total_successes": 0,
101+
"total_failures": 0,
102+
"backend_stats": {
103+
"claude_code": {
104+
"attempts": 0,
105+
"successes": 0,
106+
"failures": 0
107+
},
108+
"copilot": {
109+
"attempts": 0,
110+
"successes": 0,
111+
"failures": 0
112+
}
113+
},
114+
"overall_progress": 0.0
115+
}

0 commit comments

Comments
 (0)