substrate-ai 0.20.106 → 0.20.108

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-Dm37IPMW.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 { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-C5ASRMDX.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-D1xKwyaI.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, 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-CiMN31df.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-BaEjWFS6.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, 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-Dm37IPMW.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-CIMNjDBH.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-6GF2dThG.js";
9
- import "../errors-BaUaJmz9.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-927qGezm.js";
9
+ import "../errors-BaHE73L3.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-UrN13vHf.js";
14
+ import "../interactive-prompt-nDNiofTX.js";
15
15
  import "../recovery-engine-BKGBeBnW.js";
16
16
  import "../version-manager-impl-qFBiO4Eh.js";
17
- import { registerUpgradeCommand } from "../upgrade-ChJIBkkM.js";
17
+ import { registerUpgradeCommand } from "../upgrade-7KujpKbf.js";
18
18
  import { Command } from "commander";
19
19
  import { fileURLToPath } from "url";
20
20
  import { dirname, join, resolve } from "path";
@@ -6891,7 +6891,7 @@ async function runStatusAction(options) {
6891
6891
  logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
6892
6892
  }
6893
6893
  if (run === void 0) {
6894
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CrS1fVlc.js");
6894
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CxU-1KLv.js");
6895
6895
  const substrateDirPath = join(projectRoot, ".substrate");
6896
6896
  const processInfo = inspectProcessTree$1({
6897
6897
  projectRoot,
@@ -7839,7 +7839,7 @@ function defaultSupervisorDeps() {
7839
7839
  if (cached === null) {
7840
7840
  const { AdapterRegistry: AR } = await import(
7841
7841
  /* @vite-ignore */
7842
- "../adapter-registry-BQ-p9Hpj.js"
7842
+ "../adapter-registry-5zXxdGZq.js"
7843
7843
  );
7844
7844
  cached = new AR();
7845
7845
  await cached.discoverAndRegister();
@@ -8406,11 +8406,11 @@ async function runSupervisorAction(options, deps = {}) {
8406
8406
  try {
8407
8407
  const { createExperimenter } = await import(
8408
8408
  /* @vite-ignore */
8409
- "../experimenter-BrZXRFim.js"
8409
+ "../experimenter-BW8Bab4C.js"
8410
8410
  );
8411
8411
  const { getLatestRun: getLatest } = await import(
8412
8412
  /* @vite-ignore */
8413
- "../decisions-od6wx5ZD.js"
8413
+ "../decisions-BF76Y5h7.js"
8414
8414
  );
8415
8415
  const expAdapter = createDatabaseAdapter({
8416
8416
  backend: "auto",
@@ -8420,7 +8420,7 @@ async function runSupervisorAction(options, deps = {}) {
8420
8420
  await initSchema(expAdapter);
8421
8421
  const { runRunAction: runPipeline } = await import(
8422
8422
  /* @vite-ignore */
8423
- "../run-BPqjp1vn.js"
8423
+ "../run-CtdP1-q9.js"
8424
8424
  );
8425
8425
  const runStoryFn = async (opts) => {
8426
8426
  const exitCode = await runPipeline({
@@ -8928,10 +8928,7 @@ async function runMetricsAction(options) {
8928
8928
  if (routingRecommendations === true) {
8929
8929
  const dbRoot$1 = await resolveMainRepoRoot(projectRoot);
8930
8930
  const dbDir = join(dbRoot$1, ".substrate");
8931
- const stateStore = createStateStore({
8932
- backend: "file",
8933
- basePath: dbDir
8934
- });
8931
+ const stateStore = new FileKvStore({ basePath: dbDir });
8935
8932
  await stateStore.initialize();
8936
8933
  try {
8937
8934
  const runIndexRaw = await stateStore.getMetric("__global__", "phase_token_breakdown_runs");
@@ -8948,7 +8945,7 @@ async function runMetricsAction(options) {
8948
8945
  const routingConfigPath = join(dbDir, "routing.yml");
8949
8946
  let routingConfig = null;
8950
8947
  if (existsSync$1(routingConfigPath)) try {
8951
- const { loadModelRoutingConfig } = await import("../routing-DLQCZ9gV.js");
8948
+ const { loadModelRoutingConfig } = await import("../routing-CkUTlM3M.js");
8952
8949
  routingConfig = loadModelRoutingConfig(routingConfigPath);
8953
8950
  } catch {}
8954
8951
  if (routingConfig === null) routingConfig = {
@@ -9152,7 +9149,7 @@ async function runMetricsAction(options) {
9152
9149
  });
9153
9150
  const phaseBreakdownMap = {};
9154
9151
  try {
9155
- const kvStore = new FileStateStore({ basePath: join(dbRoot, ".substrate") });
9152
+ const kvStore = new FileKvStore({ basePath: join(dbRoot, ".substrate") });
9156
9153
  for (const run$1 of runs) {
9157
9154
  const raw = await kvStore.getMetric(run$1.run_id, "phase_token_breakdown");
9158
9155
  phaseBreakdownMap[run$1.run_id] = raw !== void 0 ? raw : null;
@@ -11784,7 +11781,7 @@ const logger$3 = createLogger("cli:routing");
11784
11781
  function registerRoutingCommand(program) {
11785
11782
  program.command("routing").description("Show routing configuration and auto-tune history").option("--history", "Show the routing auto-tune log (model changes applied)").option("--output-format <format>", "Output format: text or json", "text").action(async (options) => {
11786
11783
  const dbRoot = await resolveMainRepoRoot(process.cwd());
11787
- const store = new FileStateStore({ basePath: join$1(dbRoot, ".substrate") });
11784
+ const store = new FileKvStore({ basePath: join$1(dbRoot, ".substrate") });
11788
11785
  try {
11789
11786
  await store.initialize();
11790
11787
  if (options.history === true) {
@@ -13133,8 +13130,8 @@ async function createProgram() {
13133
13130
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
13134
13131
  function checkForUpdatesInBackground(currentVersion) {
13135
13132
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
13136
- import("../upgrade-CgNKSEI9.js").then(async () => {
13137
- const { createVersionManager } = await import("../version-manager-impl-AQBXyT3J.js");
13133
+ import("../upgrade-fViYOn8u.js").then(async () => {
13134
+ const { createVersionManager } = await import("../version-manager-impl-brvj1EYW.js");
13138
13135
  const vm = createVersionManager();
13139
13136
  const result = await vm.checkForUpdates();
13140
13137
  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-CiMN31df.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-Dm37IPMW.js";
2
2
  import "./decisions-CzSIEeGP.js";
3
3
 
4
4
  export { getLatestRun };
@@ -2970,9 +2970,10 @@ async function initMonitorSchema(adapter) {
2970
2970
  * `build_results`, `review_verdicts` (+ vestigial `_schema_version`) were
2971
2971
  * defined as the substrate-state surface in `schema.sql`. Ship 1 (v0.20.92)
2972
2972
  * excised the corresponding DoltStateStore CRUD methods after auditing every
2973
- * production project (ynab, quant) and finding all six tables empty — the
2974
- * orchestrator wires `FileStateStore` (in-memory), so DoltStateStore's write
2975
- * methods never fired and these tables were perpetually empty.
2973
+ * production project (ynab, quant) and finding all six tables empty in
2974
+ * production. The Item 7 arc (v0.20.106/v0.20.107) then verified empirically
2975
+ * that the orchestrator's `stateStore?` prop was undefined in 100% of
2976
+ * production callers, confirming the tables had no writer path at all.
2976
2977
  *
2977
2978
  * Ship 7 (v0.20.98) deleted the vestigial `_schema_version` table the same
2978
2979
  * way; Ship 8 (v0.20.99) extends that pattern to the remaining six legacy
@@ -11250,4 +11251,4 @@ async function callLLM(params) {
11250
11251
 
11251
11252
  //#endregion
11252
11253
  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, 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 };
11253
- //# sourceMappingURL=dist-CiMN31df.js.map
11254
+ //# sourceMappingURL=dist-Dm37IPMW.js.map
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-CiMN31df.js";
1
+ import { AdtError } from "./dist-Dm37IPMW.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-BaUaJmz9.js.map
74
+ //# sourceMappingURL=errors-BaHE73L3.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-CiMN31df.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-Dm37IPMW.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-C5ASRMDX.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-D1xKwyaI.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-CiMN31df.js";
4
- import "./manifest-read-6GF2dThG.js";
3
+ import "./dist-Dm37IPMW.js";
4
+ import "./manifest-read-927qGezm.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-CiMN31df.js";
3
- import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-6GF2dThG.js";
2
+ import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-Dm37IPMW.js";
3
+ import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-927qGezm.js";
4
4
  import { createRequire } from "module";
5
5
  import { dirname, join } from "path";
6
6
  import { existsSync, readFileSync } from "node:fs";
@@ -402,44 +402,15 @@ function formatPipelineSummary(run, tokenSummary, decisionsCount, storiesCount,
402
402
 
403
403
  //#endregion
404
404
  //#region src/modules/state/file-store.ts
405
- var FileStateStore = class {
405
+ var FileKvStore = class {
406
406
  _basePath;
407
- _stories = new Map();
408
- _metrics = [];
409
- _contracts = new Map();
410
- _contractVerifications = new Map();
411
- /** Key-value metrics store: outer key = runId, inner key = metric key */
407
+ /** Key-value store: outer key = runId (or '__global__'), inner key = metric key. */
412
408
  _kvMetrics = new Map();
413
409
  constructor(options = {}) {
414
410
  this._basePath = options.basePath;
415
411
  }
416
412
  async initialize() {}
417
413
  async close() {}
418
- async setStoryState(storyKey, state) {
419
- this._stories.set(storyKey, {
420
- ...state,
421
- storyKey
422
- });
423
- }
424
- async queryStories(filter) {
425
- const all = Array.from(this._stories.values());
426
- return all.filter((record) => {
427
- if (filter.phase !== void 0) {
428
- const phases = Array.isArray(filter.phase) ? filter.phase : [filter.phase];
429
- if (!phases.includes(record.phase)) return false;
430
- }
431
- if (filter.sprint !== void 0 && record.sprint !== filter.sprint) return false;
432
- if (filter.storyKey !== void 0 && record.storyKey !== filter.storyKey) return false;
433
- return true;
434
- });
435
- }
436
- async recordMetric(metric) {
437
- const record = {
438
- ...metric,
439
- recordedAt: metric.recordedAt ?? new Date().toISOString()
440
- };
441
- this._metrics.push(record);
442
- }
443
414
  async setMetric(runId, key, value) {
444
415
  let runMap = this._kvMetrics.get(runId);
445
416
  if (runMap === void 0) {
@@ -470,30 +441,6 @@ var FileStateStore = class {
470
441
  const filePath = join$1(this._basePath, "kv-metrics.json");
471
442
  await writeFile(filePath, JSON.stringify(serialized, null, 2), "utf-8");
472
443
  }
473
- async setContracts(storyKey, contracts) {
474
- this._contracts.set(storyKey, contracts.map((c) => ({ ...c })));
475
- }
476
- async queryContracts(filter) {
477
- const all = [];
478
- for (const records of this._contracts.values()) for (const r of records) all.push(r);
479
- return all.filter((r) => {
480
- if (filter?.storyKey !== void 0 && r.storyKey !== filter.storyKey) return false;
481
- if (filter?.direction !== void 0 && r.direction !== filter.direction) return false;
482
- return true;
483
- });
484
- }
485
- async setContractVerification(storyKey, results) {
486
- this._contractVerifications.set(storyKey, results.map((r) => ({ ...r })));
487
- if (this._basePath !== void 0) {
488
- const serialized = {};
489
- for (const [key, records] of this._contractVerifications) serialized[key] = records;
490
- const filePath = join$1(this._basePath, "contract-verifications.json");
491
- await writeFile(filePath, JSON.stringify(serialized, null, 2), "utf-8");
492
- }
493
- }
494
- async getHistory(_limit) {
495
- return [];
496
- }
497
444
  };
498
445
 
499
446
  //#endregion
@@ -557,14 +504,6 @@ var DoltStateStore = class {
557
504
  //#endregion
558
505
  //#region src/modules/state/index.ts
559
506
  /**
560
- * Create a StateStore for orchestrator use. Returns a FileStateStore — the
561
- * Dolt backend is no longer routed through this factory (use
562
- * `createDoltOperatorReader` for operator-side Dolt reads).
563
- */
564
- function createStateStore(config = {}) {
565
- return new FileStateStore({ basePath: config.basePath });
566
- }
567
- /**
568
507
  * Create a DoltOperatorReader for CLI operator commands (history, routing,
569
508
  * metrics, health). Constructs a DoltClient against `<basePath>/.dolt/` and
570
509
  * exposes only the read-side surface meaningful for operators.
@@ -1060,5 +999,5 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
1060
999
  }
1061
1000
 
1062
1001
  //#endregion
1063
- export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDoltOperatorReader, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, runHealthAction, validateStoryKey };
1064
- //# sourceMappingURL=health-C5ASRMDX.js.map
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-D1xKwyaI.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-CiMN31df.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-Dm37IPMW.js";
4
4
  import "./adapter-registry-DIcrxjH8.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-BaUaJmz9.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-BaHE73L3.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-6GF2dThG.js";
2
+ import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-927qGezm.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-UrN13vHf.js.map
183
+ //# sourceMappingURL=interactive-prompt-nDNiofTX.js.map
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-CiMN31df.js";
2
+ import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-Dm37IPMW.js";
3
3
  import * as path$1 from "path";
4
4
  import { join } from "path";
5
5
  import { readFile } from "fs/promises";
@@ -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-6GF2dThG.js.map
5848
+ //# sourceMappingURL=manifest-read-927qGezm.js.map
@@ -1,6 +1,6 @@
1
1
  import "../../logger-KeHncl-f.js";
2
- import "../../dist-CiMN31df.js";
3
- import "../../manifest-read-6GF2dThG.js";
4
- import { runInteractivePrompt } from "../../interactive-prompt-UrN13vHf.js";
2
+ import "../../dist-Dm37IPMW.js";
3
+ import "../../manifest-read-927qGezm.js";
4
+ import { runInteractivePrompt } from "../../interactive-prompt-nDNiofTX.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-CiMN31df.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-Dm37IPMW.js";
2
2
  import "./routing-DFxoKHDt.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,11 +1,11 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-C5ASRMDX.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-D1xKwyaI.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, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-CiMN31df.js";
5
- import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-6GF2dThG.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, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-Dm37IPMW.js";
5
+ import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-927qGezm.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-UrN13vHf.js";
8
+ import { runInteractivePrompt } from "./interactive-prompt-nDNiofTX.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";
@@ -45852,7 +45852,7 @@ async function runRunAction(options) {
45852
45852
  }
45853
45853
  let routingTuner;
45854
45854
  if (routingConfig !== void 0) {
45855
- const kvStateStore = new FileStateStore({ basePath: join(dbRoot, ".substrate") });
45855
+ const kvStateStore = new FileKvStore({ basePath: join(dbRoot, ".substrate") });
45856
45856
  routingTokenAccumulator = new RoutingTokenAccumulator(routingConfig, kvStateStore, logger);
45857
45857
  eventBus.on("routing:model-selected", (payload) => {
45858
45858
  routingTokenAccumulator.onRoutingSelected({
@@ -46954,7 +46954,7 @@ async function runFullPipeline(options) {
46954
46954
  */
46955
46955
  async function emitPreDispatchVersionAdvisory(currentVersion) {
46956
46956
  if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
46957
- const { createVersionManager } = await import("./version-manager-impl-AQBXyT3J.js");
46957
+ const { createVersionManager } = await import("./version-manager-impl-brvj1EYW.js");
46958
46958
  const vm = createVersionManager();
46959
46959
  const result = await vm.checkForUpdates(true);
46960
46960
  const gap = classifyVersionGap(currentVersion, result.latestVersion);
@@ -47051,4 +47051,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47051
47051
 
47052
47052
  //#endregion
47053
47053
  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 };
47054
- //# sourceMappingURL=run-BaEjWFS6.js.map
47054
+ //# sourceMappingURL=run-CIMNjDBH.js.map
@@ -1,14 +1,14 @@
1
- import "./health-C5ASRMDX.js";
1
+ import "./health-D1xKwyaI.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-CiMN31df.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BaEjWFS6.js";
6
- import "./manifest-read-6GF2dThG.js";
4
+ import "./dist-Dm37IPMW.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-CIMNjDBH.js";
6
+ import "./manifest-read-927qGezm.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-UrN13vHf.js";
11
+ import "./interactive-prompt-nDNiofTX.js";
12
12
  import "./recovery-engine-BKGBeBnW.js";
13
13
 
14
14
  export { runRunAction };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-CiMN31df.js";
1
+ import { createVersionManager } from "./dist-Dm37IPMW.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-ChJIBkkM.js.map
126
+ //# sourceMappingURL=upgrade-7KujpKbf.js.map
@@ -1,5 +1,5 @@
1
- import "./dist-CiMN31df.js";
1
+ import "./dist-Dm37IPMW.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-ChJIBkkM.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-7KujpKbf.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-CiMN31df.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-Dm37IPMW.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.106",
3
+ "version": "0.20.108",
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-CiMN31df.js";
2
- import "./adapter-registry-DIcrxjH8.js";
3
-
4
- export { AdapterRegistry };