substrate-ai 0.20.111 → 0.20.112

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-NCtAx8Xo.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-B-K-bN-0.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-BZsEyfqX.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-BGZiFI9J.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-7A1EUUHU.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";
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-DcGYzUFh.js";
9
- import "../errors-BzUiyd5I.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";
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-B1mN4QPJ.js";
14
+ import "../interactive-prompt-DGRuUc6E.js";
15
15
  import "../recovery-engine-BKGBeBnW.js";
16
16
  import "../version-manager-impl-qFBiO4Eh.js";
17
- import { registerUpgradeCommand } from "../upgrade-BL3czSQv.js";
17
+ import { registerUpgradeCommand } from "../upgrade-f-U437AC.js";
18
18
  import { Command } from "commander";
19
19
  import { fileURLToPath } from "url";
20
20
  import { dirname, join, resolve } from "path";
@@ -40,10 +40,6 @@ import { randomUUID as randomUUID$1 } from "crypto";
40
40
  import { createInterface as createInterface$1 } from "readline";
41
41
 
42
42
  //#region packages/core/dist/monitor/recommendation-engine.js
43
- /**
44
- * RecommendationEngine — generates routing recommendations from performance aggregates.
45
- * Migrated to @substrate-ai/core (Story 41-7)
46
- */
47
43
  var RecommendationEngine = class {
48
44
  _monitorDb;
49
45
  _filters;
@@ -56,7 +52,7 @@ var RecommendationEngine = class {
56
52
  min_sample_size: config.min_sample_size ?? 10
57
53
  };
58
54
  this._historyDays = config.recommendation_history_days ?? 90;
59
- this._logger = logger$19 ?? console;
55
+ this._logger = logger$19 ?? createStderrLogger("monitor:recommendation-engine");
60
56
  }
61
57
  generateRecommendations() {
62
58
  const sinceDate = new Date(Date.now() - this._historyDays * 24 * 60 * 60 * 1e3).toISOString();
@@ -6894,7 +6890,7 @@ async function runStatusAction(options) {
6894
6890
  logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
6895
6891
  }
6896
6892
  if (run === void 0) {
6897
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-EvY7yEBY.js");
6893
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-DDuluQFx.js");
6898
6894
  const substrateDirPath = join(projectRoot, ".substrate");
6899
6895
  const processInfo = inspectProcessTree$1({
6900
6896
  projectRoot,
@@ -7842,7 +7838,7 @@ function defaultSupervisorDeps() {
7842
7838
  if (cached === null) {
7843
7839
  const { AdapterRegistry: AR } = await import(
7844
7840
  /* @vite-ignore */
7845
- "../adapter-registry-DVrry2g2.js"
7841
+ "../adapter-registry-MDBNDWLV.js"
7846
7842
  );
7847
7843
  cached = new AR();
7848
7844
  await cached.discoverAndRegister();
@@ -8409,11 +8405,11 @@ async function runSupervisorAction(options, deps = {}) {
8409
8405
  try {
8410
8406
  const { createExperimenter } = await import(
8411
8407
  /* @vite-ignore */
8412
- "../experimenter-DrnHhYmf.js"
8408
+ "../experimenter--g818ryF.js"
8413
8409
  );
8414
8410
  const { getLatestRun: getLatest } = await import(
8415
8411
  /* @vite-ignore */
8416
- "../decisions-wR6KG0UO.js"
8412
+ "../decisions-U6v6DTBL.js"
8417
8413
  );
8418
8414
  const expAdapter = createDatabaseAdapter({
8419
8415
  backend: "auto",
@@ -8423,7 +8419,7 @@ async function runSupervisorAction(options, deps = {}) {
8423
8419
  await initSchema(expAdapter);
8424
8420
  const { runRunAction: runPipeline } = await import(
8425
8421
  /* @vite-ignore */
8426
- "../run-BISlDNAD.js"
8422
+ "../run-B7lFIS08.js"
8427
8423
  );
8428
8424
  const runStoryFn = async (opts) => {
8429
8425
  const exitCode = await runPipeline({
@@ -8948,7 +8944,7 @@ async function runMetricsAction(options) {
8948
8944
  const routingConfigPath = join(dbDir, "routing.yml");
8949
8945
  let routingConfig = null;
8950
8946
  if (existsSync$1(routingConfigPath)) try {
8951
- const { loadModelRoutingConfig } = await import("../routing-V_E4Ptz-.js");
8947
+ const { loadModelRoutingConfig } = await import("../routing-Dnm12Fum.js");
8952
8948
  routingConfig = loadModelRoutingConfig(routingConfigPath);
8953
8949
  } catch {}
8954
8950
  if (routingConfig === null) routingConfig = {
@@ -13230,8 +13226,8 @@ async function createProgram() {
13230
13226
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
13231
13227
  function checkForUpdatesInBackground(currentVersion) {
13232
13228
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
13233
- import("../upgrade-Cq0ocGd7.js").then(async () => {
13234
- const { createVersionManager } = await import("../version-manager-impl-B4cVH5X6.js");
13229
+ import("../upgrade-DPg4GENq.js").then(async () => {
13230
+ const { createVersionManager } = await import("../version-manager-impl-NE_GqZQu.js");
13235
13231
  const vm = createVersionManager();
13236
13232
  const result = await vm.checkForUpdates();
13237
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-BGZiFI9J.js";
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";
2
2
  import "./decisions-CzSIEeGP.js";
3
3
 
4
4
  export { getLatestRun };
@@ -854,6 +854,68 @@ function extractJsonAsYaml(text) {
854
854
  }
855
855
  }
856
856
 
857
+ //#endregion
858
+ //#region packages/core/dist/utils/stderr-logger.js
859
+ /**
860
+ * Stderr-routed ILogger factory.
861
+ *
862
+ * Use this instead of `console` as the default fallback for any class that
863
+ * accepts an optional ILogger. Node's `console.debug` / `console.info` are
864
+ * aliases for `console.log`, which writes to STDOUT — that contaminates
865
+ * any stdout consumer that expects clean output (e.g. `substrate run --events`
866
+ * NDJSON consumers, `--output-format json` commands, downstream parsers).
867
+ *
868
+ * v0.20.110 fixed the adapter.ts leak. v0.20.111 fixed the
869
+ * git-worktree-manager-impl.ts leak. v0.20.112 centralized the discipline:
870
+ * one shared helper, applied at every `logger ?? console` site, so future
871
+ * callers can't reintroduce the bug.
872
+ *
873
+ * Usage:
874
+ * import { createStderrLogger } from '@substrate-ai/core'
875
+ * constructor(..., logger?: ILogger) {
876
+ * this._logger = logger ?? createStderrLogger('my-module')
877
+ * }
878
+ *
879
+ * The prefix is included in every line so stderr remains useful for
880
+ * diagnostic correlation across modules — without polluting stdout.
881
+ */
882
+ /**
883
+ * Format args the same way `console.*` does — strings stay as-is, everything
884
+ * else serializes to JSON. Single-line output (newline appended by the
885
+ * stderr write).
886
+ */
887
+ function formatArgs(args) {
888
+ return args.map((a) => {
889
+ if (typeof a === "string") return a;
890
+ if (a instanceof Error) return a.message;
891
+ try {
892
+ return JSON.stringify(a);
893
+ } catch {
894
+ return String(a);
895
+ }
896
+ }).join(" ");
897
+ }
898
+ /**
899
+ * Create an ILogger that routes every level to stderr via
900
+ * `process.stderr.write`. Each line is prefixed with `[<prefix>] [<level>]`
901
+ * so operators correlating cross-module diagnostics can tell where a line
902
+ * came from.
903
+ *
904
+ * @param prefix - Module identifier used in the stderr prefix
905
+ * (e.g., 'persistence:adapter', 'git-worktree-manager')
906
+ */
907
+ function createStderrLogger(prefix) {
908
+ function emit(level, args) {
909
+ process.stderr.write(`[${prefix}] [${level}] ${formatArgs(args)}\n`);
910
+ }
911
+ return {
912
+ info: (...args) => emit("info", args),
913
+ warn: (...args) => emit("warn", args),
914
+ error: (...args) => emit("error", args),
915
+ debug: (...args) => emit("debug", args)
916
+ };
917
+ }
918
+
857
919
  //#endregion
858
920
  //#region packages/core/dist/dispatch/dispatcher-impl.js
859
921
  const SHUTDOWN_GRACE_MS = 1e4;
@@ -6514,7 +6576,7 @@ var ConfigSystemImpl = class {
6514
6576
  this._projectConfigDir = options.projectConfigDir ? resolve(options.projectConfigDir) : resolve(process.cwd(), ".substrate");
6515
6577
  this._globalConfigDir = options.globalConfigDir ? resolve(options.globalConfigDir) : resolve(homedir(), ".substrate");
6516
6578
  this._cliOverrides = options.cliOverrides ?? {};
6517
- this._logger = options.logger ?? console;
6579
+ this._logger = options.logger ?? createStderrLogger("config-system");
6518
6580
  }
6519
6581
  get isLoaded() {
6520
6582
  return this._config !== null;
@@ -7484,32 +7546,6 @@ var TelemetryNormalizer = class {
7484
7546
  //#endregion
7485
7547
  //#region packages/core/dist/telemetry/telemetry-pipeline.js
7486
7548
  /**
7487
- * TelemetryPipeline — orchestrates the full telemetry analysis pipeline.
7488
- *
7489
- * Processing flow for each batch of raw OTLP payloads:
7490
- * 1. Normalize raw OTLP → NormalizedSpan[] / NormalizedLog[] (TelemetryNormalizer)
7491
- * 2. Analyze turns via dual-track:
7492
- * a. Span-based: ITurnAnalyzer.analyze(spans) → TurnAnalysis[]
7493
- * b. Log-based: ILogTurnAnalyzer.analyze(logs) → TurnAnalysis[]
7494
- * c. Merge & deduplicate by spanId (prefer span-derived)
7495
- * 3. Compute category stats → CategoryStats[] (ICategorizer)
7496
- * 4. Compute consumer stats → ConsumerStats[] (IConsumerAnalyzer)
7497
- * 5. Score efficiency → EfficiencyScore (IEfficiencyScorer) — from merged turns
7498
- * 6. Generate recommendations → Recommendation[] (IRecommender) — from merged turns
7499
- * 7. Persist all results (ITelemetryPersistence)
7500
- *
7501
- * Design invariants:
7502
- * - Constructor injection for all dependencies
7503
- * - Never throws from processBatch() — errors are caught per-item and logged
7504
- * - Grouping by storyKey; payloads without a storyKey are skipped at the
7505
- * analysis stage (normalised data is still stored)
7506
- * - Log-only path: when no spans are present, ILogTurnAnalyzer produces turns.
7507
- *
7508
- * Duck-typed interfaces for scoring deps (implementations migrate in 41-6b).
7509
- * This allows the core package to be self-contained without importing from
7510
- * the monolith's scoring modules.
7511
- */
7512
- /**
7513
7549
  * Wires together the full OTLP analysis and persistence pipeline.
7514
7550
  *
7515
7551
  * Usage:
@@ -7537,7 +7573,7 @@ var TelemetryPipeline = class {
7537
7573
  this._efficiencyScorer = deps.efficiencyScorer;
7538
7574
  this._recommender = deps.recommender;
7539
7575
  this._persistence = deps.persistence;
7540
- this._logger = deps.logger ?? console;
7576
+ this._logger = deps.logger ?? createStderrLogger("telemetry-pipeline");
7541
7577
  }
7542
7578
  /**
7543
7579
  * Process a batch of raw OTLP payloads through the full analysis pipeline.
@@ -7837,7 +7873,7 @@ var IngestionServer = class {
7837
7873
  this._port = options.port ?? 4318;
7838
7874
  this._batchSize = options.batchSize ?? 100;
7839
7875
  this._flushIntervalMs = options.flushIntervalMs ?? 5e3;
7840
- this._logger = options.logger ?? console;
7876
+ this._logger = options.logger ?? createStderrLogger("telemetry:ingestion-server");
7841
7877
  if (options.pipeline !== void 0) this._initPipeline(options.pipeline);
7842
7878
  }
7843
7879
  /**
@@ -8062,28 +8098,10 @@ var IngestionServer = class {
8062
8098
 
8063
8099
  //#endregion
8064
8100
  //#region packages/core/dist/telemetry/turn-analyzer.js
8065
- /**
8066
- * TurnAnalyzer — computes per-turn token breakdowns from normalized spans.
8067
- *
8068
- * Takes a list of NormalizedSpan records and produces TurnAnalysis[], where
8069
- * each entry represents a root-level span (an agent "turn") with:
8070
- * - Chronological ordering (by startTime)
8071
- * - Sequential turnNumber assignment (1-N)
8072
- * - freshTokens, cacheHitRate, contextSize, contextDelta metrics
8073
- * - childSpans drill-down (tool calls within the turn)
8074
- * - isContextSpike detection (inputTokens > 2× average)
8075
- *
8076
- * Architecture constraints:
8077
- * - Constructor injection: accepts ILogger via constructor (defaults to console)
8078
- * - No external dependencies beyond types from this module
8079
- * - Zero LLM calls — pure statistical computation
8080
- *
8081
- * Migrated to @substrate-ai/core in story 41-6b.
8082
- */
8083
8101
  var TurnAnalyzer = class {
8084
8102
  _logger;
8085
8103
  constructor(logger) {
8086
- this._logger = logger ?? console;
8104
+ this._logger = logger ?? createStderrLogger("telemetry:turn-analyzer");
8087
8105
  }
8088
8106
  /**
8089
8107
  * Analyze a list of NormalizedSpan records and produce TurnAnalysis[].
@@ -8150,29 +8168,10 @@ var TurnAnalyzer = class {
8150
8168
 
8151
8169
  //#endregion
8152
8170
  //#region packages/core/dist/telemetry/log-turn-analyzer.js
8153
- /**
8154
- * LogTurnAnalyzer — computes per-turn token breakdowns from normalized log records.
8155
- *
8156
- * Takes a list of NormalizedLog records and produces TurnAnalysis[], where
8157
- * each entry represents an LLM turn derived from log data with:
8158
- * - Chronological ordering (by timestamp)
8159
- * - Sequential turnNumber assignment (1-N)
8160
- * - freshTokens, cacheHitRate, contextSize, contextDelta metrics
8161
- * - isContextSpike detection (inputTokens > 2× average)
8162
- * - Deduplication by traceId+spanId combination
8163
- *
8164
- * Architecture constraints:
8165
- * - Constructor injection: accepts ILogger via constructor (defaults to console)
8166
- * - No external dependencies beyond types from this module
8167
- * - Zero LLM calls — pure statistical computation
8168
- * - Never throws from public methods
8169
- *
8170
- * Migrated to @substrate-ai/core in story 41-6b.
8171
- */
8172
8171
  var LogTurnAnalyzer = class {
8173
8172
  _logger;
8174
8173
  constructor(logger) {
8175
- this._logger = logger ?? console;
8174
+ this._logger = logger ?? createStderrLogger("telemetry:log-turn-analyzer");
8176
8175
  }
8177
8176
  /**
8178
8177
  * Analyze a list of NormalizedLog records and produce TurnAnalysis[].
@@ -8267,23 +8266,6 @@ var LogTurnAnalyzer = class {
8267
8266
  //#endregion
8268
8267
  //#region packages/core/dist/telemetry/categorizer.js
8269
8268
  /**
8270
- * Categorizer — classifies telemetry spans into semantic categories and
8271
- * computes per-category token statistics with trend detection.
8272
- *
8273
- * Classification proceeds through three tiers:
8274
- * 1. Exact match against a lookup table of known operation names
8275
- * 2. Prefix/regex pattern match
8276
- * 3. Fuzzy case-insensitive substring match
8277
- * 4. Fallback to 'other' (overridden to 'tool_outputs' when toolName present)
8278
- *
8279
- * Architecture constraints:
8280
- * - Constructor injection: accepts ILogger via constructor (defaults to console)
8281
- * - Module-scope lookup tables to avoid recreation on every classify() call
8282
- * - Zero external dependencies beyond types from this module
8283
- *
8284
- * Migrated to @substrate-ai/core in story 41-6b.
8285
- */
8286
- /**
8287
8269
  * Tier 0: task-type to semantic category mapping.
8288
8270
  *
8289
8271
  * When a TurnAnalysis has a known taskType, the category is determined
@@ -8357,7 +8339,7 @@ const ALL_CATEGORIES = [
8357
8339
  var Categorizer = class {
8358
8340
  _logger;
8359
8341
  constructor(logger) {
8360
- this._logger = logger ?? console;
8342
+ this._logger = logger ?? createStderrLogger("telemetry:categorizer");
8361
8343
  }
8362
8344
  /**
8363
8345
  * Classify an operation into a SemanticCategory using tiered logic.
@@ -8557,26 +8539,12 @@ function extractToolNameFromSpan(span) {
8557
8539
 
8558
8540
  //#endregion
8559
8541
  //#region packages/core/dist/telemetry/consumer-analyzer.js
8560
- /**
8561
- * ConsumerAnalyzer — groups telemetry spans by consumer key and ranks by token
8562
- * consumption, producing ConsumerStats for each unique operation+tool combination.
8563
- *
8564
- * A "consumer key" is `operationName|toolName`, stable across runs and safe to
8565
- * store as a VARCHAR(300) primary-key component in Dolt.
8566
- *
8567
- * Architecture constraints:
8568
- * - Constructor injection: accepts Categorizer and ILogger (logger defaults to console)
8569
- * - Delegates classification to the injected Categorizer
8570
- * - Zero external dependencies beyond types and Categorizer from this module
8571
- *
8572
- * Migrated to @substrate-ai/core in story 41-6b.
8573
- */
8574
8542
  var ConsumerAnalyzer = class {
8575
8543
  _categorizer;
8576
8544
  _logger;
8577
8545
  constructor(categorizer, logger) {
8578
8546
  this._categorizer = categorizer;
8579
- this._logger = logger ?? console;
8547
+ this._logger = logger ?? createStderrLogger("telemetry:consumer-analyzer");
8580
8548
  }
8581
8549
  /**
8582
8550
  * Group spans by consumer key, rank by totalTokens descending, and return
@@ -8772,7 +8740,7 @@ const W_TOKEN_DENSITY = .25;
8772
8740
  var EfficiencyScorer = class {
8773
8741
  _logger;
8774
8742
  constructor(logger) {
8775
- this._logger = logger ?? console;
8743
+ this._logger = logger ?? createStderrLogger("telemetry:efficiency-scorer");
8776
8744
  }
8777
8745
  /**
8778
8746
  * Compute an efficiency score for a story given its turn analyses.
@@ -9005,7 +8973,7 @@ var EfficiencyScorer = class {
9005
8973
  var Recommender = class Recommender {
9006
8974
  _logger;
9007
8975
  constructor(logger) {
9008
- this._logger = logger ?? console;
8976
+ this._logger = logger ?? createStderrLogger("telemetry:recommender");
9009
8977
  }
9010
8978
  /**
9011
8979
  * Run all rules against the given context and return sorted recommendations.
@@ -9422,7 +9390,7 @@ var ClaudeCodeAdapter = class {
9422
9390
  adapterVersion = "1.0.0";
9423
9391
  _logger;
9424
9392
  constructor(logger) {
9425
- this._logger = logger ?? console;
9393
+ this._logger = logger ?? createStderrLogger("claude-adapter");
9426
9394
  }
9427
9395
  /**
9428
9396
  * Verify the `claude` binary is installed and responsive.
@@ -9702,7 +9670,7 @@ var CodexCLIAdapter = class {
9702
9670
  adapterVersion = "1.0.0";
9703
9671
  _logger;
9704
9672
  constructor(logger) {
9705
- this._logger = logger ?? console;
9673
+ this._logger = logger ?? createStderrLogger("codex-adapter");
9706
9674
  }
9707
9675
  /**
9708
9676
  * Verify the `codex` binary is installed and responsive.
@@ -9924,7 +9892,7 @@ var GeminiCLIAdapter = class {
9924
9892
  adapterVersion = "1.0.0";
9925
9893
  _logger;
9926
9894
  constructor(logger) {
9927
- this._logger = logger ?? console;
9895
+ this._logger = logger ?? createStderrLogger("gemini-adapter");
9928
9896
  }
9929
9897
  /**
9930
9898
  * Verify the `gemini` binary is installed and responsive.
@@ -11253,5 +11221,5 @@ async function callLLM(params) {
11253
11221
  }
11254
11222
 
11255
11223
  //#endregion
11256
- 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 };
11257
- //# sourceMappingURL=dist-BGZiFI9J.js.map
11224
+ 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
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-BGZiFI9J.js";
1
+ import { AdtError } from "./dist-NCtAx8Xo.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-BzUiyd5I.js.map
74
+ //# sourceMappingURL=errors-CbWCo0EG.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-BGZiFI9J.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-NCtAx8Xo.js";
2
2
 
3
3
  export { createExperimenter };
@@ -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-BGZiFI9J.js";
3
- import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-DcGYzUFh.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";
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-B-K-bN-0.js.map
1003
+ //# sourceMappingURL=health-BZsEyfqX.js.map
@@ -1,7 +1,7 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-B-K-bN-0.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BZsEyfqX.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-BGZiFI9J.js";
4
- import "./manifest-read-DcGYzUFh.js";
3
+ import "./dist-NCtAx8Xo.js";
4
+ import "./manifest-read-CgWpVLT_.js";
5
5
  import "./work-graph-repository-DZyJv5pV.js";
6
6
  import "./decisions-CzSIEeGP.js";
7
7
 
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-BGZiFI9J.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-NCtAx8Xo.js";
4
4
  import "./adapter-registry-DIcrxjH8.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-BzUiyd5I.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-CbWCo0EG.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-DcGYzUFh.js";
2
+ import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-CgWpVLT_.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-B1mN4QPJ.js.map
183
+ //# sourceMappingURL=interactive-prompt-DGRuUc6E.js.map
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-BGZiFI9J.js";
2
+ import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-NCtAx8Xo.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-DcGYzUFh.js.map
5848
+ //# sourceMappingURL=manifest-read-CgWpVLT_.js.map
@@ -1,6 +1,6 @@
1
1
  import "../../logger-KeHncl-f.js";
2
- import "../../dist-BGZiFI9J.js";
3
- import "../../manifest-read-DcGYzUFh.js";
4
- import { runInteractivePrompt } from "../../interactive-prompt-B1mN4QPJ.js";
2
+ import "../../dist-NCtAx8Xo.js";
3
+ import "../../manifest-read-CgWpVLT_.js";
4
+ import { runInteractivePrompt } from "../../interactive-prompt-DGRuUc6E.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-BGZiFI9J.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-NCtAx8Xo.js";
2
2
  import "./routing-DFxoKHDt.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,14 +1,14 @@
1
- import "./health-B-K-bN-0.js";
1
+ import "./health-BZsEyfqX.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-BGZiFI9J.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-7A1EUUHU.js";
6
- import "./manifest-read-DcGYzUFh.js";
4
+ import "./dist-NCtAx8Xo.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DKVXaIgo.js";
6
+ import "./manifest-read-CgWpVLT_.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-B1mN4QPJ.js";
11
+ import "./interactive-prompt-DGRuUc6E.js";
12
12
  import "./recovery-engine-BKGBeBnW.js";
13
13
 
14
14
  export { runRunAction };
@@ -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-B-K-bN-0.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-BZsEyfqX.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-BGZiFI9J.js";
5
- import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-DcGYzUFh.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";
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-B1mN4QPJ.js";
8
+ import { runInteractivePrompt } from "./interactive-prompt-DGRuUc6E.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";
@@ -383,26 +383,6 @@ async function getMergedFiles(cwd) {
383
383
  */
384
384
  const BRANCH_PREFIX = "substrate/story-";
385
385
  const DEFAULT_WORKTREE_BASE = ".substrate-worktrees";
386
- /**
387
- * Fallback logger when no ILogger is injected.
388
- *
389
- * Routes all levels to stderr via process.stderr.write — NOT to `console`.
390
- * Node's `console.debug` and `console.info` are aliases for console.log, which
391
- * writes to STDOUT. That contaminates JSON-output streams for any CLI command
392
- * that constructs a manager without explicitly passing a logger (e.g.
393
- * `substrate worktrees --output-format json`). v0.20.111 fix surfaced by the
394
- * post-v0.20.110 e2e smoke pass.
395
- */
396
- function emitDiag(level, args) {
397
- const formatted = args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" ");
398
- process.stderr.write(`[git-worktree-manager] [${level}] ${formatted}\n`);
399
- }
400
- const DEFAULT_STDERR_LOGGER = {
401
- info: (...args) => emitDiag("info", args),
402
- warn: (...args) => emitDiag("warn", args),
403
- error: (...args) => emitDiag("error", args),
404
- debug: (...args) => emitDiag("debug", args)
405
- };
406
386
  var GitWorktreeManagerImpl = class {
407
387
  _eventBus;
408
388
  _projectRoot;
@@ -420,7 +400,7 @@ var GitWorktreeManagerImpl = class {
420
400
  this._projectRoot = projectRoot;
421
401
  this._baseDirectory = baseDirectory;
422
402
  this._db = db;
423
- this._logger = logger$27 ?? DEFAULT_STDERR_LOGGER;
403
+ this._logger = logger$27 ?? createStderrLogger("git-worktree-manager");
424
404
  this._copyFiles = copyFiles;
425
405
  this._onTaskReady = ({ taskId }) => {
426
406
  this._handleTaskReady(taskId).catch((err) => {
@@ -47018,7 +46998,7 @@ async function runFullPipeline(options) {
47018
46998
  */
47019
46999
  async function emitPreDispatchVersionAdvisory(currentVersion) {
47020
47000
  if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
47021
- const { createVersionManager } = await import("./version-manager-impl-B4cVH5X6.js");
47001
+ const { createVersionManager } = await import("./version-manager-impl-NE_GqZQu.js");
47022
47002
  const vm = createVersionManager();
47023
47003
  const result = await vm.checkForUpdates(true);
47024
47004
  const gap = classifyVersionGap(currentVersion, result.latestVersion);
@@ -47115,4 +47095,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47115
47095
 
47116
47096
  //#endregion
47117
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 };
47118
- //# sourceMappingURL=run-7A1EUUHU.js.map
47098
+ //# sourceMappingURL=run-DKVXaIgo.js.map
@@ -1,5 +1,5 @@
1
- import "./dist-BGZiFI9J.js";
1
+ import "./dist-NCtAx8Xo.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-BL3czSQv.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-f-U437AC.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-BGZiFI9J.js";
1
+ import { createVersionManager } from "./dist-NCtAx8Xo.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-BL3czSQv.js.map
126
+ //# sourceMappingURL=upgrade-f-U437AC.js.map
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-BGZiFI9J.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-NCtAx8Xo.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.111",
3
+ "version": "0.20.112",
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-BGZiFI9J.js";
2
- import "./adapter-registry-DIcrxjH8.js";
3
-
4
- export { AdapterRegistry };