maestro-flow 0.5.45 → 0.5.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/.agents/agents/ralph-executor.md +51 -6
  2. package/.agents/skills/domain-add/SKILL.md +9 -0
  3. package/.agents/skills/learn-decompose/SKILL.md +12 -0
  4. package/.agents/skills/learn-follow/SKILL.md +41 -0
  5. package/.agents/skills/learn-investigate/SKILL.md +14 -0
  6. package/.agents/skills/learn-second-opinion/SKILL.md +14 -0
  7. package/.agents/skills/maestro-amend/SKILL.md +11 -0
  8. package/.agents/skills/maestro-companion/SKILL.md +11 -0
  9. package/.agents/skills/maestro-composer/SKILL.md +11 -0
  10. package/.agents/skills/maestro-guard/SKILL.md +25 -0
  11. package/.agents/skills/maestro-init/SKILL.md +28 -0
  12. package/.agents/skills/maestro-overlay/SKILL.md +11 -0
  13. package/.agents/skills/maestro-player/SKILL.md +11 -0
  14. package/.agents/skills/maestro-quick/SKILL.md +29 -0
  15. package/.agents/skills/maestro-ralph-v2/SKILL.md +124 -61
  16. package/.agents/skills/maestro-swarm-workflow/SKILL.md +25 -0
  17. package/.agents/skills/maestro-tools-execute/SKILL.md +29 -0
  18. package/.agents/skills/maestro-tools-register/SKILL.md +29 -0
  19. package/.agents/skills/maestro-ui-codify/SKILL.md +11 -0
  20. package/.agents/skills/maestro-universal-workflow/SKILL.md +59 -0
  21. package/.agents/skills/maestro-update/SKILL.md +38 -0
  22. package/.agents/skills/manage-codebase-rebuild/SKILL.md +29 -0
  23. package/.agents/skills/manage-drift-realign/SKILL.md +12 -0
  24. package/.agents/skills/manage-harvest/SKILL.md +30 -6
  25. package/.agents/skills/manage-issue/SKILL.md +23 -0
  26. package/.agents/skills/manage-issue-discover/SKILL.md +28 -0
  27. package/.agents/skills/manage-kg-extractors/SKILL.md +27 -1
  28. package/.agents/skills/manage-knowhow/SKILL.md +26 -0
  29. package/.agents/skills/manage-knowhow-capture/SKILL.md +24 -0
  30. package/.agents/skills/manage-knowledge-audit/SKILL.md +13 -0
  31. package/.agents/skills/manage-status/SKILL.md +22 -0
  32. package/.agents/skills/manage-wiki/SKILL.md +28 -0
  33. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  34. package/.agents/skills/odyssey-improve/SKILL.md +417 -281
  35. package/.agents/skills/odyssey-planex/SKILL.md +536 -420
  36. package/.agents/skills/odyssey-review-test-fix/SKILL.md +386 -251
  37. package/.agents/skills/odyssey-ui/SKILL.md +382 -247
  38. package/.agents/skills/quality-auto-test/SKILL.md +12 -0
  39. package/.agents/skills/quality-debug/SKILL.md +11 -0
  40. package/.agents/skills/quality-refactor/SKILL.md +11 -0
  41. package/.agents/skills/quality-retrospective/SKILL.md +11 -0
  42. package/.agents/skills/quality-review/SKILL.md +11 -0
  43. package/.agents/skills/quality-sync/SKILL.md +10 -0
  44. package/.agents/skills/quality-test/SKILL.md +12 -0
  45. package/.agents/skills/security-audit/SKILL.md +11 -0
  46. package/.agents/skills/spec-add/SKILL.md +27 -0
  47. package/.agents/skills/spec-load/SKILL.md +25 -0
  48. package/.agents/skills/spec-remove/SKILL.md +26 -0
  49. package/.agents/skills/spec-setup/SKILL.md +30 -0
  50. package/.agy/agents/ralph-executor.md +53 -6
  51. package/.agy/skills/domain-add/SKILL.md +9 -0
  52. package/.agy/skills/learn-decompose/SKILL.md +12 -0
  53. package/.agy/skills/learn-follow/SKILL.md +41 -0
  54. package/.agy/skills/learn-investigate/SKILL.md +14 -0
  55. package/.agy/skills/learn-second-opinion/SKILL.md +14 -0
  56. package/.agy/skills/maestro-amend/SKILL.md +11 -0
  57. package/.agy/skills/maestro-companion/SKILL.md +11 -0
  58. package/.agy/skills/maestro-composer/SKILL.md +11 -0
  59. package/.agy/skills/maestro-guard/SKILL.md +25 -0
  60. package/.agy/skills/maestro-init/SKILL.md +28 -0
  61. package/.agy/skills/maestro-overlay/SKILL.md +11 -0
  62. package/.agy/skills/maestro-player/SKILL.md +11 -0
  63. package/.agy/skills/maestro-quick/SKILL.md +29 -0
  64. package/.agy/skills/maestro-ralph-v2/SKILL.md +123 -61
  65. package/.agy/skills/maestro-swarm-workflow/SKILL.md +25 -0
  66. package/.agy/skills/maestro-tools-execute/SKILL.md +29 -0
  67. package/.agy/skills/maestro-tools-register/SKILL.md +29 -0
  68. package/.agy/skills/maestro-ui-codify/SKILL.md +11 -0
  69. package/.agy/skills/maestro-universal-workflow/SKILL.md +59 -0
  70. package/.agy/skills/maestro-update/SKILL.md +38 -0
  71. package/.agy/skills/manage-codebase-rebuild/SKILL.md +29 -0
  72. package/.agy/skills/manage-drift-realign/SKILL.md +12 -0
  73. package/.agy/skills/manage-harvest/SKILL.md +30 -6
  74. package/.agy/skills/manage-issue/SKILL.md +23 -0
  75. package/.agy/skills/manage-issue-discover/SKILL.md +28 -0
  76. package/.agy/skills/manage-kg-extractors/SKILL.md +27 -1
  77. package/.agy/skills/manage-knowhow/SKILL.md +26 -0
  78. package/.agy/skills/manage-knowhow-capture/SKILL.md +24 -0
  79. package/.agy/skills/manage-knowledge-audit/SKILL.md +13 -0
  80. package/.agy/skills/manage-status/SKILL.md +22 -0
  81. package/.agy/skills/manage-wiki/SKILL.md +28 -0
  82. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  83. package/.agy/skills/odyssey-improve/SKILL.md +417 -281
  84. package/.agy/skills/odyssey-planex/SKILL.md +536 -420
  85. package/.agy/skills/odyssey-review-test-fix/SKILL.md +386 -251
  86. package/.agy/skills/odyssey-ui/SKILL.md +382 -247
  87. package/.agy/skills/quality-auto-test/SKILL.md +12 -0
  88. package/.agy/skills/quality-debug/SKILL.md +11 -0
  89. package/.agy/skills/quality-refactor/SKILL.md +11 -0
  90. package/.agy/skills/quality-retrospective/SKILL.md +11 -0
  91. package/.agy/skills/quality-review/SKILL.md +11 -0
  92. package/.agy/skills/quality-sync/SKILL.md +10 -0
  93. package/.agy/skills/quality-test/SKILL.md +12 -0
  94. package/.agy/skills/security-audit/SKILL.md +11 -0
  95. package/.agy/skills/spec-add/SKILL.md +27 -0
  96. package/.agy/skills/spec-load/SKILL.md +25 -0
  97. package/.agy/skills/spec-remove/SKILL.md +26 -0
  98. package/.agy/skills/spec-setup/SKILL.md +30 -0
  99. package/.claude/agents/ralph-executor.md +51 -6
  100. package/.claude/commands/domain-add.md +9 -0
  101. package/.claude/commands/learn-decompose.md +12 -0
  102. package/.claude/commands/learn-follow.md +41 -0
  103. package/.claude/commands/learn-investigate.md +14 -0
  104. package/.claude/commands/learn-second-opinion.md +14 -0
  105. package/.claude/commands/maestro-amend.md +11 -0
  106. package/.claude/commands/maestro-companion.md +11 -0
  107. package/.claude/commands/maestro-composer.md +11 -0
  108. package/.claude/commands/maestro-guard.md +25 -0
  109. package/.claude/commands/maestro-init.md +28 -0
  110. package/.claude/commands/maestro-overlay.md +11 -0
  111. package/.claude/commands/maestro-player.md +11 -0
  112. package/.claude/commands/maestro-quick.md +29 -0
  113. package/.claude/commands/maestro-ralph-v2.md +124 -61
  114. package/.claude/commands/maestro-swarm-workflow.md +25 -0
  115. package/.claude/commands/maestro-tools-execute.md +29 -0
  116. package/.claude/commands/maestro-tools-register.md +29 -0
  117. package/.claude/commands/maestro-ui-codify.md +11 -0
  118. package/.claude/commands/maestro-universal-workflow.md +59 -0
  119. package/.claude/commands/maestro-update.md +38 -0
  120. package/.claude/commands/manage-codebase-rebuild.md +29 -0
  121. package/.claude/commands/manage-drift-realign.md +12 -0
  122. package/.claude/commands/manage-harvest.md +30 -6
  123. package/.claude/commands/manage-issue-discover.md +28 -0
  124. package/.claude/commands/manage-issue.md +23 -0
  125. package/.claude/commands/manage-kg-extractors.md +27 -1
  126. package/.claude/commands/manage-knowhow-capture.md +24 -0
  127. package/.claude/commands/manage-knowhow.md +26 -0
  128. package/.claude/commands/manage-knowledge-audit.md +13 -0
  129. package/.claude/commands/manage-status.md +22 -0
  130. package/.claude/commands/manage-wiki.md +28 -0
  131. package/.claude/commands/odyssey-debug.md +352 -267
  132. package/.claude/commands/odyssey-improve.md +431 -295
  133. package/.claude/commands/odyssey-planex.md +550 -434
  134. package/.claude/commands/odyssey-review-test-fix.md +400 -265
  135. package/.claude/commands/odyssey-ui.md +396 -261
  136. package/.claude/commands/quality-auto-test.md +12 -0
  137. package/.claude/commands/quality-debug.md +11 -0
  138. package/.claude/commands/quality-refactor.md +11 -0
  139. package/.claude/commands/quality-retrospective.md +11 -0
  140. package/.claude/commands/quality-review.md +11 -0
  141. package/.claude/commands/quality-sync.md +10 -0
  142. package/.claude/commands/quality-test.md +12 -0
  143. package/.claude/commands/security-audit.md +11 -0
  144. package/.claude/commands/spec-add.md +27 -0
  145. package/.claude/commands/spec-load.md +25 -0
  146. package/.claude/commands/spec-remove.md +26 -0
  147. package/.claude/commands/spec-setup.md +30 -0
  148. package/.codex/skills/codify-to-knowhow/SKILL.md +2 -0
  149. package/.codex/skills/domain-add/SKILL.md +26 -0
  150. package/.codex/skills/domain-discover/SKILL.md +46 -0
  151. package/.codex/skills/domain-list/SKILL.md +29 -0
  152. package/.codex/skills/learn-decompose/SKILL.md +2 -0
  153. package/.codex/skills/learn-follow/SKILL.md +34 -0
  154. package/.codex/skills/learn-investigate/SKILL.md +33 -0
  155. package/.codex/skills/learn-retro/SKILL.md +33 -0
  156. package/.codex/skills/learn-second-opinion/SKILL.md +30 -0
  157. package/.codex/skills/maestro-amend/SKILL.md +11 -0
  158. package/.codex/skills/maestro-companion/SKILL.md +11 -0
  159. package/.codex/skills/maestro-composer/SKILL.md +11 -0
  160. package/.codex/skills/maestro-guard/SKILL.md +25 -0
  161. package/.codex/skills/maestro-help/SKILL.md +2 -0
  162. package/.codex/skills/maestro-init/SKILL.md +16 -0
  163. package/.codex/skills/maestro-learn/SKILL.md +2 -0
  164. package/.codex/skills/maestro-overlay/SKILL.md +1 -0
  165. package/.codex/skills/maestro-player/SKILL.md +2 -0
  166. package/.codex/skills/maestro-quick/SKILL.md +17 -0
  167. package/.codex/skills/maestro-tools-execute/SKILL.md +31 -0
  168. package/.codex/skills/maestro-tools-register/SKILL.md +29 -0
  169. package/.codex/skills/maestro-ui-codify/SKILL.md +2 -0
  170. package/.codex/skills/maestro-update/SKILL.md +38 -0
  171. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -0
  172. package/.codex/skills/manage-codebase-refresh/SKILL.md +11 -0
  173. package/.codex/skills/manage-drift-realign/SKILL.md +2 -0
  174. package/.codex/skills/manage-harvest/SKILL.md +30 -8
  175. package/.codex/skills/manage-issue/SKILL.md +24 -0
  176. package/.codex/skills/manage-issue-discover/SKILL.md +2 -0
  177. package/.codex/skills/manage-knowhow/SKILL.md +26 -0
  178. package/.codex/skills/manage-knowhow-capture/SKILL.md +23 -0
  179. package/.codex/skills/manage-learn/SKILL.md +2 -0
  180. package/.codex/skills/manage-status/SKILL.md +22 -0
  181. package/.codex/skills/manage-wiki/SKILL.md +28 -0
  182. package/.codex/skills/odyssey-debug/SKILL.md +44 -0
  183. package/.codex/skills/odyssey-improve/SKILL.md +49 -0
  184. package/.codex/skills/odyssey-planex/SKILL.md +44 -0
  185. package/.codex/skills/odyssey-review-test-fix/SKILL.md +48 -0
  186. package/.codex/skills/odyssey-ui/SKILL.md +49 -0
  187. package/.codex/skills/quality-auto-test/SKILL.md +2 -0
  188. package/.codex/skills/quality-debug/SKILL.md +2 -0
  189. package/.codex/skills/quality-refactor/SKILL.md +2 -0
  190. package/.codex/skills/quality-retrospective/SKILL.md +2 -0
  191. package/.codex/skills/quality-review/SKILL.md +2 -0
  192. package/.codex/skills/quality-sync/SKILL.md +24 -0
  193. package/.codex/skills/quality-test/SKILL.md +2 -0
  194. package/.codex/skills/security-audit/SKILL.md +30 -0
  195. package/.codex/skills/spec-add/SKILL.md +28 -0
  196. package/.codex/skills/spec-load/SKILL.md +26 -0
  197. package/.codex/skills/spec-map/SKILL.md +1 -0
  198. package/.codex/skills/spec-remove/SKILL.md +28 -0
  199. package/.codex/skills/spec-setup/SKILL.md +28 -0
  200. package/.codex/skills/wiki-connect/SKILL.md +11 -0
  201. package/.codex/skills/wiki-digest/SKILL.md +11 -0
  202. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +3 -1
  203. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -1
  204. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +5 -0
  205. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +28 -4
  206. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  207. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  208. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  209. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +10 -0
  210. package/dashboard/dist-server/src/graph/kg/db/queries.js +176 -38
  211. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  212. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  213. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  214. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  215. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  216. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  217. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  218. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  219. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  220. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +20 -12
  221. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  222. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  223. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  224. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  225. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  226. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  227. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  228. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  229. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  230. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  231. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  232. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  233. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  234. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  235. package/dist/src/agents/api-explore/config.d.ts +67 -1
  236. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  237. package/dist/src/agents/api-explore/config.js +50 -15
  238. package/dist/src/agents/api-explore/config.js.map +1 -1
  239. package/dist/src/agents/api-explore/index.js +4 -4
  240. package/dist/src/agents/api-explore/index.js.map +1 -1
  241. package/dist/src/agents/api-explore/llm.d.ts +7 -1
  242. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  243. package/dist/src/agents/api-explore/llm.js +26 -12
  244. package/dist/src/agents/api-explore/llm.js.map +1 -1
  245. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  246. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  247. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  248. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  249. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  250. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  251. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  252. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  253. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  254. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  255. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  256. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  257. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  258. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  259. package/dist/src/agents/api-explore/runner.js +39 -18
  260. package/dist/src/agents/api-explore/runner.js.map +1 -1
  261. package/dist/src/agents/api-explore/session.d.ts +15 -0
  262. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  263. package/dist/src/agents/api-explore/session.js.map +1 -1
  264. package/dist/src/cli.js +1 -0
  265. package/dist/src/cli.js.map +1 -1
  266. package/dist/src/commands/explore.d.ts.map +1 -1
  267. package/dist/src/commands/explore.js +34 -2
  268. package/dist/src/commands/explore.js.map +1 -1
  269. package/dist/src/commands/install.js +7 -28
  270. package/dist/src/commands/install.js.map +1 -1
  271. package/dist/src/commands/moa.d.ts +3 -0
  272. package/dist/src/commands/moa.d.ts.map +1 -0
  273. package/dist/src/commands/moa.js +217 -0
  274. package/dist/src/commands/moa.js.map +1 -0
  275. package/dist/src/commands/search.d.ts.map +1 -1
  276. package/dist/src/commands/search.js +2 -0
  277. package/dist/src/commands/search.js.map +1 -1
  278. package/dist/src/graph/kg/db/queries.d.ts +10 -0
  279. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  280. package/dist/src/graph/kg/db/queries.js +176 -38
  281. package/dist/src/graph/kg/db/queries.js.map +1 -1
  282. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  283. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  284. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  285. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  286. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  287. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  288. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  289. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  290. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  291. package/dist/src/graph/kg/extraction/orchestrator.js +20 -12
  292. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  293. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  294. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  295. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  296. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  297. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  298. package/dist/src/hooks/plugins/explore-plugin.d.ts.map +1 -1
  299. package/dist/src/hooks/plugins/explore-plugin.js +3 -2
  300. package/dist/src/hooks/plugins/explore-plugin.js.map +1 -1
  301. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  302. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  303. package/dist/src/hooks/spec-analytics.js.map +1 -1
  304. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  305. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  306. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  307. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  308. package/dist/src/utils/update-notices.js +12 -0
  309. package/dist/src/utils/update-notices.js.map +1 -1
  310. package/package.json +1 -1
@@ -1,267 +1,352 @@
1
- ---
2
- name: odyssey-debug
3
- description: Long-running debug cycle — archaeology, diagnosis, fix, confirmation, generalization, discovery, and knowledge persistence
4
- argument-hint: "<issue> [--template <name>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <base>@~/.maestro/workflows/odyssey-base.md</base>
16
-
17
- <purpose>
18
- archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
19
- Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
20
- </purpose>
21
-
22
- <boundary>
23
- **In scope:** Single bug/issue full loop.
24
- **Out of scope:** Features → `/odyssey-planex` | Quality review → `/odyssey-review-test-fix` | UI → `/odyssey-ui` | Architecture → `/maestro-plan`
25
-
26
- **`--template <name>`:**
27
-
28
- | Template | Strategy | Use case |
29
- |----------|----------|----------|
30
- | `performance` | profiling → hot path → allocation → cache | Performance degradation |
31
- | `memory-leak` | heap snapshot → retention chain → lifecycle | Memory leaks |
32
- | `race-condition` | timeline → concurrent access → lock analysis | Race conditions |
33
- | `regression` | git bisect → diff analysis → boundary check | Regressions |
34
- | `crash` | stack trace → null chain → error propagation | Crashes / exceptions |
35
- </boundary>
36
-
37
- <context>
38
- $ARGUMENTS
39
-
40
- **Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
41
-
42
- **Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
43
- **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
44
-
45
- **session.json — debug-specific fields:**
46
- ```json
47
- { "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
48
- "patterns": [], "generalization_stats": null }
49
- ```
50
-
51
- **evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
52
- - `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
53
- - `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
54
- - `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
55
- - `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
56
- - `decision`: `question`, `options`, `context`, `status`, `resolution`
57
- - `self-iteration`: `stage`, `round`, `assessment`, `expansion`
58
-
59
- **explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
60
-
61
- **phase_goals[]:**
62
-
63
- | ID | Goal | done_when | phase | skip_when |
64
- |----|------|-----------|-------|-----------|
65
- | G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
66
- | G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
67
- | G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
68
- | G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
69
- | G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
70
- | G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
71
-
72
- **understanding.md — 9 sections:**
73
- 1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
74
- 4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
75
- 7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
76
-
77
- **Knowledge Persistence categories (§9):**
78
-
79
- | Category | Content | Follow-up |
80
- |----------|---------|-----------|
81
- | Recurring root cause pattern | Type + triggers + fix + detection | `/spec-add debug` |
82
- | Non-obvious workaround | Problem + steps + why obvious fix fails | `/spec-add learning` |
83
- | Architecture boundary violation | Violation + correct boundary + verification | `/spec-add arch` |
84
- | Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
85
- </context>
86
-
87
- <invariants>
88
- 1. **Evidence append-only** — never delete or overwrite evidence.ndjson entries
89
- 2. **Phase goal tracking** — mark goal done/failed before transition; no silent skips
90
- </invariants>
91
-
92
- <self_iteration>
93
- Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
94
- </self_iteration>
95
-
96
- <state_machine>
97
-
98
- <states>
99
- S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_DIAGNOSE → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
100
- </states>
101
-
102
- <transitions>
103
- S_INTAKE → S_INTAKE : -c + session found → A_RESUME_SESSION
104
- S_INTAKE → S_ARCHAEOLOGY : issue parsedA_INTAKE
105
- S_INTAKE → S_INTAKE : no issue, no session AskUserQuestion
106
-
107
- S_ARCHAEOLOGY → S_EXPLORE : complete
108
- S_EXPLORE → S_DIAGNOSE : complete
109
-
110
- S_DIAGNOSE → S_FIX : confirmed, !skip_fix
111
- S_DIAGNOSE → S_GENERALIZE : confirmed, skip_fix, !skip_generalize
112
- S_DIAGNOSE → S_RECORD : confirmed, skip_fix, skip_generalize
113
- S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
114
- S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
115
-
116
- S_FIX → S_CONFIRM : fix implemented
117
- S_CONFIRM S_GENERALIZE : confirmed, !skip_generalize
118
- S_CONFIRM → S_RECORD : confirmed, skip_generalize
119
- S_CONFIRM → S_FIX : needs_rework
120
-
121
- S_GENERALIZE → S_DISCOVER : similar code found
122
- S_GENERALIZE → S_RECORD : no similar code
123
-
124
- S_DISCOVER → S_DIAGNOSE : new bug → cross_phase_loops++
125
- S_DISCOVER → S_FIX : same-pattern bug + fix_template, !skip_fix → cross_phase_loops++
126
- S_DISCOVER → S_RECORD : remaining_actionable == 0
127
- S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
128
-
129
- S_RECORD → END : complete
130
- </transitions>
131
-
132
- <actions>
133
-
134
- ### A_INTAKE
135
- 1. Parse arguments, generate slug, create SESSION_DIR
136
- 2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
137
- 3. Derive `phase_goals[]` from flags
138
- 4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
139
-
140
- Commit: `"odyssey-debug({slug}): INTAKE — parse target and load context"`
141
-
142
- ### A_RESUME_SESSION
143
- Glob latest session → read `session.json` → jump to `current_state`.
144
-
145
- ### A_ARCHAEOLOGY
146
- 2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
147
-
148
- `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
149
- - PURPOSE: Review recent modifications related to {issue}
150
- - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
151
-
152
- Update §2. Commit: `"odyssey-debug({slug}): ARCHAEOLOGY — git history analysis"`
153
-
154
- ### A_EXPLORE
155
- Skip if no CLI tools (W006).
156
-
157
- `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
158
- - PURPOSE: Call chains, recent changes, error gaps, similar patterns
159
- - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
160
-
161
- Write `explore.json` + evidence phase=explore. Update §3. Mark G2. Commit: `"odyssey-debug({slug}): EXPLORE — codebase exploration"`
162
-
163
- ### A_DIAGNOSE
164
- 1. Hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
165
- 2. Test eachevidence phase=diagnosis
166
- 3. Ambiguity → evidence phase=decision; Normal: AskUserQuestion | `-y`: defer
167
- 4. Confirmed`session.json.root_cause` + §5. Mark G1.
168
-
169
- Commit: `"odyssey-debug({slug}): DIAGNOSE — root cause confirmed"`
170
-
171
- ### A_ESCALATE_DIAGNOSIS
172
- `diagnosis_retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, → S_DIAGNOSE. >= 3: Normal → AskUserQuestion | `-y` → INCONCLUSIVE → S_RECORD.
173
-
174
- ### A_FIX
175
- 1. Present root cause + proposed fix. Normal: AskUserQuestion | `-y`: auto proceed
176
- 2. Implement fix, evidence phase=decision
177
-
178
- Commit: `"odyssey-debug({slug}): FIX — {summary}"`
179
-
180
- ### A_CONFIRM
181
- 1. Run covering tests
182
- 2. `maestro delegate --role review --mode analysis` (`run_in_background: true`):
183
- - EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
184
- 3. `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
185
- 4. Update §6. `needs_rework` S_FIX. `confirmed` → mark G3.
186
-
187
- Commit: `"odyssey-debug({slug}): CONFIRM — fix verified"`
188
-
189
- ### A_GENERALIZE, A_DISCOVER, A_RECORD
190
- Base shared_actions. Debug overrides:
191
- - **A_GENERALIZE** pattern source: root cause + fix
192
- - **A_RECORD** learnings per Knowledge Persistence table
193
-
194
- **Completion summary:**
195
- ```
196
- --- DEBUG ODYSSEY COMPLETE ---
197
- Issue: {issue}
198
- Root cause: {root_cause.hypothesis}
199
- Fix: {applied|skipped|inconclusive}
200
- Patterns: {patterns_extracted} ({by_layer})
201
- Scan hits: {total_hits} ({cross_layer_confirmed} confirmed)
202
- Issues: {N} created
203
- Decisions: {N} resolved, {M} pending, {K} deferred
204
- Learnings: {N} persisted
205
- Self-iter: {N} rounds across {M} stages
206
- Goals: {done}/{total} ({skipped} skipped)
207
- ---
208
- ```
209
-
210
- </actions>
211
-
212
- <appendix>
213
-
214
- ### `-y` debug-specific points
215
-
216
- | Decision Point | Normal | `-y` |
217
- |---------------|--------|------|
218
- | A_DIAGNOSE ambiguity | AskUserQuestion | deferred |
219
- | A_ESCALATE 3-strike | AskUserQuestion | INCONCLUSIVE |
220
- | A_FIX direction | AskUserQuestion | auto proceed |
221
-
222
- ### Goal Prompt convergence rules
223
-
224
- ```
225
- Stop when root cause confirmed (or INCONCLUSIVE), fix verified,
226
- generalization exhausted, phase_goals_all_done=true.
227
- All sibling bugs fixed or issued — no leftovers.
228
- ```
229
-
230
- </appendix>
231
-
232
- </state_machine>
233
-
234
- <error_codes>
235
- | Code | Severity | Condition | Recovery |
236
- |------|----------|-----------|----------|
237
- | E001 | error | No issue, no session | Provide issue or -c |
238
- | W001 | warning | No relevant git history | Proceed |
239
- | W002 | warning | 3 retries exhausted | INCONCLUSIVE |
240
- | W003 | warning | Partial archaeology agent failure (Timeline or Blame) | Proceed with available results, log failed agent |
241
- | W005 | warning | Pending decisions | Filter evidence phase=decision |
242
- | W006 | warning | No CLI tools | Skip explore |
243
- </error_codes>
244
-
245
- <success_criteria>
246
- - [ ] Session + 4 output files + prior knowledge searched
247
- - [ ] Archaeology + CLI review evidence phase=archaeology
248
- - [ ] CLI exploration → explore.json + evidence phase=explore
249
- - [ ] Hypotheses tested, root cause with evidence refs
250
- - [ ] understanding.md 9 sections progressive
251
- - [ ] Fix + confirmed (unless --skip-fix)
252
- - [ ] Generalization + scan (unless --skip-generalize)
253
- - [ ] Discoveries classified; unfixed findings individually justified
254
- - [ ] phase_goals + goal audit + resumable via -c
255
- - [ ] Completion summary
256
- </success_criteria>
257
-
258
- <next_step_routing>
259
- | Condition | Next |
260
- |-----------|------|
261
- | Discovery issues | `/manage-issue list --source debug-odyssey` |
262
- | Document pattern | `/learn-decompose <module>` |
263
- | Formal review | `/quality-review <phase>` |
264
- | Second opinion | `/learn-second-opinion <understanding.md>` |
265
- | Related question | `/learn-investigate "<question>"` |
266
- | Pending decisions | Filter evidence phase=decision status=pending |
267
- </next_step_routing>
1
+ ---
2
+ name: odyssey-debug
3
+ description: Long-running debug cycle — archaeology, diagnosis, fix, confirmation, generalization, discovery, and knowledge persistence
4
+ argument-hint: "<issue> [--template <name>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
16
+
17
+ <purpose>
18
+ archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
19
+ Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
20
+ </purpose>
21
+
22
+ <boundary>
23
+ **In scope:** Single bug/issue full loop.
24
+ **Out of scope:** Features → `/odyssey-planex` | Quality review → `/odyssey-review-test-fix` | UI → `/odyssey-ui` | Architecture → `/maestro-plan`
25
+
26
+ **`--template <name>`:**
27
+
28
+ | Template | Strategy | Use case |
29
+ |----------|----------|----------|
30
+ | `performance` | profiling → hot path → allocation → cache | Performance degradation |
31
+ | `memory-leak` | heap snapshot → retention chain → lifecycle | Memory leaks |
32
+ | `race-condition` | timeline → concurrent access → lock analysis | Race conditions |
33
+ | `regression` | git bisect → diff analysis → boundary check | Regressions |
34
+ | `crash` | stack trace → null chain → error propagation | Crashes / exceptions |
35
+ </boundary>
36
+
37
+ <context>
38
+ $ARGUMENTS
39
+
40
+ **Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
41
+
42
+ **Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
43
+ **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
44
+
45
+ **session.json — debug-specific fields:**
46
+ ```json
47
+ { "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
48
+ "patterns": [], "generalization_stats": null }
49
+ ```
50
+
51
+ **evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
52
+ - `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
53
+ - `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
54
+ - `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
55
+ - `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
56
+ - `decision`: `question`, `options`, `context`, `status`, `resolution`
57
+ - `self-iteration`: `stage`, `round`, `assessment`, `expansion`
58
+
59
+ **explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
60
+
61
+ **phase_goals[]:**
62
+
63
+ | ID | Goal | done_when | phase | skip_when |
64
+ |----|------|-----------|-------|-----------|
65
+ | G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
66
+ | G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
67
+ | G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
68
+ | G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
69
+ | G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
70
+ | G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
71
+
72
+ **understanding.md — 9 sections:**
73
+ 1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
74
+ 4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
75
+ 7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
76
+
77
+ **Knowledge Persistence categories (§9):**
78
+
79
+ | Category | Content | Follow-up |
80
+ |----------|---------|-----------|
81
+ | Recurring root cause pattern | Type + triggers + fix + detection | `/spec-add debug` |
82
+ | Non-obvious workaround | Problem + steps + why obvious fix fails | `/spec-add learning` |
83
+ | Architecture boundary violation | Violation + correct boundary + verification | `/spec-add arch` |
84
+ | Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
85
+ </context>
86
+
87
+ <invariants>
88
+ 1. **Evidence append-only** — never delete or overwrite evidence.ndjson entries
89
+ 2. **Phase goal tracking** — mark goal done/failed before transition; no silent skips
90
+ 3. **Generalize is mandatory** — S_GENERALIZE and S_DISCOVER execute unless `skip_generalize == true`. "No findings" from prior phases, convergence signals, or context pressure are NOT valid reasons to skip. The phase itself determines whether patterns exist.
91
+ </invariants>
92
+
93
+ <self_iteration>
94
+ Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
95
+ </self_iteration>
96
+
97
+ <state_machine>
98
+
99
+ <states>
100
+ S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_DIAGNOSE → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
101
+ </states>
102
+
103
+ <transitions>
104
+ S_INTAKE → S_INTAKE : -c + session found A_RESUME_SESSION
105
+ S_INTAKE → S_ARCHAEOLOGY : issue parsedA_INTAKE
106
+ S_INTAKE → S_INTAKE : no issue, no session → AskUserQuestion
107
+
108
+ S_ARCHAEOLOGY → S_EXPLORE : complete
109
+ S_EXPLORE → S_DIAGNOSE : complete
110
+
111
+ S_DIAGNOSE → S_FIX : confirmed, !skip_fix
112
+ S_DIAGNOSE → S_GENERALIZE : confirmed, skip_fix, !skip_generalize
113
+ S_DIAGNOSE → S_RECORD : confirmed, skip_fix, skip_generalize
114
+ S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
115
+ S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
116
+
117
+ S_FIX S_CONFIRM : fix implemented
118
+ S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
119
+ S_CONFIRM → S_RECORD : confirmed, skip_generalize
120
+ S_CONFIRM → S_FIX : needs_rework
121
+
122
+ S_GENERALIZE → S_DISCOVER : similar code found
123
+ S_GENERALIZE → S_RECORD : all 3 layers scanned with evidence, total_hits == 0
124
+
125
+ S_DISCOVER → S_DIAGNOSE : new bug → cross_phase_loops++
126
+ S_DISCOVER → S_FIX : same-pattern bug + fix_template, !skip_fix → cross_phase_loops++
127
+ S_DISCOVER → S_RECORD : remaining_actionable == 0
128
+ S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
129
+
130
+ S_RECORD → END : complete
131
+ </transitions>
132
+
133
+ <actions>
134
+
135
+ ### A_INTAKE
136
+ 1. Parse arguments, generate slug, create SESSION_DIR
137
+ 2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
138
+ 3. Derive `phase_goals[]` from flags
139
+ 4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
140
+
141
+ Commit: `"odyssey-debug({slug}): INTAKE — parse target and load context"`
142
+
143
+ ### A_RESUME_SESSION
144
+ Glob latest session → read `session.json` → jump to `current_state`.
145
+
146
+ ### A_ARCHAEOLOGY
147
+ 2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
148
+
149
+ `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
150
+ - PURPOSE: Review recent modifications related to {issue}
151
+ - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
152
+
153
+ Update §2. Commit: `"odyssey-debug({slug}): ARCHAEOLOGY — git history analysis"`
154
+
155
+ ### A_EXPLORE
156
+ Skip if no CLI tools (W006).
157
+
158
+ `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
159
+ - PURPOSE: Call chains, recent changes, error gaps, similar patterns
160
+ - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
161
+
162
+ Write `explore.json` + evidence phase=explore. Update §3. Mark G2. Commit: `"odyssey-debug({slug}): EXPLORE — codebase exploration"`
163
+
164
+ ### A_DIAGNOSE
165
+ 1. Hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] §4
166
+ 2. Test each → evidence phase=diagnosis
167
+ 3. Ambiguityevidence phase=decision; Normal: AskUserQuestion | `-y`: defer
168
+ 4. Confirmed → `session.json.root_cause` + §5. Mark G1.
169
+
170
+ Commit: `"odyssey-debug({slug}): DIAGNOSE — root cause confirmed"`
171
+
172
+ ### A_ESCALATE_DIAGNOSIS
173
+ `diagnosis_retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, → S_DIAGNOSE. >= 3: Normal → AskUserQuestion | `-y` → INCONCLUSIVE → S_RECORD.
174
+
175
+ ### A_FIX
176
+ 1. Present root cause + proposed fix. Normal: AskUserQuestion | `-y`: auto proceed
177
+ 2. Implement fix, evidence phase=decision
178
+
179
+ Commit: `"odyssey-debug({slug}): FIX — {summary}"`
180
+
181
+ ### A_CONFIRM
182
+ 1. Run covering tests
183
+ 2. `maestro delegate --role review --mode analysis` (`run_in_background: true`):
184
+ - EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
185
+ 3. `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
186
+ 4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3.
187
+
188
+ Commit: `"odyssey-debug({slug}): CONFIRM — fix verified"`
189
+
190
+ ### A_GENERALIZE
191
+
192
+ **MANDATORY — executes unless `skip_generalize == true`. Prior-phase convergence, "no findings," or context pressure are NOT valid skip reasons.**
193
+
194
+ Pattern source: confirmed root cause + applied fix.
195
+
196
+ **Step 1 3-layer pattern extraction:**
197
+
198
+ | Layer | Method | Targets |
199
+ |-------|--------|---------|
200
+ | Syntax | Build regex from fix diff → Grep | Missing `await`, unchecked null, wrong comparison, identical error-handling gap |
201
+ | Semantic | Understand anti-pattern that caused the bug → Agent scan | Same async-without-catch, same boundary assumption, race on shared state |
202
+ | Structural | Find files with same module shape / import graph | Sibling handlers, parallel service implementations, same-shape error handlers |
203
+
204
+ Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
205
+
206
+ **Thoroughness floor:** ALL 3 layers must be attempted and logged. Each layer records search method, scope, hit count in evidence phase=generalization. "No hits" requires all 3 layers to return 0 with logged evidence — a single-layer quick grep does NOT satisfy.
207
+
208
+ **Step 2 — 4-agent concurrent scan** (single message, 4 Agents):
209
+
210
+ | Agent | Strategy | Scope |
211
+ |-------|----------|-------|
212
+ | Syntax grep | Grep regex from pattern signatures | Full project |
213
+ | Semantic scan | Anti-pattern understanding → scan same bug class | Related modules |
214
+ | Structural match | Find structurally similar files to buggy file | Full project |
215
+ | Historical grep | `git log -S` for pattern signatures | Git history |
216
+
217
+ **Step 3 — Cross-layer dedup:** multi-layer hit → boost | single-layer → `needs_review` | historically fixed → `regression_risk`
218
+
219
+ **Step 4 — Iterative deepening:** Module with ≥3 hits targeted deep scan (max 1 round).
220
+
221
+ **Step 5 — Persist:** Update understanding.md §7 + write `session.json.generalization_stats`:
222
+ ```json
223
+ {"patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {"syntax": 0, "semantic": 0, "structural": 0}, "deepening_triggered": false}
224
+ ```
225
+
226
+ **Transition guard:** `S_GENERALIZE → S_RECORD` requires `by_layer` has entries for all 3 layers with search evidence logged. Mark G4 done.
227
+
228
+ Commit: `"odyssey-debug({slug}): GENERALIZE — pattern scan complete"`
229
+
230
+ ### A_DISCOVER
231
+
232
+ **Executes whenever `total_hits > 0`. Cannot be skipped without `skip_generalize == true`.**
233
+
234
+ 1. **Triage** each hit with ±10 lines context → classify:
235
+ - `bug` same defect pattern confirmed
236
+ - `risk` — potential issue needing guard
237
+ - `safe` false positive (must log individual reason blanket "pre-existing" forbidden)
238
+
239
+ 2. **Route:**
240
+
241
+ | Classification | Action |
242
+ |---------------|--------|
243
+ | bug + fix_template applicable | Immediate fix → back to S_FIX |
244
+ | bug + cross-module or no template | Create issue (fix suggestion + impact) |
245
+ | risk + guard addable directly | Fix directly |
246
+ | risk + complex | Create issue |
247
+ | safe | Skip with logged per-item reason |
248
+
249
+ Normal: AskUserQuestion per hit | `-y`: auto-fix bugs with fix_template, create issue for rest
250
+
251
+ 3. **Cross-phase loops:** `cross_phase_loops++` on fix/diagnose return. `loops >= max_loops` → must log per-item reasons.
252
+
253
+ 4. Append evidence phase=discovery. Update understanding.md §8. Mark G5 done.
254
+
255
+ Commit: `"odyssey-debug({slug}): DISCOVER sibling triage complete"`
256
+
257
+ ### A_RECORD
258
+
259
+ 1. Finalize understanding.md §9 — learnings by Knowledge Persistence categories:
260
+ - Recurring root cause pattern → `/spec-add debug`
261
+ - Non-obvious workaround `/spec-add learning`
262
+ - Architecture boundary violation `/spec-add arch`
263
+ - Reusable generalization pattern `/spec-add coding`
264
+
265
+ 2. Mark G6 done. Pending decisions: Normal → AskUserQuestion | `-y` → skip (show deferred count).
266
+
267
+ 3. **Goal audit (hardened):**
268
+ - `done` → confirmed
269
+ - `skipped` → confirmed ONLY if corresponding `skip_when` flag is true
270
+ - **Hard rule:** G4 and G5 CANNOT be `skipped` unless `skip_generalize == true`. Pending without flag → `failed` (Normal: AskUserQuestion | `-y`: record `failed`)
271
+ - `phase_goals_all_done = true` only when all goals pass this audit
272
+
273
+ 4. `current_state = "COMPLETED"`, emit completion summary.
274
+
275
+ **Completion summary:**
276
+ ```
277
+ --- DEBUG ODYSSEY COMPLETE ---
278
+ Issue: {issue}
279
+ Root cause: {root_cause.hypothesis}
280
+ Fix: {applied|skipped|inconclusive}
281
+ Patterns: {patterns_extracted} ({by_layer})
282
+ Scan hits: {total_hits} ({cross_layer_confirmed} confirmed)
283
+ Issues: {N} created
284
+ Decisions: {N} resolved, {M} pending, {K} deferred
285
+ Learnings: {N} persisted
286
+ Self-iter: {N} rounds across {M} stages
287
+ Goals: {done}/{total} ({skipped} skipped)
288
+ ---
289
+ ```
290
+
291
+ Commit: `"odyssey-debug({slug}): RECORD — summary and knowledge persistence"`
292
+
293
+ </actions>
294
+
295
+ <appendix>
296
+
297
+ ### `-y` debug-specific points
298
+
299
+ | Decision Point | Normal | `-y` |
300
+ |---------------|--------|------|
301
+ | A_DIAGNOSE ambiguity | AskUserQuestion | deferred |
302
+ | A_ESCALATE 3-strike | AskUserQuestion | INCONCLUSIVE |
303
+ | A_FIX direction | AskUserQuestion | auto proceed |
304
+ | A_DISCOVER hit routing | AskUserQuestion | auto-fix bugs with template, create issue for rest |
305
+
306
+ ### Goal Prompt convergence rules
307
+
308
+ ```
309
+ Stop when root cause confirmed (or INCONCLUSIVE), fix verified,
310
+ generalization exhausted, phase_goals_all_done=true.
311
+ All sibling bugs fixed or issued — no leftovers.
312
+ ```
313
+
314
+ </appendix>
315
+
316
+ </state_machine>
317
+
318
+ <error_codes>
319
+ | Code | Severity | Condition | Recovery |
320
+ |------|----------|-----------|----------|
321
+ | E001 | error | No issue, no session | Provide issue or -c |
322
+ | W001 | warning | No relevant git history | Proceed |
323
+ | W002 | warning | 3 retries exhausted | INCONCLUSIVE |
324
+ | W003 | warning | Partial archaeology agent failure (Timeline or Blame) | Proceed with available results, log failed agent |
325
+ | W005 | warning | Pending decisions | Filter evidence phase=decision |
326
+ | W006 | warning | No CLI tools | Skip explore |
327
+ | W007 | warning | Generalization 0 hits after full 3-layer scan | Advance to S_RECORD (requires all 3 layers attempted with evidence) |
328
+ </error_codes>
329
+
330
+ <success_criteria>
331
+ - [ ] Session + 4 output files + prior knowledge searched
332
+ - [ ] Archaeology + CLI review → evidence phase=archaeology
333
+ - [ ] CLI exploration → explore.json + evidence phase=explore
334
+ - [ ] Hypotheses tested, root cause with evidence refs
335
+ - [ ] understanding.md 9 sections progressive
336
+ - [ ] Fix + confirmed (unless --skip-fix)
337
+ - [ ] Generalization + scan (unless --skip-generalize)
338
+ - [ ] Discoveries classified; unfixed findings individually justified
339
+ - [ ] phase_goals + goal audit + resumable via -c
340
+ - [ ] Completion summary
341
+ </success_criteria>
342
+
343
+ <next_step_routing>
344
+ | Condition | Next |
345
+ |-----------|------|
346
+ | Discovery issues | `/manage-issue list --source debug-odyssey` |
347
+ | Document pattern | `/learn-decompose <module>` |
348
+ | Formal review | `/quality-review <phase>` |
349
+ | Second opinion | `/learn-second-opinion <understanding.md>` |
350
+ | Related question | `/learn-investigate "<question>"` |
351
+ | Pending decisions | Filter evidence phase=decision status=pending |
352
+ </next_step_routing>