substrate-ai 0.2.19 → 0.2.21

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.
@@ -1,6 +1,6 @@
1
1
  import "./logger-D2fS2ccL.js";
2
2
  import { createDecision } from "./decisions-Dq4cAA2L.js";
3
- import { EXPERIMENT_RESULT, getRunMetrics, getStoryMetricsForRun } from "./operational-CobuCGbM.js";
3
+ import { EXPERIMENT_RESULT, getRunMetrics, getStoryMetricsForRun } from "./operational-CnMlvWqc.js";
4
4
  import { spawnGit } from "./git-utils-CtmrZrHS.js";
5
5
  import { spawn } from "node:child_process";
6
6
  import { join } from "node:path";
@@ -500,4 +500,4 @@ function createExperimenter(config, deps) {
500
500
 
501
501
  //#endregion
502
502
  export { createExperimenter };
503
- //# sourceMappingURL=experimenter-CHRVkV3d.js.map
503
+ //# sourceMappingURL=experimenter-bc40oi8p.js.map
package/dist/index.d.ts CHANGED
@@ -995,6 +995,19 @@ interface OrchestratorEvents {
995
995
  lastVerdict: string;
996
996
  reviewCycles: number;
997
997
  issues: unknown[];
998
+ /** Structured diagnosis with classification and recommended action (Story 22-3) */
999
+ diagnosis?: {
1000
+ issueDistribution: 'concentrated' | 'widespread';
1001
+ severityProfile: 'blocker-present' | 'major-only' | 'minor-only' | 'no-structured-issues';
1002
+ totalIssues: number;
1003
+ blockerCount: number;
1004
+ majorCount: number;
1005
+ minorCount: number;
1006
+ affectedFiles: string[];
1007
+ reviewCycles: number;
1008
+ recommendedAction: 'retry-targeted' | 'split-story' | 'human-intervention';
1009
+ rationale: string;
1010
+ };
998
1011
  };
999
1012
  /** A non-fatal warning occurred during story processing */
1000
1013
  'orchestrator:story-warn': {
@@ -255,7 +255,91 @@ const EXPERIMENT_RESULT = "experiment-result";
255
255
  * ```
256
256
  */
257
257
  const STORY_METRICS = "story-metrics";
258
+ /**
259
+ * Category for structured escalation diagnoses.
260
+ *
261
+ * Key schema: "{storyKey}:{runId}"
262
+ *
263
+ * Value shape:
264
+ * ```json
265
+ * {
266
+ * "issueDistribution": "concentrated",
267
+ * "severityProfile": "major-only",
268
+ * "totalIssues": 3,
269
+ * "blockerCount": 0,
270
+ * "majorCount": 3,
271
+ * "minorCount": 0,
272
+ * "affectedFiles": ["src/foo.ts"],
273
+ * "reviewCycles": 3,
274
+ * "recommendedAction": "retry-targeted",
275
+ * "rationale": "3 major issues concentrated in few files."
276
+ * }
277
+ * ```
278
+ */
279
+ const ESCALATION_DIAGNOSIS = "escalation-diagnosis";
280
+ /**
281
+ * Category for per-story outcome findings (learning loop).
282
+ *
283
+ * Key schema: "{storyKey}:{runId}"
284
+ *
285
+ * Value shape:
286
+ * ```json
287
+ * {
288
+ * "storyKey": "22-1",
289
+ * "outcome": "complete",
290
+ * "reviewCycles": 2,
291
+ * "verdictHistory": ["NEEDS_MINOR_FIXES", "SHIP_IT"],
292
+ * "recurringPatterns": ["missing error handling"]
293
+ * }
294
+ * ```
295
+ */
296
+ const STORY_OUTCOME = "story-outcome";
297
+ /**
298
+ * Category for post-implementation test expansion findings generated per-story.
299
+ *
300
+ * Key schema: "{storyKey}:{runId}"
301
+ *
302
+ * Value shape:
303
+ * ```json
304
+ * {
305
+ * "expansion_priority": "medium", // "low" | "medium" | "high"
306
+ * "coverage_gaps": [
307
+ * {
308
+ * "ac_ref": "AC1",
309
+ * "description": "Happy path not exercised at module boundary",
310
+ * "gap_type": "missing-integration" // "missing-e2e" | "missing-integration" | "unit-only"
311
+ * }
312
+ * ],
313
+ * "suggested_tests": [
314
+ * {
315
+ * "test_name": "runFoo integration happy path",
316
+ * "test_type": "integration", // "e2e" | "integration" | "unit"
317
+ * "description": "Test runFoo with real DB instance",
318
+ * "target_ac": "AC1" // optional
319
+ * }
320
+ * ],
321
+ * "notes": "Optional free-text notes", // optional
322
+ * "error": "Error message if fallback" // optional — present only on graceful fallback
323
+ * }
324
+ * ```
325
+ */
326
+ const TEST_EXPANSION_FINDING = "test-expansion-finding";
327
+ /**
328
+ * Category for pre-implementation test plans generated per-story.
329
+ *
330
+ * Key schema: "{storyKey}"
331
+ *
332
+ * Value shape:
333
+ * ```json
334
+ * {
335
+ * "test_files": ["src/modules/foo/__tests__/foo.test.ts"],
336
+ * "test_categories": ["unit", "integration"],
337
+ * "coverage_notes": "AC1 covered by foo.test.ts"
338
+ * }
339
+ * ```
340
+ */
341
+ const TEST_PLAN = "test-plan";
258
342
 
259
343
  //#endregion
260
- export { EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, aggregateTokenUsageForStory, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline, writeRunMetrics, writeStoryMetrics };
261
- //# sourceMappingURL=operational-CobuCGbM.js.map
344
+ export { ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, STORY_OUTCOME, TEST_EXPANSION_FINDING, TEST_PLAN, aggregateTokenUsageForRun, aggregateTokenUsageForStory, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline, writeRunMetrics, writeStoryMetrics };
345
+ //# sourceMappingURL=operational-CnMlvWqc.js.map