@bohuyeshan/openagent-labforge-core 3.11.5 → 3.13.0

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 (272) hide show
  1. package/README.ja.md +130 -343
  2. package/README.ko.md +128 -337
  3. package/README.md +229 -584
  4. package/README.ru.md +131 -364
  5. package/README.zh-cn.md +231 -547
  6. package/bin/openagent-labforge.js +95 -9
  7. package/bin/platform.test.ts +20 -21
  8. package/dist/agents/article-writer.d.ts +7 -0
  9. package/dist/agents/atlas/default.d.ts +1 -1
  10. package/dist/agents/atlas/gemini.d.ts +1 -1
  11. package/dist/agents/atlas/gpt.d.ts +1 -1
  12. package/dist/agents/bio-methodologist.d.ts +1 -1
  13. package/dist/agents/bio-orchestrator.d.ts +7 -0
  14. package/dist/agents/bio-skill-guidance.d.ts +1 -0
  15. package/dist/agents/builtin-agents/general-agents.d.ts +0 -1
  16. package/dist/agents/builtin-agents/sisyphus-agent.d.ts +16 -0
  17. package/dist/agents/dynamic-agent-prompt-builder.d.ts +0 -2
  18. package/dist/agents/engineering-capability.d.ts +7 -0
  19. package/dist/agents/env-context.d.ts +1 -1
  20. package/dist/agents/github-scout.d.ts +7 -0
  21. package/dist/agents/index.d.ts +0 -1
  22. package/dist/agents/metis.d.ts +1 -1
  23. package/dist/agents/momus.d.ts +1 -1
  24. package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
  25. package/dist/agents/prometheus/gemini.d.ts +1 -1
  26. package/dist/agents/prometheus/gpt.d.ts +1 -1
  27. package/dist/agents/prometheus/interview-mode.d.ts +1 -1
  28. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  29. package/dist/agents/prometheus/plan-template.d.ts +1 -1
  30. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  31. package/dist/agents/scientific-writer.d.ts +7 -0
  32. package/dist/agents/sisyphus-junior/gpt-5-3-codex.d.ts +1 -1
  33. package/dist/agents/sisyphus-junior/gpt-5-4.d.ts +1 -1
  34. package/dist/agents/sisyphus-junior/gpt.d.ts +1 -1
  35. package/dist/agents/tech-scout.d.ts +7 -0
  36. package/dist/agents/types.d.ts +1 -1
  37. package/dist/agents/wase.d.ts +8 -0
  38. package/dist/agents/wet-lab-designer.d.ts +7 -0
  39. package/dist/agents/writing-style-rules.d.ts +1 -0
  40. package/dist/cli/config-manager/bun-install.d.ts +1 -6
  41. package/dist/cli/config-manager/cleanup-managed-mcp-from-opencode-config.d.ts +2 -0
  42. package/dist/cli/config-manager/cleanup-stale-managed-agents.d.ts +2 -0
  43. package/dist/cli/config-manager/parse-opencode-config-file.d.ts +2 -0
  44. package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
  45. package/dist/cli/config-manager/sync-static-agent-to-opencode-config.d.ts +2 -0
  46. package/dist/cli/config-manager/sync-static-mcp-to-opencode-config.d.ts +2 -0
  47. package/dist/cli/config-manager/write-bootstrap-skill.d.ts +15 -0
  48. package/dist/cli/config-manager.d.ts +5 -0
  49. package/dist/cli/index.js +24986 -15362
  50. package/dist/cli/install-validators.d.ts +0 -1
  51. package/dist/cli/model-fallback-types.d.ts +0 -1
  52. package/dist/cli/run/index.d.ts +0 -1
  53. package/dist/cli/run/types.d.ts +0 -1
  54. package/dist/cli/types.d.ts +0 -3
  55. package/dist/config/schema/agent-names.d.ts +36 -3
  56. package/dist/config/schema/agent-overrides.d.ts +504 -0
  57. package/dist/config/schema/background-task.d.ts +0 -2
  58. package/dist/config/schema/experimental.d.ts +5 -0
  59. package/dist/config/schema/git-master.d.ts +0 -1
  60. package/dist/config/schema/hooks.d.ts +0 -2
  61. package/dist/config/schema/mcp-policy.d.ts +1 -0
  62. package/dist/config/schema/oh-my-opencode-config.d.ts +526 -54
  63. package/dist/config/schema.d.ts +0 -1
  64. package/dist/create-hooks.d.ts +0 -13
  65. package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +1 -16
  66. package/dist/features/background-agent/constants.d.ts +2 -1
  67. package/dist/features/background-agent/manager.d.ts +5 -20
  68. package/dist/features/background-agent/process-cleanup.d.ts +1 -1
  69. package/dist/features/background-agent/task-history.d.ts +0 -1
  70. package/dist/features/background-agent/task-poller.d.ts +0 -1
  71. package/dist/features/background-agent/types.d.ts +0 -4
  72. package/dist/features/builtin-commands/commands.d.ts +4 -1
  73. package/dist/features/builtin-skills/skills/bio-methods.d.ts +2 -0
  74. package/dist/features/builtin-skills/skills/bio-pipeline.d.ts +2 -0
  75. package/dist/features/builtin-skills/skills/bio-tools.d.ts +2 -0
  76. package/dist/features/builtin-skills/skills/bio-visualization.d.ts +2 -0
  77. package/dist/features/builtin-skills/skills/cell-annotation.d.ts +2 -0
  78. package/dist/features/builtin-skills/skills/differential-expression.d.ts +2 -0
  79. package/dist/features/builtin-skills/skills/geo-query.d.ts +2 -0
  80. package/dist/features/builtin-skills/skills/index.d.ts +14 -0
  81. package/dist/features/builtin-skills/skills/paper-evidence.d.ts +2 -0
  82. package/dist/features/builtin-skills/skills/pubmed-search.d.ts +2 -0
  83. package/dist/features/builtin-skills/skills/scrna-preprocessing.d.ts +2 -0
  84. package/dist/features/builtin-skills/skills/sequence-analysis.d.ts +2 -0
  85. package/dist/features/builtin-skills/skills/structural-biology.d.ts +2 -0
  86. package/dist/features/builtin-skills/skills/vector-design.d.ts +2 -0
  87. package/dist/features/builtin-skills/skills/wet-lab-design.d.ts +2 -0
  88. package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
  89. package/dist/features/claude-code-agent-loader/types.d.ts +1 -8
  90. package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +5 -0
  91. package/dist/features/claude-code-mcp-loader/index.d.ts +1 -0
  92. package/dist/features/claude-code-mcp-loader/types.d.ts +3 -0
  93. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
  94. package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
  95. package/dist/features/claude-code-plugin-loader/types.d.ts +1 -1
  96. package/dist/features/claude-code-session-state/state.d.ts +5 -0
  97. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
  98. package/dist/features/opencode-skill-loader/project-skill-directory-discovery.d.ts +1 -0
  99. package/dist/features/opencode-skill-loader/skill-metadata-validator.d.ts +8 -0
  100. package/dist/features/skill-mcp-manager/types.d.ts +0 -4
  101. package/dist/features/tmux-subagent/index.d.ts +0 -1
  102. package/dist/features/tmux-subagent/manager.d.ts +0 -5
  103. package/dist/features/tmux-subagent/types.d.ts +0 -2
  104. package/dist/hooks/atlas/tool-execute-after.d.ts +0 -2
  105. package/dist/hooks/atlas/types.d.ts +0 -2
  106. package/dist/hooks/atlas/verification-reminders.d.ts +0 -4
  107. package/dist/hooks/auto-slash-command/hook.d.ts +0 -7
  108. package/dist/hooks/auto-update-checker/checker.d.ts +1 -3
  109. package/dist/hooks/auto-update-checker/constants.d.ts +2 -2
  110. package/dist/hooks/comment-checker/downloader.d.ts +1 -1
  111. package/dist/hooks/compaction-context-injector/hook.d.ts +1 -5
  112. package/dist/hooks/context-window-monitor.d.ts +5 -2
  113. package/dist/hooks/index.d.ts +0 -2
  114. package/dist/hooks/keyword-detector/detector.d.ts +1 -1
  115. package/dist/hooks/keyword-detector/hook.d.ts +2 -2
  116. package/dist/hooks/keyword-detector/index.d.ts +1 -0
  117. package/dist/hooks/keyword-detector/semantic-hint.d.ts +4 -0
  118. package/dist/hooks/keyword-detector/ultrawork/autonomous.d.ts +8 -0
  119. package/dist/hooks/preemptive-compaction.d.ts +5 -2
  120. package/dist/hooks/runtime-fallback/hook.d.ts +3 -2
  121. package/dist/hooks/runtime-fallback/message-update-handler.d.ts +2 -1
  122. package/dist/hooks/runtime-fallback/types.d.ts +3 -56
  123. package/dist/hooks/session-notification-scheduler.d.ts +3 -5
  124. package/dist/hooks/session-notification.d.ts +0 -2
  125. package/dist/hooks/session-recovery/tool-pairing.d.ts +16 -0
  126. package/dist/hooks/start-work/index.d.ts +1 -1
  127. package/dist/hooks/start-work/worktree-detector.d.ts +0 -7
  128. package/dist/hooks/todo-continuation-enforcer/compaction-guard.d.ts +4 -0
  129. package/dist/hooks/todo-continuation-enforcer/constants.d.ts +6 -5
  130. package/dist/hooks/todo-continuation-enforcer/handler.d.ts +0 -1
  131. package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +0 -1
  132. package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +3 -0
  133. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +1 -1
  134. package/dist/hooks/todo-continuation-enforcer/types.d.ts +8 -3
  135. package/dist/hooks/tool-output-truncator.d.ts +0 -1
  136. package/dist/index.js +56627 -56933
  137. package/dist/mcp/extended.d.ts +4 -2
  138. package/dist/mcp/index.d.ts +2 -1
  139. package/dist/mcp/types.d.ts +2 -3
  140. package/dist/openagent-labforge.schema.json +1362 -83
  141. package/dist/plugin/hooks/create-continuation-hooks.d.ts +1 -2
  142. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
  143. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
  144. package/dist/plugin/ultrawork-model-override.d.ts +11 -1
  145. package/dist/plugin-dispose.d.ts +12 -10
  146. package/dist/plugin-handlers/agent-config-handler.d.ts +0 -1
  147. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -1
  148. package/dist/plugin-state.d.ts +0 -5
  149. package/dist/shared/agent-display-names.d.ts +1 -0
  150. package/dist/shared/data-path.d.ts +1 -1
  151. package/dist/shared/dynamic-truncator.d.ts +7 -4
  152. package/dist/shared/external-plugin-detector.d.ts +7 -0
  153. package/dist/shared/index.d.ts +5 -3
  154. package/dist/shared/jsonc-parser.d.ts +4 -0
  155. package/dist/shared/mcp-local-command-normalizer.d.ts +1 -0
  156. package/dist/shared/migrate-legacy-config-file.d.ts +1 -0
  157. package/dist/shared/model-error-classifier.d.ts +1 -2
  158. package/dist/shared/opencode-command-dirs.d.ts +0 -1
  159. package/dist/shared/plugin-identity.d.ts +2 -3
  160. package/dist/shared/project-discovery-dirs.d.ts +4 -0
  161. package/dist/shared/session-model-state.d.ts +1 -2
  162. package/dist/shared/system-directive.d.ts +5 -6
  163. package/dist/tools/call-omo-agent/background-executor.d.ts +1 -2
  164. package/dist/tools/call-omo-agent/constants.d.ts +2 -2
  165. package/dist/tools/call-omo-agent/sync-executor.d.ts +3 -11
  166. package/dist/tools/call-omo-agent/tools.d.ts +2 -2
  167. package/dist/tools/call-omo-agent/types.d.ts +13 -0
  168. package/dist/tools/delegate-task/constants.d.ts +1 -1
  169. package/dist/tools/delegate-task/model-selection.d.ts +0 -1
  170. package/dist/tools/delegate-task/model-string-parser.d.ts +3 -1
  171. package/dist/tools/delegate-task/parent-context-resolver.d.ts +22 -0
  172. package/dist/tools/lsp/constants.d.ts +0 -1
  173. package/dist/tools/lsp/lsp-client-transport.d.ts +2 -4
  174. package/dist/tools/lsp/lsp-client-wrapper.d.ts +1 -2
  175. package/generated/skills-bundles/catalog.json +1 -1
  176. package/generated/skills-bundles/full/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +56 -55
  177. package/generated/skills-bundles/full/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +105 -104
  178. package/generated/skills-bundles/full/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +272 -271
  179. package/generated/skills-bundles/full/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +40 -39
  180. package/generated/skills-bundles/full/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +274 -273
  181. package/generated/skills-bundles/full/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +131 -130
  182. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +245 -244
  183. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +247 -246
  184. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +303 -302
  185. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -84
  186. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -87
  187. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -48
  188. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -80
  189. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +31 -31
  190. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +126 -125
  191. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +80 -79
  192. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +187 -186
  193. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +11 -11
  194. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +18 -18
  195. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +20 -20
  196. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +15 -15
  197. package/generated/skills-bundles/full/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +217 -216
  198. package/generated/skills-bundles/paper/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +56 -55
  199. package/generated/skills-bundles/paper/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +105 -104
  200. package/generated/skills-bundles/paper/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +272 -271
  201. package/generated/skills-bundles/paper/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +40 -39
  202. package/generated/skills-bundles/paper/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +274 -273
  203. package/generated/skills-bundles/paper/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +131 -130
  204. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +245 -244
  205. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +247 -246
  206. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +303 -302
  207. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -84
  208. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -87
  209. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -48
  210. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -80
  211. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +31 -31
  212. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +126 -125
  213. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +80 -79
  214. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +187 -186
  215. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +11 -11
  216. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +18 -18
  217. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +20 -20
  218. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +15 -15
  219. package/generated/skills-bundles/paper/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +217 -216
  220. package/package.json +36 -32
  221. package/dist/cli/openai-only-model-catalog.d.ts +0 -3
  222. package/dist/cli/run/model-resolver.d.ts +0 -4
  223. package/dist/config/schema/git-env-prefix.d.ts +0 -5
  224. package/dist/features/background-agent/remove-task-toast-tracking.d.ts +0 -1
  225. package/dist/features/background-agent/subagent-spawn-limits.d.ts +0 -23
  226. package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +0 -4
  227. package/dist/features/tmux-subagent/pane-state-parser.d.ts +0 -8
  228. package/dist/features/tmux-subagent/tracked-session-state.d.ts +0 -8
  229. package/dist/hooks/atlas/boulder-session-lineage.d.ts +0 -6
  230. package/dist/hooks/atlas/final-wave-approval-gate.d.ts +0 -4
  231. package/dist/hooks/atlas/idle-event.d.ts +0 -8
  232. package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +0 -11
  233. package/dist/hooks/auto-slash-command/processed-command-store.d.ts +0 -7
  234. package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +0 -7
  235. package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +0 -1
  236. package/dist/hooks/compaction-context-injector/constants.d.ts +0 -5
  237. package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +0 -6
  238. package/dist/hooks/compaction-context-injector/recovery.d.ts +0 -6
  239. package/dist/hooks/compaction-context-injector/session-id.d.ts +0 -2
  240. package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +0 -16
  241. package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +0 -13
  242. package/dist/hooks/compaction-context-injector/types.d.ts +0 -43
  243. package/dist/hooks/compaction-context-injector/validated-model.d.ts +0 -13
  244. package/dist/hooks/delegate-task-english-directive/hook.d.ts +0 -14
  245. package/dist/hooks/delegate-task-english-directive/index.d.ts +0 -1
  246. package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +0 -23
  247. package/dist/hooks/gpt-permission-continuation/constants.d.ts +0 -4
  248. package/dist/hooks/gpt-permission-continuation/detector.d.ts +0 -1
  249. package/dist/hooks/gpt-permission-continuation/handler.d.ts +0 -12
  250. package/dist/hooks/gpt-permission-continuation/index.d.ts +0 -13
  251. package/dist/hooks/gpt-permission-continuation/session-state.d.ts +0 -15
  252. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +0 -16
  253. package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +0 -10
  254. package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +0 -11
  255. package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +0 -4
  256. package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +0 -7
  257. package/dist/hooks/runtime-fallback/session-messages.d.ts +0 -9
  258. package/dist/hooks/runtime-fallback/session-status-handler.d.ts +0 -3
  259. package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +0 -3
  260. package/dist/hooks/session-notification-content.d.ts +0 -30
  261. package/dist/plugin/normalize-tool-arg-schemas.d.ts +0 -2
  262. package/dist/plugin/ultrawork-variant-availability.d.ts +0 -6
  263. package/dist/shared/compaction-agent-config-checkpoint.d.ts +0 -11
  264. package/dist/shared/context-limit-resolver.d.ts +0 -5
  265. package/dist/shared/fallback-chain-from-models.d.ts +0 -3
  266. package/dist/shared/question-denied-session-permission.d.ts +0 -6
  267. package/dist/shared/retry-status-utils.d.ts +0 -2
  268. package/dist/shared/vision-capable-models-cache.d.ts +0 -4
  269. package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +0 -2
  270. package/dist/tools/look-at/multimodal-fallback-chain.d.ts +0 -4
  271. package/dist/tools/lsp/directory-diagnostics.d.ts +0 -1
  272. package/dist/tools/lsp/server-path-bases.d.ts +0 -1
@@ -6,274 +6,275 @@ allowed-tools: "Bash(*), Read, Grep, Glob, Write, Edit, Agent"
6
6
  metadata:
7
7
  category: "data-analysis/optimization"
8
8
  ---
9
- # DSE Loop: Autonomous Design Space Exploration
10
-
11
- Autonomously explore a design space: run → analyze → pick next parameters → repeat, until the objective is met or timeout is reached. Designed for computer architecture and EDA problems.
12
-
13
- ## Context: $ARGUMENTS
14
-
15
- ## Safety Rules — READ FIRST
16
-
17
- **NEVER do any of the following:**
18
- - `sudo` anything
19
- - `rm -rf`, `rm -r`, or any recursive deletion
20
- - `rm` any file you did not create in this session
21
- - Overwrite existing source files without reading them first
22
- - `git push`, `git reset --hard`, or any destructive git operation
23
- - Kill processes you did not start
24
-
25
- **If a step requires any of the above, STOP and report to the user.**
26
-
27
- ## Constants (override via $ARGUMENTS)
28
-
29
- | Constant | Default | Description |
30
- |----------|---------|-------------|
31
- | `TIMEOUT` | 2h | Total wall-clock budget. Stop exploring after this. |
32
- | `MAX_ITERATIONS` | 50 | Hard cap on number of design points evaluated. |
33
- | `PATIENCE` | 10 | Stop early if no improvement for this many consecutive iterations. |
34
- | `OBJECTIVE` | minimize | `minimize` or `maximize` the target metric. |
35
-
36
- Override inline: `/dse-loop "task desc — timeout: 4h, max_iterations: 100, patience: 15"`
37
-
38
- ## Typical Use Cases
39
-
40
- | Problem | Program | Parameters | Objective |
41
- |---------|---------|-----------|-----------|
42
- | Microarch DSE | gem5 simulation | cache size, assoc, pipeline width, ROB size, branch predictor | maximize IPC or minimize area×delay |
43
- | Synthesis tuning | yosys/DC script | optimization passes, target freq, effort level | minimize area at timing closure |
44
- | RTL parameterization | verilator sim | data width, FIFO depth, pipeline stages, buffer sizes | meet throughput target at min area |
45
- | Compiler flags | gcc/llvm build + benchmark | -O levels, unroll factor, vectorization, scheduling | minimize runtime or code size |
46
- | Placement/routing | openroad/innovus | utilization, aspect ratio, layer config | minimize wirelength / timing |
47
- | Formal verification | abc/sby | bound depth, engine, timeout per property | maximize coverage in time budget |
48
- | Memory subsystem | cacti / ramulator | bank count, row buffer policy, scheduling | optimize bandwidth/energy |
49
-
50
- ## Workflow
51
-
52
- ### Phase 0: Parse Task & Setup
53
-
54
- 1. **Parse $ARGUMENTS** to extract:
55
- - **Program**: what to run (command, script, or Makefile target)
56
- - **Parameter space**: which knobs to tune and their ranges/options (may be incomplete see step 2)
57
- - **Objective metric**: what to optimize (and how to extract it from output)
58
- - **Constraints**: hard limits that must not be violated (e.g., timing must close)
59
- - **Timeout**: wall-clock budget
60
- - **Success criteria**: when is the result "good enough" to stop early?
61
-
62
- 2. **Infer missing parameter ranges** — If the user provides parameter names but NOT ranges/options, you MUST infer them before exploring:
63
-
64
- a. **Read the source code** — search for the parameter names in the codebase:
65
- - Look for argparse/click definitions, config files, Makefile variables, module parameters, `#define`, `parameter` (SystemVerilog), `localparam`, etc.
66
- - Extract defaults, types, and any comments hinting at valid values
67
-
68
- b. **Apply domain knowledge** to set reasonable ranges:
69
- | Parameter type | Inference strategy |
70
- |---------------|-------------------|
71
- | Cache/memory sizes | Powers of 2, typically 1KB–16MB |
72
- | Associativity | Powers of 2: 1, 2, 4, 8, 16 |
73
- | Pipeline width / issue width | Small integers: 1, 2, 4, 8 |
74
- | Buffer/queue/FIFO depth | Powers of 2: 4, 8, 16, 32, 64 |
75
- | Clock period / frequency | Based on technology node; try ±50% from default |
76
- | Bound depth (BMC/formal) | Geometric: 5, 10, 20, 50, 100 |
77
- | Timeout values | Geometric: 10s, 30s, 60s, 120s, 300s |
78
- | Boolean/enum flags | Enumerate all options found in source |
79
- | Continuous (learning rate, threshold) | Log-scale sweep: 5 points spanning 2 orders of magnitude around default |
80
- | Integer counts (threads, cores) | Linear: from 1 to hardware max |
81
-
82
- c. **Start conservative** — begin with 3-5 values per parameter. Expand range later if the best result is at a boundary.
83
-
84
- d. **Log inferred ranges** — write the inferred parameter space to `dse_results/inferred_params.md` so the user can review:
85
- ```markdown
86
- # Inferred Parameter Space
87
-
88
- | Parameter | Source | Default | Inferred Range | Reasoning |
89
- |-----------|--------|---------|---------------|-----------|
90
- | CACHE_SIZE | config.py:42 | 32768 | [8192, 16384, 32768, 65536, 131072] | powers of 2, ±2x from default |
91
- | ASSOC | config.py:43 | 4 | [1, 2, 4, 8] | standard associativities |
92
- | BMC_DEPTH | run_bmc.py:15 | 10 | [5, 10, 20, 50] | geometric, common BMC depths |
93
- ```
94
-
95
- e. **Boundary expansion** — during the search, if the best result is at the min or max of a range, automatically extend that range by one step in that direction (but log the extension).
96
-
97
- 3. **Read the project** to understand:
98
- - How to run the program
99
- - Where results are produced (stdout, log files, reports)
100
- - How to parse the objective metric from output
101
- - Current/baseline configuration (if any)
102
-
103
- 4. **Create working directory**: `dse_results/` in project root
104
- - `dse_results/dse_log.csv` one row per design point
105
- - `dse_results/DSE_REPORT.md` — final report
106
- - `dse_results/DSE_STATE.json` — state for recovery
107
- - `dse_results/inferred_params.md` — inferred parameter space (if ranges were not provided)
108
- - `dse_results/configs/`config files for each run
109
- - `dse_results/outputs/` — raw output for each run
110
-
111
- 5. **Write a parameter extraction script** (`dse_results/parse_result.py` or similar) that takes a run's output and returns the objective metric as a number. Test it on a baseline run first.
112
-
113
- 6. **Run baseline** (iteration 0): run the program with default/current parameters. Record the baseline metric. This is the point to beat.
114
-
115
- ### Phase 1: Initial Exploration
116
-
117
- **Goal**: Quickly survey the space to understand which parameters matter most.
118
-
119
- **Strategy**: Latin Hypercube Sampling or structured sweep of key parameters.
120
-
121
- 1. Pick 5-10 diverse design points that span the parameter ranges
122
- 2. Run them (in parallel if independent, via background processes or sequential)
123
- 3. Record all results in `dse_log.csv`:
124
- ```
125
- iteration,param1,param2,...,metric,constraint_met,timestamp,notes
126
- 0,default,default,...,baseline_val,yes,2026-03-13T10:00:00,baseline
127
- 1,val1a,val2a,...,result1,yes,2026-03-13T10:05:00,initial sweep
128
- ...
129
- ```
130
- 4. Analyze: which parameters have the most impact on the objective?
131
- 5. Narrow the search to the most sensitive parameters
132
-
133
- ### Phase 2: Directed Search
134
-
135
- **Goal**: Converge toward the optimum by making informed choices.
136
-
137
- **Strategy**: Adaptive — pick the approach that fits the problem:
138
-
139
- - **Few parameters (≤3)**: Fine-grained grid search around the best region from Phase 1
140
- - **Many parameters (>3)**: Coordinate descent optimize one parameter at a time, holding others at current best
141
- - **Binary/categorical params**: Enumerate promising combinations
142
- - **Continuous params**: Binary search or golden section between best neighbors
143
- - **Multi-objective**: Track Pareto frontier, explore along the front
144
-
145
- For each iteration:
146
-
147
- 1. **Select next design point** based on results so far:
148
- - Look at the trend: which direction improves the metric?
149
- - Avoid re-running configurations already evaluated
150
- - Balance exploration (untested regions) vs exploitation (near current best)
151
-
152
- 2. **Modify parameters**: edit config file, command-line args, or source constants
153
-
154
- 3. **Run the program**: execute and capture output
155
-
156
- 4. **Parse results**: extract the objective metric and check constraints
157
-
158
- 5. **Log to `dse_log.csv`**: append the new row
159
-
160
- 6. **Check stopping conditions**:
161
- - Timeout reached? → stop
162
- - Max iterations reached? → stop
163
- - Patience exhausted (no improvement in N iterations)? → stop
164
- - Success criteria met (metric is "good enough")? → stop
165
- - Constraint violation pattern detected? → adjust search bounds
166
-
167
- 7. **Update `DSE_STATE.json`**:
168
- ```json
169
- {
170
- "iteration": 15,
171
- "status": "in_progress",
172
- "best_metric": 1.23,
173
- "best_params": {"cache_size": 32768, "assoc": 4, "pipeline_width": 2},
174
- "total_iterations": 15,
175
- "start_time": "2026-03-13T10:00:00",
176
- "timeout": "2h",
177
- "patience_counter": 3
178
- }
179
- ```
180
-
181
- 8. **Decide next step** → back to step 1
182
-
183
- ### Phase 3: Refinement (if time allows)
184
-
185
- If the search converged and there's still time budget:
186
-
187
- 1. **Local perturbation**: try ±1 step on each parameter from the best point
188
- 2. **Sensitivity analysis**: which parameters can be relaxed without hurting the metric?
189
- 3. **Constraint boundary**: if a constraint is nearly binding, explore near-feasible points
190
-
191
- ### Phase 4: Report
192
-
193
- Write `dse_results/DSE_REPORT.md`:
194
-
195
- ```markdown
196
- # Design Space Exploration Report
197
-
198
- **Task**: [description]
199
- **Date**: [start] → [end]
200
- **Total iterations**: N
201
- **Wall-clock time**: X hours Y minutes
202
-
203
- ## Objective
204
- - **Metric**: [what was optimized]
205
- - **Direction**: minimize / maximize
206
- - **Baseline**: [value]
207
- - **Best found**: [value] ([improvement]% better than baseline)
208
-
209
- ## Best Configuration
210
- | Parameter | Baseline | Best |
211
- |-----------|----------|------|
212
- | param1 | default | best_val |
213
- | param2 | default | best_val |
214
- | ... | ... | ... |
215
-
216
- ## Search Trajectory
217
- | Iteration | param1 | param2 | ... | Metric | Notes |
218
- |-----------|--------|--------|-----|--------|-------|
219
- | 0 (baseline) | ... | ... | ... | ... | baseline |
220
- | 1 | ... | ... | ... | ... | initial sweep |
221
- | ... | ... | ... | ... | ... | ... |
222
- | N (best) | ... | ... | ... | ... | best |
223
-
224
- ## Parameter Sensitivity
225
- - **param1**: [high/medium/low impact] — [brief explanation]
226
- - **param2**: [high/medium/low impact] — [brief explanation]
227
-
228
- ## Pareto Frontier (if multi-objective)
229
- [Table or description of non-dominated points]
230
-
231
- ## Stopping Reason
232
- [timeout / max_iterations / patience / success_criteria_met]
233
-
234
- ## Recommendations
235
- - [actionable insights from the exploration]
236
- - [which parameters matter most]
237
- - [suggested follow-up explorations]
238
- ```
239
-
240
- Also generate a summary plot if matplotlib is available:
241
- - Convergence curve (metric vs iteration)
242
- - Parameter sensitivity bar chart
243
- - Pareto frontier scatter (if multi-objective)
244
-
245
- ## State Recovery
246
-
247
- If the context window compacts mid-run, the loop recovers from `DSE_STATE.json` + `dse_log.csv`:
248
-
249
- 1. Read `DSE_STATE.json` for current iteration, best params, patience counter
250
- 2. Read `dse_log.csv` for full history
251
- 3. Resume from next iteration
252
-
253
- ## Key Rules
254
-
255
- - Work AUTONOMOUSLY — do not ask the user for permission at each iteration
256
- - **Every run must be logged** even failed runs, constraint violations, errors. The log is the ground truth.
257
- - **Never re-run an identical configuration** — check `dse_log.csv` before each run
258
- - **Respect the timeout** — check elapsed time before starting a new iteration. If the next run is likely to exceed the timeout, stop and report.
259
- - **Parse metrics programmatically** — write a parsing script, don't eyeball logs
260
- - **Keep raw outputs** — save each run's full output in `dse_results/outputs/iter_N/`
261
- - **Constraint violations are not improvements** — a design point that violates constraints is never "best", regardless of the metric
262
- - If a run crashes, log the error, skip that point, and continue with the next
263
- - If the same crash repeats 3 times with different configs, stop and report the issue
264
-
265
- ## Example Invocations
266
-
267
- ```
268
- # Minimal — just name the parameters, let the agent figure out ranges
269
- /dse-loop "Run gem5 mcf benchmark. Tune: L1D_SIZE, L2_SIZE, ROB_ENTRIES. Objective: maximize IPC. Timeout: 3h"
270
-
271
- # Partial — some ranges given, some not
272
- /dse-loop "Run make synth. Tune: CLOCK_PERIOD [5ns, 4ns, 3ns, 2ns], FLATTEN, ABC_SCRIPT. Objective: minimize area at timing closure. Timeout: 1h"
273
-
274
- # Fully specified — explicit ranges for everything
275
- /dse-loop "Simulate processor with FIFO_DEPTH [4,8,16,32], ISSUE_WIDTH [1,2,4], PREFETCH [on,off]. Run: make sim. Objective: max throughput/area. Timeout: 2h"
276
-
277
- # Real-world: PDAG-SFA formal verification tuning
278
- /dse-loop "Run python run_bmc.py. Tune: BMC_DEPTH, ENGINE, TIMEOUT_PER_PROP. Objective: maximize properties proved. Timeout: 2h"
279
- ```
9
+
10
+ # DSE Loop: Autonomous Design Space Exploration
11
+
12
+ Autonomously explore a design space: run → analyze → pick next parameters → repeat, until the objective is met or timeout is reached. Designed for computer architecture and EDA problems.
13
+
14
+ ## Context: $ARGUMENTS
15
+
16
+ ## Safety Rules — READ FIRST
17
+
18
+ **NEVER do any of the following:**
19
+ - `sudo` anything
20
+ - `rm -rf`, `rm -r`, or any recursive deletion
21
+ - `rm` any file you did not create in this session
22
+ - Overwrite existing source files without reading them first
23
+ - `git push`, `git reset --hard`, or any destructive git operation
24
+ - Kill processes you did not start
25
+
26
+ **If a step requires any of the above, STOP and report to the user.**
27
+
28
+ ## Constants (override via $ARGUMENTS)
29
+
30
+ | Constant | Default | Description |
31
+ |----------|---------|-------------|
32
+ | `TIMEOUT` | 2h | Total wall-clock budget. Stop exploring after this. |
33
+ | `MAX_ITERATIONS` | 50 | Hard cap on number of design points evaluated. |
34
+ | `PATIENCE` | 10 | Stop early if no improvement for this many consecutive iterations. |
35
+ | `OBJECTIVE` | minimize | `minimize` or `maximize` the target metric. |
36
+
37
+ Override inline: `/dse-loop "task desc — timeout: 4h, max_iterations: 100, patience: 15"`
38
+
39
+ ## Typical Use Cases
40
+
41
+ | Problem | Program | Parameters | Objective |
42
+ |---------|---------|-----------|-----------|
43
+ | Microarch DSE | gem5 simulation | cache size, assoc, pipeline width, ROB size, branch predictor | maximize IPC or minimize area×delay |
44
+ | Synthesis tuning | yosys/DC script | optimization passes, target freq, effort level | minimize area at timing closure |
45
+ | RTL parameterization | verilator sim | data width, FIFO depth, pipeline stages, buffer sizes | meet throughput target at min area |
46
+ | Compiler flags | gcc/llvm build + benchmark | -O levels, unroll factor, vectorization, scheduling | minimize runtime or code size |
47
+ | Placement/routing | openroad/innovus | utilization, aspect ratio, layer config | minimize wirelength / timing |
48
+ | Formal verification | abc/sby | bound depth, engine, timeout per property | maximize coverage in time budget |
49
+ | Memory subsystem | cacti / ramulator | bank count, row buffer policy, scheduling | optimize bandwidth/energy |
50
+
51
+ ## Workflow
52
+
53
+ ### Phase 0: Parse Task & Setup
54
+
55
+ 1. **Parse $ARGUMENTS** to extract:
56
+ - **Program**: what to run (command, script, or Makefile target)
57
+ - **Parameter space**: which knobs to tune and their ranges/options (may be incomplete — see step 2)
58
+ - **Objective metric**: what to optimize (and how to extract it from output)
59
+ - **Constraints**: hard limits that must not be violated (e.g., timing must close)
60
+ - **Timeout**: wall-clock budget
61
+ - **Success criteria**: when is the result "good enough" to stop early?
62
+
63
+ 2. **Infer missing parameter ranges** — If the user provides parameter names but NOT ranges/options, you MUST infer them before exploring:
64
+
65
+ a. **Read the source code** search for the parameter names in the codebase:
66
+ - Look for argparse/click definitions, config files, Makefile variables, module parameters, `#define`, `parameter` (SystemVerilog), `localparam`, etc.
67
+ - Extract defaults, types, and any comments hinting at valid values
68
+
69
+ b. **Apply domain knowledge** to set reasonable ranges:
70
+ | Parameter type | Inference strategy |
71
+ |---------------|-------------------|
72
+ | Cache/memory sizes | Powers of 2, typically 1KB–16MB |
73
+ | Associativity | Powers of 2: 1, 2, 4, 8, 16 |
74
+ | Pipeline width / issue width | Small integers: 1, 2, 4, 8 |
75
+ | Buffer/queue/FIFO depth | Powers of 2: 4, 8, 16, 32, 64 |
76
+ | Clock period / frequency | Based on technology node; try ±50% from default |
77
+ | Bound depth (BMC/formal) | Geometric: 5, 10, 20, 50, 100 |
78
+ | Timeout values | Geometric: 10s, 30s, 60s, 120s, 300s |
79
+ | Boolean/enum flags | Enumerate all options found in source |
80
+ | Continuous (learning rate, threshold) | Log-scale sweep: 5 points spanning 2 orders of magnitude around default |
81
+ | Integer counts (threads, cores) | Linear: from 1 to hardware max |
82
+
83
+ c. **Start conservative** — begin with 3-5 values per parameter. Expand range later if the best result is at a boundary.
84
+
85
+ d. **Log inferred ranges** — write the inferred parameter space to `dse_results/inferred_params.md` so the user can review:
86
+ ```markdown
87
+ # Inferred Parameter Space
88
+
89
+ | Parameter | Source | Default | Inferred Range | Reasoning |
90
+ |-----------|--------|---------|---------------|-----------|
91
+ | CACHE_SIZE | config.py:42 | 32768 | [8192, 16384, 32768, 65536, 131072] | powers of 2, ±2x from default |
92
+ | ASSOC | config.py:43 | 4 | [1, 2, 4, 8] | standard associativities |
93
+ | BMC_DEPTH | run_bmc.py:15 | 10 | [5, 10, 20, 50] | geometric, common BMC depths |
94
+ ```
95
+
96
+ e. **Boundary expansion** — during the search, if the best result is at the min or max of a range, automatically extend that range by one step in that direction (but log the extension).
97
+
98
+ 3. **Read the project** to understand:
99
+ - How to run the program
100
+ - Where results are produced (stdout, log files, reports)
101
+ - How to parse the objective metric from output
102
+ - Current/baseline configuration (if any)
103
+
104
+ 4. **Create working directory**: `dse_results/` in project root
105
+ - `dse_results/dse_log.csv` — one row per design point
106
+ - `dse_results/DSE_REPORT.md` — final report
107
+ - `dse_results/DSE_STATE.json` — state for recovery
108
+ - `dse_results/inferred_params.md`inferred parameter space (if ranges were not provided)
109
+ - `dse_results/configs/` — config files for each run
110
+ - `dse_results/outputs/` — raw output for each run
111
+
112
+ 5. **Write a parameter extraction script** (`dse_results/parse_result.py` or similar) that takes a run's output and returns the objective metric as a number. Test it on a baseline run first.
113
+
114
+ 6. **Run baseline** (iteration 0): run the program with default/current parameters. Record the baseline metric. This is the point to beat.
115
+
116
+ ### Phase 1: Initial Exploration
117
+
118
+ **Goal**: Quickly survey the space to understand which parameters matter most.
119
+
120
+ **Strategy**: Latin Hypercube Sampling or structured sweep of key parameters.
121
+
122
+ 1. Pick 5-10 diverse design points that span the parameter ranges
123
+ 2. Run them (in parallel if independent, via background processes or sequential)
124
+ 3. Record all results in `dse_log.csv`:
125
+ ```
126
+ iteration,param1,param2,...,metric,constraint_met,timestamp,notes
127
+ 0,default,default,...,baseline_val,yes,2026-03-13T10:00:00,baseline
128
+ 1,val1a,val2a,...,result1,yes,2026-03-13T10:05:00,initial sweep
129
+ ...
130
+ ```
131
+ 4. Analyze: which parameters have the most impact on the objective?
132
+ 5. Narrow the search to the most sensitive parameters
133
+
134
+ ### Phase 2: Directed Search
135
+
136
+ **Goal**: Converge toward the optimum by making informed choices.
137
+
138
+ **Strategy**: Adaptive — pick the approach that fits the problem:
139
+
140
+ - **Few parameters (3)**: Fine-grained grid search around the best region from Phase 1
141
+ - **Many parameters (>3)**: Coordinate descent — optimize one parameter at a time, holding others at current best
142
+ - **Binary/categorical params**: Enumerate promising combinations
143
+ - **Continuous params**: Binary search or golden section between best neighbors
144
+ - **Multi-objective**: Track Pareto frontier, explore along the front
145
+
146
+ For each iteration:
147
+
148
+ 1. **Select next design point** based on results so far:
149
+ - Look at the trend: which direction improves the metric?
150
+ - Avoid re-running configurations already evaluated
151
+ - Balance exploration (untested regions) vs exploitation (near current best)
152
+
153
+ 2. **Modify parameters**: edit config file, command-line args, or source constants
154
+
155
+ 3. **Run the program**: execute and capture output
156
+
157
+ 4. **Parse results**: extract the objective metric and check constraints
158
+
159
+ 5. **Log to `dse_log.csv`**: append the new row
160
+
161
+ 6. **Check stopping conditions**:
162
+ - Timeout reached? → stop
163
+ - Max iterations reached? → stop
164
+ - Patience exhausted (no improvement in N iterations)? → stop
165
+ - Success criteria met (metric is "good enough")? → stop
166
+ - Constraint violation pattern detected? → adjust search bounds
167
+
168
+ 7. **Update `DSE_STATE.json`**:
169
+ ```json
170
+ {
171
+ "iteration": 15,
172
+ "status": "in_progress",
173
+ "best_metric": 1.23,
174
+ "best_params": {"cache_size": 32768, "assoc": 4, "pipeline_width": 2},
175
+ "total_iterations": 15,
176
+ "start_time": "2026-03-13T10:00:00",
177
+ "timeout": "2h",
178
+ "patience_counter": 3
179
+ }
180
+ ```
181
+
182
+ 8. **Decide next step** → back to step 1
183
+
184
+ ### Phase 3: Refinement (if time allows)
185
+
186
+ If the search converged and there's still time budget:
187
+
188
+ 1. **Local perturbation**: try ±1 step on each parameter from the best point
189
+ 2. **Sensitivity analysis**: which parameters can be relaxed without hurting the metric?
190
+ 3. **Constraint boundary**: if a constraint is nearly binding, explore near-feasible points
191
+
192
+ ### Phase 4: Report
193
+
194
+ Write `dse_results/DSE_REPORT.md`:
195
+
196
+ ```markdown
197
+ # Design Space Exploration Report
198
+
199
+ **Task**: [description]
200
+ **Date**: [start] → [end]
201
+ **Total iterations**: N
202
+ **Wall-clock time**: X hours Y minutes
203
+
204
+ ## Objective
205
+ - **Metric**: [what was optimized]
206
+ - **Direction**: minimize / maximize
207
+ - **Baseline**: [value]
208
+ - **Best found**: [value] ([improvement]% better than baseline)
209
+
210
+ ## Best Configuration
211
+ | Parameter | Baseline | Best |
212
+ |-----------|----------|------|
213
+ | param1 | default | best_val |
214
+ | param2 | default | best_val |
215
+ | ... | ... | ... |
216
+
217
+ ## Search Trajectory
218
+ | Iteration | param1 | param2 | ... | Metric | Notes |
219
+ |-----------|--------|--------|-----|--------|-------|
220
+ | 0 (baseline) | ... | ... | ... | ... | baseline |
221
+ | 1 | ... | ... | ... | ... | initial sweep |
222
+ | ... | ... | ... | ... | ... | ... |
223
+ | N (best) | ... | ... | ... | ... | ★ best |
224
+
225
+ ## Parameter Sensitivity
226
+ - **param1**: [high/medium/low impact] — [brief explanation]
227
+ - **param2**: [high/medium/low impact] — [brief explanation]
228
+
229
+ ## Pareto Frontier (if multi-objective)
230
+ [Table or description of non-dominated points]
231
+
232
+ ## Stopping Reason
233
+ [timeout / max_iterations / patience / success_criteria_met]
234
+
235
+ ## Recommendations
236
+ - [actionable insights from the exploration]
237
+ - [which parameters matter most]
238
+ - [suggested follow-up explorations]
239
+ ```
240
+
241
+ Also generate a summary plot if matplotlib is available:
242
+ - Convergence curve (metric vs iteration)
243
+ - Parameter sensitivity bar chart
244
+ - Pareto frontier scatter (if multi-objective)
245
+
246
+ ## State Recovery
247
+
248
+ If the context window compacts mid-run, the loop recovers from `DSE_STATE.json` + `dse_log.csv`:
249
+
250
+ 1. Read `DSE_STATE.json` for current iteration, best params, patience counter
251
+ 2. Read `dse_log.csv` for full history
252
+ 3. Resume from next iteration
253
+
254
+ ## Key Rules
255
+
256
+ - Work AUTONOMOUSLYdo not ask the user for permission at each iteration
257
+ - **Every run must be logged** — even failed runs, constraint violations, errors. The log is the ground truth.
258
+ - **Never re-run an identical configuration** — check `dse_log.csv` before each run
259
+ - **Respect the timeout** — check elapsed time before starting a new iteration. If the next run is likely to exceed the timeout, stop and report.
260
+ - **Parse metrics programmatically** — write a parsing script, don't eyeball logs
261
+ - **Keep raw outputs** — save each run's full output in `dse_results/outputs/iter_N/`
262
+ - **Constraint violations are not improvements** a design point that violates constraints is never "best", regardless of the metric
263
+ - If a run crashes, log the error, skip that point, and continue with the next
264
+ - If the same crash repeats 3 times with different configs, stop and report the issue
265
+
266
+ ## Example Invocations
267
+
268
+ ```
269
+ # Minimal just name the parameters, let the agent figure out ranges
270
+ /dse-loop "Run gem5 mcf benchmark. Tune: L1D_SIZE, L2_SIZE, ROB_ENTRIES. Objective: maximize IPC. Timeout: 3h"
271
+
272
+ # Partial some ranges given, some not
273
+ /dse-loop "Run make synth. Tune: CLOCK_PERIOD [5ns, 4ns, 3ns, 2ns], FLATTEN, ABC_SCRIPT. Objective: minimize area at timing closure. Timeout: 1h"
274
+
275
+ # Fully specified explicit ranges for everything
276
+ /dse-loop "Simulate processor with FIFO_DEPTH [4,8,16,32], ISSUE_WIDTH [1,2,4], PREFETCH [on,off]. Run: make sim. Objective: max throughput/area. Timeout: 2h"
277
+
278
+ # Real-world: PDAG-SFA formal verification tuning
279
+ /dse-loop "Run python run_bmc.py. Tune: BMC_DEPTH, ENGINE, TIMEOUT_PER_PROP. Objective: maximize properties proved. Timeout: 2h"
280
+ ```