substrate-ai 0.20.83 → 0.20.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -3,7 +3,7 @@ import { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipel
3
3
  import { createLogger } from "../logger-KeHncl-f.js";
4
4
  import { createEventBus } from "../helpers-CElYrONe.js";
5
5
  import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, InMemoryDatabaseAdapter, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, swallowDebug, tagRunAsBaseline, updatePipelineRun } from "../dist-DCBSXUiX.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-Eqv7UsGH.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-B_B7Jr_K.js";
7
7
  import "../adapter-registry-DIcrxjH8.js";
8
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-Boipz5aP.js";
9
9
  import "../errors-D7xD-utp.js";
@@ -8436,7 +8436,7 @@ async function runSupervisorAction(options, deps = {}) {
8436
8436
  await initSchema(expAdapter);
8437
8437
  const { runRunAction: runPipeline } = await import(
8438
8438
  /* @vite-ignore */
8439
- "../run-DXazb9CF.js"
8439
+ "../run-PzGF_iNE.js"
8440
8440
  );
8441
8441
  const runStoryFn = async (opts) => {
8442
8442
  const exitCode = await runPipeline({
@@ -339,6 +339,17 @@ async function getMergedFiles(cwd) {
339
339
 
340
340
  //#endregion
341
341
  //#region packages/core/dist/git/git-worktree-manager-impl.js
342
+ /**
343
+ * Branch name prefix for substrate per-story branches.
344
+ *
345
+ * Exported as the canonical source of truth so consumers (orchestrator,
346
+ * integration tests, tooling) can compose branch names without
347
+ * independently encoding the prefix. v0.20.82 production bug:
348
+ * `orchestrator-impl.ts:4290` hardcoded `substrate/story-${storyKey}`
349
+ * while this module created `substrate/task-${taskId}` — the resulting
350
+ * merge-to-main looked at a non-existent branch. Recurrence prevention:
351
+ * all branch-name construction MUST import this constant.
352
+ */
342
353
  const BRANCH_PREFIX = "substrate/story-";
343
354
  const DEFAULT_WORKTREE_BASE = ".substrate-worktrees";
344
355
  var GitWorktreeManagerImpl = class {
@@ -6531,7 +6542,7 @@ async function runCreateStory(deps, params) {
6531
6542
  };
6532
6543
  }
6533
6544
  const implementationDecisions = await getImplementationDecisions(deps, pipelineRunId);
6534
- const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.projectRoot, storyKey);
6545
+ const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.parentProjectRoot ?? deps.projectRoot, storyKey);
6535
6546
  let effectiveSourceAcHash = source_ac_hash;
6536
6547
  if (epicShardContent.length > 0) {
6537
6548
  const storySection = extractStorySection(epicShardContent, storyKey);
@@ -7042,7 +7053,7 @@ function getEpicShard(decisions, epicId, projectRoot, storyKey) {
7042
7053
  }, "Story section absent in decisions-store shard — attempting file-based fallback before returning stale shard");
7043
7054
  }
7044
7055
  if (projectRoot) {
7045
- const fallback = readEpicShardFromFile(projectRoot, epicId);
7056
+ const fallback = readEpicShardFromFile(projectRoot, epicId, storyKey);
7046
7057
  if (fallback) {
7047
7058
  logger$21.info({ epicId }, "Using file-based fallback for epic shard");
7048
7059
  if (storyKey) {
@@ -7118,8 +7129,9 @@ async function getArchConstraints$3(deps) {
7118
7129
  }, "Architecture constraints summarized to fit create-story budget");
7119
7130
  return summarized.slice(0, ARCH_CONSTRAINT_MAX_CHARS);
7120
7131
  }
7121
- if (deps.projectRoot) {
7122
- const fallback = readArchConstraintsFromFile(deps.projectRoot);
7132
+ const archRoot = deps.parentProjectRoot ?? deps.projectRoot;
7133
+ if (archRoot) {
7134
+ const fallback = readArchConstraintsFromFile(archRoot);
7123
7135
  if (fallback) {
7124
7136
  logger$21.info("Using file-based fallback for architecture constraints (decisions table empty)");
7125
7137
  return fallback.length > ARCH_CONSTRAINT_MAX_CHARS ? fallback.slice(0, ARCH_CONSTRAINT_MAX_CHARS) + "\n\n[truncated for token budget]" : fallback;
@@ -7147,7 +7159,7 @@ async function getArchConstraints$3(deps) {
7147
7159
  *
7148
7160
  * Returns the matched section content, or empty string if no path matches.
7149
7161
  */
7150
- function readEpicShardFromFile(projectRoot, epicId) {
7162
+ function readEpicShardFromFile(projectRoot, epicId, storyKey) {
7151
7163
  try {
7152
7164
  const candidates = [join$1(projectRoot, "_bmad-output", "planning-artifacts", "epics.md"), join$1(projectRoot, "_bmad-output", "epics.md")];
7153
7165
  const epicsPath = candidates.find((p) => existsSync(p));
@@ -7173,7 +7185,15 @@ function readEpicShardFromFile(projectRoot, epicId) {
7173
7185
  const perEpicPattern = new RegExp(`^epic-${epicNum}-.*\\.md$`);
7174
7186
  const matches = entries.filter((e) => perEpicPattern.test(e)).sort();
7175
7187
  if (matches.length > 0) {
7176
- const perEpicPath = join$1(planningDir, matches[0]);
7188
+ let chosenIdx = 0;
7189
+ if (storyKey !== void 0 && matches.length > 1) for (let i = 0; i < matches.length; i++) {
7190
+ const candidateContent = readFileSync(join$1(planningDir, matches[i]), "utf-8");
7191
+ if (extractStorySection(candidateContent, storyKey) !== null) {
7192
+ chosenIdx = i;
7193
+ break;
7194
+ }
7195
+ }
7196
+ const perEpicPath = join$1(planningDir, matches[chosenIdx]);
7177
7197
  const content = readFileSync(perEpicPath, "utf-8");
7178
7198
  return content.trim();
7179
7199
  }
@@ -14096,6 +14116,7 @@ function createImplementationOrchestrator(deps) {
14096
14116
  contextCompiler,
14097
14117
  dispatcher,
14098
14118
  projectRoot: effectiveProjectRoot,
14119
+ parentProjectRoot: projectRoot,
14099
14120
  tokenCeilings,
14100
14121
  otlpEndpoint: _otlpEndpoint,
14101
14122
  agentId
@@ -14524,6 +14545,7 @@ function createImplementationOrchestrator(deps) {
14524
14545
  contextCompiler,
14525
14546
  dispatcher,
14526
14547
  projectRoot: effectiveProjectRoot,
14548
+ parentProjectRoot: projectRoot,
14527
14549
  tokenCeilings,
14528
14550
  otlpEndpoint: _otlpEndpoint,
14529
14551
  agentId
@@ -14580,6 +14602,7 @@ function createImplementationOrchestrator(deps) {
14580
14602
  contextCompiler,
14581
14603
  dispatcher,
14582
14604
  projectRoot: effectiveProjectRoot,
14605
+ parentProjectRoot: projectRoot,
14583
14606
  tokenCeilings,
14584
14607
  otlpEndpoint: _otlpEndpoint,
14585
14608
  agentId
@@ -14715,6 +14738,7 @@ function createImplementationOrchestrator(deps) {
14715
14738
  contextCompiler,
14716
14739
  dispatcher,
14717
14740
  projectRoot: effectiveProjectRoot,
14741
+ parentProjectRoot: projectRoot,
14718
14742
  tokenCeilings,
14719
14743
  otlpEndpoint: _otlpEndpoint,
14720
14744
  repoMapInjector,
@@ -14799,6 +14823,7 @@ function createImplementationOrchestrator(deps) {
14799
14823
  contextCompiler,
14800
14824
  dispatcher,
14801
14825
  projectRoot: effectiveProjectRoot,
14826
+ parentProjectRoot: projectRoot,
14802
14827
  tokenCeilings,
14803
14828
  otlpEndpoint: _otlpEndpoint,
14804
14829
  repoMapInjector,
@@ -15479,6 +15504,7 @@ function createImplementationOrchestrator(deps) {
15479
15504
  contextCompiler,
15480
15505
  dispatcher,
15481
15506
  projectRoot: effectiveProjectRoot,
15507
+ parentProjectRoot: projectRoot,
15482
15508
  tokenCeilings,
15483
15509
  otlpEndpoint: _otlpEndpoint,
15484
15510
  repoMapInjector,
@@ -15690,6 +15716,7 @@ function createImplementationOrchestrator(deps) {
15690
15716
  contextCompiler,
15691
15717
  dispatcher,
15692
15718
  projectRoot: effectiveProjectRoot,
15719
+ parentProjectRoot: projectRoot,
15693
15720
  tokenCeilings,
15694
15721
  otlpEndpoint: _otlpEndpoint,
15695
15722
  repoMapInjector,
@@ -15737,6 +15764,7 @@ function createImplementationOrchestrator(deps) {
15737
15764
  contextCompiler,
15738
15765
  dispatcher,
15739
15766
  projectRoot: effectiveProjectRoot,
15767
+ parentProjectRoot: projectRoot,
15740
15768
  tokenCeilings,
15741
15769
  otlpEndpoint: _otlpEndpoint,
15742
15770
  repoMapInjector,
@@ -15986,6 +16014,7 @@ function createImplementationOrchestrator(deps) {
15986
16014
  contextCompiler,
15987
16015
  dispatcher,
15988
16016
  projectRoot: effectiveProjectRoot,
16017
+ parentProjectRoot: projectRoot,
15989
16018
  tokenCeilings,
15990
16019
  otlpEndpoint: _otlpEndpoint,
15991
16020
  agentId
@@ -16015,7 +16044,7 @@ function createImplementationOrchestrator(deps) {
16015
16044
  }, "Test expansion failed — story verdict unchanged");
16016
16045
  }
16017
16046
  if (!noWorktree && _worktreeManager !== void 0 && _orchestratorStartBranch !== void 0 && projectRoot !== void 0) {
16018
- const branchName = `substrate/story-${storyKey}`;
16047
+ const branchName = `${BRANCH_PREFIX}${storyKey}`;
16019
16048
  logger$27.info({
16020
16049
  storyKey,
16021
16050
  branchName,
@@ -47125,4 +47154,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47125
47154
 
47126
47155
  //#endregion
47127
47156
  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 };
47128
- //# sourceMappingURL=run-Eqv7UsGH.js.map
47157
+ //# sourceMappingURL=run-B_B7Jr_K.js.map
@@ -2,7 +2,7 @@ import "./health-CuKzY0Fn.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-DCBSXUiX.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-Eqv7UsGH.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-B_B7Jr_K.js";
6
6
  import "./manifest-read-Boipz5aP.js";
7
7
  import "./routing-DFxoKHDt.js";
8
8
  import "./work-graph-repository-DZyJv5pV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.20.83",
3
+ "version": "0.20.85",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",