substrate-ai 0.19.36 → 0.19.37

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-BUcEqXA1.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, 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-Ckl2VOPW.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-DMu0MJ-N.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-6ETBV23_.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-BUcEqXA1.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-BnYv46or.js";
8
- import "../errors-QZ2_FzOB.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-AF1jEvEp.js";
8
+ import "../errors-BZnrgeyp.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-CUs8N7Sc.js";
12
+ import { registerUpgradeCommand } from "../upgrade-CABZfjn_.js";
13
13
  import { Command } from "commander";
14
14
  import { fileURLToPath } from "url";
15
15
  import { dirname, join, resolve } from "path";
@@ -3307,7 +3307,7 @@ async function runStatusAction(options) {
3307
3307
  logger$12.debug({ err }, "Work graph query failed, continuing without work graph data");
3308
3308
  }
3309
3309
  if (run === void 0) {
3310
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-B28gVggH.js");
3310
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CINTkPJp.js");
3311
3311
  const substrateDirPath = join(projectRoot, ".substrate");
3312
3312
  const processInfo = inspectProcessTree$1({
3313
3313
  projectRoot,
@@ -4252,7 +4252,7 @@ function defaultSupervisorDeps() {
4252
4252
  if (cached === null) {
4253
4253
  const { AdapterRegistry: AR } = await import(
4254
4254
  /* @vite-ignore */
4255
- "../adapter-registry-TGAj9NRP.js"
4255
+ "../adapter-registry-l9wysBOr.js"
4256
4256
  );
4257
4257
  cached = new AR();
4258
4258
  await cached.discoverAndRegister();
@@ -4819,11 +4819,11 @@ async function runSupervisorAction(options, deps = {}) {
4819
4819
  try {
4820
4820
  const { createExperimenter } = await import(
4821
4821
  /* @vite-ignore */
4822
- "../experimenter-BuEVrH4r.js"
4822
+ "../experimenter-DivOnzd-.js"
4823
4823
  );
4824
4824
  const { getLatestRun: getLatest } = await import(
4825
4825
  /* @vite-ignore */
4826
- "../decisions-8djApJK3.js"
4826
+ "../decisions-Cy3hK4HO.js"
4827
4827
  );
4828
4828
  const expAdapter = createDatabaseAdapter({
4829
4829
  backend: "auto",
@@ -4833,7 +4833,7 @@ async function runSupervisorAction(options, deps = {}) {
4833
4833
  await initSchema(expAdapter);
4834
4834
  const { runRunAction: runPipeline } = await import(
4835
4835
  /* @vite-ignore */
4836
- "../run-V2hA6nZZ.js"
4836
+ "../run-CG9c7xzB.js"
4837
4837
  );
4838
4838
  const runStoryFn = async (opts) => {
4839
4839
  const exitCode = await runPipeline({
@@ -5365,7 +5365,7 @@ async function runMetricsAction(options) {
5365
5365
  const routingConfigPath = join(dbDir, "routing.yml");
5366
5366
  let routingConfig = null;
5367
5367
  if (existsSync$1(routingConfigPath)) try {
5368
- const { loadModelRoutingConfig } = await import("../routing-CvFTGTH-.js");
5368
+ const { loadModelRoutingConfig } = await import("../routing-CfkRvmSE.js");
5369
5369
  routingConfig = loadModelRoutingConfig(routingConfigPath);
5370
5370
  } catch {}
5371
5371
  if (routingConfig === null) routingConfig = {
@@ -8620,8 +8620,8 @@ async function createProgram() {
8620
8620
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
8621
8621
  function checkForUpdatesInBackground(currentVersion) {
8622
8622
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
8623
- import("../upgrade-Bid6Q1G2.js").then(async () => {
8624
- const { createVersionManager } = await import("../version-manager-impl-BdRRhlI6.js");
8623
+ import("../upgrade-B5faf8E9.js").then(async () => {
8624
+ const { createVersionManager } = await import("../version-manager-impl-C-lKxyO_.js");
8625
8625
  const vm = createVersionManager();
8626
8626
  const result = await vm.checkForUpdates();
8627
8627
  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-6ETBV23_.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-BUcEqXA1.js";
2
2
  import "./decisions-C0pz9Clx.js";
3
3
 
4
4
  export { getLatestRun };
@@ -1264,7 +1264,9 @@ var DispatcherImpl = class {
1264
1264
  output: stdout,
1265
1265
  inputTokens,
1266
1266
  outputTokens: Math.ceil(stdout.length / CHARS_PER_TOKEN$3),
1267
- qualityScore: quality$1.qualityScore
1267
+ qualityScore: quality$1.qualityScore,
1268
+ agent,
1269
+ ...effectiveModel !== void 0 && { model: effectiveModel }
1268
1270
  });
1269
1271
  this._logger.warn({
1270
1272
  id,
@@ -1308,7 +1310,9 @@ var DispatcherImpl = class {
1308
1310
  output: stdout,
1309
1311
  inputTokens,
1310
1312
  outputTokens: Math.ceil(stdout.length / CHARS_PER_TOKEN$3),
1311
- qualityScore: quality.qualityScore
1313
+ qualityScore: quality.qualityScore,
1314
+ agent,
1315
+ ...effectiveModel !== void 0 && { model: effectiveModel }
1312
1316
  });
1313
1317
  this._logger.debug({
1314
1318
  id,
@@ -2747,6 +2751,13 @@ async function initSchema(adapter) {
2747
2751
  UNIQUE(run_id, story_key)
2748
2752
  )
2749
2753
  `);
2754
+ for (const col of [
2755
+ "primary_agent_id VARCHAR(64)",
2756
+ "primary_model VARCHAR(128)",
2757
+ "dispatch_agents_json TEXT"
2758
+ ]) try {
2759
+ await adapter.exec(`ALTER TABLE story_metrics ADD COLUMN ${col}`);
2760
+ } catch {}
2750
2761
  await adapter.exec(`
2751
2762
  CREATE TABLE IF NOT EXISTS task_metrics (
2752
2763
  task_id VARCHAR(255) NOT NULL,
@@ -3924,8 +3935,8 @@ async function writeStoryMetrics(adapter, input) {
3924
3935
  await tx.query(`INSERT INTO story_metrics (
3925
3936
  run_id, story_key, result, phase_durations_json, started_at, completed_at,
3926
3937
  wall_clock_seconds, input_tokens, output_tokens, cost_usd,
3927
- review_cycles, dispatches
3928
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
3938
+ review_cycles, dispatches, primary_agent_id, primary_model, dispatch_agents_json
3939
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
3929
3940
  input.run_id,
3930
3941
  input.story_key,
3931
3942
  input.result,
@@ -3937,7 +3948,10 @@ async function writeStoryMetrics(adapter, input) {
3937
3948
  input.output_tokens ?? 0,
3938
3949
  input.cost_usd ?? 0,
3939
3950
  input.review_cycles ?? 0,
3940
- input.dispatches ?? 0
3951
+ input.dispatches ?? 0,
3952
+ input.primary_agent_id ?? null,
3953
+ input.primary_model ?? null,
3954
+ input.dispatch_agents_json ?? null
3941
3955
  ]);
3942
3956
  });
3943
3957
  }
@@ -10794,4 +10808,4 @@ async function callLLM(params) {
10794
10808
 
10795
10809
  //#endregion
10796
10810
  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, LEARNING_FINDING, 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 };
10797
- //# sourceMappingURL=dist-6ETBV23_.js.map
10811
+ //# sourceMappingURL=dist-BUcEqXA1.js.map
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-6ETBV23_.js";
1
+ import { AdtError } from "./dist-BUcEqXA1.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-QZ2_FzOB.js.map
74
+ //# sourceMappingURL=errors-BZnrgeyp.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-6ETBV23_.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-BUcEqXA1.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-Ckl2VOPW.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-DMu0MJ-N.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-6ETBV23_.js";
3
+ import "./dist-BUcEqXA1.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, LEARNING_FINDING, createDatabaseAdapter$1 as createDatabaseAdapter, createDecision, getDecisionsByCategory, getLatestRun, getPipelineRunById, initSchema } from "./dist-6ETBV23_.js";
2
+ import { DoltClient, DoltQueryError, LEARNING_FINDING, createDatabaseAdapter$1 as createDatabaseAdapter, createDecision, getDecisionsByCategory, getLatestRun, getPipelineRunById, initSchema } from "./dist-BUcEqXA1.js";
3
3
  import { createRequire } from "module";
4
4
  import { dirname, join } from "path";
5
5
  import { readFile } from "fs/promises";
@@ -4253,4 +4253,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
4253
4253
 
4254
4254
  //#endregion
4255
4255
  export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, FindingsInjector, 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, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, createStateStore, detectCycles, extractTargetFilesFromStoryContent, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, runHealthAction, validateStoryKey };
4256
- //# sourceMappingURL=health-Ckl2VOPW.js.map
4256
+ //# sourceMappingURL=health-DMu0MJ-N.js.map
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-6ETBV23_.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-BUcEqXA1.js";
4
4
  import "./adapter-registry-DXLMTmfD.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-QZ2_FzOB.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-BZnrgeyp.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-6ETBV23_.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-BUcEqXA1.js";
2
2
  import "./routing-CcBOCuC9.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,7 +1,7 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-Ckl2VOPW.js";
1
+ import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-DMu0MJ-N.js";
2
2
  import { createLogger } from "./logger-KeHncl-f.js";
3
3
  import { TypedEventBusImpl, createEventBus, createTuiApp, isTuiCapable, printNonTtyWarning, sleep } from "./helpers-CElYrONe.js";
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-6ETBV23_.js";
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-BUcEqXA1.js";
5
5
  import { basename, dirname, extname, join } from "path";
6
6
  import { access, readFile, readdir, stat } from "fs/promises";
7
7
  import { EventEmitter } from "node:events";
@@ -11519,6 +11519,7 @@ function createImplementationOrchestrator(deps) {
11519
11519
  const _phaseStartMs = new Map();
11520
11520
  const _phaseEndMs = new Map();
11521
11521
  const _storyDispatches = new Map();
11522
+ const _storyAgents = new Map();
11522
11523
  const _storyRetryCount = new Map();
11523
11524
  let _completedDispatches = 0;
11524
11525
  let _maxConcurrentActual = 0;
@@ -11549,6 +11550,14 @@ function createImplementationOrchestrator(deps) {
11549
11550
  function incrementDispatches(storyKey) {
11550
11551
  _storyDispatches.set(storyKey, (_storyDispatches.get(storyKey) ?? 0) + 1);
11551
11552
  }
11553
+ function recordDispatchAgent(storyKey, phase, agent, model) {
11554
+ if (!_storyAgents.has(storyKey)) _storyAgents.set(storyKey, []);
11555
+ _storyAgents.get(storyKey).push({
11556
+ agent,
11557
+ phase,
11558
+ ...model !== void 0 && { model }
11559
+ });
11560
+ }
11552
11561
  /**
11553
11562
  * Initialize `_storyRetryCount` from the run manifest for crash-recovery durability (AC6, Story 53-4).
11554
11563
  * Reads persisted retry_count so that budget gate correctly accounts for prior-session retries.
@@ -11600,7 +11609,7 @@ function createImplementationOrchestrator(deps) {
11600
11609
  }
11601
11610
  return JSON.stringify(durations);
11602
11611
  }
11603
- async function writeStoryMetricsBestEffort(storyKey, result, reviewCycles) {
11612
+ async function writeStoryMetricsBestEffort(storyKey, result, reviewCycles, storyAgentId) {
11604
11613
  if (config.pipelineRunId === void 0) return;
11605
11614
  try {
11606
11615
  const storyState = _stories.get(storyKey);
@@ -11626,7 +11635,9 @@ function createImplementationOrchestrator(deps) {
11626
11635
  output_tokens: tokenAgg.output,
11627
11636
  cost_usd: tokenAgg.cost,
11628
11637
  review_cycles: reviewCycles,
11629
- dispatches: _storyDispatches.get(storyKey) ?? 0
11638
+ dispatches: _storyDispatches.get(storyKey) ?? 0,
11639
+ primary_agent_id: storyAgentId ?? agentId ?? void 0,
11640
+ dispatch_agents_json: _storyAgents.has(storyKey) ? JSON.stringify(_storyAgents.get(storyKey)) : void 0
11630
11641
  });
11631
11642
  if (stateStore !== void 0) stateStore.recordMetric({
11632
11643
  storyKey,
@@ -18489,7 +18500,16 @@ async function buildRunReport(adapter, runId, opts) {
18489
18500
  verificationStatus: vr.status,
18490
18501
  verificationChecks: vr.checks
18491
18502
  },
18492
- ...qualityScore !== void 0 && { qualityScore }
18503
+ ...qualityScore !== void 0 && { qualityScore },
18504
+ ...s$1.primary_agent_id && { agentId: s$1.primary_agent_id },
18505
+ ...s$1.primary_model && { model: s$1.primary_model },
18506
+ ...s$1.dispatch_agents_json && (() => {
18507
+ try {
18508
+ return { dispatchAgents: JSON.parse(s$1.dispatch_agents_json) };
18509
+ } catch {
18510
+ return {};
18511
+ }
18512
+ })()
18493
18513
  };
18494
18514
  });
18495
18515
  const storyScores = stories.map((s$1) => s$1.qualityScore).filter((s$1) => s$1 !== void 0);
@@ -42707,4 +42727,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
42707
42727
 
42708
42728
  //#endregion
42709
42729
  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 };
42710
- //# sourceMappingURL=run-BnYv46or.js.map
42730
+ //# sourceMappingURL=run-AF1jEvEp.js.map
@@ -1,8 +1,8 @@
1
- import "./health-Ckl2VOPW.js";
1
+ import "./health-DMu0MJ-N.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-6ETBV23_.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-BnYv46or.js";
4
+ import "./dist-BUcEqXA1.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-AF1jEvEp.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8
 
@@ -1,5 +1,5 @@
1
- import "./dist-6ETBV23_.js";
1
+ import "./dist-BUcEqXA1.js";
2
2
  import "./version-manager-impl-BmOWu8ml.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CUs8N7Sc.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CABZfjn_.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-6ETBV23_.js";
1
+ import { createVersionManager } from "./dist-BUcEqXA1.js";
2
2
  import { execSync, spawn } from "child_process";
3
3
  import * as readline from "readline";
4
4
 
@@ -123,4 +123,4 @@ function registerUpgradeCommand(program) {
123
123
 
124
124
  //#endregion
125
125
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
126
- //# sourceMappingURL=upgrade-CUs8N7Sc.js.map
126
+ //# sourceMappingURL=upgrade-CABZfjn_.js.map
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-6ETBV23_.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-BUcEqXA1.js";
2
2
  import "./version-manager-impl-BmOWu8ml.js";
3
3
 
4
4
  export { createVersionManager };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.19.36",
3
+ "version": "0.19.37",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +0,0 @@
1
- import { AdapterRegistry } from "./dist-6ETBV23_.js";
2
- import "./adapter-registry-DXLMTmfD.js";
3
-
4
- export { AdapterRegistry };