maskweaver 0.9.4 → 0.9.6

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 (229) hide show
  1. package/README.ko.md +638 -592
  2. package/README.md +671 -667
  3. package/dist/cli/doctor.js +5 -21
  4. package/dist/cli/install.d.ts +0 -8
  5. package/dist/cli/install.js +0 -39
  6. package/dist/context/config.d.ts +0 -22
  7. package/dist/context/config.js +0 -28
  8. package/dist/context/feature.d.ts +0 -39
  9. package/dist/context/feature.js +0 -77
  10. package/dist/context/files.d.ts +0 -13
  11. package/dist/context/files.js +1 -24
  12. package/dist/context/index.d.ts +0 -7
  13. package/dist/context/index.js +0 -12
  14. package/dist/context/project.d.ts +0 -21
  15. package/dist/context/project.js +0 -30
  16. package/dist/context/types.d.ts +0 -48
  17. package/dist/context/types.js +0 -12
  18. package/dist/context/utils.d.ts +0 -18
  19. package/dist/context/utils.js +0 -27
  20. package/dist/core/engine/promptBuilder.d.ts +0 -17
  21. package/dist/core/engine/promptBuilder.js +0 -28
  22. package/dist/core/index.d.ts +0 -6
  23. package/dist/core/index.js +0 -9
  24. package/dist/core/loader/MaskLoader.d.ts +0 -23
  25. package/dist/core/loader/MaskLoader.js +0 -29
  26. package/dist/core/schema/types.d.ts +0 -47
  27. package/dist/core/schema/types.js +0 -6
  28. package/dist/core/schema/validator.d.ts +0 -14
  29. package/dist/core/schema/validator.js +0 -18
  30. package/dist/i18n/index.d.ts +0 -18
  31. package/dist/i18n/index.js +4 -23
  32. package/dist/index.d.ts +0 -8
  33. package/dist/index.js +0 -8
  34. package/dist/lib.d.ts +0 -5
  35. package/dist/lib.js +0 -12
  36. package/dist/memory/chunking.d.ts +0 -22
  37. package/dist/memory/chunking.js +2 -37
  38. package/dist/memory/core.d.ts +0 -29
  39. package/dist/memory/core.js +1 -52
  40. package/dist/memory/index.d.ts +0 -5
  41. package/dist/memory/index.js +0 -10
  42. package/dist/memory/indexer.d.ts +0 -21
  43. package/dist/memory/indexer.js +0 -44
  44. package/dist/memory/providers/examples.d.ts +0 -5
  45. package/dist/memory/providers/examples.js +4 -64
  46. package/dist/memory/providers/factory.d.ts +0 -44
  47. package/dist/memory/providers/factory.js +0 -46
  48. package/dist/memory/providers/index.d.ts +0 -26
  49. package/dist/memory/providers/index.js +0 -28
  50. package/dist/memory/providers/ollama.d.ts +0 -6
  51. package/dist/memory/providers/ollama.js +1 -8
  52. package/dist/memory/providers/openai.d.ts +0 -6
  53. package/dist/memory/providers/openai.js +1 -8
  54. package/dist/memory/providers/openrouter.d.ts +0 -6
  55. package/dist/memory/providers/openrouter.js +0 -8
  56. package/dist/memory/providers/text-only.d.ts +0 -13
  57. package/dist/memory/providers/text-only.js +0 -17
  58. package/dist/memory/providers/types.d.ts +0 -39
  59. package/dist/memory/providers/types.js +0 -7
  60. package/dist/memory/providers/voyage.d.ts +0 -22
  61. package/dist/memory/providers/voyage.js +1 -24
  62. package/dist/memory/search/hybrid.d.ts +0 -12
  63. package/dist/memory/search/hybrid.js +1 -22
  64. package/dist/memory/store/sqlite.d.ts +0 -72
  65. package/dist/memory/store/sqlite.js +4 -127
  66. package/dist/plugin/config/index.d.ts +0 -112
  67. package/dist/plugin/config/index.js +0 -115
  68. package/dist/plugin/index.d.ts +0 -13
  69. package/dist/plugin/index.js +1 -123
  70. package/dist/plugin/tools/command-registry.d.ts +0 -6
  71. package/dist/plugin/tools/command-registry.js +0 -14
  72. package/dist/plugin/tools/context.d.ts +0 -12
  73. package/dist/plugin/tools/context.js +0 -58
  74. package/dist/plugin/tools/maskSave.d.ts +0 -3
  75. package/dist/plugin/tools/maskSave.js +0 -3
  76. package/dist/plugin/tools/memoryGet.d.ts +0 -3
  77. package/dist/plugin/tools/memoryGet.js +0 -3
  78. package/dist/plugin/tools/memoryIndexer.d.ts +0 -3
  79. package/dist/plugin/tools/memoryIndexer.js +0 -10
  80. package/dist/plugin/tools/memorySearch.d.ts +0 -31
  81. package/dist/plugin/tools/memorySearch.js +0 -79
  82. package/dist/plugin/tools/memoryWrite.d.ts +0 -8
  83. package/dist/plugin/tools/memoryWrite.js +0 -32
  84. package/dist/plugin/tools/retrospect.d.ts +0 -3
  85. package/dist/plugin/tools/retrospect.js +0 -3
  86. package/dist/plugin/tools/slashcommand.d.ts +0 -11
  87. package/dist/plugin/tools/slashcommand.js +0 -38
  88. package/dist/plugin/tools/squad.d.ts +0 -12
  89. package/dist/plugin/tools/squad.js +11 -83
  90. package/dist/plugin/tools/weave.d.ts +0 -6
  91. package/dist/plugin/tools/weave.js +0 -78
  92. package/dist/plugin/types.d.ts +0 -20
  93. package/dist/plugin/types.js +0 -7
  94. package/dist/retrospect/index.d.ts +0 -7
  95. package/dist/retrospect/index.js +0 -9
  96. package/dist/retrospect/mask-save.d.ts +0 -12
  97. package/dist/retrospect/mask-save.js +1 -80
  98. package/dist/retrospect/retrospect.d.ts +0 -18
  99. package/dist/retrospect/retrospect.js +0 -63
  100. package/dist/retrospect/strategies/base.d.ts +0 -15
  101. package/dist/retrospect/strategies/base.js +0 -7
  102. package/dist/retrospect/strategies/deep.d.ts +0 -12
  103. package/dist/retrospect/strategies/deep.js +0 -24
  104. package/dist/retrospect/strategies/index.d.ts +0 -12
  105. package/dist/retrospect/strategies/index.js +0 -12
  106. package/dist/retrospect/strategies/quick.d.ts +0 -12
  107. package/dist/retrospect/strategies/quick.js +0 -19
  108. package/dist/retrospect/strategies/standard.d.ts +0 -12
  109. package/dist/retrospect/strategies/standard.js +0 -15
  110. package/dist/retrospect/types.d.ts +0 -7
  111. package/dist/retrospect/types.js +0 -7
  112. package/dist/shared/config.d.ts +0 -105
  113. package/dist/shared/config.js +0 -33
  114. package/dist/shared/errors.d.ts +0 -18
  115. package/dist/shared/errors.js +0 -19
  116. package/dist/shared/generate-agents.d.ts +0 -69
  117. package/dist/shared/generate-agents.js +2 -86
  118. package/dist/shared/image.d.ts +0 -67
  119. package/dist/shared/image.js +6 -104
  120. package/dist/shared/index.d.ts +0 -5
  121. package/dist/shared/index.js +0 -7
  122. package/dist/shared/model-registry.d.ts +0 -72
  123. package/dist/shared/model-registry.js +5 -95
  124. package/dist/shared/types.d.ts +0 -15
  125. package/dist/shared/types.js +0 -3
  126. package/dist/shared-context/dag.d.ts +0 -105
  127. package/dist/shared-context/dag.js +3 -114
  128. package/dist/shared-context/index.d.ts +0 -5
  129. package/dist/shared-context/index.js +0 -15
  130. package/dist/shared-context/logger.d.ts +0 -37
  131. package/dist/shared-context/logger.js +0 -41
  132. package/dist/shared-context/parallel-executor.d.ts +0 -54
  133. package/dist/shared-context/parallel-executor.js +4 -56
  134. package/dist/shared-context/session.d.ts +0 -56
  135. package/dist/shared-context/session.js +0 -47
  136. package/dist/shared-context/squad.d.ts +0 -68
  137. package/dist/shared-context/squad.js +0 -63
  138. package/dist/shared-context/storage.d.ts +0 -132
  139. package/dist/shared-context/storage.js +0 -116
  140. package/dist/shared-context/task.d.ts +0 -120
  141. package/dist/shared-context/task.js +0 -152
  142. package/dist/shared-context/test/dag.test.js +9 -14
  143. package/dist/shared-context/test/logger.test.d.ts +0 -8
  144. package/dist/shared-context/test/logger.test.js +0 -52
  145. package/dist/shared-context/test/session.test.d.ts +0 -7
  146. package/dist/shared-context/test/session.test.js +0 -63
  147. package/dist/shared-context/test/squad.test.d.ts +0 -10
  148. package/dist/shared-context/test/squad.test.js +2 -68
  149. package/dist/shared-context/test/storage.test.d.ts +0 -8
  150. package/dist/shared-context/test/storage.test.js +0 -68
  151. package/dist/shared-context/test/task.test.d.ts +0 -7
  152. package/dist/shared-context/test/task.test.js +0 -54
  153. package/dist/shared-context/test/watchdog.test.d.ts +0 -7
  154. package/dist/shared-context/test/watchdog.test.js +3 -58
  155. package/dist/shared-context/types.d.ts +0 -215
  156. package/dist/shared-context/types.js +0 -125
  157. package/dist/shared-context/watchdog.d.ts +0 -127
  158. package/dist/shared-context/watchdog.js +0 -148
  159. package/dist/shared-context/worktree.d.ts +0 -68
  160. package/dist/shared-context/worktree.js +2 -34
  161. package/dist/verify/budget.d.ts +0 -29
  162. package/dist/verify/budget.js +0 -34
  163. package/dist/verify/critical-files.d.ts +0 -17
  164. package/dist/verify/critical-files.js +0 -37
  165. package/dist/verify/escalation.d.ts +0 -20
  166. package/dist/verify/escalation.js +0 -22
  167. package/dist/verify/index.d.ts +0 -5
  168. package/dist/verify/index.js +0 -11
  169. package/dist/verify/prompts.d.ts +0 -20
  170. package/dist/verify/prompts.js +0 -20
  171. package/dist/verify/types.d.ts +0 -26
  172. package/dist/verify/types.js +1 -12
  173. package/dist/verify/verifier.d.ts +0 -29
  174. package/dist/verify/verifier.js +0 -54
  175. package/dist/version.d.ts +1 -16
  176. package/dist/version.js +1 -16
  177. package/dist/weave/bridge.d.ts +0 -35
  178. package/dist/weave/bridge.js +0 -51
  179. package/dist/weave/environment/detector.d.ts +0 -6
  180. package/dist/weave/environment/detector.js +4 -45
  181. package/dist/weave/environment/index.d.ts +0 -19
  182. package/dist/weave/environment/index.js +1 -39
  183. package/dist/weave/environment/issues.d.ts +0 -35
  184. package/dist/weave/environment/issues.js +0 -59
  185. package/dist/weave/git.d.ts +0 -8
  186. package/dist/weave/git.js +0 -8
  187. package/dist/weave/index.d.ts +0 -13
  188. package/dist/weave/index.js +2 -28
  189. package/dist/weave/knowledge/global.d.ts +0 -39
  190. package/dist/weave/knowledge/global.js +2 -78
  191. package/dist/weave/loop.js +0 -3
  192. package/dist/weave/orchestrator.d.ts +0 -69
  193. package/dist/weave/orchestrator.js +1 -101
  194. package/dist/weave/phase-manager.d.ts +0 -64
  195. package/dist/weave/phase-manager.js +0 -89
  196. package/dist/weave/security/secret-scan.d.ts +0 -14
  197. package/dist/weave/security/secret-scan.js +0 -19
  198. package/dist/weave/stages/build.js +0 -15
  199. package/dist/weave/stages/execute.d.ts +0 -42
  200. package/dist/weave/stages/execute.js +4 -86
  201. package/dist/weave/stages/handoff.d.ts +0 -7
  202. package/dist/weave/stages/handoff.js +0 -43
  203. package/dist/weave/stages/index.d.ts +0 -3
  204. package/dist/weave/stages/index.js +0 -3
  205. package/dist/weave/stages/intake.d.ts +0 -8
  206. package/dist/weave/stages/intake.js +5 -65
  207. package/dist/weave/stages/map.d.ts +0 -1
  208. package/dist/weave/stages/openspec.d.ts +0 -1
  209. package/dist/weave/stages/plan.d.ts +0 -11
  210. package/dist/weave/stages/plan.js +1 -53
  211. package/dist/weave/stages/refine.d.ts +0 -7
  212. package/dist/weave/stages/refine.js +0 -7
  213. package/dist/weave/stages/research.d.ts +0 -6
  214. package/dist/weave/stages/research.js +0 -6
  215. package/dist/weave/stages/spec.d.ts +0 -12
  216. package/dist/weave/stages/spec.js +0 -17
  217. package/dist/weave/types.d.ts +0 -20
  218. package/dist/weave/types.js +0 -5
  219. package/dist/weave/verification/commands.d.ts +0 -12
  220. package/dist/weave/verification/commands.js +0 -19
  221. package/dist/weave/verification/index.d.ts +0 -6
  222. package/dist/weave/verification/index.js +1 -19
  223. package/dist/weave/verification/playwright.d.ts +0 -47
  224. package/dist/weave/verification/playwright.js +1 -90
  225. package/dist/weave/worktree.d.ts +0 -16
  226. package/dist/weave/worktree.js +0 -23
  227. package/dist/weave/yaml-repair.d.ts +0 -39
  228. package/dist/weave/yaml-repair.js +13 -116
  229. package/package.json +1 -1
@@ -1,14 +1,3 @@
1
- /**
2
- * Weave Execute Stage
3
- *
4
- * Generates execution plans with automatic mask and agent tier selection.
5
- * Actual code generation/testing is performed by AI agents (dummy-flash/human/premium)
6
- * via the Task tool — this module handles:
7
- * - Phase validation and dependency checking
8
- * - Execution plan generation (mask + agent tier per task)
9
- * - Formatting the plan for the Mask Weaver to act upon
10
- * - AI-driven verification system integration
11
- */
12
1
  import { getOrchestrator } from '../orchestrator.js';
13
2
  import { getPhaseManager } from '../phase-manager.js';
14
3
  import { searchTroubleshooting } from '../knowledge/global.js';
@@ -95,33 +84,16 @@ async function collectGdcExtractContexts(basePath, phase, changeId) {
95
84
  }
96
85
  return contexts;
97
86
  }
98
- // ============================================================================
99
- // Prepare Phase Execution (primary entry point for craft)
100
- // ============================================================================
101
- /**
102
- * Prepare a phase for execution.
103
- *
104
- * This is the primary entry point for craft. It:
105
- * 1. Validates dependencies
106
- * 2. Marks the phase as in_progress
107
- * 3. Generates an execution plan (mask + agent tier per task)
108
- * 4. Returns the plan for the Mask Weaver to delegate via Task tool
109
- *
110
- * The actual code generation/testing is performed by AI agents
111
- * (dummy-flash, dummy-human, dummy-premium) — not by this function.
112
- */
113
87
  export async function preparePhaseExecution(options) {
114
88
  const { phaseId, onEvent = () => { }, projectType, basePath } = options;
115
89
  const runtimeBasePath = basePath || process.cwd();
116
90
  const manager = getPhaseManager(basePath);
117
91
  const orchestrator = getOrchestrator();
118
- // Load plan and get phase
119
92
  await manager.loadPlan();
120
93
  const phase = manager.getPhase(phaseId);
121
94
  if (!phase) {
122
95
  throw new Error(`Phase not found: ${phaseId}`);
123
96
  }
124
- // Check dependencies
125
97
  const plan = await manager.loadPlan();
126
98
  if (phase.dependsOn && phase.dependsOn.length > 0) {
127
99
  for (const depId of phase.dependsOn) {
@@ -131,10 +103,8 @@ export async function preparePhaseExecution(options) {
131
103
  }
132
104
  }
133
105
  }
134
- // Mark phase as in progress
135
106
  await manager.updatePhaseStatus(phaseId, 'in_progress');
136
107
  onEvent({ type: 'phase_started', phaseId });
137
- // Generate execution plan with mask + agent tier per task
138
108
  const executionPlan = await orchestrator.generateExecutionPlan(phase, { projectType });
139
109
  executionPlan.gdcContextFiles = await collectGdcExtractContexts(runtimeBasePath, phase, plan?.activeChangeId);
140
110
  return {
@@ -142,13 +112,6 @@ export async function preparePhaseExecution(options) {
142
112
  phase,
143
113
  };
144
114
  }
145
- // ============================================================================
146
- // Format Execution Plan (markdown output for Mask Weaver)
147
- // ============================================================================
148
- /**
149
- * Format a PhaseExecutionPlan into markdown instructions
150
- * that the Mask Weaver can read and act upon.
151
- */
152
115
  export function formatExecutionPlan(plan) {
153
116
  const lines = [];
154
117
  lines.push(`## Phase ${plan.phaseId}: ${plan.phaseName}`);
@@ -164,7 +127,6 @@ export function formatExecutionPlan(plan) {
164
127
  lines.push(`| ${i + 1} | ${tp.task.id} | ${tp.task.name} | ${tp.complexity} | ${tierLabel} | ${mask} |`);
165
128
  }
166
129
  lines.push('');
167
- // Summarize tier distribution
168
130
  const flash = plan.taskPlans.filter(p => p.agentTier === 'dummy-flash').length;
169
131
  const human = plan.taskPlans.filter(p => p.agentTier === 'dummy-human').length;
170
132
  const premium = plan.taskPlans.filter(p => p.agentTier === 'dummy-premium').length;
@@ -177,7 +139,6 @@ export function formatExecutionPlan(plan) {
177
139
  if (premium > 0)
178
140
  lines.push(`- **dummy-premium** (${premium} tasks): Complex reasoning required`);
179
141
  lines.push('');
180
- // Add troubleshooting hints if any
181
142
  const tasksWithHints = plan.taskPlans.filter(p => p.troubleshootingHints.length > 0);
182
143
  if (tasksWithHints.length > 0) {
183
144
  lines.push('### Troubleshooting Hints (from Global Knowledge)');
@@ -211,13 +172,11 @@ export function formatExecutionPlan(plan) {
211
172
  }
212
173
  lines.push('');
213
174
  }
214
- // Parallel execution analysis (if multiple tasks)
215
175
  if (plan.taskPlans.length > 1) {
216
176
  const parallelAnalysis = analyzeParallelOpportunities(plan);
217
177
  lines.push(formatParallelAnalysis(parallelAnalysis));
218
178
  lines.push('');
219
179
  }
220
- // Execution instructions for the Mask Weaver
221
180
  lines.push('### Instructions');
222
181
  lines.push('');
223
182
  lines.push('For each task above, delegate using `Task(<agent_tier>)` with the specified mask.');
@@ -244,26 +203,16 @@ function formatTierLabel(tier) {
244
203
  case 'dummy-premium': return 'premium';
245
204
  }
246
205
  }
247
- // ============================================================================
248
- // Legacy Execute (backward compatibility)
249
- // ============================================================================
250
- /**
251
- * @deprecated Use preparePhaseExecution() + formatExecutionPlan() instead.
252
- * Kept for backward compatibility.
253
- */
254
206
  export async function execute(options) {
255
207
  const startTime = Date.now();
256
208
  const { phaseId } = options;
257
- // Use preparePhaseExecution internally
258
209
  const { plan: executionPlan, phase } = await preparePhaseExecution(options);
259
210
  const manager = getPhaseManager(options.basePath);
260
211
  const masksUsed = new Set();
261
- // Collect masks from the execution plan
262
212
  for (const tp of executionPlan.taskPlans) {
263
213
  if (tp.mask)
264
214
  masksUsed.add(tp.mask);
265
215
  }
266
- // Update plan with masks used
267
216
  await manager.updatePhaseStatus(phaseId, 'in_progress', {
268
217
  masksUsed: Array.from(masksUsed),
269
218
  });
@@ -271,7 +220,7 @@ export async function execute(options) {
271
220
  return {
272
221
  success: true,
273
222
  phase: finalPhase,
274
- tasksCompleted: 0, // No tasks auto-executed — AI agent handles this
223
+ tasksCompleted: 0,
275
224
  tasksFailed: 0,
276
225
  troubleshootingUsed: 0,
277
226
  troubleshootingRecorded: 0,
@@ -280,10 +229,6 @@ export async function execute(options) {
280
229
  executionPlan,
281
230
  };
282
231
  }
283
- /**
284
- * Run all verification layers in order.
285
- * Returns as soon as any layer fails.
286
- */
287
232
  export async function runAIVerification(options) {
288
233
  const results = [];
289
234
  const layers = getVerificationLayers(options);
@@ -340,19 +285,13 @@ function getVerificationLayers(options) {
340
285
  const mode = options.mode || 'full';
341
286
  const full = mode === 'full';
342
287
  return [
343
- // Layer 1: Build/Compile
344
288
  { name: 'TypeCheck', order: 1, type: 'build', enabled: rec.buildSteps.some(s => s.name === 'TypeCheck') },
345
289
  { name: 'Lint', order: 2, type: 'build', enabled: full && rec.buildSteps.some(s => s.name === 'Lint') },
346
290
  { name: 'Build', order: 3, type: 'build', enabled: full && rec.buildSteps.some(s => s.name === 'Build') },
347
- // Layer 2: Unit/Integration Tests
348
291
  { name: 'UnitTests', order: 4, type: 'test', enabled: hasTests },
349
- // Layer 3: E2E Tests (Playwright/Cypress)
350
292
  { name: 'E2ETests', order: 5, type: 'test', enabled: options.enablePlaywright ?? false },
351
- // Layer 4: Visual Verification (Screenshots)
352
293
  { name: 'Screenshot', order: 6, type: 'visual', enabled: options.enableScreenshots ?? false },
353
- // Layer 5: API/DB Verification
354
294
  { name: 'APICheck', order: 7, type: 'api', enabled: !!options.devServerUrl },
355
- // Layer 6: Accessibility (optional)
356
295
  { name: 'Accessibility', order: 8, type: 'accessibility', enabled: false },
357
296
  ];
358
297
  }
@@ -388,7 +327,6 @@ async function runShellCommand(cmd, cwd, options) {
388
327
  proc.kill();
389
328
  }
390
329
  catch {
391
- // ignore
392
330
  }
393
331
  }, timeoutMs);
394
332
  const finalize = (exitCode) => {
@@ -451,7 +389,6 @@ async function runBuildVerification(options, stepName) {
451
389
  ? `timed out (>${Math.round(result.timeoutMs / 1000)}s)`
452
390
  : `exit code ${result.exitCode}`;
453
391
  const combined = `${result.stdout}\n${result.stderr}`.trim();
454
- // Try to find similar troubleshooting entries
455
392
  if (combined.length > 0) {
456
393
  try {
457
394
  const solutions = await searchTroubleshooting(combined, {
@@ -466,7 +403,6 @@ async function runBuildVerification(options, stepName) {
466
403
  }
467
404
  }
468
405
  catch {
469
- // ignore knowledge search failures
470
406
  }
471
407
  }
472
408
  return {
@@ -479,14 +415,10 @@ async function runBuildVerification(options, stepName) {
479
415
  }
480
416
  return { passed: true, logs, layer: 'Build', duration: result.durationMs };
481
417
  }
482
- // ============================================================================
483
- // Test Verification (unit, E2E)
484
- // ============================================================================
485
418
  async function runTestVerification(options, stepName) {
486
419
  const { projectPath, enablePlaywright, devServerUrl } = options;
487
420
  const logs = [];
488
421
  let playwrightResult = null;
489
- // Unit tests (recommended)
490
422
  if (stepName === 'UnitTests') {
491
423
  const rec = recommendVerificationCommands({
492
424
  projectPath: options.projectPath,
@@ -538,7 +470,6 @@ async function runTestVerification(options, stepName) {
538
470
  }
539
471
  }
540
472
  catch {
541
- // ignore
542
473
  }
543
474
  }
544
475
  return {
@@ -551,7 +482,6 @@ async function runTestVerification(options, stepName) {
551
482
  }
552
483
  return { passed: true, logs, layer: 'Test', duration: result.durationMs };
553
484
  }
554
- // E2E tests with Playwright
555
485
  if (stepName === 'E2ETests') {
556
486
  if (!enablePlaywright) {
557
487
  logs.push('[E2E] Skipped (enablePlaywright=false)');
@@ -622,9 +552,6 @@ async function runTestVerification(options, stepName) {
622
552
  logs.push(`[${stepName}] Skipped (unknown test step)`);
623
553
  return { passed: true, logs, layer: 'Test', duration: 0 };
624
554
  }
625
- // ============================================================================
626
- // Visual Verification (Screenshots, Browser Testing)
627
- // ============================================================================
628
555
  async function runVisualVerification(options) {
629
556
  const { devServerUrl, enableScreenshots, projectPath } = options;
630
557
  const startTime = Date.now();
@@ -659,9 +586,6 @@ async function runVisualVerification(options) {
659
586
  duration: Date.now() - startTime,
660
587
  };
661
588
  }
662
- // ============================================================================
663
- // API/DB Verification (endpoints, database queries)
664
- // ============================================================================
665
589
  async function runAPIVerification(options) {
666
590
  const { devServerUrl } = options;
667
591
  if (!devServerUrl) {
@@ -673,9 +597,6 @@ async function runAPIVerification(options) {
673
597
  logs.push('[API] Would verify database connectivity and basic queries');
674
598
  return { passed: true, logs, layer: 'API', duration: 0 };
675
599
  }
676
- // ============================================================================
677
- // Accessibility Verification
678
- // ============================================================================
679
600
  async function runAccessibilityVerification(options) {
680
601
  const { devServerUrl } = options;
681
602
  if (!devServerUrl) {
@@ -685,9 +606,6 @@ async function runAccessibilityVerification(options) {
685
606
  logs.push('[A11y] Would run axe-core accessibility scan');
686
607
  return { passed: true, logs, layer: 'Accessibility', duration: 0 };
687
608
  }
688
- // ============================================================================
689
- // Verification Report Generation
690
- // ============================================================================
691
609
  export function generateVerificationReport(results) {
692
610
  const lines = [
693
611
  '## AI Verification Results\n',
@@ -725,8 +643,8 @@ export const DEFAULT_VERIFY_CONFIG = {
725
643
  runLint: true,
726
644
  runBuild: true,
727
645
  runUnitTests: true,
728
- runE2ETests: false, // Opt-in
729
- captureScreenshots: false, // Opt-in
646
+ runE2ETests: false,
647
+ captureScreenshots: false,
730
648
  checkAPIHealth: true,
731
- runAccessibilityCheck: false, // Opt-in
649
+ runAccessibilityCheck: false,
732
650
  };
@@ -1,9 +1,3 @@
1
- /**
2
- * Weave Handoff Stage
3
- *
4
- * User handoff after AI verification is complete.
5
- * Integrates with retrospect for session analysis.
6
- */
7
1
  import type { WeavePhase, WeaveEvent } from '../types.js';
8
2
  export interface HandoffOptions {
9
3
  phaseId: string;
@@ -11,7 +5,6 @@ export interface HandoffOptions {
11
5
  screenshotPath?: string;
12
6
  testResults?: TestResults;
13
7
  onEvent?: (event: WeaveEvent) => void;
14
- /** Base path for .opencode/weave (defaults to process.cwd()) */
15
8
  basePath?: string;
16
9
  }
17
10
  export interface TestResults {
@@ -1,9 +1,3 @@
1
- /**
2
- * Weave Handoff Stage
3
- *
4
- * User handoff after AI verification is complete.
5
- * Integrates with retrospect for session analysis.
6
- */
7
1
  import { getPhaseManager } from '../phase-manager.js';
8
2
  import { countGdcCheckIssues, getEffectiveGdcConfig, getStatsNodeSummary, runGdcMachineCommand } from '../gdc.js';
9
3
  function collectPhaseNodeIds(phase) {
@@ -51,14 +45,10 @@ async function buildGdcCompletionSummary(basePath, phase) {
51
45
  lines.push(`- Check issues: errors=${counts.errors}, warnings=${counts.warnings}, info=${counts.infos}, total=${counts.issueCount}`);
52
46
  return lines;
53
47
  }
54
- // ============================================================================
55
- // Handoff Message Generation
56
- // ============================================================================
57
48
  function generateHandoffMessage(phase, devUrl, testResults) {
58
49
  const lines = [];
59
50
  lines.push(`## ✅ Phase ${phase.id} 검증 완료!`);
60
51
  lines.push('');
61
- // Test results section
62
52
  if (testResults) {
63
53
  lines.push('### 🤖 AI 자동 테스트 결과');
64
54
  lines.push('');
@@ -90,19 +80,16 @@ function generateHandoffMessage(phase, devUrl, testResults) {
90
80
  }
91
81
  lines.push('');
92
82
  }
93
- // Access URL
94
83
  if (devUrl) {
95
84
  lines.push('### 🔗 접속');
96
85
  lines.push(devUrl);
97
86
  lines.push('');
98
87
  }
99
- // Checklist
100
88
  lines.push('### 📋 확인 체크리스트');
101
89
  for (const item of phase.checklist) {
102
90
  lines.push(`- [ ] ${item}`);
103
91
  }
104
92
  lines.push('');
105
- // Human-only checks
106
93
  lines.push('### 👤 사람만 판단 가능한 것');
107
94
  lines.push('');
108
95
  lines.push('AI가 객관적으로 측정할 수 없는 주관적 판단:');
@@ -111,7 +98,6 @@ function generateHandoffMessage(phase, devUrl, testResults) {
111
98
  lines.push('- [ ] **사용성**: 실제로 써보니 편한가요?');
112
99
  lines.push('- [ ] **비즈니스 의도**: 원래 원하던 게 이게 맞나요?');
113
100
  lines.push('');
114
- // Response options
115
101
  lines.push('### 👆 확인 후 알려주세요');
116
102
  lines.push('');
117
103
  lines.push('**[Approve]** - 다음 Phase로');
@@ -119,9 +105,6 @@ function generateHandoffMessage(phase, devUrl, testResults) {
119
105
  lines.push('**[Later]** - 나중에');
120
106
  return lines.join('\n');
121
107
  }
122
- // ============================================================================
123
- // Main Handoff Function
124
- // ============================================================================
125
108
  export async function handoff(options) {
126
109
  const { phaseId, devUrl, testResults, onEvent = () => { }, basePath } = options;
127
110
  const manager = getPhaseManager(basePath);
@@ -130,15 +113,12 @@ export async function handoff(options) {
130
113
  if (!phase) {
131
114
  throw new Error(`Phase not found: ${phaseId}`);
132
115
  }
133
- // Generate handoff message
134
116
  const message = generateHandoffMessage(phase, devUrl, testResults);
135
- // Human-only checks (AI cannot verify these)
136
117
  const humanOnlyChecks = [
137
118
  '전체적인 디자인 느낌이 의도대로인가요?',
138
119
  '실제로 써보니 편한가요?',
139
120
  '원래 원하던 게 이게 맞나요?',
140
121
  ];
141
- // Next steps based on phase
142
122
  const stats = manager.getStats();
143
123
  const nextPhase = manager.getNextPhase();
144
124
  const nextSteps = [];
@@ -146,7 +126,6 @@ export async function handoff(options) {
146
126
  nextSteps.push(`다음 Phase를 시작하려면: /weave craft ${nextPhase.id}`);
147
127
  }
148
128
  nextSteps.push('전체 상태를 확인하려면: /weave status');
149
- // Emit event
150
129
  onEvent({ type: 'user_handoff', phaseId, checklist: phase.checklist });
151
130
  return {
152
131
  phase,
@@ -156,9 +135,6 @@ export async function handoff(options) {
156
135
  nextSteps,
157
136
  };
158
137
  }
159
- // ============================================================================
160
- // Response Handling
161
- // ============================================================================
162
138
  export async function handleUserResponse(phaseId, response, feedback, basePath) {
163
139
  const manager = getPhaseManager(basePath);
164
140
  await manager.loadPlan();
@@ -168,10 +144,7 @@ export async function handleUserResponse(phaseId, response, feedback, basePath)
168
144
  }
169
145
  switch (response) {
170
146
  case 'approve': {
171
- // Mark phase as completed
172
147
  await manager.updatePhaseStatus(phaseId, 'completed');
173
- // TODO: Trigger retrospect for mask effectiveness analysis
174
- // await performRetrospect({ trigger: 'phase_complete', phaseId, ... });
175
148
  const nextPhase = manager.getNextPhase();
176
149
  const stats = manager.getStats();
177
150
  let message = `✅ Phase ${phaseId} 승인 완료!\n\n`;
@@ -196,30 +169,22 @@ export async function handleUserResponse(phaseId, response, feedback, basePath)
196
169
  return { message, nextAction: 'await_feedback' };
197
170
  }
198
171
  case 'later': {
199
- // Keep phase in progress
200
172
  const message = `⏸ 일시 중지합니다.\n\n나중에 이어하려면:\n\`\`\`\n/weave craft ${phaseId}\n\`\`\``;
201
173
  return { message };
202
174
  }
203
175
  }
204
176
  }
205
- // ============================================================================
206
- // Status Report
207
- // ============================================================================
208
177
  export async function generateStatusReport(basePath) {
209
178
  const manager = basePath ? getPhaseManager(basePath) : getPhaseManager();
210
- // Check for multi-plan mode via state.yaml
211
179
  const state = await manager.loadState();
212
180
  if (state) {
213
- // Multi-plan mode
214
181
  const allPlans = await manager.loadAllPlans();
215
182
  if (allPlans.length === 0) {
216
183
  return '📋 아직 계획이 없습니다.\n\n시작하려면: `/weave design [docs-path]`';
217
184
  }
218
185
  const activePlanName = await manager.getActivePlanName();
219
- // Load active plan for detailed view
220
186
  const plan = await manager.loadPlan();
221
187
  const lines = [];
222
- // All plans overview
223
188
  lines.push(`## 📊 Weave 진행 상황 (${allPlans.length} plans)`);
224
189
  lines.push('');
225
190
  lines.push('### 📁 모든 Plans');
@@ -237,18 +202,15 @@ export async function generateStatusReport(basePath) {
237
202
  lines.push(`| ${p.projectName}${marker} | ${progress}% | ${completed}/${total} | ${status} |`);
238
203
  }
239
204
  lines.push('');
240
- // Active plan detail
241
205
  if (plan) {
242
206
  const stats = manager.getStats();
243
207
  lines.push(`### 🎯 Active Plan: ${plan.projectName}`);
244
208
  lines.push('');
245
209
  lines.push(`**진행률**: ${stats.progress}%`);
246
- // Progress bar
247
210
  const filled = Math.round(stats.progress / 5);
248
211
  const empty = 20 - filled;
249
212
  lines.push(`[${'\u2588'.repeat(filled)}${'\u2591'.repeat(empty)}] ${stats.completedPhases}/${stats.totalPhases}`);
250
213
  lines.push('');
251
- // Phase list
252
214
  lines.push('### Phases');
253
215
  lines.push('');
254
216
  for (const phase of plan.phases) {
@@ -275,7 +237,6 @@ export async function generateStatusReport(basePath) {
275
237
  lines.push(line);
276
238
  }
277
239
  lines.push('');
278
- // Next action
279
240
  const currentPhase = plan.phases.find(p => p.status === 'in_progress');
280
241
  const nextPhase = manager.getNextPhase();
281
242
  if (currentPhase) {
@@ -293,7 +254,6 @@ export async function generateStatusReport(basePath) {
293
254
  }
294
255
  return lines.join('\n');
295
256
  }
296
- // Legacy single-plan mode
297
257
  const plan = await manager.loadPlan();
298
258
  if (!plan) {
299
259
  return '📋 아직 계획이 없습니다.\n\n시작하려면: `/weave design [docs-path]`';
@@ -305,12 +265,10 @@ export async function generateStatusReport(basePath) {
305
265
  lines.push(`**프로젝트**: ${plan.projectName}`);
306
266
  lines.push(`**진행률**: ${stats.progress}%`);
307
267
  lines.push('');
308
- // Progress bar
309
268
  const filled = Math.round(stats.progress / 5);
310
269
  const empty = 20 - filled;
311
270
  lines.push(`[${'█'.repeat(filled)}${'░'.repeat(empty)}] ${stats.completedPhases}/${stats.totalPhases}`);
312
271
  lines.push('');
313
- // Phase list
314
272
  lines.push('### Phases');
315
273
  lines.push('');
316
274
  for (const phase of plan.phases) {
@@ -337,7 +295,6 @@ export async function generateStatusReport(basePath) {
337
295
  lines.push(line);
338
296
  }
339
297
  lines.push('');
340
- // Next action
341
298
  const currentPhase = plan.phases.find(p => p.status === 'in_progress');
342
299
  const nextPhase = manager.getNextPhase();
343
300
  if (currentPhase) {
@@ -1,6 +1,3 @@
1
- /**
2
- * Weave Stages Index
3
- */
4
1
  export { intake } from './intake.js';
5
2
  export type { IntakeOptions, IntakeResult, DocumentAnalysis, Question } from './intake.js';
6
3
  export { buildResearchReport, writeResearchReport } from './research.js';
@@ -1,6 +1,3 @@
1
- /**
2
- * Weave Stages Index
3
- */
4
1
  export { intake } from './intake.js';
5
2
  export { buildResearchReport, writeResearchReport } from './research.js';
6
3
  export { refinePlanFromNotes } from './refine.js';
@@ -1,9 +1,3 @@
1
- /**
2
- * Weave Intake Stage
3
- *
4
- * Document analysis and question generation.
5
- * Uses Maskweaver memory for semantic search of past similar projects.
6
- */
7
1
  import type { WeaveEvent, EnvironmentAnalysis, MapResult, StructuralChange, ConsentPrompt } from '../types.js';
8
2
  export interface IntakeOptions {
9
3
  docsPath: string;
@@ -60,9 +54,7 @@ export interface InterviewResult {
60
54
  }
61
55
  export declare function interview(options: InterviewOptions): Promise<InterviewResult>;
62
56
  export interface IntakeWithAnalysisOptions extends IntakeOptions {
63
- /** Skip environment analysis for faster intake */
64
57
  skipEnvironmentAnalysis?: boolean;
65
- /** Only include warning+ severity issues in environment analysis */
66
58
  warningsOnly?: boolean;
67
59
  }
68
60
  export declare function intake(options: IntakeOptions | IntakeWithAnalysisOptions): Promise<IntakeResult>;