substrate-ai 0.19.26 → 0.19.28

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.
@@ -0,0 +1,4 @@
1
+ import { AdapterRegistry } from "./dist-R0W4ofKv.js";
2
+ import "./adapter-registry-DXLMTmfD.js";
3
+
4
+ export { AdapterRegistry };
package/dist/cli/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot } from "../health-CAg5B3m_.js";
2
+ import { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot } from "../health-M0iCuP26.js";
3
3
  import { createLogger } from "../logger-KeHncl-f.js";
4
4
  import { createEventBus } from "../helpers-CElYrONe.js";
5
- import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-D0SnP1ns.js";
5
+ import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-R0W4ofKv.js";
6
6
  import "../adapter-registry-DXLMTmfD.js";
7
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-CsNW777k.js";
8
- import "../errors-Crc4y34k.js";
7
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-DabSV2xH.js";
8
+ import "../errors-BJRMJyGb.js";
9
9
  import "../routing-CcBOCuC9.js";
10
10
  import "../decisions-C0pz9Clx.js";
11
11
  import "../version-manager-impl-BmOWu8ml.js";
12
- import { registerUpgradeCommand } from "../upgrade-DldTl30b.js";
12
+ import { registerUpgradeCommand } from "../upgrade-DwEbjHWg.js";
13
13
  import { Command } from "commander";
14
14
  import { fileURLToPath } from "url";
15
15
  import { dirname, join, resolve } from "path";
@@ -24,7 +24,7 @@ import { join as join$1 } from "node:path";
24
24
  import { z } from "zod";
25
25
  import * as fs from "node:fs/promises";
26
26
  import { access as access$1, readFile as readFile$1, readdir as readdir$1 } from "node:fs/promises";
27
- import { appendFileSync, chmodSync, cpSync, existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync, rmSync as rmSync$1, statSync, unlinkSync, writeFileSync as writeFileSync$1 } from "fs";
27
+ import { appendFileSync, chmodSync, cpSync, existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync, rmSync as rmSync$1, statSync, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
28
28
  import { homedir } from "os";
29
29
  import { createRequire } from "node:module";
30
30
  import { fileURLToPath as fileURLToPath$1 } from "node:url";
@@ -1801,7 +1801,7 @@ function clearBmadCommandFiles(commandsDir) {
1801
1801
  try {
1802
1802
  const entries = readdirSync$1(commandsDir);
1803
1803
  for (const entry of entries) if (entry.startsWith("bmad-") && entry.endsWith(".md")) try {
1804
- unlinkSync(join(commandsDir, entry));
1804
+ unlinkSync$1(join(commandsDir, entry));
1805
1805
  } catch {}
1806
1806
  } catch {}
1807
1807
  }
@@ -3228,7 +3228,7 @@ async function runStatusAction(options) {
3228
3228
  if (run === void 0) run = await getLatestRun(adapter);
3229
3229
  }
3230
3230
  if (run === void 0) {
3231
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-gww8zfnD.js");
3231
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CVfyC7j0.js");
3232
3232
  const substrateDirPath = join(projectRoot, ".substrate");
3233
3233
  const processInfo = inspectProcessTree$1({
3234
3234
  projectRoot,
@@ -4115,7 +4115,7 @@ function defaultSupervisorDeps() {
4115
4115
  if (cached === null) {
4116
4116
  const { AdapterRegistry: AR } = await import(
4117
4117
  /* @vite-ignore */
4118
- "../adapter-registry-Cw2DpQOy.js"
4118
+ "../adapter-registry-S_u-oxuM.js"
4119
4119
  );
4120
4120
  cached = new AR();
4121
4121
  await cached.discoverAndRegister();
@@ -4557,11 +4557,11 @@ async function runSupervisorAction(options, deps = {}) {
4557
4557
  try {
4558
4558
  const { createExperimenter } = await import(
4559
4559
  /* @vite-ignore */
4560
- "../experimenter-Ajtt8D60.js"
4560
+ "../experimenter-Sq8sNz9y.js"
4561
4561
  );
4562
4562
  const { getLatestRun: getLatest } = await import(
4563
4563
  /* @vite-ignore */
4564
- "../decisions-BYjuW3st.js"
4564
+ "../decisions-CnvFtZ7P.js"
4565
4565
  );
4566
4566
  const expAdapter = createDatabaseAdapter({
4567
4567
  backend: "auto",
@@ -4571,7 +4571,7 @@ async function runSupervisorAction(options, deps = {}) {
4571
4571
  await initSchema(expAdapter);
4572
4572
  const { runRunAction: runPipeline } = await import(
4573
4573
  /* @vite-ignore */
4574
- "../run-CH6kOKMs.js"
4574
+ "../run-CjwCYY8Q.js"
4575
4575
  );
4576
4576
  const runStoryFn = async (opts) => {
4577
4577
  const exitCode = await runPipeline({
@@ -5101,7 +5101,7 @@ async function runMetricsAction(options) {
5101
5101
  const routingConfigPath = join(dbDir, "routing.yml");
5102
5102
  let routingConfig = null;
5103
5103
  if (existsSync$1(routingConfigPath)) try {
5104
- const { loadModelRoutingConfig } = await import("../routing-DZuOjyTy.js");
5104
+ const { loadModelRoutingConfig } = await import("../routing-CRjtRmIl.js");
5105
5105
  routingConfig = loadModelRoutingConfig(routingConfigPath);
5106
5106
  } catch {}
5107
5107
  if (routingConfig === null) routingConfig = {
@@ -7461,7 +7461,7 @@ async function runCancelAction(options) {
7461
7461
  }, "json", true) + "\n");
7462
7462
  else process.stdout.write("No running pipeline found.\n");
7463
7463
  if (existsSync$1(pidFilePath)) try {
7464
- unlinkSync(pidFilePath);
7464
+ unlinkSync$1(pidFilePath);
7465
7465
  if (outputFormat === "human") process.stdout.write("Cleaned up stale PID file.\n");
7466
7466
  } catch {}
7467
7467
  return 0;
@@ -7492,7 +7492,7 @@ async function runCancelAction(options) {
7492
7492
  killed.push(zombiePid);
7493
7493
  } catch {}
7494
7494
  if (existsSync$1(pidFilePath)) try {
7495
- unlinkSync(pidFilePath);
7495
+ unlinkSync$1(pidFilePath);
7496
7496
  } catch {}
7497
7497
  try {
7498
7498
  const adapter = createDatabaseAdapter({
@@ -8355,8 +8355,8 @@ async function createProgram() {
8355
8355
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
8356
8356
  function checkForUpdatesInBackground(currentVersion) {
8357
8357
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
8358
- import("../upgrade-d21gzvUw.js").then(async () => {
8359
- const { createVersionManager } = await import("../version-manager-impl-Vlz013ih.js");
8358
+ import("../upgrade-Q9YROhpA.js").then(async () => {
8359
+ const { createVersionManager } = await import("../version-manager-impl-DReRXdW7.js");
8360
8360
  const vm = createVersionManager();
8361
8361
  const result = await vm.checkForUpdates();
8362
8362
  if (result.updateAvailable) {
@@ -1,4 +1,4 @@
1
- import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-D0SnP1ns.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-R0W4ofKv.js";
2
2
  import "./decisions-C0pz9Clx.js";
3
3
 
4
4
  export { getLatestRun };
@@ -38,7 +38,7 @@ const DEFAULT_TIMEOUTS = {
38
38
  "create-story": 6e5,
39
39
  "dev-story": 18e5,
40
40
  "code-review": 9e5,
41
- "minor-fixes": 12e5,
41
+ "minor-fixes": 3e5,
42
42
  "major-rework": 9e5,
43
43
  "readiness-check": 6e5,
44
44
  "elicitation": 9e5,
@@ -213,6 +213,56 @@ function containsAnchorKey(content) {
213
213
  return YAML_ANCHOR_KEYS.some((key) => content.includes(key));
214
214
  }
215
215
  /**
216
+ * Merge duplicate top-level YAML keys by concatenating their array values.
217
+ *
218
+ * LLMs sometimes emit the same mapping key twice, splitting a list across two
219
+ * blocks (e.g., `non_functional_requirements:` appears twice, each with
220
+ * different items). This violates YAML 1.2 but is recoverable: we detect
221
+ * duplicate top-level keys and merge their children into a single key.
222
+ *
223
+ * Only operates on top-level keys (no indentation). Nested duplicates are not
224
+ * handled — they're rare in practice and harder to fix safely.
225
+ */
226
+ function mergeDuplicateYamlKeys(yamlText) {
227
+ const lines = yamlText.split("\n");
228
+ const sections = [];
229
+ let current = null;
230
+ for (const line of lines) {
231
+ const keyMatch = line.match(/^([a-zA-Z_][a-zA-Z0-9_]*):\s*(.*)$/);
232
+ if (keyMatch) {
233
+ const key = keyMatch[1];
234
+ const rest = keyMatch[2].trim();
235
+ current = {
236
+ key,
237
+ lines: [line]
238
+ };
239
+ sections.push(current);
240
+ if (rest.length > 0 && !rest.startsWith("#")) current = null;
241
+ } else if (current) current.lines.push(line);
242
+ else sections.push({
243
+ key: "",
244
+ lines: [line]
245
+ });
246
+ }
247
+ const seen = new Map();
248
+ const merged = [];
249
+ for (const section of sections) {
250
+ if (section.key === "") {
251
+ merged.push(section);
252
+ continue;
253
+ }
254
+ const existing = seen.get(section.key);
255
+ if (existing !== void 0) {
256
+ const target = merged[existing];
257
+ target.lines.push(...section.lines.slice(1));
258
+ } else {
259
+ seen.set(section.key, merged.length);
260
+ merged.push(section);
261
+ }
262
+ }
263
+ return merged.flatMap((s) => s.lines).join("\n");
264
+ }
265
+ /**
216
266
  * Parse a YAML string and optionally validate it against a Zod schema.
217
267
  *
218
268
  * @param yamlText - Raw YAML string to parse
@@ -225,7 +275,15 @@ function parseYamlResult(yamlText, schema) {
225
275
  raw = yaml.load(sanitizeYamlEscapes(yamlText));
226
276
  } catch (err) {
227
277
  const message = err instanceof Error ? err.message : String(err);
228
- return {
278
+ if (message.includes("duplicated mapping key")) try {
279
+ raw = yaml.load(sanitizeYamlEscapes(mergeDuplicateYamlKeys(yamlText)));
280
+ } catch {
281
+ return {
282
+ parsed: null,
283
+ error: `YAML parse error: ${message}`
284
+ };
285
+ }
286
+ else return {
229
287
  parsed: null,
230
288
  error: `YAML parse error: ${message}`
231
289
  };
@@ -4098,7 +4156,10 @@ var DoltQueryError = class extends Error {
4098
4156
  */
4099
4157
  function runExecFile(cmd, args, opts) {
4100
4158
  return new Promise((resolve$2, reject) => {
4101
- execFile(cmd, args, opts, (err, stdout, stderr) => {
4159
+ execFile(cmd, args, {
4160
+ ...opts,
4161
+ maxBuffer: 10 * 1024 * 1024
4162
+ }, (err, stdout, stderr) => {
4102
4163
  if (err) reject(err);
4103
4164
  else resolve$2({
4104
4165
  stdout,
@@ -5383,7 +5444,9 @@ const BudgetConfigSchema = z.object({
5383
5444
  }).strict();
5384
5445
  const TelemetryConfigSchema = z.object({
5385
5446
  enabled: z.boolean().default(false),
5386
- port: z.number().int().min(1).max(65535).default(4318)
5447
+ port: z.number().int().min(1).max(65535).default(4318),
5448
+ meshUrl: z.string().url().optional(),
5449
+ projectId: z.string().optional()
5387
5450
  }).strict();
5388
5451
  /** Current supported config format version */
5389
5452
  const CURRENT_CONFIG_FORMAT_VERSION = "1";
@@ -5400,7 +5463,8 @@ const SubstrateConfigSchema = z.object({
5400
5463
  providers: ProvidersSchema,
5401
5464
  cost_tracker: CostTrackerConfigSchema.optional(),
5402
5465
  budget: BudgetConfigSchema.optional(),
5403
- telemetry: TelemetryConfigSchema.optional()
5466
+ telemetry: TelemetryConfigSchema.optional(),
5467
+ trivialOutputThreshold: z.number().int().nonnegative().optional()
5404
5468
  }).passthrough();
5405
5469
  const PartialProviderConfigSchema = ProviderConfigSchema.partial();
5406
5470
  const PartialGlobalSettingsSchema = GlobalSettingsSchema.partial();
@@ -5415,7 +5479,8 @@ const PartialSubstrateConfigSchema = z.object({
5415
5479
  }).partial().optional(),
5416
5480
  cost_tracker: CostTrackerConfigSchema.partial().optional(),
5417
5481
  budget: BudgetConfigSchema.partial().optional(),
5418
- telemetry: TelemetryConfigSchema.partial().optional()
5482
+ telemetry: TelemetryConfigSchema.partial().optional(),
5483
+ trivialOutputThreshold: z.number().int().nonnegative().optional()
5419
5484
  }).passthrough();
5420
5485
 
5421
5486
  //#endregion
@@ -10453,4 +10518,4 @@ async function callLLM(params) {
10453
10518
 
10454
10519
  //#endregion
10455
10520
  export { ADVISORY_NOTES, AdapterRegistry, AdtError, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, Categorizer, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, ConsumerAnalyzer, CostTrackerConfigSchema, DEFAULT_CONFIG, DEFAULT_GLOBAL_SETTINGS, DispatcherImpl, DoltClient, DoltNotInstalled, DoltQueryError, ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, EfficiencyScorer, GeminiCLIAdapter, GlobalSettingsSchema, IngestionServer, LogTurnAnalyzer, ModelRoutingConfigSchema, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProviderPolicySchema, ProvidersSchema, Recommender, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, STORY_METRICS, STORY_OUTCOME, SubstrateConfigSchema, TASK_TYPE_PHASE_MAP, TEST_EXPANSION_FINDING, TEST_PLAN, TelemetryConfigSchema, TelemetryNormalizer, TelemetryPipeline, TurnAnalyzer, VersionManagerImpl, addTokenUsage, aggregateTokenUsageForRun, aggregateTokenUsageForStory, buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, callLLM, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDatabaseAdapter as createDatabaseAdapter$1, createDecision, createDoltClient, createExperimenter, createPipelineRun, createRequirement, createVersionManager, detectInterfaceChanges, determineVerdict, getActiveDecisions, getAllCostEntriesFiltered, getArtifactByTypeForRun, getArtifactsByRun, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getModelTier, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRequirements, listRunMetrics, loadModelRoutingConfig, loadParentRunDecisions, registerArtifact, resolvePromptFile, supersedeDecision, tagRunAsBaseline, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics };
10456
- //# sourceMappingURL=dist-D0SnP1ns.js.map
10521
+ //# sourceMappingURL=dist-R0W4ofKv.js.map
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-D0SnP1ns.js";
1
+ import { AdtError } from "./dist-R0W4ofKv.js";
2
2
 
3
3
  //#region src/core/errors.ts
4
4
  /** Error thrown when task configuration is invalid */
@@ -71,4 +71,4 @@ var TaskGraphIncompatibleFormatError = class extends AdtError {
71
71
 
72
72
  //#endregion
73
73
  export { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError };
74
- //# sourceMappingURL=errors-Crc4y34k.js.map
74
+ //# sourceMappingURL=errors-BJRMJyGb.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-D0SnP1ns.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-R0W4ofKv.js";
2
2
 
3
3
  export { createExperimenter };
@@ -1,6 +1,6 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-CAg5B3m_.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-M0iCuP26.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-D0SnP1ns.js";
3
+ import "./dist-R0W4ofKv.js";
4
4
  import "./decisions-C0pz9Clx.js";
5
5
 
6
6
  export { inspectProcessTree };
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-D0SnP1ns.js";
2
+ import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-R0W4ofKv.js";
3
3
  import { createRequire } from "module";
4
4
  import { dirname, join } from "path";
5
5
  import { existsSync, readFileSync } from "node:fs";
@@ -1819,6 +1819,9 @@ async function getAutoHealthData(options) {
1819
1819
  else if (active > 0) verdict = "STALLED";
1820
1820
  else verdict = "HEALTHY";
1821
1821
  else if (run.status === "completed" || run.status === "failed" || run.status === "stopped") verdict = "NO_PIPELINE_RUNNING";
1822
+ const warnings = [];
1823
+ if (doltStateInfo !== void 0 && doltStateInfo.responsive === false) warnings.push("Dolt not connected — decision store queries may fail, story context will be degraded");
1824
+ if (escalated > 0) warnings.push(`${escalated} story(ies) escalated — operator intervention may be needed`);
1822
1825
  const healthOutput = {
1823
1826
  verdict,
1824
1827
  run_id: run.id,
@@ -1834,7 +1837,8 @@ async function getAutoHealthData(options) {
1834
1837
  pending,
1835
1838
  details: storyDetails
1836
1839
  },
1837
- ...doltStateInfo !== void 0 ? { dolt_state: doltStateInfo } : {}
1840
+ ...doltStateInfo !== void 0 ? { dolt_state: doltStateInfo } : {},
1841
+ ...warnings.length > 0 ? { warnings } : {}
1838
1842
  };
1839
1843
  return healthOutput;
1840
1844
  } finally {
@@ -1881,6 +1885,10 @@ async function runHealthAction(options) {
1881
1885
  process.stdout.write(" 1. Retry escalated stories: substrate retry-escalated\n");
1882
1886
  process.stdout.write(" 2. Or start a new run: substrate run --events\n");
1883
1887
  }
1888
+ if (health.warnings !== void 0 && health.warnings.length > 0) {
1889
+ process.stdout.write("\n Warnings:\n");
1890
+ for (const w of health.warnings) process.stdout.write(` ⚠ ${w}\n`);
1891
+ }
1884
1892
  if (health.dolt_state !== void 0) {
1885
1893
  const ds = health.dolt_state;
1886
1894
  const initStr = ds.initialized ? "yes" : "no";
@@ -1941,4 +1949,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
1941
1949
 
1942
1950
  //#endregion
1943
1951
  export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createStateStore, detectCycles, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runHealthAction, validateStoryKey };
1944
- //# sourceMappingURL=health-CAg5B3m_.js.map
1952
+ //# sourceMappingURL=health-M0iCuP26.js.map
package/dist/index.d.ts CHANGED
@@ -96,6 +96,8 @@ interface PipelineStartEvent {
96
96
  concurrency: number;
97
97
  /** Execution engine: 'linear' or 'graph' */
98
98
  engine?: string;
99
+ /** Persistence backend: 'dolt' or 'memory' — aids diagnosing data loss */
100
+ adapter_backend?: string;
99
101
  }
100
102
  /**
101
103
  * Emitted as the last event when the pipeline finishes.
@@ -630,6 +632,47 @@ interface PipelinePhaseCompleteEvent {
630
632
  /** Phase name (e.g., 'analysis', 'implementation') */
631
633
  phase: string;
632
634
  }
635
+ /**
636
+ * Emitted after each individual Tier A verification check completes (Story 51-6).
637
+ * Payload mirrors the SdlcEvents 'verification:check-complete' payload plus ts timestamp.
638
+ */
639
+ interface VerificationCheckCompleteEvent {
640
+ type: 'verification:check-complete';
641
+ /** ISO-8601 timestamp generated at emit time */
642
+ ts: string;
643
+ /** Story key (e.g., "51-5") */
644
+ storyKey: string;
645
+ /** Check name (e.g., "phantom-review", "trivial-output", "build") */
646
+ checkName: string;
647
+ /** Check result status */
648
+ status: 'pass' | 'warn' | 'fail';
649
+ /** Human-readable details from the check */
650
+ details: string;
651
+ /** Check execution time in milliseconds */
652
+ duration_ms: number;
653
+ }
654
+ /**
655
+ * Emitted once per story after all Tier A verification checks complete (Story 51-6).
656
+ * Payload is the full VerificationSummary shape plus ts timestamp.
657
+ */
658
+ interface VerificationStoryCompleteEvent {
659
+ type: 'verification:story-complete';
660
+ /** ISO-8601 timestamp generated at emit time */
661
+ ts: string;
662
+ /** Story key (e.g., "51-5") */
663
+ storyKey: string;
664
+ /** Per-check results */
665
+ checks: Array<{
666
+ checkName: string;
667
+ status: 'pass' | 'warn' | 'fail';
668
+ details: string;
669
+ duration_ms: number;
670
+ }>;
671
+ /** Aggregated worst-case status across all checks */
672
+ status: 'pass' | 'warn' | 'fail';
673
+ /** Total duration of all checks in milliseconds */
674
+ duration_ms: number;
675
+ }
633
676
  /**
634
677
  * Discriminated union of all pipeline event types.
635
678
  *
@@ -642,7 +685,7 @@ interface PipelinePhaseCompleteEvent {
642
685
  * }
643
686
  * ```
644
687
  */
645
- type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent | PipelinePhaseStartEvent | PipelinePhaseCompleteEvent | StoryAutoApprovedEvent; //#endregion
688
+ type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent | PipelinePhaseStartEvent | PipelinePhaseCompleteEvent | StoryAutoApprovedEvent | VerificationCheckCompleteEvent | VerificationStoryCompleteEvent; //#endregion
646
689
  //#region packages/core/dist/types.d.ts
647
690
 
648
691
  /**
@@ -1587,6 +1630,8 @@ declare const SubstrateConfigSchema: z.ZodObject<{
1587
1630
  telemetry: z.ZodOptional<z.ZodObject<{
1588
1631
  enabled: z.ZodDefault<z.ZodBoolean>;
1589
1632
  port: z.ZodDefault<z.ZodNumber>;
1633
+ meshUrl: z.ZodOptional<z.ZodString>;
1634
+ projectId: z.ZodOptional<z.ZodString>;
1590
1635
  }, z.core.$strict>>;
1591
1636
  default_agent: z.ZodOptional<z.ZodString>;
1592
1637
  }, z.core.$strict>;
@@ -1779,6 +1824,26 @@ interface OrchestratorEvents {
1779
1824
  taskId: TaskId;
1780
1825
  branchName: string;
1781
1826
  };
1827
+ /** An individual Tier A verification check completed for a story */
1828
+ 'verification:check-complete': {
1829
+ storyKey: string;
1830
+ checkName: string;
1831
+ status: 'pass' | 'warn' | 'fail';
1832
+ details: string;
1833
+ duration_ms: number;
1834
+ };
1835
+ /** All Tier A verification checks completed for a story */
1836
+ 'verification:story-complete': {
1837
+ storyKey: string;
1838
+ checks: Array<{
1839
+ checkName: string;
1840
+ status: 'pass' | 'warn' | 'fail';
1841
+ details: string;
1842
+ duration_ms: number;
1843
+ }>;
1844
+ status: 'pass' | 'warn' | 'fail';
1845
+ duration_ms: number;
1846
+ };
1782
1847
  /** Plan generation has started */
1783
1848
  'plan:generating': {
1784
1849
  agent: string;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { childLogger, createLogger, logger } from "./logger-KeHncl-f.js";
2
2
  import { assertDefined, createEventBus, createTuiApp, deepClone, formatDuration, generateId, isPlainObject, isTuiCapable, printNonTtyWarning, sleep, withRetry } from "./helpers-CElYrONe.js";
3
- import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-D0SnP1ns.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-R0W4ofKv.js";
4
4
  import "./adapter-registry-DXLMTmfD.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-Crc4y34k.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-BJRMJyGb.js";
6
6
 
7
7
  //#region src/core/di.ts
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-D0SnP1ns.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-R0W4ofKv.js";
2
2
  import "./routing-CcBOCuC9.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,8 +1,8 @@
1
- import "./health-CAg5B3m_.js";
1
+ import "./health-M0iCuP26.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-D0SnP1ns.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction } from "./run-CsNW777k.js";
4
+ import "./dist-R0W4ofKv.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-DabSV2xH.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8