substrate-ai 0.20.112 → 0.20.113

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-CW4d4JMj.js";
2
+ import "./adapter-registry-DIcrxjH8.js";
3
+
4
+ export { AdapterRegistry };
package/dist/cli/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import { FileKvStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-BZsEyfqX.js";
2
+ import { FileKvStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-DI5inO7P.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, InMemoryDatabaseAdapter, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createPipelineRun, createStderrLogger, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initWorkGraphSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, swallowDebug, tagRunAsBaseline, updatePipelineRun } from "../dist-NCtAx8Xo.js";
6
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-DKVXaIgo.js";
5
+ import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, InMemoryDatabaseAdapter, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createPipelineRun, createStderrLogger, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initWorkGraphSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, swallowDebug, tagRunAsBaseline, updatePipelineRun } from "../dist-CW4d4JMj.js";
6
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-BEXmYJob.js";
7
7
  import "../adapter-registry-DIcrxjH8.js";
8
- import { RunManifest, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, parseRuntimeProbes, readCurrentRunId, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck } from "../manifest-read-CgWpVLT_.js";
9
- import "../errors-CbWCo0EG.js";
8
+ import { RunManifest, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, parseRuntimeProbes, readCurrentRunId, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck } from "../manifest-read-DwpffChw.js";
9
+ import "../errors-Da7Izmsw.js";
10
10
  import "../routing-DFxoKHDt.js";
11
11
  import { WorkGraphRepository } from "../work-graph-repository-DZyJv5pV.js";
12
12
  import "../decisions-CzSIEeGP.js";
13
13
  import "../decision-router-DblHY8se.js";
14
- import "../interactive-prompt-DGRuUc6E.js";
14
+ import "../interactive-prompt-Cpke493f.js";
15
15
  import "../recovery-engine-BKGBeBnW.js";
16
16
  import "../version-manager-impl-qFBiO4Eh.js";
17
- import { registerUpgradeCommand } from "../upgrade-f-U437AC.js";
17
+ import { registerUpgradeCommand } from "../upgrade-W9n0n39E.js";
18
18
  import { Command } from "commander";
19
19
  import { fileURLToPath } from "url";
20
20
  import { dirname, join, resolve } from "path";
@@ -6890,7 +6890,7 @@ async function runStatusAction(options) {
6890
6890
  logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
6891
6891
  }
6892
6892
  if (run === void 0) {
6893
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-DDuluQFx.js");
6893
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-Bc0Q5hGJ.js");
6894
6894
  const substrateDirPath = join(projectRoot, ".substrate");
6895
6895
  const processInfo = inspectProcessTree$1({
6896
6896
  projectRoot,
@@ -7838,7 +7838,7 @@ function defaultSupervisorDeps() {
7838
7838
  if (cached === null) {
7839
7839
  const { AdapterRegistry: AR } = await import(
7840
7840
  /* @vite-ignore */
7841
- "../adapter-registry-MDBNDWLV.js"
7841
+ "../adapter-registry-Dv83m9Uh.js"
7842
7842
  );
7843
7843
  cached = new AR();
7844
7844
  await cached.discoverAndRegister();
@@ -8405,11 +8405,11 @@ async function runSupervisorAction(options, deps = {}) {
8405
8405
  try {
8406
8406
  const { createExperimenter } = await import(
8407
8407
  /* @vite-ignore */
8408
- "../experimenter--g818ryF.js"
8408
+ "../experimenter-Dvo-LfAe.js"
8409
8409
  );
8410
8410
  const { getLatestRun: getLatest } = await import(
8411
8411
  /* @vite-ignore */
8412
- "../decisions-U6v6DTBL.js"
8412
+ "../decisions-BM12_hm6.js"
8413
8413
  );
8414
8414
  const expAdapter = createDatabaseAdapter({
8415
8415
  backend: "auto",
@@ -8419,7 +8419,7 @@ async function runSupervisorAction(options, deps = {}) {
8419
8419
  await initSchema(expAdapter);
8420
8420
  const { runRunAction: runPipeline } = await import(
8421
8421
  /* @vite-ignore */
8422
- "../run-B7lFIS08.js"
8422
+ "../run-BTr8rP21.js"
8423
8423
  );
8424
8424
  const runStoryFn = async (opts) => {
8425
8425
  const exitCode = await runPipeline({
@@ -8944,7 +8944,7 @@ async function runMetricsAction(options) {
8944
8944
  const routingConfigPath = join(dbDir, "routing.yml");
8945
8945
  let routingConfig = null;
8946
8946
  if (existsSync$1(routingConfigPath)) try {
8947
- const { loadModelRoutingConfig } = await import("../routing-Dnm12Fum.js");
8947
+ const { loadModelRoutingConfig } = await import("../routing-BiT4IXk2.js");
8948
8948
  routingConfig = loadModelRoutingConfig(routingConfigPath);
8949
8949
  } catch {}
8950
8950
  if (routingConfig === null) routingConfig = {
@@ -13226,8 +13226,8 @@ async function createProgram() {
13226
13226
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
13227
13227
  function checkForUpdatesInBackground(currentVersion) {
13228
13228
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
13229
- import("../upgrade-DPg4GENq.js").then(async () => {
13230
- const { createVersionManager } = await import("../version-manager-impl-NE_GqZQu.js");
13229
+ import("../upgrade-BciwetMn.js").then(async () => {
13230
+ const { createVersionManager } = await import("../version-manager-impl-G82XqDMV.js");
13231
13231
  const vm = createVersionManager();
13232
13232
  const result = await vm.checkForUpdates();
13233
13233
  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-NCtAx8Xo.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-CW4d4JMj.js";
2
2
  import "./decisions-CzSIEeGP.js";
3
3
 
4
4
  export { getLatestRun };
@@ -4828,6 +4828,37 @@ const noopLogger = {
4828
4828
  warn: () => {},
4829
4829
  error: () => {}
4830
4830
  };
4831
+ /**
4832
+ * Transient Dolt CLI lock errors. When multiple `dolt sql -q` subprocesses (or
4833
+ * a foreign process) touch the same repo's noms manifest concurrently, the
4834
+ * losers fail with "database is read only" / "cannot update manifest". The lock
4835
+ * releases in ~10-100ms, so a bounded retry-with-backoff recovers cleanly.
4836
+ *
4837
+ * This is substrate's CLI-mode concurrency fix (v0.20.113, F1): under
4838
+ * `concurrency:3` + the telemetry IngestionServer, simultaneous CLI writes to
4839
+ * `.substrate/state` collided 146+ times in one run, breaking wg_stories
4840
+ * updates, telemetry persistence, and the auto-commit step. The per-instance
4841
+ * promise mutex serializes promises but not the OS-level manifest lock release,
4842
+ * and cross-process writers bypass it entirely — so retry is the topology-
4843
+ * independent fix. (Pool/sql-server mode avoids this via MVCC and is unaffected.)
4844
+ */
4845
+ const TRANSIENT_LOCK_RE = /database is read only|cannot update manifest|manifest.*lock|resource temporarily unavailable/i;
4846
+ /** Backoff schedule (ms) for transient-lock retries. Length = max retries. */
4847
+ const CLI_RETRY_BACKOFF_MS = [
4848
+ 50,
4849
+ 150,
4850
+ 400,
4851
+ 800,
4852
+ 1500
4853
+ ];
4854
+ function isTransientLockError(err) {
4855
+ const msg = err instanceof Error ? `${err.message}` : String(err);
4856
+ const stderr = err?.stderr ?? "";
4857
+ return TRANSIENT_LOCK_RE.test(msg) || TRANSIENT_LOCK_RE.test(stderr);
4858
+ }
4859
+ function sleep(ms) {
4860
+ return new Promise((resolve$2) => setTimeout(resolve$2, ms));
4861
+ }
4831
4862
  var DoltClient = class {
4832
4863
  repoPath;
4833
4864
  socketPath;
@@ -4918,13 +4949,13 @@ var DoltClient = class {
4918
4949
  const batchSql = `BEGIN; ${statements.join("; ")}; COMMIT`;
4919
4950
  await this._withCliLock(async () => {
4920
4951
  try {
4921
- await runExecFile("dolt", [
4952
+ await this._runDoltWithRetry([
4922
4953
  "sql",
4923
4954
  "-q",
4924
4955
  batchSql,
4925
4956
  "--result-format",
4926
4957
  "json"
4927
- ], { cwd: this.repoPath });
4958
+ ], "transact");
4928
4959
  } catch (err) {
4929
4960
  throw new DoltQueryError(batchSql, err instanceof Error ? err.message : String(err));
4930
4961
  }
@@ -4967,6 +4998,26 @@ var DoltClient = class {
4967
4998
  return prev.then(fn).finally(() => release());
4968
4999
  }
4969
5000
  /**
5001
+ * Run a `dolt` CLI subprocess, retrying on transient noms-manifest lock
5002
+ * contention ("database is read only" / "cannot update manifest"). See
5003
+ * TRANSIENT_LOCK_RE for the rationale. Non-transient errors throw immediately
5004
+ * on the first attempt. The final attempt's error propagates unchanged so the
5005
+ * caller's DoltQueryError wrapping is preserved. (v0.20.113, F1.)
5006
+ */
5007
+ async _runDoltWithRetry(args, label) {
5008
+ let lastErr;
5009
+ for (let attempt = 0; attempt <= CLI_RETRY_BACKOFF_MS.length; attempt++) try {
5010
+ return await runExecFile("dolt", args, { cwd: this.repoPath });
5011
+ } catch (err) {
5012
+ lastErr = err;
5013
+ if (!isTransientLockError(err) || attempt === CLI_RETRY_BACKOFF_MS.length) throw err;
5014
+ const backoff = CLI_RETRY_BACKOFF_MS[attempt];
5015
+ this._log.warn(`[dolt-client] transient lock on ${label} (attempt ${attempt + 1}/${CLI_RETRY_BACKOFF_MS.length + 1}); retrying in ${backoff}ms`);
5016
+ await sleep(backoff);
5017
+ }
5018
+ throw lastErr;
5019
+ }
5020
+ /**
4970
5021
  * Substitute `?` placeholders in a SQL string with properly escaped literal
4971
5022
  * values from the `params` array. Used by both `_queryCli` and the CLI
4972
5023
  * `transact` path to produce a fully-resolved SQL string for shell execution.
@@ -4993,7 +5044,7 @@ var DoltClient = class {
4993
5044
  "--result-format",
4994
5045
  "json"
4995
5046
  ];
4996
- const { stdout } = await runExecFile("dolt", args, { cwd: this.repoPath });
5047
+ const { stdout } = await this._runDoltWithRetry(args, "query");
4997
5048
  const lines = (stdout || "").trim().split("\n").filter(Boolean);
4998
5049
  const lastLine = lines.length > 0 ? lines[lines.length - 1] : "{\"rows\":[]}";
4999
5050
  const parsed = JSON.parse(lastLine);
@@ -5025,7 +5076,7 @@ var DoltClient = class {
5025
5076
  async execArgs(args) {
5026
5077
  return this._withCliLock(async () => {
5027
5078
  try {
5028
- const { stdout } = await runExecFile("dolt", args, { cwd: this.repoPath });
5079
+ const { stdout } = await this._runDoltWithRetry(args, "exec");
5029
5080
  return stdout;
5030
5081
  } catch (err) {
5031
5082
  const detail = err instanceof Error ? err.message : String(err);
@@ -11222,4 +11273,4 @@ async function callLLM(params) {
11222
11273
 
11223
11274
  //#endregion
11224
11275
  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, InMemoryDatabaseAdapter, 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, classifyVersionGap, compareRunMetrics, createAmendmentRun, createConfigSystem, createDatabaseAdapter as createDatabaseAdapter$1, createDecision, createExperimenter, createPipelineRun, createRequirement, createStderrLogger, 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, initWorkGraphSchema, initializeDolt, listRequirements, listRunMetrics, loadModelRoutingConfig, loadParentRunDecisions, registerArtifact, resolvePromptFile, supersedeDecision, swallowDebug, tagRunAsBaseline, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics };
11225
- //# sourceMappingURL=dist-NCtAx8Xo.js.map
11276
+ //# sourceMappingURL=dist-CW4d4JMj.js.map
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-NCtAx8Xo.js";
1
+ import { AdtError } from "./dist-CW4d4JMj.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-CbWCo0EG.js.map
74
+ //# sourceMappingURL=errors-Da7Izmsw.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-NCtAx8Xo.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-CW4d4JMj.js";
2
2
 
3
3
  export { createExperimenter };
@@ -1,7 +1,7 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BZsEyfqX.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-DI5inO7P.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-NCtAx8Xo.js";
4
- import "./manifest-read-CgWpVLT_.js";
3
+ import "./dist-CW4d4JMj.js";
4
+ import "./manifest-read-DwpffChw.js";
5
5
  import "./work-graph-repository-DZyJv5pV.js";
6
6
  import "./decisions-CzSIEeGP.js";
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-NCtAx8Xo.js";
3
- import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-CgWpVLT_.js";
2
+ import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-CW4d4JMj.js";
3
+ import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-DwpffChw.js";
4
4
  import { createRequire } from "module";
5
5
  import { dirname, join } from "path";
6
6
  import { existsSync, readFileSync } from "node:fs";
@@ -1000,4 +1000,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
1000
1000
 
1001
1001
  //#endregion
1002
1002
  export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, runHealthAction, validateStoryKey };
1003
- //# sourceMappingURL=health-BZsEyfqX.js.map
1003
+ //# sourceMappingURL=health-DI5inO7P.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-NCtAx8Xo.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-CW4d4JMj.js";
4
4
  import "./adapter-registry-DIcrxjH8.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-CbWCo0EG.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-Da7Izmsw.js";
6
6
 
7
7
  //#region src/core/di.ts
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-CgWpVLT_.js";
2
+ import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-DwpffChw.js";
3
3
  import { join } from "node:path";
4
4
  import { mkdir, readFile, writeFile } from "node:fs/promises";
5
5
  import * as readline from "node:readline";
@@ -180,4 +180,4 @@ async function runInteractivePrompt(decisionContext) {
180
180
 
181
181
  //#endregion
182
182
  export { runInteractivePrompt };
183
- //# sourceMappingURL=interactive-prompt-DGRuUc6E.js.map
183
+ //# sourceMappingURL=interactive-prompt-Cpke493f.js.map
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-NCtAx8Xo.js";
2
+ import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-CW4d4JMj.js";
3
3
  import * as path$1 from "path";
4
4
  import { join } from "path";
5
5
  import { readFile } from "fs/promises";
@@ -2868,7 +2868,7 @@ function probesInvokeProductionTrigger(probes) {
2868
2868
  for (const probe of probes) for (const pattern of TRIGGER_COMMAND_PATTERNS) if (pattern.test(probe.command)) return true;
2869
2869
  return false;
2870
2870
  }
2871
- const defaultExecutors = { host: (probe) => executeProbeOnHost(probe, { cwd: process.cwd() }) };
2871
+ const defaultExecutors = { host: (probe, cwd) => executeProbeOnHost(probe, { cwd: cwd ?? process.cwd() }) };
2872
2872
  var RuntimeProbeCheck = class {
2873
2873
  name = "runtime-probes";
2874
2874
  tier = "A";
@@ -2953,7 +2953,7 @@ var RuntimeProbeCheck = class {
2953
2953
  });
2954
2954
  continue;
2955
2955
  }
2956
- const result = await this._executors.host(probe);
2956
+ const result = await this._executors.host(probe, context.workingDir);
2957
2957
  if (result.outcome === "pass") continue;
2958
2958
  const descriptor = probe.description ? ` (${probe.description})` : "";
2959
2959
  if (result.outcome === "timeout") {
@@ -5845,4 +5845,4 @@ async function resolveRunManifest(dbRoot, runId) {
5845
5845
 
5846
5846
  //#endregion
5847
5847
  export { FindingsInjector, RunManifest, RuntimeProbeListSchema, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, readCurrentRunId, renderFindings, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck, runStaleVerificationRecovery };
5848
- //# sourceMappingURL=manifest-read-CgWpVLT_.js.map
5848
+ //# sourceMappingURL=manifest-read-DwpffChw.js.map
@@ -1,6 +1,6 @@
1
1
  import "../../logger-KeHncl-f.js";
2
- import "../../dist-NCtAx8Xo.js";
3
- import "../../manifest-read-CgWpVLT_.js";
4
- import { runInteractivePrompt } from "../../interactive-prompt-DGRuUc6E.js";
2
+ import "../../dist-CW4d4JMj.js";
3
+ import "../../manifest-read-DwpffChw.js";
4
+ import { runInteractivePrompt } from "../../interactive-prompt-Cpke493f.js";
5
5
 
6
6
  export { runInteractivePrompt };
@@ -1,4 +1,4 @@
1
- import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-NCtAx8Xo.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-CW4d4JMj.js";
2
2
  import "./routing-DFxoKHDt.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,11 +1,11 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-BZsEyfqX.js";
1
+ import { BMAD_BASELINE_TOKENS_FULL, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-DI5inO7P.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, classifyVersionGap, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, createStderrLogger, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-NCtAx8Xo.js";
5
- import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-CgWpVLT_.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, classifyVersionGap, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, createStderrLogger, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-CW4d4JMj.js";
5
+ import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-DwpffChw.js";
6
6
  import { WorkGraphRepository, detectCycles } from "./work-graph-repository-DZyJv5pV.js";
7
7
  import { deriveExitCode, routeDecision } from "./decision-router-DblHY8se.js";
8
- import { runInteractivePrompt } from "./interactive-prompt-DGRuUc6E.js";
8
+ import { runInteractivePrompt } from "./interactive-prompt-Cpke493f.js";
9
9
  import { runRecoveryEngine } from "./recovery-engine-BKGBeBnW.js";
10
10
  import { basename, dirname, extname, join } from "path";
11
11
  import { access, readFile, readdir, stat } from "fs/promises";
@@ -46998,7 +46998,7 @@ async function runFullPipeline(options) {
46998
46998
  */
46999
46999
  async function emitPreDispatchVersionAdvisory(currentVersion) {
47000
47000
  if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
47001
- const { createVersionManager } = await import("./version-manager-impl-NE_GqZQu.js");
47001
+ const { createVersionManager } = await import("./version-manager-impl-G82XqDMV.js");
47002
47002
  const vm = createVersionManager();
47003
47003
  const result = await vm.checkForUpdates(true);
47004
47004
  const gap = classifyVersionGap(currentVersion, result.latestVersion);
@@ -47095,4 +47095,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47095
47095
 
47096
47096
  //#endregion
47097
47097
  export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR$1 as GLOBSTAR, GitClient, GrammarLoader, Minimatch$1 as Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape$1 as escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runRunAction, runSolutioningPhase, unescape$1 as unescape, validateStopAfterFromConflict, wireNdjsonEmitter };
47098
- //# sourceMappingURL=run-DKVXaIgo.js.map
47098
+ //# sourceMappingURL=run-BEXmYJob.js.map
@@ -1,14 +1,14 @@
1
- import "./health-BZsEyfqX.js";
1
+ import "./health-DI5inO7P.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-NCtAx8Xo.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DKVXaIgo.js";
6
- import "./manifest-read-CgWpVLT_.js";
4
+ import "./dist-CW4d4JMj.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BEXmYJob.js";
6
+ import "./manifest-read-DwpffChw.js";
7
7
  import "./routing-DFxoKHDt.js";
8
8
  import "./work-graph-repository-DZyJv5pV.js";
9
9
  import "./decisions-CzSIEeGP.js";
10
10
  import "./decision-router-DblHY8se.js";
11
- import "./interactive-prompt-DGRuUc6E.js";
11
+ import "./interactive-prompt-Cpke493f.js";
12
12
  import "./recovery-engine-BKGBeBnW.js";
13
13
 
14
14
  export { runRunAction };
@@ -1,5 +1,5 @@
1
- import "./dist-NCtAx8Xo.js";
1
+ import "./dist-CW4d4JMj.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-f-U437AC.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-W9n0n39E.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-NCtAx8Xo.js";
1
+ import { createVersionManager } from "./dist-CW4d4JMj.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-f-U437AC.js.map
126
+ //# sourceMappingURL=upgrade-W9n0n39E.js.map
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-NCtAx8Xo.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-CW4d4JMj.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.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.20.112",
3
+ "version": "0.20.113",
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-NCtAx8Xo.js";
2
- import "./adapter-registry-DIcrxjH8.js";
3
-
4
- export { AdapterRegistry };