aspectcode 0.4.0 → 1.0.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 (242) hide show
  1. package/README.md +13 -0
  2. package/dist/agentsMdRenderer.d.ts +16 -0
  3. package/dist/agentsMdRenderer.d.ts.map +1 -0
  4. package/dist/agentsMdRenderer.js +137 -0
  5. package/dist/agentsMdRenderer.js.map +1 -0
  6. package/dist/auth.d.ts +31 -0
  7. package/dist/auth.d.ts.map +1 -0
  8. package/dist/auth.js +385 -0
  9. package/dist/auth.js.map +1 -0
  10. package/dist/autoResolve.d.ts +41 -0
  11. package/dist/autoResolve.d.ts.map +1 -0
  12. package/dist/autoResolve.js +196 -0
  13. package/dist/autoResolve.js.map +1 -0
  14. package/dist/changeEvaluator.d.ts +56 -0
  15. package/dist/changeEvaluator.d.ts.map +1 -0
  16. package/dist/changeEvaluator.js +674 -0
  17. package/dist/changeEvaluator.js.map +1 -0
  18. package/dist/cli.d.ts +12 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +1 -1
  21. package/dist/cli.js.map +1 -1
  22. package/dist/config.d.ts +37 -17
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/config.js +50 -2
  25. package/dist/config.js.map +1 -1
  26. package/dist/dreamCycle.d.ts +57 -0
  27. package/dist/dreamCycle.d.ts.map +1 -0
  28. package/dist/dreamCycle.js +334 -0
  29. package/dist/dreamCycle.js.map +1 -0
  30. package/dist/kbBuilder.d.ts +1 -2
  31. package/dist/kbBuilder.d.ts.map +1 -1
  32. package/dist/kbBuilder.js +1 -2
  33. package/dist/kbBuilder.js.map +1 -1
  34. package/dist/main.d.ts +2 -1
  35. package/dist/main.d.ts.map +1 -1
  36. package/dist/main.js +149 -8
  37. package/dist/main.js.map +1 -1
  38. package/dist/optimize.d.ts +13 -6
  39. package/dist/optimize.d.ts.map +1 -1
  40. package/dist/optimize.js +433 -142
  41. package/dist/optimize.js.map +1 -1
  42. package/dist/pipeline.d.ts +21 -18
  43. package/dist/pipeline.d.ts.map +1 -1
  44. package/dist/pipeline.js +1139 -162
  45. package/dist/pipeline.js.map +1 -1
  46. package/dist/preferences.d.ts +80 -0
  47. package/dist/preferences.d.ts.map +1 -0
  48. package/dist/preferences.js +238 -0
  49. package/dist/preferences.js.map +1 -0
  50. package/dist/runtimeState.d.ts +30 -0
  51. package/dist/runtimeState.d.ts.map +1 -0
  52. package/dist/runtimeState.js +39 -0
  53. package/dist/runtimeState.js.map +1 -0
  54. package/dist/scopedRules.d.ts +84 -0
  55. package/dist/scopedRules.d.ts.map +1 -0
  56. package/dist/scopedRules.js +449 -0
  57. package/dist/scopedRules.js.map +1 -0
  58. package/dist/ui/Dashboard.d.ts +4 -16
  59. package/dist/ui/Dashboard.d.ts.map +1 -1
  60. package/dist/ui/Dashboard.js +339 -141
  61. package/dist/ui/Dashboard.js.map +1 -1
  62. package/dist/ui/MemoryMap.d.ts +16 -0
  63. package/dist/ui/MemoryMap.d.ts.map +1 -0
  64. package/dist/ui/MemoryMap.js +266 -0
  65. package/dist/ui/MemoryMap.js.map +1 -0
  66. package/dist/ui/SettingsPanel.d.ts +18 -0
  67. package/dist/ui/SettingsPanel.d.ts.map +1 -0
  68. package/dist/ui/SettingsPanel.js +241 -0
  69. package/dist/ui/SettingsPanel.js.map +1 -0
  70. package/dist/ui/prompts.d.ts +7 -0
  71. package/dist/ui/prompts.d.ts.map +1 -1
  72. package/dist/ui/prompts.js +63 -0
  73. package/dist/ui/prompts.js.map +1 -1
  74. package/dist/ui/store.d.ts +154 -18
  75. package/dist/ui/store.d.ts.map +1 -1
  76. package/dist/ui/store.js +154 -24
  77. package/dist/ui/store.js.map +1 -1
  78. package/dist/ui/theme.d.ts +1 -8
  79. package/dist/ui/theme.d.ts.map +1 -1
  80. package/dist/ui/theme.js +2 -20
  81. package/dist/ui/theme.js.map +1 -1
  82. package/dist/updateChecker.d.ts +13 -0
  83. package/dist/updateChecker.d.ts.map +1 -0
  84. package/dist/updateChecker.js +66 -0
  85. package/dist/updateChecker.js.map +1 -0
  86. package/dist/usageTracker.d.ts +12 -0
  87. package/dist/usageTracker.d.ts.map +1 -0
  88. package/dist/usageTracker.js +89 -0
  89. package/dist/usageTracker.js.map +1 -0
  90. package/dist/writer.d.ts +1 -7
  91. package/dist/writer.d.ts.map +1 -1
  92. package/dist/writer.js +1 -11
  93. package/dist/writer.js.map +1 -1
  94. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -1
  95. package/node_modules/@aspectcode/core/dist/analysis/repo.js +13 -2
  96. package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -1
  97. package/node_modules/@aspectcode/core/dist/index.d.ts +1 -3
  98. package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -1
  99. package/node_modules/@aspectcode/core/dist/index.js +1 -3
  100. package/node_modules/@aspectcode/core/dist/index.js.map +1 -1
  101. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts +14 -0
  102. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts.map +1 -0
  103. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js +191 -0
  104. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js.map +1 -0
  105. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +1 -0
  106. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -1
  107. package/node_modules/@aspectcode/core/dist/parsers/index.js +6 -1
  108. package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -1
  109. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +20 -0
  110. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -1
  111. package/node_modules/@aspectcode/core/dist/parsers/languages.js +25 -0
  112. package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -1
  113. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -1
  114. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +4 -1
  115. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -1
  116. package/node_modules/@aspectcode/core/package.json +2 -2
  117. package/node_modules/@aspectcode/core/parsers/cpp.wasm +0 -0
  118. package/node_modules/@aspectcode/core/parsers/go.wasm +0 -0
  119. package/node_modules/@aspectcode/core/parsers/php.wasm +0 -0
  120. package/node_modules/@aspectcode/core/parsers/ruby.wasm +0 -0
  121. package/node_modules/@aspectcode/core/parsers/rust.wasm +0 -0
  122. package/node_modules/@aspectcode/emitters/dist/index.d.ts +1 -17
  123. package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -1
  124. package/node_modules/@aspectcode/emitters/dist/index.js +2 -89
  125. package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -1
  126. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +0 -2
  127. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -1
  128. package/node_modules/@aspectcode/emitters/dist/instructions/index.js +1 -7
  129. package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -1
  130. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +0 -18
  131. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -1
  132. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +0 -57
  133. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -1
  134. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +0 -18
  135. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -1
  136. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +0 -130
  137. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -1
  138. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +2 -4
  139. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -1
  140. package/node_modules/@aspectcode/emitters/dist/kb/index.js +1 -11
  141. package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -1
  142. package/node_modules/@aspectcode/emitters/package.json +3 -3
  143. package/node_modules/@aspectcode/evaluator/dist/apply.d.ts +55 -0
  144. package/node_modules/@aspectcode/evaluator/dist/apply.d.ts.map +1 -0
  145. package/node_modules/@aspectcode/evaluator/dist/apply.js +368 -0
  146. package/node_modules/@aspectcode/evaluator/dist/apply.js.map +1 -0
  147. package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts +16 -25
  148. package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts.map +1 -1
  149. package/node_modules/@aspectcode/evaluator/dist/diagnosis.js +115 -138
  150. package/node_modules/@aspectcode/evaluator/dist/diagnosis.js.map +1 -1
  151. package/node_modules/@aspectcode/evaluator/dist/index.d.ts +8 -43
  152. package/node_modules/@aspectcode/evaluator/dist/index.d.ts.map +1 -1
  153. package/node_modules/@aspectcode/evaluator/dist/index.js +15 -61
  154. package/node_modules/@aspectcode/evaluator/dist/index.js.map +1 -1
  155. package/node_modules/@aspectcode/evaluator/dist/judge.d.ts +32 -0
  156. package/node_modules/@aspectcode/evaluator/dist/judge.d.ts.map +1 -0
  157. package/node_modules/@aspectcode/evaluator/dist/judge.js +165 -0
  158. package/node_modules/@aspectcode/evaluator/dist/judge.js.map +1 -0
  159. package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts +15 -0
  160. package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts.map +1 -0
  161. package/node_modules/@aspectcode/evaluator/dist/llmUtil.js +41 -0
  162. package/node_modules/@aspectcode/evaluator/dist/llmUtil.js.map +1 -0
  163. package/node_modules/@aspectcode/evaluator/dist/probes.d.ts +20 -29
  164. package/node_modules/@aspectcode/evaluator/dist/probes.d.ts.map +1 -1
  165. package/node_modules/@aspectcode/evaluator/dist/probes.js +188 -204
  166. package/node_modules/@aspectcode/evaluator/dist/probes.js.map +1 -1
  167. package/node_modules/@aspectcode/evaluator/dist/runner.d.ts +7 -32
  168. package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -1
  169. package/node_modules/@aspectcode/evaluator/dist/runner.js +21 -146
  170. package/node_modules/@aspectcode/evaluator/dist/runner.js.map +1 -1
  171. package/node_modules/@aspectcode/evaluator/dist/types.d.ts +141 -99
  172. package/node_modules/@aspectcode/evaluator/dist/types.d.ts.map +1 -1
  173. package/node_modules/@aspectcode/evaluator/dist/types.js +10 -2
  174. package/node_modules/@aspectcode/evaluator/dist/types.js.map +1 -1
  175. package/node_modules/@aspectcode/evaluator/package.json +4 -4
  176. package/node_modules/@aspectcode/optimizer/dist/index.d.ts +3 -10
  177. package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -1
  178. package/node_modules/@aspectcode/optimizer/dist/index.js +1 -19
  179. package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -1
  180. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -1
  181. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +40 -0
  182. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -1
  183. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts +9 -0
  184. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts.map +1 -0
  185. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js +83 -0
  186. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js.map +1 -0
  187. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +4 -3
  188. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -1
  189. package/node_modules/@aspectcode/optimizer/dist/providers/index.js +24 -10
  190. package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -1
  191. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -1
  192. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +22 -0
  193. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -1
  194. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +14 -0
  195. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -1
  196. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +1 -0
  197. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -1
  198. package/node_modules/@aspectcode/optimizer/dist/types.d.ts +14 -0
  199. package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -1
  200. package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -1
  201. package/node_modules/@aspectcode/optimizer/package.json +2 -2
  202. package/package.json +6 -7
  203. package/dist/complaintProcessor.d.ts +0 -16
  204. package/dist/complaintProcessor.d.ts.map +0 -1
  205. package/dist/complaintProcessor.js +0 -134
  206. package/dist/complaintProcessor.js.map +0 -1
  207. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +0 -72
  208. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +0 -1
  209. package/node_modules/@aspectcode/emitters/dist/emitter.js +0 -10
  210. package/node_modules/@aspectcode/emitters/dist/emitter.js.map +0 -1
  211. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +0 -15
  212. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +0 -1
  213. package/node_modules/@aspectcode/emitters/dist/instructions/content.js +0 -289
  214. package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +0 -1
  215. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +0 -13
  216. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +0 -1
  217. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +0 -55
  218. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +0 -1
  219. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +0 -9
  220. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +0 -1
  221. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +0 -30
  222. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +0 -1
  223. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +0 -21
  224. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +0 -1
  225. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +0 -125
  226. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +0 -1
  227. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +0 -37
  228. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +0 -1
  229. package/node_modules/@aspectcode/emitters/dist/manifest.js +0 -50
  230. package/node_modules/@aspectcode/emitters/dist/manifest.js.map +0 -1
  231. package/node_modules/@aspectcode/emitters/dist/report.d.ts +0 -22
  232. package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +0 -1
  233. package/node_modules/@aspectcode/emitters/dist/report.js +0 -3
  234. package/node_modules/@aspectcode/emitters/dist/report.js.map +0 -1
  235. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +0 -14
  236. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +0 -1
  237. package/node_modules/@aspectcode/emitters/dist/stableJson.js +0 -40
  238. package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +0 -1
  239. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +0 -29
  240. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +0 -1
  241. package/node_modules/@aspectcode/emitters/dist/transaction.js +0 -104
  242. package/node_modules/@aspectcode/emitters/dist/transaction.js.map +0 -1
@@ -1,229 +1,213 @@
1
1
  "use strict";
2
2
  /**
3
- * Probe generator — creates scoped micro-tests from KB content.
3
+ * LLM-powered probe generator — creates synthetic bug-fix tasks.
4
4
  *
5
- * Probes are derived from:
6
- * 1. KB structure (hubs, entry points, naming conventions, integrations)
7
- * 2. KB diff (changed areas and their 1-hop dependents)
8
- * 3. Harvested prompts (real user interactions that reveal problem areas)
5
+ * Each probe is a realistic coding-assistant request with expected
6
+ * behaviours. Probes are generated via LLM at temperature 0.9 for
7
+ * diversity, with deduplication across iterations and a fallback
8
+ * pool of hardcoded templates.
9
9
  *
10
- * Each probe is a self-contained scenario that can be "run" by sending it
11
- * to an LLM with AGENTS.md as context and evaluating the response.
10
+ * Ported from sweagent_bench oracle/probes.py.
12
11
  */
13
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.normalizeProbeText = normalizeProbeText;
14
+ exports.isDuplicate = isDuplicate;
15
+ exports.parseProbeResponse = parseProbeResponse;
14
16
  exports.generateProbes = generateProbes;
15
- exports.extractSection = extractSection;
16
- exports.parseHubs = parseHubs;
17
- exports.parseEntryPoints = parseEntryPoints;
18
- exports.parseConventions = parseConventions;
19
- exports.parseDiffFiles = parseDiffFiles;
20
- // ── KB section parsers ──────────────────────────────────────
21
- /** Extract a section from KB text by heading prefix. */
22
- function extractSection(kb, heading) {
23
- const idx = kb.indexOf(heading);
24
- if (idx < 0)
25
- return '';
26
- const start = idx + heading.length;
27
- // Find the next `---` separator or end of string
28
- const sepIdx = kb.indexOf('\n---\n', start);
29
- return sepIdx > 0 ? kb.slice(start, sepIdx).trim() : kb.slice(start).trim();
30
- }
31
- /** Parse "High-Risk Architectural Hubs" table rows: | path | in | out | */
32
- function parseHubs(architecture) {
33
- const hubs = [];
34
- const tableRegex = /\|\s*`?([^`|]+?)`?\s*\|\s*(\d+)\s*\|\s*(\d+)\s*\|/g;
35
- const section = extractSubSection(architecture, 'High-Risk Architectural Hubs');
36
- let match;
37
- while ((match = tableRegex.exec(section)) !== null) {
38
- hubs.push({
39
- file: match[1].trim(),
40
- inDegree: parseInt(match[2], 10),
41
- outDegree: parseInt(match[3], 10),
42
- });
17
+ const llmUtil_1 = require("./llmUtil");
18
+ // ── Constants ───────────────────────────────────────────────
19
+ const MAX_KB_CHARS = 12000;
20
+ const MAX_TOPUP_ATTEMPTS = 3;
21
+ // ── Prompts ─────────────────────────────────────────────────
22
+ function buildProbeSystemPrompt(maxProbes) {
23
+ return `Generate probe tasks to evaluate whether AGENTS.md improves repo self-exploration.
24
+
25
+ Return ONLY a JSON array of probe objects with this shape:
26
+ [
27
+ {
28
+ "task": "short realistic coding-assistant user request",
29
+ "expected_behaviors": ["behavior 1", "behavior 2"],
30
+ "rationale": "why this probe is useful"
43
31
  }
44
- return hubs;
32
+ ]
33
+
34
+ Rules:
35
+ - Return exactly ${maxProbes} probes, diverse across bug-fix and test-failure tasks.
36
+ - Tasks must be concrete coding requests, not AGENTS/meta questions.
37
+ - Each probe must include 2-4 expected behaviors.
38
+ - Expected behaviors must emphasize: evidence-first localization, dependency tracing, minimal scoped edits, and targeted validation.
39
+ - Every task must be patchable and executable by a tool-using coding runner (inspect files, run commands, propose code diff).
40
+ - Avoid pure advisory/navigation-only tasks that do not naturally end in a code diff.
41
+ - Avoid duplicates with prior tasks.
42
+ - Exactly ${maxProbes} probes.`;
45
43
  }
46
- /** Parse "Entry Points" from architecture section. */
47
- function parseEntryPoints(architecture) {
48
- const entries = [];
49
- const section = extractSubSection(architecture, 'Entry Points');
50
- const regex = /\|\s*`?([^`|]+?)`?\s*\|\s*([^|]+?)\s*\|/g;
51
- let match;
52
- while ((match = regex.exec(section)) !== null) {
53
- const file = match[1].trim();
54
- const kind = match[2].trim();
55
- if (file && !file.includes('---') && kind !== 'Kind') {
56
- entries.push({ file, kind });
57
- }
58
- }
59
- return entries;
44
+ function buildProbeUserPrompt(projectName, agentsMd, kbText, priorTasks) {
45
+ const priorSection = priorTasks.length > 0
46
+ ? priorTasks.map((t, i) => `${i + 1}. ${t}`).join('\n')
47
+ : '(none)';
48
+ return `Project: ${projectName}
49
+
50
+ CURRENT AGENTS.MD:
51
+ ---
52
+ ${agentsMd}
53
+ ---
54
+
55
+ REPO KB SNIPPET:
56
+ ---
57
+ ${kbText}
58
+ ---
59
+
60
+ PRIOR PROBE TASKS (avoid duplicates):
61
+ ${priorSection}
62
+
63
+ Generate probes now.
64
+
65
+ Additional requirements for this batch:
66
+ - Include realistic technical context (module/function/test hints) when possible.
67
+ - Prefer scoped fixes; avoid broad refactors.
68
+ - Phrase each task as a request to fix a concrete failing behavior or test regression.`;
60
69
  }
61
- /** Parse naming conventions from the map section. */
62
- function parseConventions(mapSection) {
63
- const section = extractSubSection(mapSection, 'Conventions');
64
- return section
65
- .split('\n')
66
- .filter((line) => line.startsWith('- ') || line.startsWith('* '))
67
- .map((line) => line.replace(/^[-*]\s*/, '').trim())
68
- .filter(Boolean);
70
+ // ── Fallback probe pool ─────────────────────────────────────
71
+ const FALLBACK_BEHAVIORS = [
72
+ 'Localizes likely files/functions before editing',
73
+ 'Applies a minimal scoped code change',
74
+ 'Runs targeted validation relevant to the change',
75
+ ];
76
+ const FALLBACK_PROBES = [
77
+ { task: 'A recent commit introduced a regression in a high-traffic module. A core function now returns incorrect results for edge-case inputs. Fix it.', rationale: 'Tests regression diagnosis in a core path' },
78
+ { task: 'A test suite for the main entry point is failing after a dependency update. The test expects old behavior. Update the test or the code to restore correctness.', rationale: 'Tests adaptation to dependency changes' },
79
+ { task: 'An edge case in input validation causes a crash when empty strings are passed. Add proper validation and a test.', rationale: 'Tests defensive coding and validation' },
80
+ { task: 'A serialization function drops fields when the input contains nested objects with optional keys. Fix the serialization logic.', rationale: 'Tests careful data handling' },
81
+ { task: 'A caching layer returns stale data after a config change. The cache invalidation logic does not account for the new config key. Fix it.', rationale: 'Tests understanding of caching dependencies' },
82
+ { task: 'A version compatibility check is too strict and rejects valid inputs from the latest release. Relax the check while maintaining safety.', rationale: 'Tests careful constraint relaxation' },
83
+ { task: 'A lifecycle hook fires in the wrong order during initialization, causing a null reference. Fix the ordering.', rationale: 'Tests understanding of initialization order' },
84
+ { task: 'A deduplication filter is too aggressive and removes valid entries that share a partial key. Fix the matching logic.', rationale: 'Tests precise filtering logic' },
85
+ { task: 'An API endpoint returns a 500 error when called with a valid but uncommon parameter combination. Trace and fix the handler.', rationale: 'Tests end-to-end debugging' },
86
+ { task: 'A migration script fails silently when the target schema already exists. Add proper detection and error handling.', rationale: 'Tests robustness in data operations' },
87
+ { task: 'A search function returns duplicate results when the query matches items in multiple indexes. Fix the result merging.', rationale: 'Tests data aggregation correctness' },
88
+ { task: 'An event handler leaks resources because it registers listeners but never removes them. Fix the cleanup.', rationale: 'Tests resource management' },
89
+ { task: 'A formatting function produces incorrect output for locale-specific inputs. Fix the locale handling.', rationale: 'Tests internationalization awareness' },
90
+ { task: 'A retry mechanism enters an infinite loop when the error type changes between attempts. Add proper loop termination.', rationale: 'Tests error handling robustness' },
91
+ { task: 'A permissions check incorrectly grants access when multiple roles overlap. Fix the authorization logic.', rationale: 'Tests security-sensitive logic' },
92
+ ];
93
+ // ── Deduplication ───────────────────────────────────────────
94
+ function normalizeProbeText(text) {
95
+ return text
96
+ .toLowerCase()
97
+ .replace(/[^a-z0-9\s]/g, '')
98
+ .replace(/\s+/g, ' ')
99
+ .trim();
69
100
  }
70
- /** Extract a sub-section within a larger section by heading. */
71
- function extractSubSection(section, heading) {
72
- const regex = new RegExp(`#+\\s*${heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`, 'i');
73
- const match = regex.exec(section);
74
- if (!match)
75
- return '';
76
- const start = match.index + match[0].length;
77
- // Find next heading of same or higher level
78
- const nextHeading = section.slice(start).search(/\n#{1,3}\s/);
79
- return nextHeading > 0 ? section.slice(start, start + nextHeading).trim() : section.slice(start).trim();
101
+ function isDuplicate(task, existing) {
102
+ const normalized = normalizeProbeText(task);
103
+ return existing.some((t) => {
104
+ const n = normalizeProbeText(t);
105
+ return n === normalized || n.includes(normalized) || normalized.includes(n);
106
+ });
80
107
  }
81
- /** Parse file paths mentioned in a diff string. */
82
- function parseDiffFiles(diff) {
83
- const files = new Set();
84
- const regex = /^[+-]{3}\s+[ab]\/(.+)$/gm;
85
- let match;
86
- while ((match = regex.exec(diff)) !== null) {
87
- files.add(match[1]);
108
+ function parseProbeResponse(raw) {
109
+ // Strip thinking tags
110
+ let cleaned = raw.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
111
+ // Strip code fences
112
+ cleaned = cleaned.replace(/^```(?:json)?\s*\n?/m, '').replace(/\n?```\s*$/m, '').trim();
113
+ try {
114
+ const parsed = JSON.parse(cleaned);
115
+ if (Array.isArray(parsed))
116
+ return parsed;
88
117
  }
89
- // Also pick up paths from @@ hunks or added/removed lines referencing files
90
- const pathRegex = /(?:^[+-]\s*(?:import|from|require)\s*.*?['"])([^'"]+)['"]/gm;
91
- while ((match = pathRegex.exec(diff)) !== null) {
92
- files.add(match[1]);
118
+ catch {
119
+ // Try to find JSON array
120
+ const match = cleaned.match(/\[[\s\S]*\]/);
121
+ if (match) {
122
+ try {
123
+ return JSON.parse(match[0]);
124
+ }
125
+ catch {
126
+ // fall through
127
+ }
128
+ }
93
129
  }
94
- return [...files];
95
- }
96
- // ── Probe generators by category ────────────────────────────
97
- function generateHubProbes(hubs) {
98
- return hubs.slice(0, 5).map((hub) => ({
99
- id: `hub-safety-${sanitizeId(hub.file)}`,
100
- description: `Test that the AI handles ${hub.file} carefully (${hub.inDegree} dependents)`,
101
- category: 'hub-safety',
102
- contextFiles: [hub.file],
103
- task: `I need to modify \`${hub.file}\` to add a new exported function. This file has ${hub.inDegree} files that depend on it. Write the code change and explain what else needs updating.`,
104
- expectedBehaviors: [
105
- `Acknowledges that ${hub.file} is a high-risk hub with many dependents`,
106
- 'Warns about or checks for breaking changes to existing exports',
107
- 'Suggests verifying or updating downstream consumers',
108
- 'Makes a minimal, backwards-compatible change',
109
- ],
110
- }));
111
- }
112
- function generateEntryPointProbes(entries) {
113
- return entries.slice(0, 3).map((entry) => ({
114
- id: `entry-point-${sanitizeId(entry.file)}`,
115
- description: `Test that the AI handles ${entry.kind} entry point ${entry.file} correctly`,
116
- category: 'entry-point',
117
- contextFiles: [entry.file],
118
- task: `I want to add a new ${entry.kind.toLowerCase()} route/command in \`${entry.file}\`. Where should I add it and what patterns should I follow?`,
119
- expectedBehaviors: [
120
- `References the existing patterns in ${entry.file}`,
121
- `Follows the ${entry.kind.toLowerCase()} conventions used in the project`,
122
- 'Suggests appropriate error handling consistent with existing handlers',
123
- 'Places the new code in the correct location within the file',
124
- ],
125
- }));
126
- }
127
- function generateNamingProbes(conventions) {
128
- if (conventions.length === 0)
129
- return [];
130
- const conventionText = conventions.slice(0, 5).join('; ');
131
- return [{
132
- id: 'naming-conventions',
133
- description: 'Test that the AI follows the project\'s naming conventions',
134
- category: 'naming',
135
- contextFiles: [],
136
- task: `I need to create a new utility module with a helper function and a class. What should I name the file, function, and class? The project has these conventions: ${conventionText}`,
137
- expectedBehaviors: conventions.slice(0, 5).map((c) => `Follows convention: ${c}`),
138
- }];
139
- }
140
- function generateDiffProbes(diffFiles) {
141
- if (diffFiles.length === 0)
142
- return [];
143
- return diffFiles.slice(0, 3).map((file) => ({
144
- id: `diff-area-${sanitizeId(file)}`,
145
- description: `Test AI awareness of recently changed file ${file}`,
146
- category: 'architecture',
147
- contextFiles: [file],
148
- task: `I'm working on \`${file}\` which was recently modified. I need to add a related feature. What do I need to know about this file and its dependencies before making changes?`,
149
- expectedBehaviors: [
150
- `Identifies the role/purpose of ${file} in the project`,
151
- 'Notes any imports/exports that constrain changes',
152
- 'Suggests checking dependent files',
153
- 'Follows the existing code style in the file',
154
- ],
155
- }));
156
- }
157
- function generateHarvestedProbes(prompts) {
158
- // Take the most recent prompts that reference specific files
159
- const withFiles = prompts
160
- .filter((p) => p.filesReferenced.length > 0)
161
- .slice(0, 3);
162
- return withFiles.map((p, i) => ({
163
- id: `harvested-${i}-${sanitizeId(p.filesReferenced[0] ?? 'general')}`,
164
- description: `Probe from real ${p.source} interaction involving ${p.filesReferenced.join(', ')}`,
165
- category: 'harvested',
166
- contextFiles: p.filesReferenced,
167
- task: p.userPrompt,
168
- expectedBehaviors: [
169
- 'Produces a response consistent with the project\'s conventions',
170
- 'References the correct files and their roles',
171
- 'Does not hallucinate non-existent APIs or patterns',
172
- `Handles the task at least as well as the original ${p.source} response`,
173
- ],
174
- }));
175
- }
176
- // ── Helpers ─────────────────────────────────────────────────
177
- function sanitizeId(path) {
178
- return path
179
- .replace(/[/\\]/g, '-')
180
- .replace(/\.[^.]+$/, '')
181
- .replace(/[^a-zA-Z0-9-]/g, '')
182
- .toLowerCase()
183
- .slice(0, 40);
130
+ return [];
184
131
  }
185
132
  // ── Public API ──────────────────────────────────────────────
186
133
  /**
187
- * Generate probes scoped to the KB content and optional diff.
134
+ * Generate probes via LLM with fallback to hardcoded templates.
188
135
  *
189
- * When a diff is provided, probes focus on changed areas.
190
- * Otherwise, probes cover the full KB (hubs, entry points, conventions).
136
+ * Uses temperature 0.9 for diverse probe generation. Deduplicates
137
+ * against prior tasks across iterations. Falls back to a pool of
138
+ * hardcoded templates when LLM generation fails.
191
139
  */
192
- function generateProbes(options) {
193
- const { kb, kbDiff, harvestedPrompts, maxProbes = 10 } = options;
194
- const architecture = extractSection(kb, '## High-Risk Architectural Hubs');
195
- const fullArch = extractSection(kb, '# Architecture') || extractSection(kb, '## High-Risk');
196
- const mapSection = extractSection(kb, '# Map') || extractSection(kb, '## Data Models');
140
+ async function generateProbes(options) {
141
+ const { kb, currentAgentsMd, priorProbeTasks, maxProbes = 10, provider, projectName = 'project', log, signal, } = options;
142
+ if (signal?.aborted)
143
+ return [];
144
+ // Truncate KB to fit in prompt
145
+ const kbText = kb.length > MAX_KB_CHARS
146
+ ? kb.slice(0, MAX_KB_CHARS - 20) + '\n[... truncated]'
147
+ : kb;
148
+ const allPriorTasks = [...priorProbeTasks];
197
149
  const probes = [];
198
- // 1. Hub safety probes
199
- const hubs = parseHubs(fullArch || architecture);
200
- probes.push(...generateHubProbes(hubs));
201
- // 2. Entry point probes
202
- const entries = parseEntryPoints(fullArch || architecture);
203
- probes.push(...generateEntryPointProbes(entries));
204
- // 3. Naming convention probes
205
- const conventions = parseConventions(mapSection);
206
- probes.push(...generateNamingProbes(conventions));
207
- // 4. Diff-scoped probes (prioritized when available)
208
- if (kbDiff) {
209
- const diffFiles = parseDiffFiles(kbDiff);
210
- const diffProbes = generateDiffProbes(diffFiles);
211
- // Insert diff probes at the front (highest priority)
212
- probes.unshift(...diffProbes);
213
- }
214
- // 5. Harvested prompt probes
215
- if (harvestedPrompts && harvestedPrompts.length > 0) {
216
- probes.push(...generateHarvestedProbes(harvestedPrompts));
150
+ let attempts = 0;
151
+ while (probes.length < maxProbes && attempts <= MAX_TOPUP_ATTEMPTS) {
152
+ if (signal?.aborted)
153
+ break;
154
+ attempts++;
155
+ const remaining = maxProbes - probes.length;
156
+ const systemPrompt = buildProbeSystemPrompt(remaining);
157
+ const userPrompt = buildProbeUserPrompt(projectName, currentAgentsMd, kbText, allPriorTasks);
158
+ const messages = [
159
+ { role: 'system', content: systemPrompt },
160
+ { role: 'user', content: userPrompt },
161
+ ];
162
+ let rawProbes = [];
163
+ try {
164
+ const response = await (0, llmUtil_1.chatWithTemp)(provider, messages, 0.9, signal);
165
+ rawProbes = parseProbeResponse(response);
166
+ }
167
+ catch (err) {
168
+ const msg = err instanceof Error ? err.message : String(err);
169
+ log?.warn(`Probe generation attempt ${attempts} failed: ${msg}`);
170
+ }
171
+ // Process and deduplicate
172
+ for (const raw of rawProbes) {
173
+ if (probes.length >= maxProbes)
174
+ break;
175
+ if (!raw.task || !raw.expected_behaviors?.length)
176
+ continue;
177
+ if (isDuplicate(raw.task, allPriorTasks))
178
+ continue;
179
+ const id = `probe-${probes.length + 1}-${normalizeProbeText(raw.task).slice(0, 30).replace(/\s/g, '-')}`;
180
+ probes.push({
181
+ id,
182
+ task: raw.task,
183
+ expectedBehaviors: raw.expected_behaviors.slice(0, 4),
184
+ rationale: raw.rationale,
185
+ });
186
+ allPriorTasks.push(raw.task);
187
+ }
188
+ // If first attempt got nothing, try again before falling back
189
+ if (rawProbes.length === 0 && attempts >= 2)
190
+ break;
217
191
  }
218
- // Deduplicate by id and cap at maxProbes
219
- const seen = new Set();
220
- const unique = [];
221
- for (const probe of probes) {
222
- if (!seen.has(probe.id) && unique.length < maxProbes) {
223
- seen.add(probe.id);
224
- unique.push(probe);
192
+ // Fallback to hardcoded templates if still under target
193
+ if (probes.length < maxProbes) {
194
+ log?.debug(`Using fallback probes (generated ${probes.length}/${maxProbes})`);
195
+ for (const fallback of FALLBACK_PROBES) {
196
+ if (probes.length >= maxProbes)
197
+ break;
198
+ if (isDuplicate(fallback.task, allPriorTasks))
199
+ continue;
200
+ const id = `fallback-${probes.length + 1}`;
201
+ probes.push({
202
+ id,
203
+ task: fallback.task,
204
+ expectedBehaviors: FALLBACK_BEHAVIORS,
205
+ rationale: fallback.rationale,
206
+ });
207
+ allPriorTasks.push(fallback.task);
225
208
  }
226
209
  }
227
- return unique;
210
+ log?.info(`Generated ${probes.length} probes (${attempts} LLM attempts)`);
211
+ return probes;
228
212
  }
229
213
  //# sourceMappingURL=probes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"probes.js","sourceRoot":"","sources":["../src/probes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAoMH,wCA4CC;AAGQ,wCAAc;AAAE,8BAAS;AAAE,4CAAgB;AAAE,4CAAgB;AAAE,wCAAc;AA1OtF,+DAA+D;AAE/D,wDAAwD;AACxD,SAAS,cAAc,CAAC,EAAU,EAAE,OAAe;IACjD,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IACnC,iDAAiD;IACjD,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9E,CAAC;AAED,2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Y,QAAQ,gBAAgB,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -2,43 +2,18 @@
2
2
  * Probe runner — simulates AI responses to probes using AGENTS.md as context.
3
3
  *
4
4
  * For each probe, constructs a chat where:
5
- * - System prompt = current AGENTS.md + relevant file contents
5
+ * - System prompt = current AGENTS.md
6
6
  * - User prompt = the probe's task
7
- * Then sends it to the LLM and collects the response.
8
- */
9
- import type { LlmProvider, OptLogger } from '@aspectcode/optimizer';
10
- import type { Probe, ProbeResult, BehaviorResult } from './types';
11
- /**
12
- * Build the system prompt for a probe run.
13
- * Includes the AGENTS.md instructions and relevant file contents.
14
- */
15
- declare function buildProbeSystemPrompt(agentsContent: string, probe: Probe, fileContents?: ReadonlyMap<string, string>): string;
16
- /**
17
- * Build the evaluation prompt that scores a probe response
18
- * against expected behaviours.
7
+ * Then sends it to the LLM (temperature 0.0) and returns the raw response.
8
+ *
9
+ * Judging/evaluation is handled separately by the judge module.
19
10
  */
20
- declare function buildBehaviorEvalPrompt(probe: Probe, response: string): string;
21
- /** Parse the structured behaviour evaluation response. */
22
- declare function parseBehaviorEval(response: string, expectedBehaviors: string[]): {
23
- results: BehaviorResult[];
24
- allPassed: boolean;
25
- };
26
- /** Callback invoked before/after each probe for live progress updates. */
27
- export interface ProbeProgressCallback {
28
- (info: {
29
- probeIndex: number;
30
- total: number;
31
- probeId: string;
32
- phase: 'starting' | 'done';
33
- passed?: boolean;
34
- }): void;
35
- }
11
+ import type { Probe, SimulationResult, LlmProvider, OptLogger, ProbeProgressCallback } from './types';
36
12
  /**
37
13
  * Run all probes against the current AGENTS.md.
38
14
  *
39
15
  * Each probe is run sequentially (to respect rate limits).
40
- * Returns results for all probes.
16
+ * Returns simulation results (raw responses, no evaluation).
41
17
  */
42
- export declare function runProbes(agentsContent: string, probes: Probe[], provider: LlmProvider, fileContents?: ReadonlyMap<string, string>, log?: OptLogger, signal?: AbortSignal, onProbeProgress?: ProbeProgressCallback): Promise<ProbeResult[]>;
43
- export { buildProbeSystemPrompt, buildBehaviorEvalPrompt, parseBehaviorEval };
18
+ export declare function runProbes(agentsContent: string, probes: Probe[], provider: LlmProvider, log?: OptLogger, signal?: AbortSignal, onProbeProgress?: ProbeProgressCallback): Promise<SimulationResult[]>;
44
19
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAe,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKlE;;;GAGG;AACH,iBAAS,sBAAsB,CAC7B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,KAAK,EACZ,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,MAAM,CAqBR;AAED;;;GAGG;AACH,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CA2BR;AAED,0DAA0D;AAC1D,iBAAS,iBAAiB,CACxB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,EAAE,GAC1B;IAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAkBnD;AAkGD,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACpH;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,aAAa,EAAE,MAAM,E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