substrate-ai 0.2.18 → 0.2.20

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.
package/dist/cli/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BBr-wMHS.js";
2
+ import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-CcWb6Kb-.js";
3
3
  import { createLogger, deepMask } from "../logger-D2fS2ccL.js";
4
4
  import { AdapterRegistry, createEventBus } from "../event-bus-BMxhfxfT.js";
5
5
  import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema, defaultConfigMigrator } from "../version-manager-impl-CZ6KF1Ds.js";
6
6
  import { ConfigError, ConfigIncompatibleFormatError } from "../errors-BPqtzQ4U.js";
7
7
  import { addTokenUsage, createDecision, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestRun, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-Dq4cAA2L.js";
8
- import { EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../operational-CobuCGbM.js";
8
+ import { EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../operational-Dq4IfJzE.js";
9
9
  import { abortMerge, createWorktree, getConflictingFiles, getMergedFiles, getOrphanedWorktrees, performMerge, removeBranch, removeWorktree, simulateMerge, verifyGitVersion } from "../git-utils-CtmrZrHS.js";
10
10
  import { registerUpgradeCommand } from "../upgrade-CjjAx5kD.js";
11
11
  import { Command } from "commander";
@@ -2828,7 +2828,7 @@ async function runSupervisorAction(options, deps = {}) {
2828
2828
  try {
2829
2829
  const { createExperimenter } = await import(
2830
2830
  /* @vite-ignore */
2831
- "../experimenter-CHRVkV3d.js"
2831
+ "../experimenter-prkFLFPw.js"
2832
2832
  );
2833
2833
  const { getLatestRun: getLatest } = await import(
2834
2834
  /* @vite-ignore */
@@ -2842,7 +2842,7 @@ async function runSupervisorAction(options, deps = {}) {
2842
2842
  const expDb = expDbWrapper.db;
2843
2843
  const { runRunAction: runPipeline } = await import(
2844
2844
  /* @vite-ignore */
2845
- "../run-cxQgjit7.js"
2845
+ "../run-C5zfaWYN.js"
2846
2846
  );
2847
2847
  const runStoryFn = async (opts) => {
2848
2848
  const exitCode = await runPipeline({
@@ -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-Dq4IfJzE.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-prkFLFPw.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,46 @@ 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";
258
297
 
259
298
  //#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
299
+ export { ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, STORY_OUTCOME, aggregateTokenUsageForRun, aggregateTokenUsageForStory, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline, writeRunMetrics, writeStoryMetrics };
300
+ //# sourceMappingURL=operational-Dq4IfJzE.js.map
@@ -0,0 +1,7 @@
1
+ import { registerRunCommand, runRunAction } from "./run-CcWb6Kb-.js";
2
+ import "./logger-D2fS2ccL.js";
3
+ import "./event-bus-BMxhfxfT.js";
4
+ import "./decisions-Dq4cAA2L.js";
5
+ import "./operational-Dq4IfJzE.js";
6
+
7
+ export { runRunAction };