substrate-ai 0.20.153 → 0.20.155

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,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { FileKvStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-BmBd4zyE.js";
2
+ import { FileKvStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-DtcROhq3.js";
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, createGitWorktreeManager, createPipelineRun, createStderrLogger, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initWorkGraphSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, swallowDebug, tagRunAsBaseline, updatePipelineRun } from "../dist-Dl3vBZil.js";
6
6
  import "../adapter-registry-DXLMTmfD.js";
7
- 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-Dan3I0ea.js";
8
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-DEBYRpko.js";
7
+ 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-B2Tn8bvh.js";
8
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-BbgwnFFw.js";
9
9
  import "../errors-Dyyei2ah.js";
10
10
  import "../routing-DFxoKHDt.js";
11
11
  import { WorkGraphRepository } from "../work-graph-repository-DZyJv5pV.js";
12
12
  import "../decisions-CzSIEeGP.js";
13
13
  import "../decision-router-BAPpON_C.js";
14
- import "../interactive-prompt-Cj0Od5XZ.js";
14
+ import "../interactive-prompt-D-xBHKiP.js";
15
15
  import "../recovery-engine-BKGBeBnW.js";
16
16
  import "../version-manager-impl-qFBiO4Eh.js";
17
17
  import { registerUpgradeCommand } from "../upgrade-DGqUA_5f.js";
@@ -7126,7 +7126,7 @@ async function runStatusAction(options) {
7126
7126
  logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
7127
7127
  }
7128
7128
  if (run === void 0) {
7129
- const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-BwXD8UBv.js");
7129
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-C4ussodZ.js");
7130
7130
  const substrateDirPath = join(projectRoot, ".substrate");
7131
7131
  const processInfo = inspectProcessTree$1({
7132
7132
  projectRoot,
@@ -8655,7 +8655,7 @@ async function runSupervisorAction(options, deps = {}) {
8655
8655
  await initSchema(expAdapter);
8656
8656
  const { runRunAction: runPipeline } = await import(
8657
8657
  /* @vite-ignore */
8658
- "../run-DIu8THqp.js"
8658
+ "../run-DjjG9wNI.js"
8659
8659
  );
8660
8660
  const runStoryFn = async (opts) => {
8661
8661
  const exitCode = await runPipeline({
@@ -1,7 +1,7 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BmBd4zyE.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-DtcROhq3.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./dist-Dl3vBZil.js";
4
- import "./manifest-read-Dan3I0ea.js";
4
+ import "./manifest-read-B2Tn8bvh.js";
5
5
  import "./work-graph-repository-DZyJv5pV.js";
6
6
  import "./decisions-CzSIEeGP.js";
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
2
  import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-Dl3vBZil.js";
3
- import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-Dan3I0ea.js";
3
+ import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-B2Tn8bvh.js";
4
4
  import { createRequire } from "module";
5
5
  import { dirname, join } from "path";
6
6
  import { existsSync, readFileSync } from "node:fs";
@@ -1000,4 +1000,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
1000
1000
 
1001
1001
  //#endregion
1002
1002
  export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDoltOperatorReader, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, runHealthAction, validateStoryKey };
1003
- //# sourceMappingURL=health-BmBd4zyE.js.map
1003
+ //# sourceMappingURL=health-DtcROhq3.js.map
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-Dan3I0ea.js";
2
+ import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-B2Tn8bvh.js";
3
3
  import { join } from "node:path";
4
4
  import { mkdir, readFile, writeFile } from "node:fs/promises";
5
5
  import * as readline from "node:readline";
@@ -180,4 +180,4 @@ async function runInteractivePrompt(decisionContext) {
180
180
 
181
181
  //#endregion
182
182
  export { runInteractivePrompt };
183
- //# sourceMappingURL=interactive-prompt-Cj0Od5XZ.js.map
183
+ //# sourceMappingURL=interactive-prompt-D-xBHKiP.js.map
@@ -2415,11 +2415,33 @@ const LANGUAGE_EXTENSIONS = {
2415
2415
  ".mjs",
2416
2416
  ".cjs"
2417
2417
  ],
2418
- python: [".py"],
2418
+ python: [".py", ".pyi"],
2419
2419
  go: [".go"],
2420
2420
  rust: [".rs"],
2421
2421
  java: [".java"],
2422
- kotlin: [".kt", ".kts"]
2422
+ kotlin: [".kt", ".kts"],
2423
+ ruby: [".rb", ".rake"],
2424
+ php: [".php"],
2425
+ csharp: [".cs"],
2426
+ cpp: [
2427
+ ".cpp",
2428
+ ".cc",
2429
+ ".cxx",
2430
+ ".hpp",
2431
+ ".hh"
2432
+ ],
2433
+ c: [".c", ".h"],
2434
+ swift: [".swift"],
2435
+ scala: [".scala", ".sc"],
2436
+ elixir: [".ex", ".exs"],
2437
+ clojure: [
2438
+ ".clj",
2439
+ ".cljs",
2440
+ ".cljc"
2441
+ ],
2442
+ perl: [".pl", ".pm"],
2443
+ lua: [".lua"],
2444
+ dart: [".dart"]
2423
2445
  };
2424
2446
  /** JS-family toolchain manifests whose appearance flips build detection. */
2425
2447
  const JS_TOOLCHAIN_MANIFESTS = [
@@ -2436,7 +2458,20 @@ const JS_TOOLCHAIN_MANIFESTS = [
2436
2458
  const ALWAYS_DENY_SEGMENTS = [
2437
2459
  "node_modules",
2438
2460
  ".venv",
2439
- "__pycache__"
2461
+ "venv",
2462
+ "__pycache__",
2463
+ "vendor",
2464
+ "target",
2465
+ ".gradle",
2466
+ ".tox",
2467
+ ".mypy_cache",
2468
+ ".pytest_cache",
2469
+ ".ruff_cache",
2470
+ ".next",
2471
+ ".nuxt",
2472
+ ".svelte-kit",
2473
+ "coverage",
2474
+ ".turbo"
2440
2475
  ];
2441
2476
  /**
2442
2477
  * Collect every `language: <x>` declaration in the profile (single-project
@@ -2477,7 +2512,11 @@ function classifyContamination(changedFiles, allowedLanguages) {
2477
2512
  droppings.push(file);
2478
2513
  continue;
2479
2514
  }
2480
- if (!allowJs && segments.includes("dist")) {
2515
+ if (segments.some((seg) => seg.endsWith(".egg-info"))) {
2516
+ droppings.push(file);
2517
+ continue;
2518
+ }
2519
+ if (!allowJs && segments.some((seg) => seg === "dist" || seg === "build" || seg === "out")) {
2481
2520
  droppings.push(file);
2482
2521
  continue;
2483
2522
  }
@@ -2568,6 +2607,8 @@ function isTestPath(file) {
2568
2607
  if (/(^|\/)(__tests__|tests?)\//.test(norm)) return true;
2569
2608
  if (/\.(test|spec)\.[a-z]+$/.test(base)) return true;
2570
2609
  if (/^test_.*\.py$/.test(base) || /_test\.(py|go)$/.test(base)) return true;
2610
+ if (base === "conftest.py") return true;
2611
+ if (/(^|\/)(fixtures|factories|testsupport|test-support|test_support|__mocks__|__fixtures__)\//.test(norm)) return true;
2571
2612
  return false;
2572
2613
  }
2573
2614
  var TestMutationCheck = class {
@@ -6331,4 +6372,4 @@ async function resolveRunManifest(dbRoot, runId) {
6331
6372
 
6332
6373
  //#endregion
6333
6374
  export { FindingsInjector, RunManifest, RuntimeProbeListSchema, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, readCurrentRunId, renderFindings, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck, runStaleVerificationRecovery };
6334
- //# sourceMappingURL=manifest-read-Dan3I0ea.js.map
6375
+ //# sourceMappingURL=manifest-read-B2Tn8bvh.js.map
@@ -1,6 +1,6 @@
1
1
  import "../../logger-KeHncl-f.js";
2
2
  import "../../dist-Dl3vBZil.js";
3
- import "../../manifest-read-Dan3I0ea.js";
4
- import { runInteractivePrompt } from "../../interactive-prompt-Cj0Od5XZ.js";
3
+ import "../../manifest-read-B2Tn8bvh.js";
4
+ import { runInteractivePrompt } from "../../interactive-prompt-D-xBHKiP.js";
5
5
 
6
6
  export { runInteractivePrompt };
@@ -1,11 +1,11 @@
1
- import { BMAD_BASELINE_TOKENS_FULL, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-BmBd4zyE.js";
1
+ import { BMAD_BASELINE_TOKENS_FULL, FileKvStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-DtcROhq3.js";
2
2
  import { createLogger } from "./logger-KeHncl-f.js";
3
3
  import { TypedEventBusImpl, createEventBus, createTuiApp, isTuiCapable, printNonTtyWarning, sleep } from "./helpers-CElYrONe.js";
4
4
  import { ADVISORY_NOTES, BRANCH_PREFIX, CLAUDE_AUTH_FAILURE_HINT, CODEX_SANDBOX_BLOCK_HINT, 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, classifyVersionGap, createConfigSystem, createDatabaseAdapter$1, createDecision, createGitWorktreeManager, createPipelineRun, createRequirement, detectClaudeAuthFailure, detectCodexSandboxBlock, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-Dl3vBZil.js";
5
- import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-Dan3I0ea.js";
5
+ import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-B2Tn8bvh.js";
6
6
  import { WorkGraphRepository, detectCycles } from "./work-graph-repository-DZyJv5pV.js";
7
7
  import { deriveExitCode, routeDecision } from "./decision-router-BAPpON_C.js";
8
- import { runInteractivePrompt } from "./interactive-prompt-Cj0Od5XZ.js";
8
+ import { runInteractivePrompt } from "./interactive-prompt-D-xBHKiP.js";
9
9
  import { runRecoveryEngine } from "./recovery-engine-BKGBeBnW.js";
10
10
  import { basename, dirname, extname, join } from "path";
11
11
  import { access, readFile, readdir, stat } from "fs/promises";
@@ -14217,11 +14217,25 @@ function createImplementationOrchestrator(deps) {
14217
14217
  await persistState();
14218
14218
  return;
14219
14219
  }
14220
- if (effectiveProjectRoot !== void 0 && effectiveProjectRoot !== projectRoot && isAbsolute(createResult.story_file)) {
14221
- const relToWorktree = relative(effectiveProjectRoot, createResult.story_file);
14220
+ if (effectiveProjectRoot !== void 0 && effectiveProjectRoot !== projectRoot) {
14221
+ const resolvedStoryFile = isAbsolute(createResult.story_file) ? createResult.story_file : resolve$1(effectiveProjectRoot, createResult.story_file);
14222
+ const canonicalize = (p) => {
14223
+ let cur = p;
14224
+ for (let i = 0; i < 64; i++) try {
14225
+ return join$1(realpathSync(cur), relative(cur, p));
14226
+ } catch {
14227
+ const parent = dirname$1(cur);
14228
+ if (parent === cur) break;
14229
+ cur = parent;
14230
+ }
14231
+ return p;
14232
+ };
14233
+ const realWorktree = canonicalize(effectiveProjectRoot);
14234
+ const realStoryFile = canonicalize(resolvedStoryFile);
14235
+ const relToWorktree = relative(realWorktree, realStoryFile);
14222
14236
  const outsideWorktree = relToWorktree.startsWith("..") || isAbsolute(relToWorktree);
14223
14237
  if (outsideWorktree) {
14224
- const errMsg = `create-story wrote its artifact OUTSIDE the story worktree: ${createResult.story_file} (worktree: ${effectiveProjectRoot}). The agent escaped its working directory — this is the parent/home-directory write-leak class (field finding #15). The stray file was NOT adopted; inspect and remove it.`;
14238
+ const errMsg = `create-story wrote its artifact OUTSIDE the story worktree: ${createResult.story_file} (resolved: ${resolvedStoryFile}) (worktree: ${effectiveProjectRoot}). The agent escaped its working directory — this is the parent/home-directory write-leak class (field finding #15). The stray file was NOT adopted; inspect and remove it.`;
14225
14239
  logger$27.error({
14226
14240
  storyKey,
14227
14241
  storyFile: createResult.story_file,
@@ -15266,6 +15280,72 @@ function createImplementationOrchestrator(deps) {
15266
15280
  }
15267
15281
  if (devStoryWasSuccess && gitDiffFiles !== void 0 && gitDiffFiles.length > 0) {
15268
15282
  const implClassification = classifyImplementationDiff(gitDiffFiles);
15283
+ let implAddedLines;
15284
+ if (implClassification.hasImplementation && baselineHeadSha) {
15285
+ const numstatCwd = effectiveProjectRoot ?? process.cwd();
15286
+ try {
15287
+ execSync("git add -N -A", {
15288
+ cwd: numstatCwd,
15289
+ timeout: 5e3,
15290
+ stdio: [
15291
+ "ignore",
15292
+ "pipe",
15293
+ "pipe"
15294
+ ]
15295
+ });
15296
+ const numstat = execSync("git diff -w --numstat HEAD", {
15297
+ cwd: numstatCwd,
15298
+ encoding: "utf-8",
15299
+ timeout: 5e3,
15300
+ stdio: [
15301
+ "ignore",
15302
+ "pipe",
15303
+ "pipe"
15304
+ ]
15305
+ });
15306
+ try {
15307
+ execSync("git reset -q", {
15308
+ cwd: numstatCwd,
15309
+ timeout: 5e3,
15310
+ stdio: [
15311
+ "ignore",
15312
+ "pipe",
15313
+ "pipe"
15314
+ ]
15315
+ });
15316
+ } catch {}
15317
+ const isArtifactPath = (f$1) => {
15318
+ const n$1 = f$1.replace(/\\/g, "/").replace(/^\.\//, "");
15319
+ return n$1.startsWith("_bmad-output/") || n$1.startsWith(".substrate/");
15320
+ };
15321
+ const implRows = numstat.split("\n").map((line) => line.split(" ")).filter((cols) => cols.length === 3 && cols[0] !== "-" && !isArtifactPath(cols[2]));
15322
+ implAddedLines = implRows.length > 0 ? implRows.reduce((sum, cols) => sum + (Number.parseInt(cols[0], 10) || 0), 0) : void 0;
15323
+ } catch {
15324
+ implAddedLines = void 0;
15325
+ }
15326
+ }
15327
+ if (implClassification.hasImplementation && implAddedLines === 0) {
15328
+ logger$27.warn({
15329
+ storyKey,
15330
+ changed: gitDiffFiles.slice(0, 10)
15331
+ }, "dev-story reported success but its implementation files added zero non-whitespace lines (empty stub / whitespace-only / pure deletion) — escalating no-implementation");
15332
+ endPhase(storyKey, "dev-story", devStoryModel);
15333
+ updateStory(storyKey, {
15334
+ phase: "ESCALATED",
15335
+ error: "no-implementation",
15336
+ completedAt: new Date().toISOString()
15337
+ });
15338
+ await writeStoryMetricsBestEffort(storyKey, "escalated", 0);
15339
+ await emitEscalation({
15340
+ storyKey,
15341
+ lastVerdict: "no-implementation",
15342
+ reviewCycles: 0,
15343
+ issues: [`dev-story reported COMPLETE and touched non-artifact files, but added ZERO non-whitespace lines to any of them (${gitDiffFiles.slice(0, 10).join(", ")}) — the "implementation" is an empty stub, a whitespace-only edit, or a pure deletion.`],
15344
+ escalationReason: "no-implementation"
15345
+ });
15346
+ await persistState();
15347
+ return;
15348
+ }
15269
15349
  if (!implClassification.hasImplementation) {
15270
15350
  logger$27.warn({
15271
15351
  storyKey,
@@ -47933,4 +48013,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47933
48013
 
47934
48014
  //#endregion
47935
48015
  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 };
47936
- //# sourceMappingURL=run-DEBYRpko.js.map
48016
+ //# sourceMappingURL=run-BbgwnFFw.js.map
@@ -1,14 +1,14 @@
1
- import "./health-BmBd4zyE.js";
1
+ import "./health-DtcROhq3.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-Dl3vBZil.js";
5
- import "./manifest-read-Dan3I0ea.js";
6
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DEBYRpko.js";
5
+ import "./manifest-read-B2Tn8bvh.js";
6
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BbgwnFFw.js";
7
7
  import "./routing-DFxoKHDt.js";
8
8
  import "./work-graph-repository-DZyJv5pV.js";
9
9
  import "./decisions-CzSIEeGP.js";
10
10
  import "./decision-router-BAPpON_C.js";
11
- import "./interactive-prompt-Cj0Od5XZ.js";
11
+ import "./interactive-prompt-D-xBHKiP.js";
12
12
  import "./recovery-engine-BKGBeBnW.js";
13
13
 
14
14
  export { runRunAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.20.153",
3
+ "version": "0.20.155",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",