substrate-ai 0.16.0 → 0.16.1

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
@@ -4,7 +4,7 @@ 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, EXPERIMENT_RESULT, GlobalSettingsSchema, 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, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRequirements, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-CLvAwmT7.js";
6
6
  import "../adapter-registry-DXLMTmfD.js";
7
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-z84Uu_U2.js";
7
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-C7m0gTBv.js";
8
8
  import "../errors-D1LU8CZ9.js";
9
9
  import "../routing-CcBOCuC9.js";
10
10
  import "../decisions-C0pz9Clx.js";
@@ -4359,7 +4359,7 @@ async function runSupervisorAction(options, deps = {}) {
4359
4359
  await initSchema(expAdapter);
4360
4360
  const { runRunAction: runPipeline } = await import(
4361
4361
  /* @vite-ignore */
4362
- "../run-Q2TZstl9.js"
4362
+ "../run-Cfm9wW8m.js"
4363
4363
  );
4364
4364
  const runStoryFn = async (opts) => {
4365
4365
  const exitCode = await runPipeline({
@@ -15,6 +15,7 @@ import { createHash, randomUUID } from "node:crypto";
15
15
  import { z } from "zod";
16
16
  import { access as access$1, lstat, mkdir as mkdir$1, readFile as readFile$1, readdir as readdir$1, readlink, realpath, stat as stat$1, unlink, writeFile as writeFile$1 } from "node:fs/promises";
17
17
  import { existsSync as existsSync$1, lstatSync, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdir as readdir$2, readdirSync as readdirSync$1, readlinkSync, realpathSync, unlinkSync, writeFileSync as writeFileSync$1 } from "fs";
18
+ import { createRequire } from "node:module";
18
19
  import { fileURLToPath } from "node:url";
19
20
  import { createHash as createHash$1 } from "crypto";
20
21
  import { spawn as spawn$1 } from "child_process";
@@ -17036,12 +17037,26 @@ const __dirname = dirname$1(fileURLToPath(import.meta.url));
17036
17037
  /**
17037
17038
  * Returns the absolute path to the bundled SDLC pipeline DOT file.
17038
17039
  *
17039
- * Exported for use by the CLI composition root (story 43-10) — preferred over
17040
- * ad-hoc path construction with createRequire because `__dirname` is already
17041
- * resolved here relative to the installed package.
17040
+ * Resolution order:
17041
+ * 1. Relative to __dirname (works in source/unbundled: __dirname = packages/sdlc/src/orchestrator/)
17042
+ * 2. Via createRequire to locate @substrate-ai/sdlc package.json, then graphs/ relative to it
17043
+ * (works when bundled: __dirname points to dist/ but createRequire finds the real package)
17044
+ *
17045
+ * @throws {Error} if the DOT file cannot be found by any method.
17042
17046
  */
17043
17047
  function resolveGraphPath$1() {
17044
- return join$1(__dirname, "../../graphs/sdlc-pipeline.dot");
17048
+ const candidates = [
17049
+ join$1(__dirname, "../../graphs/sdlc-pipeline.dot"),
17050
+ join$1(__dirname, "../graphs/sdlc-pipeline.dot"),
17051
+ join$1(__dirname, "graphs/sdlc-pipeline.dot")
17052
+ ];
17053
+ try {
17054
+ const require$1 = createRequire(import.meta.url);
17055
+ const sdlcPkgPath = require$1.resolve("@substrate-ai/sdlc/package.json");
17056
+ candidates.push(join$1(dirname$1(sdlcPkgPath), "graphs", "sdlc-pipeline.dot"));
17057
+ } catch {}
17058
+ for (const candidate of candidates) if (existsSync(candidate)) return candidate;
17059
+ throw new Error(`Cannot locate sdlc-pipeline.dot. Searched:\n${candidates.map((c) => ` ${c}`).join("\n")}`);
17045
17060
  }
17046
17061
  /** Thrown by `createGraphOrchestrator` when the supplied graph is structurally invalid. */
17047
17062
  var GraphOrchestratorInitError = class extends Error {
@@ -17067,7 +17082,11 @@ function createGraphOrchestrator(config) {
17067
17082
  const initialContext = {
17068
17083
  storyKey,
17069
17084
  projectRoot: config.projectRoot,
17070
- methodologyPack: config.methodologyPack
17085
+ methodologyPack: config.methodologyPack,
17086
+ ...config.pipelineRunId !== void 0 ? {
17087
+ runId: config.pipelineRunId,
17088
+ pipelineRunId: config.pipelineRunId
17089
+ } : {}
17071
17090
  };
17072
17091
  const factoryBus = new EventEmitter();
17073
17092
  const bridge = config.eventBus != null ? createSdlcEventBridge({
@@ -22956,7 +22975,7 @@ function createGraphExecutor() {
22956
22975
  };
22957
22976
  let completedNodes = [];
22958
22977
  let nodeRetries = {};
22959
- let context = new GraphContext();
22978
+ let context = new GraphContext(config.initialContext);
22960
22979
  let step = 0;
22961
22980
  const visitCount = new Map();
22962
22981
  let resumeCompletedSet = null;
@@ -29499,7 +29518,7 @@ function registerFactoryCommand(program) {
29499
29518
  * @returns A HandlerRegistry with all four SDLC handlers registered.
29500
29519
  */
29501
29520
  function buildSdlcHandlerRegistry(deps) {
29502
- const registry = new HandlerRegistry();
29521
+ const registry = createDefaultRegistry();
29503
29522
  registry.register("sdlc.phase", createSdlcPhaseHandler(deps.phaseHandlerDeps));
29504
29523
  registry.register("sdlc.create-story", createSdlcCreateStoryHandler(deps.createStoryOptions));
29505
29524
  registry.register("sdlc.dev-story", createSdlcDevStoryHandler(deps.devStoryOptions));
@@ -30948,4 +30967,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
30948
30967
 
30949
30968
  //#endregion
30950
30969
  export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
30951
- //# sourceMappingURL=run-z84Uu_U2.js.map
30970
+ //# sourceMappingURL=run-C7m0gTBv.js.map
@@ -2,7 +2,7 @@ import "./health-DswaC1q5.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-CLvAwmT7.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-z84Uu_U2.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-C7m0gTBv.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "scripts": {
50
50
  "agent-memory:bootstrap": "node scripts/bootstrap-agent-memory.mjs",
51
51
  "build": "tsc --build packages/core packages/sdlc packages/factory && tsdown",
52
- "postbuild": "cp -r src/cli/templates dist/cli/templates && cp src/modules/state/schema.sql dist/schema.sql",
52
+ "postbuild": "cp -r src/cli/templates dist/cli/templates && cp src/modules/state/schema.sql dist/schema.sql && mkdir -p dist/graphs && cp packages/sdlc/graphs/sdlc-pipeline.dot dist/graphs/",
53
53
  "check:circular": "dpdm --no-warning --exit-code circular:1 packages/core/src/index.ts packages/sdlc/src/index.ts packages/factory/src/index.ts",
54
54
  "dev": "tsx watch src/cli/index.ts",
55
55
  "test": "vitest run --coverage",