substrate-ai 0.6.6 → 0.6.8
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
2
|
+
import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-tB6yG6o8.js";
|
|
3
3
|
import { createLogger } from "../logger-D2fS2ccL.js";
|
|
4
4
|
import { AdapterRegistry } from "../adapter-registry-D2zdMwVu.js";
|
|
5
5
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-DtZW1maj.js";
|
|
@@ -3486,7 +3486,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
3486
3486
|
await initSchema(expAdapter);
|
|
3487
3487
|
const { runRunAction: runPipeline } = await import(
|
|
3488
3488
|
/* @vite-ignore */
|
|
3489
|
-
"../run-
|
|
3489
|
+
"../run-ME16n4N_.js"
|
|
3490
3490
|
);
|
|
3491
3491
|
const runStoryFn = async (opts) => {
|
|
3492
3492
|
const exitCode = await runPipeline({
|
|
@@ -1922,8 +1922,8 @@ function resolveBmadMethodVersion(fromDir = __dirname) {
|
|
|
1922
1922
|
const BMAD_BASELINE_TOKENS_FULL = 56800;
|
|
1923
1923
|
/** BMAD baseline token total for create+dev+review comparison */
|
|
1924
1924
|
const BMAD_BASELINE_TOKENS = 23800;
|
|
1925
|
-
/** Story key pattern:
|
|
1926
|
-
const STORY_KEY_PATTERN$1 = /^[A-Za-z0-9]
|
|
1925
|
+
/** Story key pattern: e.g. "10-1", "1-1a", "NEW-26", "E6" */
|
|
1926
|
+
const STORY_KEY_PATTERN$1 = /^[A-Za-z0-9]+(-[A-Za-z0-9]+)?$/;
|
|
1927
1927
|
/**
|
|
1928
1928
|
* Top-level keys in .claude/settings.json that substrate owns.
|
|
1929
1929
|
* On init, these are set/updated unconditionally.
|
|
@@ -7266,6 +7266,30 @@ function detectPackageManager(projectRoot) {
|
|
|
7266
7266
|
/** Default timeout in milliseconds for the build verification gate */
|
|
7267
7267
|
const DEFAULT_VERIFY_TIMEOUT_MS = 6e4;
|
|
7268
7268
|
/**
|
|
7269
|
+
* Derive turbo --filter flags from changed file paths.
|
|
7270
|
+
*
|
|
7271
|
+
* Maps file paths like "apps/web/src/foo.ts" or "packages/db/src/bar.ts"
|
|
7272
|
+
* to turbo package filters like "--filter=web" or "--filter=@nextgen/db".
|
|
7273
|
+
* Falls back to reading package.json in each directory to get the real
|
|
7274
|
+
* package name. Returns empty array if no turbo-scoped packages detected.
|
|
7275
|
+
*/
|
|
7276
|
+
function deriveTurboFilters(changedFiles, projectRoot) {
|
|
7277
|
+
const packageDirs = new Set();
|
|
7278
|
+
for (const file of changedFiles) {
|
|
7279
|
+
const match$1 = file.match(/^((?:apps|packages)\/[^/]+)\//);
|
|
7280
|
+
if (match$1) packageDirs.add(match$1[1]);
|
|
7281
|
+
}
|
|
7282
|
+
if (packageDirs.size === 0) return [];
|
|
7283
|
+
const filters = [];
|
|
7284
|
+
for (const dir of packageDirs) try {
|
|
7285
|
+
const pkgJsonPath = join$1(projectRoot, dir, "package.json");
|
|
7286
|
+
const raw = readFileSync$1(pkgJsonPath, "utf-8");
|
|
7287
|
+
const pkg = JSON.parse(raw);
|
|
7288
|
+
if (pkg.name) filters.push(`--filter=${pkg.name}`);
|
|
7289
|
+
} catch {}
|
|
7290
|
+
return filters;
|
|
7291
|
+
}
|
|
7292
|
+
/**
|
|
7269
7293
|
* Run the build verification gate synchronously.
|
|
7270
7294
|
*
|
|
7271
7295
|
* Executes the configured verifyCommand (default: "npm run build") in the
|
|
@@ -7273,12 +7297,16 @@ const DEFAULT_VERIFY_TIMEOUT_MS = 6e4;
|
|
|
7273
7297
|
* returns { status: 'passed' }. On failure or timeout, returns a structured
|
|
7274
7298
|
* result with status, exitCode, output, and reason.
|
|
7275
7299
|
*
|
|
7300
|
+
* When changedFiles is provided and the command is a turbo build, the build
|
|
7301
|
+
* is scoped to only the affected packages via --filter flags. This prevents
|
|
7302
|
+
* cascading failures from other concurrent stories' modifications.
|
|
7303
|
+
*
|
|
7276
7304
|
* AC4/5: reads verifyCommand from options (or defaults to 'npm run build').
|
|
7277
7305
|
* AC6: if verifyCommand is empty string or false, returns { status: 'skipped' }.
|
|
7278
7306
|
* AC8: timeout is configurable via verifyTimeoutMs (default 60 s).
|
|
7279
7307
|
*/
|
|
7280
7308
|
function runBuildVerification(options) {
|
|
7281
|
-
const { verifyCommand, verifyTimeoutMs, projectRoot } = options;
|
|
7309
|
+
const { verifyCommand, verifyTimeoutMs, projectRoot, changedFiles } = options;
|
|
7282
7310
|
let cmd;
|
|
7283
7311
|
if (verifyCommand === void 0) {
|
|
7284
7312
|
const detection = detectPackageManager(projectRoot);
|
|
@@ -7290,6 +7318,16 @@ function runBuildVerification(options) {
|
|
|
7290
7318
|
cmd = detection.command;
|
|
7291
7319
|
} else cmd = verifyCommand;
|
|
7292
7320
|
if (!cmd) return { status: "skipped" };
|
|
7321
|
+
if (changedFiles && changedFiles.length > 0 && typeof cmd === "string" && cmd.includes("turbo")) {
|
|
7322
|
+
const filters = deriveTurboFilters(changedFiles, projectRoot);
|
|
7323
|
+
if (filters.length > 0) {
|
|
7324
|
+
cmd = `${cmd} ${filters.join(" ")}`;
|
|
7325
|
+
logger$23.info({
|
|
7326
|
+
filters,
|
|
7327
|
+
originalCmd: options.verifyCommand ?? "(auto-detected)"
|
|
7328
|
+
}, "Build verification: scoped turbo build to affected packages");
|
|
7329
|
+
}
|
|
7330
|
+
}
|
|
7293
7331
|
const timeoutMs = verifyTimeoutMs ?? DEFAULT_VERIFY_TIMEOUT_MS;
|
|
7294
7332
|
try {
|
|
7295
7333
|
const stdout = execSync(cmd, {
|
|
@@ -7805,12 +7843,12 @@ var FileStateStore = class {
|
|
|
7805
7843
|
//#region src/modules/state/dolt-store.ts
|
|
7806
7844
|
const log = createLogger("modules:state:dolt");
|
|
7807
7845
|
/**
|
|
7808
|
-
* Validate that a story key matches the expected pattern (e.g. "26-7", "1-1a", "NEW-26").
|
|
7846
|
+
* Validate that a story key matches the expected pattern (e.g. "26-7", "1-1a", "NEW-26", "E6").
|
|
7809
7847
|
* Prevents SQL injection via string-interpolated identifiers.
|
|
7810
7848
|
*/
|
|
7811
|
-
const STORY_KEY_PATTERN = /^[A-Za-z0-9]
|
|
7849
|
+
const STORY_KEY_PATTERN = /^[A-Za-z0-9]+(-[A-Za-z0-9]+)?$/;
|
|
7812
7850
|
function assertValidStoryKey(storyKey) {
|
|
7813
|
-
if (!STORY_KEY_PATTERN.test(storyKey)) throw new DoltQueryError("assertValidStoryKey", `Invalid story key: '${storyKey}'. Must match pattern <
|
|
7851
|
+
if (!STORY_KEY_PATTERN.test(storyKey)) throw new DoltQueryError("assertValidStoryKey", `Invalid story key: '${storyKey}'. Must match pattern <key> or <epic>-<story> (e.g. "E6", "10-1", "1-1a", "NEW-26").`);
|
|
7814
7852
|
}
|
|
7815
7853
|
/**
|
|
7816
7854
|
* Dolt-backed implementation of the StateStore interface.
|
|
@@ -9379,6 +9417,29 @@ async function getGitDiffForFiles(files, workingDirectory = process.cwd()) {
|
|
|
9379
9417
|
], workingDirectory, "git-diff-files");
|
|
9380
9418
|
}
|
|
9381
9419
|
/**
|
|
9420
|
+
* Capture the file-level stat summary scoped to specific files.
|
|
9421
|
+
*
|
|
9422
|
+
* Runs `git diff --stat HEAD -- file1.ts file2.ts ...` to produce a condensed
|
|
9423
|
+
* stat summary limited to only the specified file paths. Used as a fallback
|
|
9424
|
+
* when the scoped full diff exceeds the token budget — ensures the stat-only
|
|
9425
|
+
* summary also stays scoped to the story's files rather than showing all
|
|
9426
|
+
* uncommitted changes in the repo.
|
|
9427
|
+
*
|
|
9428
|
+
* @param files - List of file paths to scope the stat summary to
|
|
9429
|
+
* @param workingDirectory - Directory to run git in (defaults to process.cwd())
|
|
9430
|
+
* @returns The scoped stat summary string, or '' on error/empty
|
|
9431
|
+
*/
|
|
9432
|
+
async function getGitDiffStatForFiles(files, workingDirectory = process.cwd()) {
|
|
9433
|
+
if (files.length === 0) return "";
|
|
9434
|
+
return runGitCommand([
|
|
9435
|
+
"diff",
|
|
9436
|
+
"--stat",
|
|
9437
|
+
"HEAD",
|
|
9438
|
+
"--",
|
|
9439
|
+
...files
|
|
9440
|
+
], workingDirectory, "git-diff-stat-files");
|
|
9441
|
+
}
|
|
9442
|
+
/**
|
|
9382
9443
|
* Get all changed file paths from the working tree via `git status --porcelain`.
|
|
9383
9444
|
*
|
|
9384
9445
|
* Includes all status codes (M, A, R, D, ??) so that newly created untracked
|
|
@@ -10366,8 +10427,8 @@ async function runCodeReview(deps, params) {
|
|
|
10366
10427
|
estimatedTotal: scopedTotal,
|
|
10367
10428
|
ceiling: TOKEN_CEILING,
|
|
10368
10429
|
fileCount: filesModified.length
|
|
10369
|
-
}, "Scoped diff exceeds token ceiling — falling back to stat-only summary");
|
|
10370
|
-
gitDiffContent = await
|
|
10430
|
+
}, "Scoped diff exceeds token ceiling — falling back to scoped stat-only summary");
|
|
10431
|
+
gitDiffContent = await getGitDiffStatForFiles(filesModified, cwd);
|
|
10371
10432
|
}
|
|
10372
10433
|
} else {
|
|
10373
10434
|
const changedFiles = await getGitChangedFiles(cwd);
|
|
@@ -10917,7 +10978,7 @@ async function runTestExpansion(deps, params) {
|
|
|
10917
10978
|
ceiling: TOKEN_CEILING,
|
|
10918
10979
|
fileCount: filesModified.length
|
|
10919
10980
|
}, "Scoped diff exceeds token ceiling — falling back to stat-only summary");
|
|
10920
|
-
gitDiffContent = await
|
|
10981
|
+
gitDiffContent = await getGitDiffStatForFiles(filesModified, cwd);
|
|
10921
10982
|
}
|
|
10922
10983
|
} catch (err) {
|
|
10923
10984
|
logger$13.warn({ error: err instanceof Error ? err.message : String(err) }, "Failed to get git diff — proceeding with empty diff");
|
|
@@ -17156,7 +17217,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
17156
17217
|
const buildVerifyResult = config.skipBuildVerify === true ? { status: "skipped" } : runBuildVerification({
|
|
17157
17218
|
verifyCommand: pack.manifest.verifyCommand,
|
|
17158
17219
|
verifyTimeoutMs: pack.manifest.verifyTimeoutMs,
|
|
17159
|
-
projectRoot: projectRoot ?? process.cwd()
|
|
17220
|
+
projectRoot: projectRoot ?? process.cwd(),
|
|
17221
|
+
changedFiles: gitDiffFiles
|
|
17160
17222
|
});
|
|
17161
17223
|
if (buildVerifyResult.status === "passed") {
|
|
17162
17224
|
eventBus.emit("story:build-verification-passed", { storyKey });
|
|
@@ -17164,30 +17226,80 @@ function createImplementationOrchestrator(deps) {
|
|
|
17164
17226
|
} else if (buildVerifyResult.status === "failed" || buildVerifyResult.status === "timeout") {
|
|
17165
17227
|
const truncatedOutput = (buildVerifyResult.output ?? "").slice(0, 2e3);
|
|
17166
17228
|
const reason = buildVerifyResult.reason ?? "build-verification-failed";
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17229
|
+
let retryPassed = false;
|
|
17230
|
+
const fullOutput = buildVerifyResult.output ?? "";
|
|
17231
|
+
const missingPkgMatch = fullOutput.match(/Cannot find (?:module|package) ['"]([^'"]+)['"]/) ?? fullOutput.match(/ERR_MODULE_NOT_FOUND[^]*?['"]([^'"]+)['"]/);
|
|
17232
|
+
if (missingPkgMatch && buildVerifyResult.status !== "timeout") {
|
|
17233
|
+
const missingPkg = missingPkgMatch[1].replace(/^(@[^/]+\/[^/]+)\/.*$/, "$1").replace(/^([^@][^/]*)\/.*$/, "$1");
|
|
17234
|
+
const resolvedRoot = projectRoot ?? process.cwd();
|
|
17235
|
+
logger$27.warn({
|
|
17236
|
+
storyKey,
|
|
17237
|
+
missingPkg
|
|
17238
|
+
}, "Build-fix retry: detected missing npm package — attempting npm install");
|
|
17239
|
+
try {
|
|
17240
|
+
execSync(`npm install ${missingPkg}`, {
|
|
17241
|
+
cwd: resolvedRoot,
|
|
17242
|
+
timeout: 6e4,
|
|
17243
|
+
encoding: "utf-8",
|
|
17244
|
+
stdio: "pipe"
|
|
17245
|
+
});
|
|
17246
|
+
logger$27.warn({
|
|
17247
|
+
storyKey,
|
|
17248
|
+
missingPkg
|
|
17249
|
+
}, "Build-fix retry: npm install succeeded — retrying build verification");
|
|
17250
|
+
const retryResult = runBuildVerification({
|
|
17251
|
+
verifyCommand: pack.manifest.verifyCommand,
|
|
17252
|
+
verifyTimeoutMs: pack.manifest.verifyTimeoutMs,
|
|
17253
|
+
projectRoot: resolvedRoot,
|
|
17254
|
+
changedFiles: gitDiffFiles
|
|
17255
|
+
});
|
|
17256
|
+
if (retryResult.status === "passed") {
|
|
17257
|
+
retryPassed = true;
|
|
17258
|
+
eventBus.emit("story:build-verification-passed", { storyKey });
|
|
17259
|
+
logger$27.warn({
|
|
17260
|
+
storyKey,
|
|
17261
|
+
missingPkg
|
|
17262
|
+
}, "Build-fix retry: build verification passed after installing missing package");
|
|
17263
|
+
} else logger$27.warn({
|
|
17264
|
+
storyKey,
|
|
17265
|
+
missingPkg,
|
|
17266
|
+
retryStatus: retryResult.status
|
|
17267
|
+
}, "Build-fix retry: build still fails after installing missing package — escalating");
|
|
17268
|
+
} catch (installErr) {
|
|
17269
|
+
const installMsg = installErr instanceof Error ? installErr.message : String(installErr);
|
|
17270
|
+
logger$27.warn({
|
|
17271
|
+
storyKey,
|
|
17272
|
+
missingPkg,
|
|
17273
|
+
error: installMsg
|
|
17274
|
+
}, "Build-fix retry: npm install failed — escalating");
|
|
17275
|
+
}
|
|
17276
|
+
}
|
|
17277
|
+
if (!retryPassed) {
|
|
17278
|
+
eventBus.emit("story:build-verification-failed", {
|
|
17279
|
+
storyKey,
|
|
17280
|
+
exitCode: buildVerifyResult.exitCode ?? 1,
|
|
17281
|
+
output: truncatedOutput
|
|
17282
|
+
});
|
|
17283
|
+
logger$27.warn({
|
|
17284
|
+
storyKey,
|
|
17285
|
+
reason,
|
|
17286
|
+
exitCode: buildVerifyResult.exitCode
|
|
17287
|
+
}, "Build verification failed — escalating story");
|
|
17288
|
+
updateStory(storyKey, {
|
|
17289
|
+
phase: "ESCALATED",
|
|
17290
|
+
error: reason,
|
|
17291
|
+
completedAt: new Date().toISOString()
|
|
17292
|
+
});
|
|
17293
|
+
await writeStoryMetricsBestEffort(storyKey, "escalated", 0);
|
|
17294
|
+
await emitEscalation({
|
|
17295
|
+
storyKey,
|
|
17296
|
+
lastVerdict: reason,
|
|
17297
|
+
reviewCycles: 0,
|
|
17298
|
+
issues: [truncatedOutput]
|
|
17299
|
+
});
|
|
17300
|
+
await persistState();
|
|
17301
|
+
return;
|
|
17302
|
+
}
|
|
17191
17303
|
}
|
|
17192
17304
|
}
|
|
17193
17305
|
try {
|
|
@@ -17921,24 +18033,20 @@ function createImplementationOrchestrator(deps) {
|
|
|
17921
18033
|
*/
|
|
17922
18034
|
async function runWithConcurrency(groups, maxConcurrency) {
|
|
17923
18035
|
const queue = [...groups];
|
|
17924
|
-
const running =
|
|
18036
|
+
const running = new Set();
|
|
17925
18037
|
function enqueue() {
|
|
17926
18038
|
const group = queue.shift();
|
|
17927
18039
|
if (group === void 0) return;
|
|
17928
18040
|
const p = processConflictGroup(group).finally(() => {
|
|
17929
|
-
|
|
17930
|
-
|
|
18041
|
+
running.delete(p);
|
|
18042
|
+
while (running.size < maxConcurrency && queue.length > 0) enqueue();
|
|
17931
18043
|
});
|
|
17932
|
-
running.
|
|
17933
|
-
if (running.
|
|
18044
|
+
running.add(p);
|
|
18045
|
+
if (running.size > _maxConcurrentActual) _maxConcurrentActual = running.size;
|
|
17934
18046
|
}
|
|
17935
18047
|
const initial = Math.min(maxConcurrency, queue.length);
|
|
17936
18048
|
for (let i = 0; i < initial; i++) enqueue();
|
|
17937
|
-
while (
|
|
17938
|
-
await Promise.race(running);
|
|
17939
|
-
enqueue();
|
|
17940
|
-
}
|
|
17941
|
-
await Promise.all(running);
|
|
18049
|
+
while (running.size > 0) await Promise.race(running);
|
|
17942
18050
|
}
|
|
17943
18051
|
async function run(storyKeys) {
|
|
17944
18052
|
if (_state === "RUNNING" || _state === "PAUSED") {
|
|
@@ -18069,6 +18177,11 @@ function createImplementationOrchestrator(deps) {
|
|
|
18069
18177
|
batchCount: batches.length,
|
|
18070
18178
|
maxConcurrency: config.maxConcurrency
|
|
18071
18179
|
}, "Orchestrator starting");
|
|
18180
|
+
logger$27.info({
|
|
18181
|
+
storyCount: storyKeys.length,
|
|
18182
|
+
conflictGroups: batches.length,
|
|
18183
|
+
maxConcurrency: config.maxConcurrency
|
|
18184
|
+
}, `Story dispatch plan: ${storyKeys.length} stories in ${batches.length} conflict groups (max concurrency: ${config.maxConcurrency})`);
|
|
18072
18185
|
if (config.skipPreflight !== true) {
|
|
18073
18186
|
const preflightStart = Date.now();
|
|
18074
18187
|
const preFlightResult = runBuildVerification({
|
|
@@ -22590,7 +22703,7 @@ async function runRunAction(options) {
|
|
|
22590
22703
|
if (storiesArg !== void 0 && storiesArg !== "") {
|
|
22591
22704
|
parsedStoryKeys = storiesArg.split(",").map((k) => k.trim()).filter((k) => k.length > 0);
|
|
22592
22705
|
for (const key of parsedStoryKeys) if (!validateStoryKey(key)) {
|
|
22593
|
-
const errorMsg = `Story key '${key}' is not a valid format. Expected: <epic>-<story> (e.g., 10-1, 1-1a, NEW-26)`;
|
|
22706
|
+
const errorMsg = `Story key '${key}' is not a valid format. Expected: <key> or <epic>-<story> (e.g., E6, 10-1, 1-1a, NEW-26)`;
|
|
22594
22707
|
if (outputFormat === "json") process.stdout.write(formatOutput(null, "json", false, errorMsg) + "\n");
|
|
22595
22708
|
else process.stderr.write(`Error: ${errorMsg}\n`);
|
|
22596
22709
|
return 1;
|
|
@@ -23182,6 +23295,19 @@ async function runRunAction(options) {
|
|
|
23182
23295
|
});
|
|
23183
23296
|
}
|
|
23184
23297
|
const ingestionServer = telemetryEnabled ? new IngestionServer({ port: telemetryPort }) : void 0;
|
|
23298
|
+
if (ingestionServer !== void 0) {
|
|
23299
|
+
process.on("exit", () => {
|
|
23300
|
+
ingestionServer.stop();
|
|
23301
|
+
});
|
|
23302
|
+
process.on("SIGINT", () => {
|
|
23303
|
+
ingestionServer.stop();
|
|
23304
|
+
process.exit(130);
|
|
23305
|
+
});
|
|
23306
|
+
process.on("SIGTERM", () => {
|
|
23307
|
+
ingestionServer.stop();
|
|
23308
|
+
process.exit(143);
|
|
23309
|
+
});
|
|
23310
|
+
}
|
|
23185
23311
|
if (telemetryPersistence !== void 0) {
|
|
23186
23312
|
const routingTelemetry = new RoutingTelemetry(telemetryPersistence, logger);
|
|
23187
23313
|
eventBus.on("routing:model-selected", (payload) => {
|
|
@@ -23542,6 +23668,19 @@ async function runFullPipeline(options) {
|
|
|
23542
23668
|
}
|
|
23543
23669
|
} else if (currentPhase === "implementation") {
|
|
23544
23670
|
const fpIngestionServer = fullTelemetryEnabled ? new IngestionServer({ port: fullTelemetryPort ?? 4318 }) : void 0;
|
|
23671
|
+
if (fpIngestionServer !== void 0) {
|
|
23672
|
+
process.on("exit", () => {
|
|
23673
|
+
fpIngestionServer.stop();
|
|
23674
|
+
});
|
|
23675
|
+
process.on("SIGINT", () => {
|
|
23676
|
+
fpIngestionServer.stop();
|
|
23677
|
+
process.exit(130);
|
|
23678
|
+
});
|
|
23679
|
+
process.on("SIGTERM", () => {
|
|
23680
|
+
fpIngestionServer.stop();
|
|
23681
|
+
process.exit(143);
|
|
23682
|
+
});
|
|
23683
|
+
}
|
|
23545
23684
|
const fpTelemetryPersistence = fullTelemetryEnabled ? new AdapterTelemetryPersistence(adapter) : void 0;
|
|
23546
23685
|
const orchestrator = createImplementationOrchestrator({
|
|
23547
23686
|
db: adapter,
|
|
@@ -23705,4 +23844,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
23705
23844
|
|
|
23706
23845
|
//#endregion
|
|
23707
23846
|
export { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
23708
|
-
//# sourceMappingURL=run-
|
|
23847
|
+
//# sourceMappingURL=run-tB6yG6o8.js.map
|