opencode-swarm-plugin 0.22.0 → 0.23.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 (128) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +109 -429
  4. package/dist/agent-mail.d.ts +480 -0
  5. package/dist/agent-mail.d.ts.map +1 -0
  6. package/dist/anti-patterns.d.ts +257 -0
  7. package/dist/anti-patterns.d.ts.map +1 -0
  8. package/dist/beads.d.ts +377 -0
  9. package/dist/beads.d.ts.map +1 -0
  10. package/dist/eval-capture.d.ts +206 -0
  11. package/dist/eval-capture.d.ts.map +1 -0
  12. package/dist/index.d.ts +1299 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +498 -4246
  15. package/dist/learning.d.ts +670 -0
  16. package/dist/learning.d.ts.map +1 -0
  17. package/dist/mandate-promotion.d.ts +93 -0
  18. package/dist/mandate-promotion.d.ts.map +1 -0
  19. package/dist/mandate-storage.d.ts +209 -0
  20. package/dist/mandate-storage.d.ts.map +1 -0
  21. package/dist/mandates.d.ts +230 -0
  22. package/dist/mandates.d.ts.map +1 -0
  23. package/dist/output-guardrails.d.ts +125 -0
  24. package/dist/output-guardrails.d.ts.map +1 -0
  25. package/dist/pattern-maturity.d.ts +246 -0
  26. package/dist/pattern-maturity.d.ts.map +1 -0
  27. package/dist/plugin.d.ts +22 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +493 -4241
  30. package/dist/rate-limiter.d.ts +218 -0
  31. package/dist/rate-limiter.d.ts.map +1 -0
  32. package/dist/repo-crawl.d.ts +146 -0
  33. package/dist/repo-crawl.d.ts.map +1 -0
  34. package/dist/schemas/bead.d.ts +255 -0
  35. package/dist/schemas/bead.d.ts.map +1 -0
  36. package/dist/schemas/evaluation.d.ts +161 -0
  37. package/dist/schemas/evaluation.d.ts.map +1 -0
  38. package/dist/schemas/index.d.ts +34 -0
  39. package/dist/schemas/index.d.ts.map +1 -0
  40. package/dist/schemas/mandate.d.ts +336 -0
  41. package/dist/schemas/mandate.d.ts.map +1 -0
  42. package/dist/schemas/swarm-context.d.ts +131 -0
  43. package/dist/schemas/swarm-context.d.ts.map +1 -0
  44. package/dist/schemas/task.d.ts +188 -0
  45. package/dist/schemas/task.d.ts.map +1 -0
  46. package/dist/skills.d.ts +471 -0
  47. package/dist/skills.d.ts.map +1 -0
  48. package/dist/storage.d.ts +260 -0
  49. package/dist/storage.d.ts.map +1 -0
  50. package/dist/structured.d.ts +196 -0
  51. package/dist/structured.d.ts.map +1 -0
  52. package/dist/swarm-decompose.d.ts +201 -0
  53. package/dist/swarm-decompose.d.ts.map +1 -0
  54. package/dist/swarm-mail.d.ts +240 -0
  55. package/dist/swarm-mail.d.ts.map +1 -0
  56. package/dist/swarm-orchestrate.d.ts +708 -0
  57. package/dist/swarm-orchestrate.d.ts.map +1 -0
  58. package/dist/swarm-prompts.d.ts +292 -0
  59. package/dist/swarm-prompts.d.ts.map +1 -0
  60. package/dist/swarm-strategies.d.ts +100 -0
  61. package/dist/swarm-strategies.d.ts.map +1 -0
  62. package/dist/swarm.d.ts +455 -0
  63. package/dist/swarm.d.ts.map +1 -0
  64. package/dist/tool-availability.d.ts +91 -0
  65. package/dist/tool-availability.d.ts.map +1 -0
  66. package/docs/planning/ADR-001-monorepo-structure.md +171 -0
  67. package/docs/planning/ADR-002-package-extraction.md +393 -0
  68. package/docs/planning/ADR-003-performance-improvements.md +451 -0
  69. package/docs/planning/ADR-004-message-queue-features.md +187 -0
  70. package/docs/planning/ADR-005-devtools-observability.md +202 -0
  71. package/docs/planning/ROADMAP.md +368 -0
  72. package/package.json +13 -24
  73. package/src/agent-mail.ts +1 -1
  74. package/src/beads.ts +1 -2
  75. package/src/index.ts +2 -2
  76. package/src/learning.integration.test.ts +66 -11
  77. package/src/mandate-storage.test.ts +3 -3
  78. package/src/storage.ts +78 -10
  79. package/src/swarm-mail.ts +3 -3
  80. package/src/swarm-orchestrate.ts +7 -7
  81. package/src/tool-availability.ts +1 -1
  82. package/tsconfig.json +1 -1
  83. package/.beads/.local_version +0 -1
  84. package/.beads/README.md +0 -81
  85. package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
  86. package/.beads/config.yaml +0 -62
  87. package/.beads/issues.jsonl +0 -2197
  88. package/.beads/metadata.json +0 -4
  89. package/.gitattributes +0 -3
  90. package/.github/workflows/ci.yml +0 -30
  91. package/.github/workflows/opencode.yml +0 -31
  92. package/.opencode/skills/tdd/SKILL.md +0 -182
  93. package/INTEGRATION_EXAMPLE.md +0 -66
  94. package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
  95. package/bun.lock +0 -286
  96. package/dist/pglite.data +0 -0
  97. package/dist/pglite.wasm +0 -0
  98. package/src/streams/agent-mail.test.ts +0 -777
  99. package/src/streams/agent-mail.ts +0 -535
  100. package/src/streams/debug.test.ts +0 -500
  101. package/src/streams/debug.ts +0 -727
  102. package/src/streams/effect/ask.integration.test.ts +0 -314
  103. package/src/streams/effect/ask.ts +0 -202
  104. package/src/streams/effect/cursor.integration.test.ts +0 -418
  105. package/src/streams/effect/cursor.ts +0 -288
  106. package/src/streams/effect/deferred.test.ts +0 -357
  107. package/src/streams/effect/deferred.ts +0 -445
  108. package/src/streams/effect/index.ts +0 -17
  109. package/src/streams/effect/layers.ts +0 -73
  110. package/src/streams/effect/lock.test.ts +0 -385
  111. package/src/streams/effect/lock.ts +0 -399
  112. package/src/streams/effect/mailbox.test.ts +0 -260
  113. package/src/streams/effect/mailbox.ts +0 -318
  114. package/src/streams/events.test.ts +0 -924
  115. package/src/streams/events.ts +0 -329
  116. package/src/streams/index.test.ts +0 -229
  117. package/src/streams/index.ts +0 -578
  118. package/src/streams/migrations.test.ts +0 -359
  119. package/src/streams/migrations.ts +0 -362
  120. package/src/streams/projections.test.ts +0 -611
  121. package/src/streams/projections.ts +0 -504
  122. package/src/streams/store.integration.test.ts +0 -658
  123. package/src/streams/store.ts +0 -1075
  124. package/src/streams/swarm-mail.ts +0 -552
  125. package/test-bug-fixes.ts +0 -86
  126. package/vitest.integration.config.ts +0 -19
  127. package/vitest.integration.setup.ts +0 -48
  128. package/workflow-integration-analysis.md +0 -876
@@ -0,0 +1,670 @@
1
+ /**
2
+ * Learning Module - Confidence decay, feedback scoring, and outcome tracking
3
+ *
4
+ * Implements patterns from cass-memory for learning from swarm outcomes:
5
+ * - Confidence decay: evaluation criteria weights fade unless revalidated
6
+ * - Feedback events: track helpful/harmful signals from task outcomes
7
+ * - Outcome scoring: implicit feedback from duration, errors, retries
8
+ *
9
+ * @see https://github.com/Dicklesworthstone/cass_memory_system/blob/main/src/scoring.ts
10
+ * @see https://github.com/Dicklesworthstone/cass_memory_system/blob/main/src/outcome.ts
11
+ */
12
+ import { z } from "zod";
13
+ /**
14
+ * Feedback event types
15
+ */
16
+ export declare const FeedbackTypeSchema: z.ZodEnum<{
17
+ helpful: "helpful";
18
+ harmful: "harmful";
19
+ neutral: "neutral";
20
+ }>;
21
+ export type FeedbackType = z.infer<typeof FeedbackTypeSchema>;
22
+ /**
23
+ * A feedback event records whether a criterion evaluation was accurate
24
+ *
25
+ * When an evaluation criterion (e.g., "type_safe") is later proven correct
26
+ * or incorrect, we record that as feedback to adjust future weights.
27
+ */
28
+ export declare const FeedbackEventSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ criterion: z.ZodString;
31
+ type: z.ZodEnum<{
32
+ helpful: "helpful";
33
+ harmful: "harmful";
34
+ neutral: "neutral";
35
+ }>;
36
+ timestamp: z.ZodString;
37
+ context: z.ZodOptional<z.ZodString>;
38
+ bead_id: z.ZodOptional<z.ZodString>;
39
+ raw_value: z.ZodDefault<z.ZodNumber>;
40
+ }, z.core.$strip>;
41
+ export type FeedbackEvent = z.infer<typeof FeedbackEventSchema>;
42
+ /**
43
+ * Criterion weight with decay tracking
44
+ */
45
+ export declare const CriterionWeightSchema: z.ZodObject<{
46
+ criterion: z.ZodString;
47
+ weight: z.ZodNumber;
48
+ helpful_count: z.ZodNumber;
49
+ harmful_count: z.ZodNumber;
50
+ last_validated: z.ZodOptional<z.ZodString>;
51
+ half_life_days: z.ZodDefault<z.ZodNumber>;
52
+ }, z.core.$strip>;
53
+ export type CriterionWeight = z.infer<typeof CriterionWeightSchema>;
54
+ /**
55
+ * Error types that can occur during subtask execution
56
+ */
57
+ export declare const ErrorTypeSchema: z.ZodEnum<{
58
+ timeout: "timeout";
59
+ unknown: "unknown";
60
+ conflict: "conflict";
61
+ validation: "validation";
62
+ tool_failure: "tool_failure";
63
+ }>;
64
+ export type ErrorType = z.infer<typeof ErrorTypeSchema>;
65
+ /**
66
+ * An error entry in the error accumulator
67
+ *
68
+ * Errors are accumulated during subtask execution and can be fed
69
+ * into retry prompts to help agents learn from past failures.
70
+ */
71
+ export declare const ErrorEntrySchema: z.ZodObject<{
72
+ id: z.ZodString;
73
+ bead_id: z.ZodString;
74
+ error_type: z.ZodEnum<{
75
+ timeout: "timeout";
76
+ unknown: "unknown";
77
+ conflict: "conflict";
78
+ validation: "validation";
79
+ tool_failure: "tool_failure";
80
+ }>;
81
+ message: z.ZodString;
82
+ stack_trace: z.ZodOptional<z.ZodString>;
83
+ tool_name: z.ZodOptional<z.ZodString>;
84
+ timestamp: z.ZodString;
85
+ resolved: z.ZodDefault<z.ZodBoolean>;
86
+ context: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ export type ErrorEntry = z.infer<typeof ErrorEntrySchema>;
89
+ /**
90
+ * Decomposition strategies for tracking which approach was used
91
+ */
92
+ export declare const DecompositionStrategySchema: z.ZodEnum<{
93
+ "file-based": "file-based";
94
+ "feature-based": "feature-based";
95
+ "risk-based": "risk-based";
96
+ "research-based": "research-based";
97
+ }>;
98
+ export type DecompositionStrategy = z.infer<typeof DecompositionStrategySchema>;
99
+ /**
100
+ * Failure mode taxonomy (imported from evaluation.ts)
101
+ */
102
+ export declare const FailureModeSchema: z.ZodEnum<{
103
+ timeout: "timeout";
104
+ unknown: "unknown";
105
+ conflict: "conflict";
106
+ validation: "validation";
107
+ tool_failure: "tool_failure";
108
+ context_overflow: "context_overflow";
109
+ dependency_blocked: "dependency_blocked";
110
+ user_cancelled: "user_cancelled";
111
+ }>;
112
+ export type FailureMode = z.infer<typeof FailureModeSchema>;
113
+ /**
114
+ * Outcome signals from a completed subtask
115
+ *
116
+ * These implicit signals help score decomposition quality without
117
+ * explicit feedback from the user.
118
+ */
119
+ export declare const OutcomeSignalsSchema: z.ZodObject<{
120
+ bead_id: z.ZodString;
121
+ duration_ms: z.ZodNumber;
122
+ error_count: z.ZodNumber;
123
+ retry_count: z.ZodNumber;
124
+ success: z.ZodBoolean;
125
+ files_touched: z.ZodDefault<z.ZodArray<z.ZodString>>;
126
+ timestamp: z.ZodString;
127
+ strategy: z.ZodOptional<z.ZodEnum<{
128
+ "file-based": "file-based";
129
+ "feature-based": "feature-based";
130
+ "risk-based": "risk-based";
131
+ "research-based": "research-based";
132
+ }>>;
133
+ failure_mode: z.ZodOptional<z.ZodEnum<{
134
+ timeout: "timeout";
135
+ unknown: "unknown";
136
+ conflict: "conflict";
137
+ validation: "validation";
138
+ tool_failure: "tool_failure";
139
+ context_overflow: "context_overflow";
140
+ dependency_blocked: "dependency_blocked";
141
+ user_cancelled: "user_cancelled";
142
+ }>>;
143
+ failure_details: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ export type OutcomeSignals = z.infer<typeof OutcomeSignalsSchema>;
146
+ /**
147
+ * Scored outcome with implicit feedback type
148
+ */
149
+ export declare const ScoredOutcomeSchema: z.ZodObject<{
150
+ signals: z.ZodObject<{
151
+ bead_id: z.ZodString;
152
+ duration_ms: z.ZodNumber;
153
+ error_count: z.ZodNumber;
154
+ retry_count: z.ZodNumber;
155
+ success: z.ZodBoolean;
156
+ files_touched: z.ZodDefault<z.ZodArray<z.ZodString>>;
157
+ timestamp: z.ZodString;
158
+ strategy: z.ZodOptional<z.ZodEnum<{
159
+ "file-based": "file-based";
160
+ "feature-based": "feature-based";
161
+ "risk-based": "risk-based";
162
+ "research-based": "research-based";
163
+ }>>;
164
+ failure_mode: z.ZodOptional<z.ZodEnum<{
165
+ timeout: "timeout";
166
+ unknown: "unknown";
167
+ conflict: "conflict";
168
+ validation: "validation";
169
+ tool_failure: "tool_failure";
170
+ context_overflow: "context_overflow";
171
+ dependency_blocked: "dependency_blocked";
172
+ user_cancelled: "user_cancelled";
173
+ }>>;
174
+ failure_details: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strip>;
176
+ type: z.ZodEnum<{
177
+ helpful: "helpful";
178
+ harmful: "harmful";
179
+ neutral: "neutral";
180
+ }>;
181
+ decayed_value: z.ZodNumber;
182
+ reasoning: z.ZodString;
183
+ }, z.core.$strip>;
184
+ export type ScoredOutcome = z.infer<typeof ScoredOutcomeSchema>;
185
+ /**
186
+ * Default configuration for learning
187
+ */
188
+ export interface LearningConfig {
189
+ /** Half-life for confidence decay in days */
190
+ halfLifeDays: number;
191
+ /** Minimum feedback events before adjusting weights */
192
+ minFeedbackForAdjustment: number;
193
+ /** Maximum harmful ratio before deprecating a criterion */
194
+ maxHarmfulRatio: number;
195
+ /** Threshold duration (ms) for "fast" completion */
196
+ fastCompletionThresholdMs: number;
197
+ /** Threshold duration (ms) for "slow" completion */
198
+ slowCompletionThresholdMs: number;
199
+ /** Maximum errors before considering harmful */
200
+ maxErrorsForHelpful: number;
201
+ }
202
+ export declare const DEFAULT_LEARNING_CONFIG: LearningConfig;
203
+ /**
204
+ * Calculate decayed value using half-life formula
205
+ *
206
+ * Value decays by 50% every `halfLifeDays` days.
207
+ * Formula: value * 0.5^(age/halfLife)
208
+ *
209
+ * @param timestamp - When the event occurred (ISO-8601)
210
+ * @param now - Current time
211
+ * @param halfLifeDays - Half-life in days (default: 90)
212
+ * @returns Decayed value between 0 and 1
213
+ *
214
+ * @example
215
+ * // Event from 90 days ago with 90-day half-life
216
+ * calculateDecayedValue("2024-09-08T00:00:00Z", new Date("2024-12-07"), 90)
217
+ * // Returns ~0.5
218
+ */
219
+ export declare function calculateDecayedValue(timestamp: string, now?: Date, halfLifeDays?: number): number;
220
+ /**
221
+ * Calculate weighted criterion score from feedback events
222
+ *
223
+ * Applies decay to each feedback event and aggregates them.
224
+ * Helpful events increase the score, harmful events decrease it.
225
+ *
226
+ * @param events - Feedback events for this criterion
227
+ * @param config - Learning configuration
228
+ * @returns Weight between 0 and 1
229
+ */
230
+ export declare function calculateCriterionWeight(events: FeedbackEvent[], config?: LearningConfig): CriterionWeight;
231
+ /**
232
+ * Score implicit feedback from task outcome signals
233
+ *
234
+ * Infers whether a decomposition/subtask was helpful or harmful based on:
235
+ * - Duration: fast completion = helpful, slow = harmful
236
+ * - Errors: few errors = helpful, many = harmful
237
+ * - Retries: no retries = helpful, many = harmful
238
+ * - Success: success = helpful, failure = harmful
239
+ *
240
+ * @param signals - Outcome signals from completed subtask
241
+ * @param config - Learning configuration
242
+ * @returns Scored outcome with feedback type and reasoning
243
+ */
244
+ export declare function scoreImplicitFeedback(signals: OutcomeSignals, config?: LearningConfig): ScoredOutcome;
245
+ /**
246
+ * Create a feedback event from a scored outcome
247
+ *
248
+ * Converts implicit outcome scoring into an explicit feedback event
249
+ * that can be stored and used for criterion weight calculation.
250
+ *
251
+ * @param outcome - Scored outcome
252
+ * @param criterion - Which criterion this feedback applies to
253
+ * @returns Feedback event
254
+ */
255
+ export declare function outcomeToFeedback(outcome: ScoredOutcome, criterion: string): FeedbackEvent;
256
+ /**
257
+ * Apply criterion weights to evaluation scores
258
+ *
259
+ * Adjusts raw evaluation scores by their learned weights.
260
+ * Criteria with low confidence (due to past failures) have reduced impact.
261
+ *
262
+ * @param criteria - Map of criterion name to raw score (0-1)
263
+ * @param weights - Map of criterion name to weight
264
+ * @returns Weighted scores
265
+ */
266
+ export declare function applyWeights(criteria: Record<string, number>, weights: Record<string, CriterionWeight>): Record<string, {
267
+ raw: number;
268
+ weighted: number;
269
+ weight: number;
270
+ }>;
271
+ /**
272
+ * Check if a criterion should be deprecated based on feedback
273
+ *
274
+ * A criterion is deprecated if it has enough feedback and the
275
+ * harmful ratio exceeds the threshold.
276
+ *
277
+ * @param weight - Criterion weight with feedback counts
278
+ * @param config - Learning configuration
279
+ * @returns Whether the criterion should be deprecated
280
+ */
281
+ export declare function shouldDeprecateCriterion(weight: CriterionWeight, config?: LearningConfig): boolean;
282
+ /**
283
+ * Storage interface for feedback events
284
+ *
285
+ * Implementations can use file system, SQLite, or other backends.
286
+ */
287
+ export interface FeedbackStorage {
288
+ /** Store a feedback event */
289
+ store(event: FeedbackEvent): Promise<void>;
290
+ /** Get all feedback events for a criterion */
291
+ getByCriterion(criterion: string): Promise<FeedbackEvent[]>;
292
+ /** Get all feedback events for a bead */
293
+ getByBead(beadId: string): Promise<FeedbackEvent[]>;
294
+ /** Get all feedback events */
295
+ getAll(): Promise<FeedbackEvent[]>;
296
+ }
297
+ /**
298
+ * In-memory feedback storage (for testing and short-lived sessions)
299
+ *
300
+ * Uses LRU eviction to prevent unbounded memory growth.
301
+ */
302
+ export declare class InMemoryFeedbackStorage implements FeedbackStorage {
303
+ private events;
304
+ private readonly maxSize;
305
+ constructor(maxSize?: number);
306
+ store(event: FeedbackEvent): Promise<void>;
307
+ getByCriterion(criterion: string): Promise<FeedbackEvent[]>;
308
+ getByBead(beadId: string): Promise<FeedbackEvent[]>;
309
+ getAll(): Promise<FeedbackEvent[]>;
310
+ }
311
+ /**
312
+ * Strike record for a bead
313
+ *
314
+ * Tracks consecutive fix failures to detect architectural problems.
315
+ * After 3 strikes, the system should STOP and question the architecture
316
+ * rather than attempting Fix #4.
317
+ */
318
+ export declare const StrikeRecordSchema: z.ZodObject<{
319
+ bead_id: z.ZodString;
320
+ strike_count: z.ZodNumber;
321
+ failures: z.ZodArray<z.ZodObject<{
322
+ attempt: z.ZodString;
323
+ reason: z.ZodString;
324
+ timestamp: z.ZodString;
325
+ }, z.core.$strip>>;
326
+ first_strike_at: z.ZodOptional<z.ZodString>;
327
+ last_strike_at: z.ZodOptional<z.ZodString>;
328
+ }, z.core.$strip>;
329
+ export type StrikeRecord = z.infer<typeof StrikeRecordSchema>;
330
+ /**
331
+ * Storage interface for strike records
332
+ */
333
+ export interface StrikeStorage {
334
+ /** Store a strike record */
335
+ store(record: StrikeRecord): Promise<void>;
336
+ /** Get strike record for a bead */
337
+ get(beadId: string): Promise<StrikeRecord | null>;
338
+ /** Get all strike records */
339
+ getAll(): Promise<StrikeRecord[]>;
340
+ /** Clear strikes for a bead */
341
+ clear(beadId: string): Promise<void>;
342
+ }
343
+ /**
344
+ * In-memory strike storage
345
+ */
346
+ export declare class InMemoryStrikeStorage implements StrikeStorage {
347
+ private strikes;
348
+ store(record: StrikeRecord): Promise<void>;
349
+ get(beadId: string): Promise<StrikeRecord | null>;
350
+ getAll(): Promise<StrikeRecord[]>;
351
+ clear(beadId: string): Promise<void>;
352
+ }
353
+ /**
354
+ * Add a strike to a bead's record
355
+ *
356
+ * Records a failure attempt and increments the strike count.
357
+ *
358
+ * @param beadId - Bead ID
359
+ * @param attempt - Description of what was attempted
360
+ * @param reason - Why it failed
361
+ * @param storage - Strike storage (defaults to in-memory)
362
+ * @returns Updated strike record
363
+ */
364
+ export declare function addStrike(beadId: string, attempt: string, reason: string, storage?: StrikeStorage): Promise<StrikeRecord>;
365
+ /**
366
+ * Get strike count for a bead
367
+ *
368
+ * @param beadId - Bead ID
369
+ * @param storage - Strike storage
370
+ * @returns Strike count (0-3)
371
+ */
372
+ export declare function getStrikes(beadId: string, storage?: StrikeStorage): Promise<number>;
373
+ /**
374
+ * Check if a bead has struck out (3 strikes)
375
+ *
376
+ * @param beadId - Bead ID
377
+ * @param storage - Strike storage
378
+ * @returns True if bead has 3 strikes
379
+ */
380
+ export declare function isStrikedOut(beadId: string, storage?: StrikeStorage): Promise<boolean>;
381
+ /**
382
+ * Generate architecture review prompt for a struck-out bead
383
+ *
384
+ * When a bead hits 3 strikes, this generates a prompt that forces
385
+ * the human to question the architecture instead of attempting Fix #4.
386
+ *
387
+ * @param beadId - Bead ID
388
+ * @param storage - Strike storage
389
+ * @returns Architecture review prompt
390
+ */
391
+ export declare function getArchitecturePrompt(beadId: string, storage?: StrikeStorage): Promise<string>;
392
+ /**
393
+ * Clear strikes for a bead (e.g., after successful fix)
394
+ *
395
+ * @param beadId - Bead ID
396
+ * @param storage - Strike storage
397
+ */
398
+ export declare function clearStrikes(beadId: string, storage?: StrikeStorage): Promise<void>;
399
+ /**
400
+ * Storage interface for error entries
401
+ *
402
+ * Similar to FeedbackStorage but for tracking errors during execution.
403
+ */
404
+ export interface ErrorStorage {
405
+ /** Store an error entry */
406
+ store(entry: ErrorEntry): Promise<void>;
407
+ /** Get all errors for a bead */
408
+ getByBead(beadId: string): Promise<ErrorEntry[]>;
409
+ /** Get unresolved errors for a bead */
410
+ getUnresolvedByBead(beadId: string): Promise<ErrorEntry[]>;
411
+ /** Mark an error as resolved */
412
+ markResolved(id: string): Promise<void>;
413
+ /** Get all errors */
414
+ getAll(): Promise<ErrorEntry[]>;
415
+ }
416
+ /**
417
+ * In-memory error storage
418
+ *
419
+ * Accumulates errors during subtask execution for feeding into retry prompts.
420
+ */
421
+ export declare class InMemoryErrorStorage implements ErrorStorage {
422
+ private errors;
423
+ store(entry: ErrorEntry): Promise<void>;
424
+ getByBead(beadId: string): Promise<ErrorEntry[]>;
425
+ getUnresolvedByBead(beadId: string): Promise<ErrorEntry[]>;
426
+ markResolved(id: string): Promise<void>;
427
+ getAll(): Promise<ErrorEntry[]>;
428
+ }
429
+ /**
430
+ * Error accumulator for tracking errors during subtask execution
431
+ *
432
+ * Implements patterns from "Patterns for Building AI Agents" p.40:
433
+ * - Examines and corrects errors when something goes wrong
434
+ * - Feeds error context into retry prompts
435
+ * - Tracks error patterns for learning
436
+ */
437
+ export declare class ErrorAccumulator {
438
+ private storage;
439
+ constructor(storage?: ErrorStorage);
440
+ /**
441
+ * Record an error during subtask execution
442
+ *
443
+ * @param beadId - Bead ID where error occurred
444
+ * @param errorType - Category of error
445
+ * @param message - Human-readable error message
446
+ * @param options - Additional context (stack trace, tool name, etc.)
447
+ * @returns The created error entry
448
+ */
449
+ recordError(beadId: string, errorType: ErrorType, message: string, options?: {
450
+ stack_trace?: string;
451
+ tool_name?: string;
452
+ context?: string;
453
+ }): Promise<ErrorEntry>;
454
+ /**
455
+ * Get all errors for a bead (resolved and unresolved)
456
+ */
457
+ getErrors(beadId: string): Promise<ErrorEntry[]>;
458
+ /**
459
+ * Get only unresolved errors for a bead
460
+ */
461
+ getUnresolvedErrors(beadId: string): Promise<ErrorEntry[]>;
462
+ /**
463
+ * Mark an error as resolved
464
+ */
465
+ resolveError(errorId: string): Promise<void>;
466
+ /**
467
+ * Format errors as context for retry prompts
468
+ *
469
+ * Groups errors by type and provides structured feedback
470
+ * for the agent to learn from.
471
+ *
472
+ * @param beadId - Bead to get error context for
473
+ * @param includeResolved - Include resolved errors (default: false)
474
+ * @returns Formatted error context string
475
+ */
476
+ getErrorContext(beadId: string, includeResolved?: boolean): Promise<string>;
477
+ /**
478
+ * Get error statistics for outcome tracking
479
+ *
480
+ * @param beadId - Bead to get stats for
481
+ * @returns Error counts and patterns
482
+ */
483
+ getErrorStats(beadId: string): Promise<{
484
+ total: number;
485
+ unresolved: number;
486
+ by_type: Record<ErrorType, number>;
487
+ }>;
488
+ }
489
+ /**
490
+ * Format memory store instruction for successful task completion
491
+ *
492
+ * @param beadId - Bead ID that completed
493
+ * @param summary - Completion summary
494
+ * @param filesTouched - Files modified
495
+ * @param strategy - Decomposition strategy used (if applicable)
496
+ * @returns Memory store instruction object
497
+ */
498
+ export declare function formatMemoryStoreOnSuccess(beadId: string, summary: string, filesTouched: string[], strategy?: DecompositionStrategy): {
499
+ information: string;
500
+ metadata: string;
501
+ instruction: string;
502
+ };
503
+ /**
504
+ * Format memory store instruction for architectural problems (3-strike)
505
+ *
506
+ * @param beadId - Bead ID that struck out
507
+ * @param failures - Array of failure attempts
508
+ * @returns Memory store instruction object
509
+ */
510
+ export declare function formatMemoryStoreOn3Strike(beadId: string, failures: Array<{
511
+ attempt: string;
512
+ reason: string;
513
+ }>): {
514
+ information: string;
515
+ metadata: string;
516
+ instruction: string;
517
+ };
518
+ /**
519
+ * Format memory query instruction for task decomposition
520
+ *
521
+ * @param task - Task description
522
+ * @param limit - Max results to return
523
+ * @returns Memory query instruction object
524
+ */
525
+ export declare function formatMemoryQueryForDecomposition(task: string, limit?: number): {
526
+ query: string;
527
+ limit: number;
528
+ instruction: string;
529
+ };
530
+ /**
531
+ * Format memory validation hint when CASS history helped
532
+ *
533
+ * @param beadId - Bead ID that benefited from CASS
534
+ * @returns Memory validation hint
535
+ */
536
+ export declare function formatMemoryValidationHint(beadId: string): {
537
+ instruction: string;
538
+ context: string;
539
+ };
540
+ export declare const learningSchemas: {
541
+ FeedbackTypeSchema: z.ZodEnum<{
542
+ helpful: "helpful";
543
+ harmful: "harmful";
544
+ neutral: "neutral";
545
+ }>;
546
+ FeedbackEventSchema: z.ZodObject<{
547
+ id: z.ZodString;
548
+ criterion: z.ZodString;
549
+ type: z.ZodEnum<{
550
+ helpful: "helpful";
551
+ harmful: "harmful";
552
+ neutral: "neutral";
553
+ }>;
554
+ timestamp: z.ZodString;
555
+ context: z.ZodOptional<z.ZodString>;
556
+ bead_id: z.ZodOptional<z.ZodString>;
557
+ raw_value: z.ZodDefault<z.ZodNumber>;
558
+ }, z.core.$strip>;
559
+ CriterionWeightSchema: z.ZodObject<{
560
+ criterion: z.ZodString;
561
+ weight: z.ZodNumber;
562
+ helpful_count: z.ZodNumber;
563
+ harmful_count: z.ZodNumber;
564
+ last_validated: z.ZodOptional<z.ZodString>;
565
+ half_life_days: z.ZodDefault<z.ZodNumber>;
566
+ }, z.core.$strip>;
567
+ OutcomeSignalsSchema: z.ZodObject<{
568
+ bead_id: z.ZodString;
569
+ duration_ms: z.ZodNumber;
570
+ error_count: z.ZodNumber;
571
+ retry_count: z.ZodNumber;
572
+ success: z.ZodBoolean;
573
+ files_touched: z.ZodDefault<z.ZodArray<z.ZodString>>;
574
+ timestamp: z.ZodString;
575
+ strategy: z.ZodOptional<z.ZodEnum<{
576
+ "file-based": "file-based";
577
+ "feature-based": "feature-based";
578
+ "risk-based": "risk-based";
579
+ "research-based": "research-based";
580
+ }>>;
581
+ failure_mode: z.ZodOptional<z.ZodEnum<{
582
+ timeout: "timeout";
583
+ unknown: "unknown";
584
+ conflict: "conflict";
585
+ validation: "validation";
586
+ tool_failure: "tool_failure";
587
+ context_overflow: "context_overflow";
588
+ dependency_blocked: "dependency_blocked";
589
+ user_cancelled: "user_cancelled";
590
+ }>>;
591
+ failure_details: z.ZodOptional<z.ZodString>;
592
+ }, z.core.$strip>;
593
+ ScoredOutcomeSchema: z.ZodObject<{
594
+ signals: z.ZodObject<{
595
+ bead_id: z.ZodString;
596
+ duration_ms: z.ZodNumber;
597
+ error_count: z.ZodNumber;
598
+ retry_count: z.ZodNumber;
599
+ success: z.ZodBoolean;
600
+ files_touched: z.ZodDefault<z.ZodArray<z.ZodString>>;
601
+ timestamp: z.ZodString;
602
+ strategy: z.ZodOptional<z.ZodEnum<{
603
+ "file-based": "file-based";
604
+ "feature-based": "feature-based";
605
+ "risk-based": "risk-based";
606
+ "research-based": "research-based";
607
+ }>>;
608
+ failure_mode: z.ZodOptional<z.ZodEnum<{
609
+ timeout: "timeout";
610
+ unknown: "unknown";
611
+ conflict: "conflict";
612
+ validation: "validation";
613
+ tool_failure: "tool_failure";
614
+ context_overflow: "context_overflow";
615
+ dependency_blocked: "dependency_blocked";
616
+ user_cancelled: "user_cancelled";
617
+ }>>;
618
+ failure_details: z.ZodOptional<z.ZodString>;
619
+ }, z.core.$strip>;
620
+ type: z.ZodEnum<{
621
+ helpful: "helpful";
622
+ harmful: "harmful";
623
+ neutral: "neutral";
624
+ }>;
625
+ decayed_value: z.ZodNumber;
626
+ reasoning: z.ZodString;
627
+ }, z.core.$strip>;
628
+ DecompositionStrategySchema: z.ZodEnum<{
629
+ "file-based": "file-based";
630
+ "feature-based": "feature-based";
631
+ "risk-based": "risk-based";
632
+ "research-based": "research-based";
633
+ }>;
634
+ ErrorTypeSchema: z.ZodEnum<{
635
+ timeout: "timeout";
636
+ unknown: "unknown";
637
+ conflict: "conflict";
638
+ validation: "validation";
639
+ tool_failure: "tool_failure";
640
+ }>;
641
+ ErrorEntrySchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ bead_id: z.ZodString;
644
+ error_type: z.ZodEnum<{
645
+ timeout: "timeout";
646
+ unknown: "unknown";
647
+ conflict: "conflict";
648
+ validation: "validation";
649
+ tool_failure: "tool_failure";
650
+ }>;
651
+ message: z.ZodString;
652
+ stack_trace: z.ZodOptional<z.ZodString>;
653
+ tool_name: z.ZodOptional<z.ZodString>;
654
+ timestamp: z.ZodString;
655
+ resolved: z.ZodDefault<z.ZodBoolean>;
656
+ context: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$strip>;
658
+ StrikeRecordSchema: z.ZodObject<{
659
+ bead_id: z.ZodString;
660
+ strike_count: z.ZodNumber;
661
+ failures: z.ZodArray<z.ZodObject<{
662
+ attempt: z.ZodString;
663
+ reason: z.ZodString;
664
+ timestamp: z.ZodString;
665
+ }, z.core.$strip>>;
666
+ first_strike_at: z.ZodOptional<z.ZodString>;
667
+ last_strike_at: z.ZodOptional<z.ZodString>;
668
+ }, z.core.$strip>;
669
+ };
670
+ //# sourceMappingURL=learning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../src/learning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;EAA4C,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iB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