substrate-ai 0.20.84 → 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-DsiQdegK.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-C3XJLgze.js"
8439
+ "../run-PzGF_iNE.js"
8440
8440
  );
8441
8441
  const runStoryFn = async (opts) => {
8442
8442
  const exitCode = await runPipeline({
@@ -6542,7 +6542,7 @@ async function runCreateStory(deps, params) {
6542
6542
  };
6543
6543
  }
6544
6544
  const implementationDecisions = await getImplementationDecisions(deps, pipelineRunId);
6545
- const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.projectRoot, storyKey);
6545
+ const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.parentProjectRoot ?? deps.projectRoot, storyKey);
6546
6546
  let effectiveSourceAcHash = source_ac_hash;
6547
6547
  if (epicShardContent.length > 0) {
6548
6548
  const storySection = extractStorySection(epicShardContent, storyKey);
@@ -7053,7 +7053,7 @@ function getEpicShard(decisions, epicId, projectRoot, storyKey) {
7053
7053
  }, "Story section absent in decisions-store shard — attempting file-based fallback before returning stale shard");
7054
7054
  }
7055
7055
  if (projectRoot) {
7056
- const fallback = readEpicShardFromFile(projectRoot, epicId);
7056
+ const fallback = readEpicShardFromFile(projectRoot, epicId, storyKey);
7057
7057
  if (fallback) {
7058
7058
  logger$21.info({ epicId }, "Using file-based fallback for epic shard");
7059
7059
  if (storyKey) {
@@ -7129,8 +7129,9 @@ async function getArchConstraints$3(deps) {
7129
7129
  }, "Architecture constraints summarized to fit create-story budget");
7130
7130
  return summarized.slice(0, ARCH_CONSTRAINT_MAX_CHARS);
7131
7131
  }
7132
- if (deps.projectRoot) {
7133
- const fallback = readArchConstraintsFromFile(deps.projectRoot);
7132
+ const archRoot = deps.parentProjectRoot ?? deps.projectRoot;
7133
+ if (archRoot) {
7134
+ const fallback = readArchConstraintsFromFile(archRoot);
7134
7135
  if (fallback) {
7135
7136
  logger$21.info("Using file-based fallback for architecture constraints (decisions table empty)");
7136
7137
  return fallback.length > ARCH_CONSTRAINT_MAX_CHARS ? fallback.slice(0, ARCH_CONSTRAINT_MAX_CHARS) + "\n\n[truncated for token budget]" : fallback;
@@ -7158,7 +7159,7 @@ async function getArchConstraints$3(deps) {
7158
7159
  *
7159
7160
  * Returns the matched section content, or empty string if no path matches.
7160
7161
  */
7161
- function readEpicShardFromFile(projectRoot, epicId) {
7162
+ function readEpicShardFromFile(projectRoot, epicId, storyKey) {
7162
7163
  try {
7163
7164
  const candidates = [join$1(projectRoot, "_bmad-output", "planning-artifacts", "epics.md"), join$1(projectRoot, "_bmad-output", "epics.md")];
7164
7165
  const epicsPath = candidates.find((p) => existsSync(p));
@@ -7184,7 +7185,15 @@ function readEpicShardFromFile(projectRoot, epicId) {
7184
7185
  const perEpicPattern = new RegExp(`^epic-${epicNum}-.*\\.md$`);
7185
7186
  const matches = entries.filter((e) => perEpicPattern.test(e)).sort();
7186
7187
  if (matches.length > 0) {
7187
- 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]);
7188
7197
  const content = readFileSync(perEpicPath, "utf-8");
7189
7198
  return content.trim();
7190
7199
  }
@@ -14107,6 +14116,7 @@ function createImplementationOrchestrator(deps) {
14107
14116
  contextCompiler,
14108
14117
  dispatcher,
14109
14118
  projectRoot: effectiveProjectRoot,
14119
+ parentProjectRoot: projectRoot,
14110
14120
  tokenCeilings,
14111
14121
  otlpEndpoint: _otlpEndpoint,
14112
14122
  agentId
@@ -14535,6 +14545,7 @@ function createImplementationOrchestrator(deps) {
14535
14545
  contextCompiler,
14536
14546
  dispatcher,
14537
14547
  projectRoot: effectiveProjectRoot,
14548
+ parentProjectRoot: projectRoot,
14538
14549
  tokenCeilings,
14539
14550
  otlpEndpoint: _otlpEndpoint,
14540
14551
  agentId
@@ -14591,6 +14602,7 @@ function createImplementationOrchestrator(deps) {
14591
14602
  contextCompiler,
14592
14603
  dispatcher,
14593
14604
  projectRoot: effectiveProjectRoot,
14605
+ parentProjectRoot: projectRoot,
14594
14606
  tokenCeilings,
14595
14607
  otlpEndpoint: _otlpEndpoint,
14596
14608
  agentId
@@ -14726,6 +14738,7 @@ function createImplementationOrchestrator(deps) {
14726
14738
  contextCompiler,
14727
14739
  dispatcher,
14728
14740
  projectRoot: effectiveProjectRoot,
14741
+ parentProjectRoot: projectRoot,
14729
14742
  tokenCeilings,
14730
14743
  otlpEndpoint: _otlpEndpoint,
14731
14744
  repoMapInjector,
@@ -14810,6 +14823,7 @@ function createImplementationOrchestrator(deps) {
14810
14823
  contextCompiler,
14811
14824
  dispatcher,
14812
14825
  projectRoot: effectiveProjectRoot,
14826
+ parentProjectRoot: projectRoot,
14813
14827
  tokenCeilings,
14814
14828
  otlpEndpoint: _otlpEndpoint,
14815
14829
  repoMapInjector,
@@ -15490,6 +15504,7 @@ function createImplementationOrchestrator(deps) {
15490
15504
  contextCompiler,
15491
15505
  dispatcher,
15492
15506
  projectRoot: effectiveProjectRoot,
15507
+ parentProjectRoot: projectRoot,
15493
15508
  tokenCeilings,
15494
15509
  otlpEndpoint: _otlpEndpoint,
15495
15510
  repoMapInjector,
@@ -15701,6 +15716,7 @@ function createImplementationOrchestrator(deps) {
15701
15716
  contextCompiler,
15702
15717
  dispatcher,
15703
15718
  projectRoot: effectiveProjectRoot,
15719
+ parentProjectRoot: projectRoot,
15704
15720
  tokenCeilings,
15705
15721
  otlpEndpoint: _otlpEndpoint,
15706
15722
  repoMapInjector,
@@ -15748,6 +15764,7 @@ function createImplementationOrchestrator(deps) {
15748
15764
  contextCompiler,
15749
15765
  dispatcher,
15750
15766
  projectRoot: effectiveProjectRoot,
15767
+ parentProjectRoot: projectRoot,
15751
15768
  tokenCeilings,
15752
15769
  otlpEndpoint: _otlpEndpoint,
15753
15770
  repoMapInjector,
@@ -15997,6 +16014,7 @@ function createImplementationOrchestrator(deps) {
15997
16014
  contextCompiler,
15998
16015
  dispatcher,
15999
16016
  projectRoot: effectiveProjectRoot,
16017
+ parentProjectRoot: projectRoot,
16000
16018
  tokenCeilings,
16001
16019
  otlpEndpoint: _otlpEndpoint,
16002
16020
  agentId
@@ -47136,4 +47154,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47136
47154
 
47137
47155
  //#endregion
47138
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 };
47139
- //# sourceMappingURL=run-DsiQdegK.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-DsiQdegK.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.84",
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",