substrate-ai 0.19.29 → 0.19.30

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,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest } from "../health-BS20i6mY.js";
2
+ import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest } from "../health-DKallkoo.js";
3
3
  import { createLogger } from "../logger-KeHncl-f.js";
4
4
  import { createEventBus } from "../helpers-CElYrONe.js";
5
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-BBYhrXw9.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-B0Pe5kol.js";
8
8
  import "../errors-BJRMJyGb.js";
9
9
  import "../routing-CcBOCuC9.js";
10
10
  import "../decisions-C0pz9Clx.js";
@@ -3303,7 +3303,7 @@ async function runStatusAction(options) {
3303
3303
  logger$12.debug({ err }, "Work graph query failed, continuing without work graph data");
3304
3304
  }
3305
3305
  if (run === void 0) {
3306
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-Cy_9GgQ_.js");
3306
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-Bb5KxPlE.js");
3307
3307
  const substrateDirPath = join(projectRoot, ".substrate");
3308
3308
  const processInfo = inspectProcessTree$1({
3309
3309
  projectRoot,
@@ -4446,7 +4446,10 @@ async function handleStallRecovery(health, state, config, deps, io) {
4446
4446
  };
4447
4447
  }
4448
4448
  const newRestartCount = state.restartCount + 1;
4449
- if (health.run_id !== null) await incrementRestarts(health.run_id, projectRoot);
4449
+ if (health.run_id !== null) {
4450
+ await incrementRestarts(health.run_id, projectRoot);
4451
+ RunManifest.open(health.run_id, join(projectRoot, ".substrate", "runs")).update({ restart_count: newRestartCount }).catch(() => {});
4452
+ }
4450
4453
  emitEvent({
4451
4454
  type: "supervisor:restart",
4452
4455
  run_id: health.run_id,
@@ -4710,7 +4713,7 @@ async function runSupervisorAction(options, deps = {}) {
4710
4713
  await initSchema(expAdapter);
4711
4714
  const { runRunAction: runPipeline } = await import(
4712
4715
  /* @vite-ignore */
4713
- "../run-D0-aXchh.js"
4716
+ "../run-BIVex2-V.js"
4714
4717
  );
4715
4718
  const runStoryFn = async (opts) => {
4716
4719
  const exitCode = await runPipeline({
@@ -7644,6 +7647,7 @@ async function runCancelAction(options) {
7644
7647
  const runningRuns = await getRunningPipelineRuns(adapter);
7645
7648
  for (const run of runningRuns) {
7646
7649
  await updatePipelineRun(adapter, run.id, { status: "stopped" });
7650
+ RunManifest.open(run.id, join(dbRoot, "runs")).update({ run_status: "stopped" }).catch(() => {});
7647
7651
  if (outputFormat === "human") process.stdout.write(`Marked pipeline run ${run.id} as stopped.\n`);
7648
7652
  }
7649
7653
  } finally {
@@ -1,4 +1,4 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BS20i6mY.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-DKallkoo.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./dist-R0W4ofKv.js";
4
4
  import "./decisions-C0pz9Clx.js";
@@ -1895,7 +1895,9 @@ const PerStoryStateSchema = z.object({
1895
1895
  started_at: z.string(),
1896
1896
  completed_at: z.string().optional(),
1897
1897
  verification_result: StoredVerificationSummarySchema.optional(),
1898
- cost_usd: z.number().nonnegative().optional()
1898
+ cost_usd: z.number().nonnegative().optional(),
1899
+ review_cycles: z.number().int().nonnegative().optional(),
1900
+ dispatches: z.number().int().nonnegative().optional()
1899
1901
  });
1900
1902
 
1901
1903
  //#endregion
@@ -3143,4 +3145,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
3143
3145
 
3144
3146
  //#endregion
3145
3147
  export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createGraphOrchestrator, createStateStore, detectCycles, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, runHealthAction, validateStoryKey };
3146
- //# sourceMappingURL=health-BS20i6mY.js.map
3148
+ //# sourceMappingURL=health-DKallkoo.js.map
@@ -1,4 +1,4 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createGraphOrchestrator, detectCycles, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-BS20i6mY.js";
1
+ import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createGraphOrchestrator, detectCycles, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-DKallkoo.js";
2
2
  import { createLogger } from "./logger-KeHncl-f.js";
3
3
  import { TypedEventBusImpl, createEventBus, createTuiApp, isTuiCapable, printNonTtyWarning, sleep } from "./helpers-CElYrONe.js";
4
4
  import { ADVISORY_NOTES, Categorizer, ConsumerAnalyzer, DEFAULT_GLOBAL_SETTINGS, DispatcherImpl, DoltClient, ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, EfficiencyScorer, IngestionServer, LogTurnAnalyzer, OPERATIONAL_FINDING, Recommender, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, STORY_METRICS, STORY_OUTCOME, SubstrateConfigSchema, TEST_EXPANSION_FINDING, TEST_PLAN, TelemetryNormalizer, TelemetryPipeline, TurnAnalyzer, addTokenUsage, aggregateTokenUsageForRun, aggregateTokenUsageForStory, callLLM, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-R0W4ofKv.js";
@@ -12047,7 +12047,9 @@ function createImplementationOrchestrator(deps) {
12047
12047
  runManifest.patchStoryState(storyKey, {
12048
12048
  status: manifestStatus,
12049
12049
  phase: String(updates.phase),
12050
- completed_at: fullUpdated.completedAt ?? new Date().toISOString()
12050
+ completed_at: fullUpdated.completedAt ?? new Date().toISOString(),
12051
+ review_cycles: fullUpdated.reviewCycles ?? 0,
12052
+ dispatches: _storyDispatches.get(storyKey) ?? 0
12051
12053
  }).catch((err) => logger$23.warn({
12052
12054
  err,
12053
12055
  storyKey
@@ -41499,7 +41501,9 @@ async function runRunAction(options) {
41499
41501
  ...skipVerification === true ? { skip_verification: true } : {},
41500
41502
  ...eventsFlag === true ? { events: true } : {}
41501
41503
  };
41502
- await RunManifest.open(pipelineRun.id, runsDir).patchCLIFlags(cliFlags);
41504
+ const manifest = RunManifest.open(pipelineRun.id, runsDir);
41505
+ await manifest.patchCLIFlags(cliFlags);
41506
+ await manifest.update({ run_status: "running" });
41503
41507
  } catch (err) {
41504
41508
  logger.warn({ err }, "Failed to persist CLI flags to run manifest — pipeline continues");
41505
41509
  }
@@ -41995,6 +41999,11 @@ async function runRunAction(options) {
41995
41999
  } catch (metricsErr) {
41996
42000
  logger.warn({ err: metricsErr }, "Failed to write run metrics (best-effort)");
41997
42001
  }
42002
+ try {
42003
+ const runsDir = join(dbDir, "runs");
42004
+ const terminalStatus = failedKeys.length > 0 ? "failed" : "completed";
42005
+ await RunManifest.open(pipelineRun.id, runsDir).update({ run_status: terminalStatus });
42006
+ } catch {}
41998
42007
  if (progressRenderer !== void 0) progressRenderer.render({
41999
42008
  type: "pipeline:complete",
42000
42009
  ts: new Date().toISOString(),
@@ -42426,6 +42435,7 @@ async function runFullPipeline(options) {
42426
42435
  const stopCountRows = await adapter.query(`SELECT COUNT(*) as cnt FROM decisions WHERE pipeline_run_id = ?`, [runId]);
42427
42436
  const decisionsCount$1 = stopCountRows[0]?.cnt ?? 0;
42428
42437
  await updatePipelineRun(adapter, runId, { status: "stopped" });
42438
+ RunManifest.open(runId, join(dbDir, "runs")).update({ run_status: "stopped" }).catch(() => {});
42429
42439
  const phaseStartedAt = new Date(startedAt).toISOString();
42430
42440
  const phaseCompletedAt = new Date().toISOString();
42431
42441
  const summary = formatPhaseCompletionSummary({
@@ -42546,4 +42556,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
42546
42556
 
42547
42557
  //#endregion
42548
42558
  export { 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, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict, wireNdjsonEmitter };
42549
- //# sourceMappingURL=run-BBYhrXw9.js.map
42559
+ //# sourceMappingURL=run-B0Pe5kol.js.map
@@ -1,8 +1,8 @@
1
- import "./health-BS20i6mY.js";
1
+ import "./health-DKallkoo.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-R0W4ofKv.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-BBYhrXw9.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-B0Pe5kol.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.19.29",
3
+ "version": "0.19.30",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",