cawdex 1.35.75 → 1.35.76

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 (84) hide show
  1. package/README.md +5 -5
  2. package/bin/anycode.js +2 -2
  3. package/bin/cawdex.js +408 -408
  4. package/bin/ecc-hooks.cjs +11 -11
  5. package/dist/agents-md.d.ts +31 -0
  6. package/dist/agents-md.js +340 -0
  7. package/dist/agents-md.js.map +1 -0
  8. package/dist/agents.js +1424 -1424
  9. package/dist/api.d.ts +1 -0
  10. package/dist/api.js +19 -14
  11. package/dist/api.js.map +1 -1
  12. package/dist/autonomous-loops.js +287 -287
  13. package/dist/benchmark-repos.d.ts +31 -0
  14. package/dist/benchmark-repos.js +234 -8
  15. package/dist/benchmark-repos.js.map +1 -1
  16. package/dist/command-palette.js +4 -2
  17. package/dist/command-palette.js.map +1 -1
  18. package/dist/compaction.js +8 -8
  19. package/dist/config.js +51 -36
  20. package/dist/config.js.map +1 -1
  21. package/dist/content-engine.js +543 -543
  22. package/dist/context-brief.d.ts +4 -0
  23. package/dist/context-brief.js +230 -0
  24. package/dist/context-brief.js.map +1 -0
  25. package/dist/cost-tracker.d.ts +33 -14
  26. package/dist/cost-tracker.js +81 -19
  27. package/dist/cost-tracker.js.map +1 -1
  28. package/dist/coverage.js +39 -39
  29. package/dist/docs-sync.js +98 -98
  30. package/dist/evaluation.js +452 -452
  31. package/dist/fixed-footer.d.ts +7 -1
  32. package/dist/fixed-footer.js +92 -18
  33. package/dist/fixed-footer.js.map +1 -1
  34. package/dist/git-workflow.js +49 -49
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +161 -63
  37. package/dist/index.js.map +1 -1
  38. package/dist/live-queue.js +1 -1
  39. package/dist/live-queue.js.map +1 -1
  40. package/dist/model-aliases.d.ts +37 -0
  41. package/dist/model-aliases.js +203 -0
  42. package/dist/model-aliases.js.map +1 -0
  43. package/dist/orchestration.js +15 -15
  44. package/dist/permissions.d.ts +6 -0
  45. package/dist/permissions.js +53 -0
  46. package/dist/permissions.js.map +1 -1
  47. package/dist/pm2-manager.js +26 -26
  48. package/dist/query.d.ts +0 -1
  49. package/dist/query.js +74 -39
  50. package/dist/query.js.map +1 -1
  51. package/dist/refactor.js +87 -87
  52. package/dist/repo-command.js +7 -1
  53. package/dist/repo-command.js.map +1 -1
  54. package/dist/search-first.js +92 -92
  55. package/dist/skill-create.js +100 -100
  56. package/dist/stitch.js +1 -1
  57. package/dist/system-prompt.d.ts +2 -1
  58. package/dist/system-prompt.js +10 -5
  59. package/dist/system-prompt.js.map +1 -1
  60. package/dist/tools/github-repo-digest.d.ts +1 -1
  61. package/dist/tools/github-repo-digest.js +38 -6
  62. package/dist/tools/github-repo-digest.js.map +1 -1
  63. package/dist/types.d.ts +3 -0
  64. package/dist/types.js.map +1 -1
  65. package/dist/verification.js +55 -55
  66. package/package.json +1 -1
  67. package/resources/__init__.py +1 -1
  68. package/resources/exgentic/cawdex_agent/README.md +114 -114
  69. package/resources/exgentic/cawdex_agent/__init__.py +5 -5
  70. package/resources/exgentic/cawdex_agent/agent.py +605 -605
  71. package/resources/exgentic/cawdex_agent/requirements.txt +2 -2
  72. package/resources/exgentic/cawdex_agent/setup.sh +21 -21
  73. package/resources/exgentic/cawdex_agent/utils.py +1061 -1061
  74. package/resources/hal/cawdex_agent/README.md +24 -24
  75. package/resources/hal/cawdex_agent/__init__.py +1 -1
  76. package/resources/hal/cawdex_agent/main.py +550 -550
  77. package/resources/hal/cawdex_agent/requirements.txt +2 -2
  78. package/resources/kbench/cawdex_agent/README.md +107 -107
  79. package/resources/kbench/cawdex_agent/adapter.manifest.json +19 -19
  80. package/resources/kbench/cawdex_agent/runner.mjs +753 -753
  81. package/resources/open_agent_leaderboard/cawdex-agent-card.md +119 -119
  82. package/resources/terminal_bench/__init__.py +1 -1
  83. package/resources/terminal_bench/cawdex_agent.py +174 -174
  84. package/resources/terminal_bench/setup.sh +121 -121
@@ -9,32 +9,32 @@ import chalk from 'chalk';
9
9
  * Instructs the agent to review the PR, address comments, and re-review until approved.
10
10
  */
11
11
  export function buildPRLoopPrompt(cwd) {
12
- return `You are a thorough code reviewer in an autonomous PR review loop.
13
-
14
- Working directory: ${cwd}
15
-
16
- Your task is to:
17
- 1. Review the current PR changes
18
- 2. Identify issues, improvements, or feedback
19
- 3. Suggest fixes or clarifications
20
- 4. After fixes are applied, re-review until you approve
21
-
22
- Loop Instructions:
23
- - On each iteration, provide clear, actionable feedback
24
- - Mark feedback as CRITICAL, MAJOR, or MINOR
25
- - Track which issues have been resolved
26
- - When all issues are resolved, respond with: "PR_APPROVED"
27
- - If no changes are made after feedback, respond with: "NO_CHANGES_DETECTED"
28
- - Maximum 5 iterations allowed
29
-
30
- Format your response as:
31
- \`\`\`
32
- ## Review Iteration [N]
33
- ### Issues Found:
34
- - [issue]: [description]
35
-
36
- ### Approved: [yes/no]
37
- ### Next Steps: [what needs fixing]
12
+ return `You are a thorough code reviewer in an autonomous PR review loop.
13
+
14
+ Working directory: ${cwd}
15
+
16
+ Your task is to:
17
+ 1. Review the current PR changes
18
+ 2. Identify issues, improvements, or feedback
19
+ 3. Suggest fixes or clarifications
20
+ 4. After fixes are applied, re-review until you approve
21
+
22
+ Loop Instructions:
23
+ - On each iteration, provide clear, actionable feedback
24
+ - Mark feedback as CRITICAL, MAJOR, or MINOR
25
+ - Track which issues have been resolved
26
+ - When all issues are resolved, respond with: "PR_APPROVED"
27
+ - If no changes are made after feedback, respond with: "NO_CHANGES_DETECTED"
28
+ - Maximum 5 iterations allowed
29
+
30
+ Format your response as:
31
+ \`\`\`
32
+ ## Review Iteration [N]
33
+ ### Issues Found:
34
+ - [issue]: [description]
35
+
36
+ ### Approved: [yes/no]
37
+ ### Next Steps: [what needs fixing]
38
38
  \`\`\``;
39
39
  }
40
40
  /**
@@ -45,31 +45,31 @@ export function buildSequentialPipelinePrompt(tasks) {
45
45
  const taskList = tasks
46
46
  .map((task, i) => `${i + 1}. ${task}`)
47
47
  .join('\n');
48
- return `Execute the following tasks sequentially. Each task can reference the output of prior tasks.
49
-
50
- ## Tasks:
51
- ${taskList}
52
-
53
- ## Execution Rules:
54
- - Run tasks in the specified order
55
- - Each task sees all prior outputs
56
- - After completing each task, summarize the result
57
- - If a task fails, explain the error and attempt recovery
58
- - Continue to the next task even if recovery is partial (unless critical)
59
-
60
- For each task, format your response:
61
- \`\`\`
62
- ## Task [N]: [name]
63
- ### Input from prior tasks: [summary or "none"]
64
- ### Execution:
65
- [your work here]
66
-
67
- ### Result:
68
- [clear summary of what was accomplished]
69
-
70
- ### Status: [success/partial/failed]
71
- \`\`\`
72
-
48
+ return `Execute the following tasks sequentially. Each task can reference the output of prior tasks.
49
+
50
+ ## Tasks:
51
+ ${taskList}
52
+
53
+ ## Execution Rules:
54
+ - Run tasks in the specified order
55
+ - Each task sees all prior outputs
56
+ - After completing each task, summarize the result
57
+ - If a task fails, explain the error and attempt recovery
58
+ - Continue to the next task even if recovery is partial (unless critical)
59
+
60
+ For each task, format your response:
61
+ \`\`\`
62
+ ## Task [N]: [name]
63
+ ### Input from prior tasks: [summary or "none"]
64
+ ### Execution:
65
+ [your work here]
66
+
67
+ ### Result:
68
+ [clear summary of what was accomplished]
69
+
70
+ ### Status: [success/partial/failed]
71
+ \`\`\`
72
+
73
73
  After all tasks, provide a final summary of the entire pipeline.`;
74
74
  }
75
75
  /**
@@ -85,34 +85,34 @@ export function buildDAGPrompt(dag) {
85
85
  : dag.strategy === 'sequential'
86
86
  ? 'Run steps one at a time in dependency order.'
87
87
  : 'Run steps in topological layers for optimal parallelism.';
88
- return `Execute the following task graph (DAG). Each step may depend on prior steps.
89
-
90
- ## Task Graph:
91
- ${stepList}
92
-
93
- ## Strategy: ${dag.strategy}
94
- ${strategyDescription}
95
-
96
- ## Execution Rules:
97
- - Respect all dependency relationships
98
- - Skip a step if its dependency failed (mark as skipped)
99
- - For parallel execution, run independent steps concurrently
100
- - Capture the result of each step for dependent steps to use
101
- - On error, log clearly and continue (unless critical)
102
-
103
- For each step, format your response:
104
- \`\`\`
105
- ## Step: [id] - [name]
106
- ### Dependencies: [list of completed prior steps or "none"]
107
- ### Execution:
108
- [your work here]
109
-
110
- ### Result:
111
- [clear output]
112
-
113
- ### Status: [success/skipped/failed]
114
- \`\`\`
115
-
88
+ return `Execute the following task graph (DAG). Each step may depend on prior steps.
89
+
90
+ ## Task Graph:
91
+ ${stepList}
92
+
93
+ ## Strategy: ${dag.strategy}
94
+ ${strategyDescription}
95
+
96
+ ## Execution Rules:
97
+ - Respect all dependency relationships
98
+ - Skip a step if its dependency failed (mark as skipped)
99
+ - For parallel execution, run independent steps concurrently
100
+ - Capture the result of each step for dependent steps to use
101
+ - On error, log clearly and continue (unless critical)
102
+
103
+ For each step, format your response:
104
+ \`\`\`
105
+ ## Step: [id] - [name]
106
+ ### Dependencies: [list of completed prior steps or "none"]
107
+ ### Execution:
108
+ [your work here]
109
+
110
+ ### Result:
111
+ [clear output]
112
+
113
+ ### Status: [success/skipped/failed]
114
+ \`\`\`
115
+
116
116
  After all steps, provide a final summary of the DAG execution.`;
117
117
  }
118
118
  /**
@@ -202,29 +202,29 @@ export function printDAGStatus(dag) {
202
202
  * Instructs the agent to break down a task into subtasks for parallel/sequential execution.
203
203
  */
204
204
  export function buildMultiPlanPrompt(task) {
205
- return `Decompose the following task into 2-5 independent subtasks that can be executed in parallel or sequence:
206
-
207
- Task: ${task}
208
-
209
- For each subtask, provide:
210
- 1. Subtask ID (e.g., "backend-setup")
211
- 2. Subtask name
212
- 3. Clear description of what to do
213
- 4. Any dependencies on other subtasks (or "none")
214
- 5. Estimated complexity: low/medium/high
215
-
216
- Format as JSON array:
217
- [
218
- {
219
- "id": "subtask-id",
220
- "name": "Subtask Name",
221
- "description": "What this subtask does",
222
- "dependsOn": ["other-id"] or [],
223
- "complexity": "low|medium|high"
224
- },
225
- ...
226
- ]
227
-
205
+ return `Decompose the following task into 2-5 independent subtasks that can be executed in parallel or sequence:
206
+
207
+ Task: ${task}
208
+
209
+ For each subtask, provide:
210
+ 1. Subtask ID (e.g., "backend-setup")
211
+ 2. Subtask name
212
+ 3. Clear description of what to do
213
+ 4. Any dependencies on other subtasks (or "none")
214
+ 5. Estimated complexity: low/medium/high
215
+
216
+ Format as JSON array:
217
+ [
218
+ {
219
+ "id": "subtask-id",
220
+ "name": "Subtask Name",
221
+ "description": "What this subtask does",
222
+ "dependsOn": ["other-id"] or [],
223
+ "complexity": "low|medium|high"
224
+ },
225
+ ...
226
+ ]
227
+
228
228
  Only output the JSON, no explanation.`;
229
229
  }
230
230
  /**
@@ -232,29 +232,29 @@ Only output the JSON, no explanation.`;
232
232
  * Takes a JSON plan and generates execution instructions.
233
233
  */
234
234
  export function buildMultiExecutePrompt(plan) {
235
- return `Execute the following task plan. Each subtask may have dependencies.
236
-
237
- ## Plan:
238
- ${plan}
239
-
240
- ## Execution Instructions:
241
- 1. Parse the plan to understand subtask dependencies
242
- 2. Execute subtasks in order (respecting dependencies)
243
- 3. For independent subtasks, you may mention running them in parallel
244
- 4. After completing each subtask, summarize its result
245
- 5. If a subtask fails, attempt recovery or skip dependent tasks
246
- 6. Provide a final summary of all subtask results
247
-
248
- Format each subtask execution as:
249
- \`\`\`
250
- ## Subtask: [id] - [name]
251
- ### Execution:
252
- [your work]
253
-
254
- ### Result:
255
- [output]
256
-
257
- ### Status: [success/failed/skipped]
235
+ return `Execute the following task plan. Each subtask may have dependencies.
236
+
237
+ ## Plan:
238
+ ${plan}
239
+
240
+ ## Execution Instructions:
241
+ 1. Parse the plan to understand subtask dependencies
242
+ 2. Execute subtasks in order (respecting dependencies)
243
+ 3. For independent subtasks, you may mention running them in parallel
244
+ 4. After completing each subtask, summarize its result
245
+ 5. If a subtask fails, attempt recovery or skip dependent tasks
246
+ 6. Provide a final summary of all subtask results
247
+
248
+ Format each subtask execution as:
249
+ \`\`\`
250
+ ## Subtask: [id] - [name]
251
+ ### Execution:
252
+ [your work]
253
+
254
+ ### Result:
255
+ [output]
256
+
257
+ ### Status: [success/failed/skipped]
258
258
  \`\`\``;
259
259
  }
260
260
  /**
@@ -263,45 +263,45 @@ Format each subtask execution as:
263
263
  */
264
264
  export function buildMultiBackendPrompt(services) {
265
265
  const serviceList = services.map((s, i) => `${i + 1}. ${s}`).join('\n');
266
- return `You are orchestrating changes across multiple backend services.
267
-
268
- ## Services to coordinate:
269
- ${serviceList}
270
-
271
- ## Coordination Rules:
272
- 1. Identify dependencies between services (if service A depends on service B, B must be updated first)
273
- 2. Group changes by update type (API changes, database migrations, configuration)
274
- 3. Create a safe update sequence that minimizes downtime
275
- 4. For each service, specify:
276
- - What changes are needed
277
- - Any pre-requisites or migrations
278
- - Testing strategy
279
- - Rollback plan
280
-
281
- 5. Consider:
282
- - API compatibility (version gates if needed)
283
- - Database schema compatibility
284
- - Gradual rollout vs. big bang
285
- - Health checks and monitoring
286
-
287
- Format your response:
288
- \`\`\`
289
- ## Update Plan
290
-
291
- ### Phase 1: Preparation
292
- - Service changes to make
293
- - Migrations to run
294
- - Infrastructure checks
295
-
296
- ### Phase 2: Gradual Rollout
297
- - Service update order
298
- - Health checks between updates
299
- - Rollback triggers
300
-
301
- ### Phase 3: Validation
302
- - Integration tests to run
303
- - Metrics to monitor
304
- - Success criteria
266
+ return `You are orchestrating changes across multiple backend services.
267
+
268
+ ## Services to coordinate:
269
+ ${serviceList}
270
+
271
+ ## Coordination Rules:
272
+ 1. Identify dependencies between services (if service A depends on service B, B must be updated first)
273
+ 2. Group changes by update type (API changes, database migrations, configuration)
274
+ 3. Create a safe update sequence that minimizes downtime
275
+ 4. For each service, specify:
276
+ - What changes are needed
277
+ - Any pre-requisites or migrations
278
+ - Testing strategy
279
+ - Rollback plan
280
+
281
+ 5. Consider:
282
+ - API compatibility (version gates if needed)
283
+ - Database schema compatibility
284
+ - Gradual rollout vs. big bang
285
+ - Health checks and monitoring
286
+
287
+ Format your response:
288
+ \`\`\`
289
+ ## Update Plan
290
+
291
+ ### Phase 1: Preparation
292
+ - Service changes to make
293
+ - Migrations to run
294
+ - Infrastructure checks
295
+
296
+ ### Phase 2: Gradual Rollout
297
+ - Service update order
298
+ - Health checks between updates
299
+ - Rollback triggers
300
+
301
+ ### Phase 3: Validation
302
+ - Integration tests to run
303
+ - Metrics to monitor
304
+ - Success criteria
305
305
  \`\`\``;
306
306
  }
307
307
  /**
@@ -310,49 +310,49 @@ Format your response:
310
310
  */
311
311
  export function buildMultiFrontendPrompt(components) {
312
312
  const componentList = components.map((c, i) => `${i + 1}. ${c}`).join('\n');
313
- return `You are orchestrating changes across multiple frontend components.
314
-
315
- ## Components to coordinate:
316
- ${componentList}
317
-
318
- ## Coordination Rules:
319
- 1. Map component dependencies (if ComponentA uses ComponentB, B must be updated first)
320
- 2. Identify shared state or context that multiple components use
321
- 3. Plan the update sequence to maintain app stability
322
- 4. For each component, specify:
323
- - Props/API changes needed
324
- - State management updates
325
- - CSS/styling updates
326
- - Test coverage needed
327
-
328
- 5. Consider:
329
- - Backward compatibility (graceful degradation)
330
- - Build system impact
331
- - Bundle size implications
332
- - Visual regression testing
333
-
334
- Format your response:
335
- \`\`\`
336
- ## Component Update Plan
337
-
338
- ### Dependency Graph
339
- [List component dependencies]
340
-
341
- ### Update Sequence
342
- [Order of component updates]
343
-
344
- ### Per-Component Changes
345
- For each component:
346
- - Props/API changes
347
- - State updates
348
- - Styling updates
349
- - Tests to add/update
350
-
351
- ### Integration Testing
352
- [How to verify components work together]
353
-
354
- ### Rollback Plan
355
- [If something breaks]
313
+ return `You are orchestrating changes across multiple frontend components.
314
+
315
+ ## Components to coordinate:
316
+ ${componentList}
317
+
318
+ ## Coordination Rules:
319
+ 1. Map component dependencies (if ComponentA uses ComponentB, B must be updated first)
320
+ 2. Identify shared state or context that multiple components use
321
+ 3. Plan the update sequence to maintain app stability
322
+ 4. For each component, specify:
323
+ - Props/API changes needed
324
+ - State management updates
325
+ - CSS/styling updates
326
+ - Test coverage needed
327
+
328
+ 5. Consider:
329
+ - Backward compatibility (graceful degradation)
330
+ - Build system impact
331
+ - Bundle size implications
332
+ - Visual regression testing
333
+
334
+ Format your response:
335
+ \`\`\`
336
+ ## Component Update Plan
337
+
338
+ ### Dependency Graph
339
+ [List component dependencies]
340
+
341
+ ### Update Sequence
342
+ [Order of component updates]
343
+
344
+ ### Per-Component Changes
345
+ For each component:
346
+ - Props/API changes
347
+ - State updates
348
+ - Styling updates
349
+ - Tests to add/update
350
+
351
+ ### Integration Testing
352
+ [How to verify components work together]
353
+
354
+ ### Rollback Plan
355
+ [If something breaks]
356
356
  \`\`\``;
357
357
  }
358
358
  /**
@@ -361,33 +361,33 @@ For each component:
361
361
  */
362
362
  export function buildLoopOperatorPrompt(task, loopType) {
363
363
  const loopInstructions = getLoopTypeInstructions(loopType);
364
- return `You are running an autonomous loop of type: ${loopType}
365
-
366
- Task: ${task}
367
-
368
- ## Loop Operating System:
369
- ${loopInstructions}
370
-
371
- ## General Loop Rules:
372
- 1. Each iteration, perform the loop action and evaluate the stopping condition
373
- 2. If the stopping condition is met, output "LOOP_COMPLETE" and summarize
374
- 3. If the stopping condition is not met, iterate again
375
- 4. Maximum 10 iterations allowed (unless specified otherwise)
376
- 5. After each iteration, provide a status update
377
-
378
- Format each iteration as:
379
- \`\`\`
380
- ## Iteration [N]
381
- ### Action:
382
- [what you did]
383
-
384
- ### Evaluation:
385
- [did the stopping condition pass?]
386
-
387
- ### Status:
388
- [continue/complete]
389
- \`\`\`
390
-
364
+ return `You are running an autonomous loop of type: ${loopType}
365
+
366
+ Task: ${task}
367
+
368
+ ## Loop Operating System:
369
+ ${loopInstructions}
370
+
371
+ ## General Loop Rules:
372
+ 1. Each iteration, perform the loop action and evaluate the stopping condition
373
+ 2. If the stopping condition is met, output "LOOP_COMPLETE" and summarize
374
+ 3. If the stopping condition is not met, iterate again
375
+ 4. Maximum 10 iterations allowed (unless specified otherwise)
376
+ 5. After each iteration, provide a status update
377
+
378
+ Format each iteration as:
379
+ \`\`\`
380
+ ## Iteration [N]
381
+ ### Action:
382
+ [what you did]
383
+
384
+ ### Evaluation:
385
+ [did the stopping condition pass?]
386
+
387
+ ### Status:
388
+ [continue/complete]
389
+ \`\`\`
390
+
391
391
  After loop completion, provide a final summary.`;
392
392
  }
393
393
  /**
@@ -395,65 +395,65 @@ After loop completion, provide a final summary.`;
395
395
  */
396
396
  function getLoopTypeInstructions(loopType) {
397
397
  const instructions = {
398
- verification: `
399
- This is a VERIFICATION LOOP:
400
- 1. Run tests for the target code
401
- 2. If tests pass, stopping condition is met (LOOP_COMPLETE)
402
- 3. If tests fail, identify the issue and propose a fix
403
- 4. Apply the fix and re-run tests
404
- 5. Iterate until tests pass or max iterations reached
398
+ verification: `
399
+ This is a VERIFICATION LOOP:
400
+ 1. Run tests for the target code
401
+ 2. If tests pass, stopping condition is met (LOOP_COMPLETE)
402
+ 3. If tests fail, identify the issue and propose a fix
403
+ 4. Apply the fix and re-run tests
404
+ 5. Iterate until tests pass or max iterations reached
405
405
  `,
406
- review: `
407
- This is a REVIEW LOOP:
408
- 1. Review the current state/code/design
409
- 2. Identify issues, gaps, or improvements
410
- 3. If no issues found, stopping condition is met (LOOP_COMPLETE)
411
- 4. If issues found, address them one by one
412
- 5. Re-review after fixes and iterate until all issues resolved
406
+ review: `
407
+ This is a REVIEW LOOP:
408
+ 1. Review the current state/code/design
409
+ 2. Identify issues, gaps, or improvements
410
+ 3. If no issues found, stopping condition is met (LOOP_COMPLETE)
411
+ 4. If issues found, address them one by one
412
+ 5. Re-review after fixes and iterate until all issues resolved
413
413
  `,
414
- exploration: `
415
- This is an EXPLORATION LOOP:
416
- 1. Explore the current state to understand it
417
- 2. Ask clarifying questions or gather information
418
- 3. If sufficient understanding is achieved, stopping condition is met (LOOP_COMPLETE)
419
- 4. If gaps remain, dig deeper or investigate specific areas
420
- 5. Repeat until you have a complete mental model
414
+ exploration: `
415
+ This is an EXPLORATION LOOP:
416
+ 1. Explore the current state to understand it
417
+ 2. Ask clarifying questions or gather information
418
+ 3. If sufficient understanding is achieved, stopping condition is met (LOOP_COMPLETE)
419
+ 4. If gaps remain, dig deeper or investigate specific areas
420
+ 5. Repeat until you have a complete mental model
421
421
  `,
422
- convergence: `
423
- This is a CONVERGENCE LOOP:
424
- 1. Generate or refine a solution
425
- 2. Evaluate it against criteria
426
- 3. If it meets all criteria, stopping condition is met (LOOP_COMPLETE)
427
- 4. If gaps remain, identify what needs improvement
428
- 5. Refine the solution and re-evaluate
429
- 6. Iterate until solution converges to acceptable quality
422
+ convergence: `
423
+ This is a CONVERGENCE LOOP:
424
+ 1. Generate or refine a solution
425
+ 2. Evaluate it against criteria
426
+ 3. If it meets all criteria, stopping condition is met (LOOP_COMPLETE)
427
+ 4. If gaps remain, identify what needs improvement
428
+ 5. Refine the solution and re-evaluate
429
+ 6. Iterate until solution converges to acceptable quality
430
430
  `,
431
- debugging: `
432
- This is a DEBUGGING LOOP:
433
- 1. Identify the symptom or error
434
- 2. Form a hypothesis about the root cause
435
- 3. Test the hypothesis with evidence
436
- 4. If confirmed, stopping condition is met (LOOP_COMPLETE)
437
- 5. If not confirmed, form a new hypothesis
438
- 6. Iterate until root cause is identified and explained
431
+ debugging: `
432
+ This is a DEBUGGING LOOP:
433
+ 1. Identify the symptom or error
434
+ 2. Form a hypothesis about the root cause
435
+ 3. Test the hypothesis with evidence
436
+ 4. If confirmed, stopping condition is met (LOOP_COMPLETE)
437
+ 5. If not confirmed, form a new hypothesis
438
+ 6. Iterate until root cause is identified and explained
439
439
  `,
440
- optimization: `
441
- This is an OPTIMIZATION LOOP:
442
- 1. Measure the current performance or quality metric
443
- 2. Identify opportunities to improve
444
- 3. Apply an optimization
445
- 4. Re-measure and check for improvement
446
- 5. If metric reaches target, stopping condition is met (LOOP_COMPLETE)
447
- 6. If not, apply another optimization
448
- 7. Iterate until target is reached or diminishing returns found
440
+ optimization: `
441
+ This is an OPTIMIZATION LOOP:
442
+ 1. Measure the current performance or quality metric
443
+ 2. Identify opportunities to improve
444
+ 3. Apply an optimization
445
+ 4. Re-measure and check for improvement
446
+ 5. If metric reaches target, stopping condition is met (LOOP_COMPLETE)
447
+ 6. If not, apply another optimization
448
+ 7. Iterate until target is reached or diminishing returns found
449
449
  `,
450
- default: `
451
- This is a GENERIC AUTONOMOUS LOOP:
452
- 1. On each iteration, work toward the task goal
453
- 2. Evaluate progress: Are you closer to completion?
454
- 3. If task is complete, stopping condition is met (LOOP_COMPLETE)
455
- 4. If not, identify next steps and continue
456
- 5. Iterate until task is complete or max iterations reached
450
+ default: `
451
+ This is a GENERIC AUTONOMOUS LOOP:
452
+ 1. On each iteration, work toward the task goal
453
+ 2. Evaluate progress: Are you closer to completion?
454
+ 3. If task is complete, stopping condition is met (LOOP_COMPLETE)
455
+ 4. If not, identify next steps and continue
456
+ 5. Iterate until task is complete or max iterations reached
457
457
  `,
458
458
  };
459
459
  return instructions[loopType] || instructions['default'];