substrate-ai 0.20.55 → 0.20.57

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.
@@ -1,7 +1,7 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-PSnpYDAa.js";
1
+ import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-PdI4-96I.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, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-VcMmfo2w.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, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-W2emvN3F.js";
5
5
  import { basename, dirname, extname, join } from "path";
6
6
  import { access, readFile, readdir, stat } from "fs/promises";
7
7
  import { EventEmitter } from "node:events";
@@ -12749,6 +12749,13 @@ function createImplementationOrchestrator(deps) {
12749
12749
  err,
12750
12750
  storyKey
12751
12751
  }, `patchStoryState(${manifestStatus}) failed — pipeline continues`));
12752
+ } else {
12753
+ const intermediatePhase = updates.phase;
12754
+ runManifest.patchStoryState(storyKey, { phase: String(intermediatePhase) }).catch((err) => logger$26.warn({
12755
+ err,
12756
+ storyKey,
12757
+ phase: intermediatePhase
12758
+ }, "phase-persistence-write-failed — pipeline continues"));
12752
12759
  }
12753
12760
  }
12754
12761
  }
@@ -12801,6 +12808,22 @@ function createImplementationOrchestrator(deps) {
12801
12808
  function getStallThresholdMs(phase) {
12802
12809
  return phase === "IN_DEV" ? DEV_STORY_STALL_THRESHOLD_MS : DEFAULT_STALL_THRESHOLD_MS;
12803
12810
  }
12811
+ /**
12812
+ * Map an internal StoryPhase to a consumer-facing manifest-compatible status string.
12813
+ * Mirrors the PerStoryStatus values in per-story-state.ts.
12814
+ * Story 66-2: obs_2026-05-03_022 fix #2.
12815
+ */
12816
+ function storyPhaseToStatus(phase) {
12817
+ switch (phase) {
12818
+ case "COMPLETE": return "complete";
12819
+ case "ESCALATED": return "escalated";
12820
+ case "VERIFICATION_FAILED": return "verification-failed";
12821
+ case "IN_REVIEW":
12822
+ case "NEEDS_FIXES": return "in-review";
12823
+ case "PENDING": return "pending";
12824
+ default: return "dispatched";
12825
+ }
12826
+ }
12804
12827
  function startHeartbeat() {
12805
12828
  if (_heartbeatTimer !== null) return;
12806
12829
  _heartbeatTimer = setInterval(() => {
@@ -12810,11 +12833,17 @@ function createImplementationOrchestrator(deps) {
12810
12833
  for (const s$1 of _stories.values()) if (s$1.phase === "PENDING") queued++;
12811
12834
  else if (s$1.phase !== "COMPLETE" && s$1.phase !== "ESCALATED" && s$1.phase !== "VERIFICATION_FAILED") active++;
12812
12835
  const completed = _completedDispatches;
12836
+ const perStoryState = {};
12837
+ for (const [key, s$1] of _stories) perStoryState[key] = {
12838
+ phase: s$1.phase,
12839
+ status: storyPhaseToStatus(s$1.phase)
12840
+ };
12813
12841
  eventBus.emit("orchestrator:heartbeat", {
12814
12842
  runId: config.pipelineRunId ?? "",
12815
12843
  activeDispatches: active,
12816
12844
  completedDispatches: completed,
12817
- queuedDispatches: queued
12845
+ queuedDispatches: queued,
12846
+ ...Object.keys(perStoryState).length > 0 ? { perStoryState } : {}
12818
12847
  });
12819
12848
  if (config.pipelineRunId !== void 0) updatePipelineRun(db, config.pipelineRunId, { current_phase: "implementation" }).catch((err) => {
12820
12849
  logger$26.debug({ err }, "Heartbeat: failed to touch updated_at (non-fatal)");
@@ -28141,43 +28170,43 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
28141
28170
  }
28142
28171
  return uriTokens.join("");
28143
28172
  }
28144
- function resolveComponents(base$1, relative) {
28173
+ function resolveComponents(base$1, relative$1) {
28145
28174
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
28146
28175
  var skipNormalization = arguments[3];
28147
28176
  var target = {};
28148
28177
  if (!skipNormalization) {
28149
28178
  base$1 = parse$1(serialize(base$1, options), options);
28150
- relative = parse$1(serialize(relative, options), options);
28179
+ relative$1 = parse$1(serialize(relative$1, options), options);
28151
28180
  }
28152
28181
  options = options || {};
28153
- if (!options.tolerant && relative.scheme) {
28154
- target.scheme = relative.scheme;
28155
- target.userinfo = relative.userinfo;
28156
- target.host = relative.host;
28157
- target.port = relative.port;
28158
- target.path = removeDotSegments(relative.path || "");
28159
- target.query = relative.query;
28182
+ if (!options.tolerant && relative$1.scheme) {
28183
+ target.scheme = relative$1.scheme;
28184
+ target.userinfo = relative$1.userinfo;
28185
+ target.host = relative$1.host;
28186
+ target.port = relative$1.port;
28187
+ target.path = removeDotSegments(relative$1.path || "");
28188
+ target.query = relative$1.query;
28160
28189
  } else {
28161
- if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
28162
- target.userinfo = relative.userinfo;
28163
- target.host = relative.host;
28164
- target.port = relative.port;
28165
- target.path = removeDotSegments(relative.path || "");
28166
- target.query = relative.query;
28190
+ if (relative$1.userinfo !== void 0 || relative$1.host !== void 0 || relative$1.port !== void 0) {
28191
+ target.userinfo = relative$1.userinfo;
28192
+ target.host = relative$1.host;
28193
+ target.port = relative$1.port;
28194
+ target.path = removeDotSegments(relative$1.path || "");
28195
+ target.query = relative$1.query;
28167
28196
  } else {
28168
- if (!relative.path) {
28197
+ if (!relative$1.path) {
28169
28198
  target.path = base$1.path;
28170
- if (relative.query !== void 0) target.query = relative.query;
28199
+ if (relative$1.query !== void 0) target.query = relative$1.query;
28171
28200
  else target.query = base$1.query;
28172
28201
  } else {
28173
- if (relative.path.charAt(0) === "/") target.path = removeDotSegments(relative.path);
28202
+ if (relative$1.path.charAt(0) === "/") target.path = removeDotSegments(relative$1.path);
28174
28203
  else {
28175
- if ((base$1.userinfo !== void 0 || base$1.host !== void 0 || base$1.port !== void 0) && !base$1.path) target.path = "/" + relative.path;
28176
- else if (!base$1.path) target.path = relative.path;
28177
- else target.path = base$1.path.slice(0, base$1.path.lastIndexOf("/") + 1) + relative.path;
28204
+ if ((base$1.userinfo !== void 0 || base$1.host !== void 0 || base$1.port !== void 0) && !base$1.path) target.path = "/" + relative$1.path;
28205
+ else if (!base$1.path) target.path = relative$1.path;
28206
+ else target.path = base$1.path.slice(0, base$1.path.lastIndexOf("/") + 1) + relative$1.path;
28178
28207
  target.path = removeDotSegments(target.path);
28179
28208
  }
28180
- target.query = relative.query;
28209
+ target.query = relative$1.query;
28181
28210
  }
28182
28211
  target.userinfo = base$1.userinfo;
28183
28212
  target.host = base$1.host;
@@ -28185,7 +28214,7 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
28185
28214
  }
28186
28215
  target.scheme = base$1.scheme;
28187
28216
  }
28188
- target.fragment = relative.fragment;
28217
+ target.fragment = relative$1.fragment;
28189
28218
  return target;
28190
28219
  }
28191
28220
  function resolve$6(baseURI, relativeURI, options) {
@@ -41030,16 +41059,16 @@ var Ignore = class {
41030
41059
  ignored(p) {
41031
41060
  const fullpath = p.fullpath();
41032
41061
  const fullpaths = `${fullpath}/`;
41033
- const relative = p.relative() || ".";
41034
- const relatives = `${relative}/`;
41035
- for (const m of this.relative) if (m.match(relative) || m.match(relatives)) return true;
41062
+ const relative$1 = p.relative() || ".";
41063
+ const relatives = `${relative$1}/`;
41064
+ for (const m of this.relative) if (m.match(relative$1) || m.match(relatives)) return true;
41036
41065
  for (const m of this.absolute) if (m.match(fullpath) || m.match(fullpaths)) return true;
41037
41066
  return false;
41038
41067
  }
41039
41068
  childrenIgnored(p) {
41040
41069
  const fullpath = p.fullpath() + "/";
41041
- const relative = (p.relative() || ".") + "/";
41042
- for (const m of this.relativeChildren) if (m.match(relative)) return true;
41070
+ const relative$1 = (p.relative() || ".") + "/";
41071
+ for (const m of this.relativeChildren) if (m.match(relative$1)) return true;
41043
41072
  for (const m of this.absoluteChildren) if (m.match(fullpath)) return true;
41044
41073
  return false;
41045
41074
  }
@@ -43878,7 +43907,8 @@ function wireNdjsonEmitter(eventBus, ndjsonEmitter) {
43878
43907
  run_id: payload.runId,
43879
43908
  active_dispatches: payload.activeDispatches,
43880
43909
  completed_dispatches: payload.completedDispatches,
43881
- queued_dispatches: payload.queuedDispatches
43910
+ queued_dispatches: payload.queuedDispatches,
43911
+ ...payload.perStoryState !== void 0 ? { per_story_state: payload.perStoryState } : {}
43882
43912
  });
43883
43913
  });
43884
43914
  eventBus.on("orchestrator:stall", (payload) => {
@@ -44655,6 +44685,12 @@ async function runRunAction(options) {
44655
44685
  adapter_backend: adapter.backendType
44656
44686
  });
44657
44687
  wireNdjsonEmitter(eventBus, ndjsonEmitter);
44688
+ const heartbeatSnapshotPath = join(dbDir, "latest-heartbeat-per-story-state.json");
44689
+ eventBus.on("orchestrator:heartbeat", (payload) => {
44690
+ if (payload.perStoryState !== void 0 && Object.keys(payload.perStoryState).length > 0) try {
44691
+ writeFileSync$1(heartbeatSnapshotPath, JSON.stringify(payload.perStoryState), "utf-8");
44692
+ } catch {}
44693
+ });
44658
44694
  }
44659
44695
  const ingestionServer = telemetryEnabled ? new IngestionServer({ port: telemetryPort }) : void 0;
44660
44696
  if (ingestionServer !== void 0) {
@@ -45033,6 +45069,12 @@ async function runFullPipeline(options) {
45033
45069
  adapter_backend: adapter.backendType
45034
45070
  });
45035
45071
  wireNdjsonEmitter(eventBus, fullPipelineNdjsonEmitter);
45072
+ const heartbeatSnapshotPathFp = join(dbDir, "latest-heartbeat-per-story-state.json");
45073
+ eventBus.on("orchestrator:heartbeat", (payload) => {
45074
+ if (payload.perStoryState !== void 0 && Object.keys(payload.perStoryState).length > 0) try {
45075
+ writeFileSync$1(heartbeatSnapshotPathFp, JSON.stringify(payload.perStoryState), "utf-8");
45076
+ } catch {}
45077
+ });
45036
45078
  }
45037
45079
  const phaseOrder = [];
45038
45080
  if (effectiveResearch) phaseOrder.push("research");
@@ -45429,5 +45471,5 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
45429
45471
  }
45430
45472
 
45431
45473
  //#endregion
45432
- export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runRunAction, runSolutioningPhase, validateStopAfterFromConflict, wireNdjsonEmitter };
45433
- //# sourceMappingURL=run-CeaNSnD6.js.map
45474
+ 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, 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 };
45475
+ //# sourceMappingURL=run-DcDoaG12.js.map
@@ -1,5 +1,5 @@
1
- import "./dist-VcMmfo2w.js";
1
+ import "./dist-W2emvN3F.js";
2
2
  import "./version-manager-impl-BmOWu8ml.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CF4__LCr.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CAqLkNUP.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-VcMmfo2w.js";
1
+ import { createVersionManager } from "./dist-W2emvN3F.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-CF4__LCr.js.map
126
+ //# sourceMappingURL=upgrade-CAqLkNUP.js.map
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-VcMmfo2w.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-W2emvN3F.js";
2
2
  import "./version-manager-impl-BmOWu8ml.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.55",
3
+ "version": "0.20.57",
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-VcMmfo2w.js";
2
- import "./adapter-registry-DXLMTmfD.js";
3
-
4
- export { AdapterRegistry };