compile-fix.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. {
  2. "version": "3.16",
  3. "name": "CompileFix",
  4. "description": "Apply targeted VL fixes based on the latest .vl-code/last-compile.json report. Precondition: run VLCompile first so the compile report is fresh. This workflow fixes files from the current report, then stops for an external recompile/verification pass.",
  5. "sectionMerge": true,
  6. "registry": {
  7. "params": [
  8. "projectPath(STRING)"
  9. ],
  10. "services": [],
  11. "apis": [],
  12. "components": [],
  13. "vars": [
  14. "$compileReport(OBJECT)",
  15. "$errors(ARRAY)",
  16. "$fixTargets(ARRAY)"
  17. ],
  18. "files": {
  19. "inputs": [
  20. ".vl-code/last-compile.json"
  21. ],
  22. "artifacts": []
  23. },
  24. "docs": {
  25. "1": "VL Syntax Rules"
  26. }
  27. },
  28. "steps": [
  29. {
  30. "id": "LLM_010_LoadCompileReport",
  31. "meta": {
  32. "title": "1. Load latest compile report"
  33. },
  34. "in": {
  35. "docs": [
  36. "1"
  37. ],
  38. "max_tokens": 16384,
  39. "readFiles": [
  40. ".vl-code/last-compile.json"
  41. ],
  42. "messages": [
  43. {
  44. "role": "user",
  45. "content": "Read .vl-code/last-compile.json and return a JSON summary with EXACTLY these top-level keys: success(BOOL), errors(ARRAY of {file, line, message}), warningCount(INT), summary(STRING).\n\nRules:\n1. Only include hard compile errors in errors. Exclude warnings.\n2. If the file is missing, stale, malformed, or contains no hard errors, return success:true and errors:[] with an explanatory summary.\n3. Preserve file paths exactly as reported."
  46. }
  47. ],
  48. "output_config": {
  49. "format": {
  50. "type": "json_object"
  51. }
  52. }
  53. },
  54. "out": {
  55. "$compileReport": "=_result",
  56. "$errors": "=_result.errors"
  57. },
  58. "next": "Branch_015_CheckErrors"
  59. },
  60. {
  61. "id": "Branch_015_CheckErrors",
  62. "meta": {
  63. "title": "2. Check whether fixes are needed"
  64. },
  65. "cases": [
  66. {
  67. "condition": "=$errors.length > 0",
  68. "next": "LLM_020_PlanFixes"
  69. }
  70. ],
  71. "default": "Stop_NoErrors"
  72. },
  73. {
  74. "id": "LLM_020_PlanFixes",
  75. "meta": {
  76. "title": "3. Plan file-level fixes from compile errors"
  77. },
  78. "in": {
  79. "docs": [
  80. "1"
  81. ],
  82. "max_tokens": 32768,
  83. "readFiles": [
  84. "=$errors.map(e => e.file)"
  85. ],
  86. "messages": [
  87. {
  88. "role": "user",
  89. "content": "Latest compile report summary:"
  90. },
  91. {
  92. "role": "user",
  93. "content": "=$compileReport"
  94. },
  95. {
  96. "role": "user",
  97. "content": "Plan the minimum file-level fixes needed to resolve these compile errors. Return JSON with EXACTLY one top-level key: fixes(ARRAY of {file, line, errors, reason}).\n\nRules:\n1. Group multiple errors for the same file into a single fixes item.\n2. Keep file paths exactly as given.\n3. Do not invent new files.\n4. Focus only on the reported compiler errors."
  98. }
  99. ],
  100. "output_config": {
  101. "format": {
  102. "type": "json_object"
  103. }
  104. }
  105. },
  106. "out": {
  107. "$fixTargets": "=_result.fixes"
  108. },
  109. "next": "Loop_030_ApplyFixes"
  110. },
  111. {
  112. "id": "Loop_030_ApplyFixes",
  113. "meta": {
  114. "title": "4. Apply fixes to affected files"
  115. },
  116. "source": "=$fixTargets",
  117. "mode": "serial",
  118. "children": [
  119. "LLM_031_ApplyFix"
  120. ],
  121. "next": "Stop_NeedsRecompile",
  122. "onError": "skip"
  123. },
  124. {
  125. "id": "LLM_031_ApplyFix",
  126. "meta": {
  127. "title": "Fix file: =_item.file"
  128. },
  129. "in": {
  130. "docs": [
  131. "1"
  132. ],
  133. "max_tokens": 32768,
  134. "stream": true,
  135. "readFiles": [
  136. "=_item.file"
  137. ],
  138. "messages": [
  139. {
  140. "role": "user",
  141. "content": "Compiler-driven fix target:"
  142. },
  143. {
  144. "role": "user",
  145. "content": "=_item"
  146. },
  147. {
  148. "role": "user",
  149. "content": "Latest compile report summary:"
  150. },
  151. {
  152. "role": "user",
  153. "content": "=$compileReport"
  154. },
  155. {
  156. "role": "user",
  157. "content": "Update the file to resolve the reported compiler errors only. Output the COMPLETE updated file, preserve unaffected logic/layout, and keep the VL version header on the first non-empty line."
  158. }
  159. ]
  160. },
  161. "out": {
  162. "/{_item.file}": "=_result"
  163. },
  164. "next": "RETURN"
  165. },
  166. {
  167. "id": "Stop_NoErrors",
  168. "meta": {
  169. "title": "No hard compile errors in latest report"
  170. }
  171. },
  172. {
  173. "id": "Stop_NeedsRecompile",
  174. "meta": {
  175. "title": "Fixes applied — recompile externally to verify"
  176. }
  177. }
  178. ]
  179. }