substrate-ai 0.20.152 → 0.20.154

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.
@@ -0,0 +1,4 @@
1
+ import { AdapterRegistry } from "./dist-Dl3vBZil.js";
2
+ import "./adapter-registry-DXLMTmfD.js";
3
+
4
+ export { AdapterRegistry };
package/dist/cli/index.js CHANGED
@@ -1,20 +1,20 @@
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-Bj5OYB7r.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-BmBd4zyE.js";
3
3
  import { createLogger } from "../logger-KeHncl-f.js";
4
4
  import { createEventBus } from "../helpers-CElYrONe.js";
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-90byyGPp.js";
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-BAN_-QKy.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-DbT2-Wzg.js";
9
- import "../errors-ST3E8qWc.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-CNzfjk92.js";
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-Du_Yt_N4.js";
14
+ import "../interactive-prompt-Cj0Od5XZ.js";
15
15
  import "../recovery-engine-BKGBeBnW.js";
16
16
  import "../version-manager-impl-qFBiO4Eh.js";
17
- import { registerUpgradeCommand } from "../upgrade-Dw6jKkH3.js";
17
+ import { registerUpgradeCommand } from "../upgrade-DGqUA_5f.js";
18
18
  import { Command } from "commander";
19
19
  import { fileURLToPath } from "url";
20
20
  import { dirname, join, resolve } from "path";
@@ -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-DK5Kk5Bi.js");
7129
+ const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-BwXD8UBv.js");
7130
7130
  const substrateDirPath = join(projectRoot, ".substrate");
7131
7131
  const processInfo = inspectProcessTree$1({
7132
7132
  projectRoot,
@@ -8074,7 +8074,7 @@ function defaultSupervisorDeps() {
8074
8074
  if (cached === null) {
8075
8075
  const { AdapterRegistry: AR } = await import(
8076
8076
  /* @vite-ignore */
8077
- "../adapter-registry-BsBP3j5i.js"
8077
+ "../adapter-registry-DJI97Kz-.js"
8078
8078
  );
8079
8079
  cached = new AR();
8080
8080
  await cached.discoverAndRegister();
@@ -8641,11 +8641,11 @@ async function runSupervisorAction(options, deps = {}) {
8641
8641
  try {
8642
8642
  const { createExperimenter } = await import(
8643
8643
  /* @vite-ignore */
8644
- "../experimenter-CyA9K5u6.js"
8644
+ "../experimenter-BtX2GBSg.js"
8645
8645
  );
8646
8646
  const { getLatestRun: getLatest } = await import(
8647
8647
  /* @vite-ignore */
8648
- "../decisions-DH12X_94.js"
8648
+ "../decisions-Dd8Nc_Vs.js"
8649
8649
  );
8650
8650
  const expAdapter = createDatabaseAdapter({
8651
8651
  backend: "auto",
@@ -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-BbXX6gY5.js"
8658
+ "../run-6x92Moln.js"
8659
8659
  );
8660
8660
  const runStoryFn = async (opts) => {
8661
8661
  const exitCode = await runPipeline({
@@ -9180,7 +9180,7 @@ async function runMetricsAction(options) {
9180
9180
  const routingConfigPath = join(dbDir, "routing.yml");
9181
9181
  let routingConfig = null;
9182
9182
  if (existsSync$1(routingConfigPath)) try {
9183
- const { loadModelRoutingConfig } = await import("../routing-pCkRxj09.js");
9183
+ const { loadModelRoutingConfig } = await import("../routing-CKcQZJZo.js");
9184
9184
  routingConfig = loadModelRoutingConfig(routingConfigPath);
9185
9185
  } catch {}
9186
9186
  if (routingConfig === null) routingConfig = {
@@ -13508,8 +13508,8 @@ async function createProgram() {
13508
13508
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
13509
13509
  function checkForUpdatesInBackground(currentVersion) {
13510
13510
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
13511
- import("../upgrade-unZndH-S.js").then(async () => {
13512
- const { createVersionManager } = await import("../version-manager-impl--XXnwjMd.js");
13511
+ import("../upgrade-CNtCNhsT.js").then(async () => {
13512
+ const { createVersionManager } = await import("../version-manager-impl-f4r2s_Nv.js");
13513
13513
  const vm = createVersionManager();
13514
13514
  const result = await vm.checkForUpdates();
13515
13515
  if (result.updateAvailable) {
@@ -1,4 +1,4 @@
1
- import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-90byyGPp.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-Dl3vBZil.js";
2
2
  import "./decisions-CzSIEeGP.js";
3
3
 
4
4
  export { getLatestRun };
@@ -9566,10 +9566,20 @@ const execAsync$2 = promisify(exec);
9566
9566
  * directory — the worktree base, outside any repo after H4.2) so it can
9567
9567
  * never be committed by commit-first.
9568
9568
  *
9569
- * Rules: reads/search/bash allowed everywhere (verification needs the
9570
- * suite + git); file MUTATION allowed only under the worktree anything
9571
- * else falls to "ask", which headless -p mode denies visibly (there is no
9572
- * interactive prompt to stall on).
9569
+ * Scopes the Edit/Write/NotebookEdit TOOLS to the worktree (out-of-worktree
9570
+ * mutation via those tools falls to "ask", which headless -p mode denies).
9571
+ *
9572
+ * NOT A SECURITY BOUNDARY (red-team, 2026-07-06). `Bash` is allowed with no
9573
+ * path restriction — Claude Code's Bash permissioning is command-string
9574
+ * based, and Bash can invoke any binary that writes (echo/tee/python/…), so a
9575
+ * determined agent can mutate ANY path the host user can write. `git -C
9576
+ * <path>` likewise reaches repos outside the worktree (the H4.1
9577
+ * GIT_CEILING_DIRECTORIES scrub only blocks AMBIENT discovery, not explicit
9578
+ * targets). This profile is accident-mitigation — it stops a well-behaved
9579
+ * agent from *tool*-writing outside its worktree — not containment of a
9580
+ * hostile one. Real confinement (worktree as the only writable mount)
9581
+ * requires the container execution backend (H4.4 seam; see
9582
+ * docs/2026-07-06-container-execution-seam.md and the red-team review).
9573
9583
  */
9574
9584
  function writeScopedPermissionSettings(worktreePath) {
9575
9585
  const wt = path$3.resolve(worktreePath);
@@ -12600,4 +12610,4 @@ async function callLLM(params) {
12600
12610
 
12601
12611
  //#endregion
12602
12612
  export { ADVISORY_NOTES, AdapterRegistry, AdtError, BRANCH_PREFIX, BudgetConfigSchema, CLAUDE_AUTH_FAILURE_HINT, CODEX_SANDBOX_BLOCK_HINT, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, Categorizer, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, ConsumerAnalyzer, CostTrackerConfigSchema, DEFAULT_CONFIG, DEFAULT_GLOBAL_SETTINGS, DispatcherImpl, DoltClient, DoltNotInstalled, DoltQueryError, ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, EfficiencyScorer, GeminiCLIAdapter, GlobalSettingsSchema, InMemoryDatabaseAdapter, IngestionServer, LEARNING_FINDING, LogTurnAnalyzer, ModelRoutingConfigSchema, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProviderPolicySchema, ProvidersSchema, Recommender, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, STORY_METRICS, STORY_OUTCOME, SubstrateConfigSchema, TASK_TYPE_PHASE_MAP, TEST_EXPANSION_FINDING, TEST_PLAN, TelemetryConfigSchema, TelemetryNormalizer, TelemetryPipeline, TurnAnalyzer, VersionManagerImpl, addTokenUsage, aggregateTokenUsageForRun, aggregateTokenUsageForStory, buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, callLLM, checkDoltInstalled, classifyVersionGap, compareRunMetrics, createAmendmentRun, createConfigSystem, createDatabaseAdapter as createDatabaseAdapter$1, createDecision, createExperimenter, createGitWorktreeManager, createPipelineRun, createRequirement, createStderrLogger, createVersionManager, detectClaudeAuthFailure, detectCodexSandboxBlock, detectInterfaceChanges, determineVerdict, getActiveDecisions, getAllCostEntriesFiltered, getArtifactByTypeForRun, getArtifactsByRun, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getModelTier, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initWorkGraphSchema, initializeDolt, listRequirements, listRunMetrics, loadModelRoutingConfig, loadParentRunDecisions, registerArtifact, resolvePromptFile, supersedeDecision, swallowDebug, tagRunAsBaseline, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics };
12603
- //# sourceMappingURL=dist-90byyGPp.js.map
12613
+ //# sourceMappingURL=dist-Dl3vBZil.js.map
@@ -1,4 +1,4 @@
1
- import { AdtError } from "./dist-90byyGPp.js";
1
+ import { AdtError } from "./dist-Dl3vBZil.js";
2
2
 
3
3
  //#region src/core/errors.ts
4
4
  /** Error thrown when task configuration is invalid */
@@ -71,4 +71,4 @@ var TaskGraphIncompatibleFormatError = class extends AdtError {
71
71
 
72
72
  //#endregion
73
73
  export { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError };
74
- //# sourceMappingURL=errors-ST3E8qWc.js.map
74
+ //# sourceMappingURL=errors-Dyyei2ah.js.map
@@ -1,3 +1,3 @@
1
- import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-90byyGPp.js";
1
+ import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-Dl3vBZil.js";
2
2
 
3
3
  export { createExperimenter };
@@ -1,6 +1,6 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-90byyGPp.js";
3
- import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-BAN_-QKy.js";
2
+ import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-Dl3vBZil.js";
3
+ import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-Dan3I0ea.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-Bj5OYB7r.js.map
1003
+ //# sourceMappingURL=health-BmBd4zyE.js.map
@@ -1,7 +1,7 @@
1
- import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-Bj5OYB7r.js";
1
+ import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BmBd4zyE.js";
2
2
  import "./logger-KeHncl-f.js";
3
- import "./dist-90byyGPp.js";
4
- import "./manifest-read-BAN_-QKy.js";
3
+ import "./dist-Dl3vBZil.js";
4
+ import "./manifest-read-Dan3I0ea.js";
5
5
  import "./work-graph-repository-DZyJv5pV.js";
6
6
  import "./decisions-CzSIEeGP.js";
7
7
 
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { childLogger, createLogger, logger } from "./logger-KeHncl-f.js";
2
2
  import { assertDefined, createEventBus, createTuiApp, deepClone, formatDuration, generateId, isPlainObject, isTuiCapable, printNonTtyWarning, sleep, withRetry } from "./helpers-CElYrONe.js";
3
- import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-90byyGPp.js";
3
+ import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-Dl3vBZil.js";
4
4
  import "./adapter-registry-DXLMTmfD.js";
5
- import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-ST3E8qWc.js";
5
+ import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-Dyyei2ah.js";
6
6
 
7
7
  //#region src/core/di.ts
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-BAN_-QKy.js";
2
+ import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-Dan3I0ea.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-Du_Yt_N4.js.map
183
+ //# sourceMappingURL=interactive-prompt-Cj0Od5XZ.js.map
@@ -1,5 +1,5 @@
1
1
  import { createLogger } from "./logger-KeHncl-f.js";
2
- import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-90byyGPp.js";
2
+ import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-Dl3vBZil.js";
3
3
  import * as path$1 from "path";
4
4
  import { join } from "path";
5
5
  import { readFile } from "fs/promises";
@@ -6331,4 +6331,4 @@ async function resolveRunManifest(dbRoot, runId) {
6331
6331
 
6332
6332
  //#endregion
6333
6333
  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-BAN_-QKy.js.map
6334
+ //# sourceMappingURL=manifest-read-Dan3I0ea.js.map
@@ -1,6 +1,6 @@
1
1
  import "../../logger-KeHncl-f.js";
2
- import "../../dist-90byyGPp.js";
3
- import "../../manifest-read-BAN_-QKy.js";
4
- import { runInteractivePrompt } from "../../interactive-prompt-Du_Yt_N4.js";
2
+ import "../../dist-Dl3vBZil.js";
3
+ import "../../manifest-read-Dan3I0ea.js";
4
+ import { runInteractivePrompt } from "../../interactive-prompt-Cj0Od5XZ.js";
5
5
 
6
6
  export { runInteractivePrompt };
@@ -1,4 +1,4 @@
1
- import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-90byyGPp.js";
1
+ import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-Dl3vBZil.js";
2
2
  import "./routing-DFxoKHDt.js";
3
3
 
4
4
  export { loadModelRoutingConfig };
@@ -1,14 +1,14 @@
1
- import "./health-Bj5OYB7r.js";
1
+ import "./health-BmBd4zyE.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
- import "./dist-90byyGPp.js";
5
- import "./manifest-read-BAN_-QKy.js";
6
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DbT2-Wzg.js";
4
+ import "./dist-Dl3vBZil.js";
5
+ import "./manifest-read-Dan3I0ea.js";
6
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-CNzfjk92.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-Du_Yt_N4.js";
11
+ import "./interactive-prompt-Cj0Od5XZ.js";
12
12
  import "./recovery-engine-BKGBeBnW.js";
13
13
 
14
14
  export { runRunAction };
@@ -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-Bj5OYB7r.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-BmBd4zyE.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, 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-90byyGPp.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-BAN_-QKy.js";
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";
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-Du_Yt_N4.js";
8
+ import { runInteractivePrompt } from "./interactive-prompt-Cj0Od5XZ.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";
@@ -5324,7 +5324,7 @@ function runBuildVerification(options) {
5324
5324
  * never appear here. Feeds the reward-hack tripwire (agents editing existing
5325
5325
  * tests to go green — the measured exploit pattern).
5326
5326
  */
5327
- function checkGitModifiedTrackedFiles(workingDir = process.cwd()) {
5327
+ function checkGitModifiedTrackedFiles(workingDir = process.cwd(), baselineSha) {
5328
5328
  const results = new Set();
5329
5329
  try {
5330
5330
  execSync("git rev-parse --verify HEAD", {
@@ -5339,7 +5339,9 @@ function checkGitModifiedTrackedFiles(workingDir = process.cwd()) {
5339
5339
  } catch {
5340
5340
  return [];
5341
5341
  }
5342
- for (const args of ["git diff --name-only HEAD", "git diff --cached --name-only"]) try {
5342
+ const diffs = ["git diff --name-only HEAD", "git diff --cached --name-only"];
5343
+ if (baselineSha !== void 0 && baselineSha.length > 0) diffs.push(`git diff --name-only --diff-filter=MD ${baselineSha}..HEAD`);
5344
+ for (const args of diffs) try {
5343
5345
  execSync(args, {
5344
5346
  cwd: workingDir,
5345
5347
  encoding: "utf-8",
@@ -14215,11 +14217,12 @@ function createImplementationOrchestrator(deps) {
14215
14217
  await persistState();
14216
14218
  return;
14217
14219
  }
14218
- if (effectiveProjectRoot !== void 0 && effectiveProjectRoot !== projectRoot && isAbsolute(createResult.story_file)) {
14219
- 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 relToWorktree = relative(effectiveProjectRoot, resolvedStoryFile);
14220
14223
  const outsideWorktree = relToWorktree.startsWith("..") || isAbsolute(relToWorktree);
14221
14224
  if (outsideWorktree) {
14222
- 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.`;
14225
+ 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.`;
14223
14226
  logger$27.error({
14224
14227
  storyKey,
14225
14228
  storyFile: createResult.story_file,
@@ -15192,7 +15195,7 @@ function createImplementationOrchestrator(deps) {
15192
15195
  if (devStoryWasSuccess) {
15193
15196
  gitDiffFiles = checkGitDiffFiles(effectiveProjectRoot ?? process.cwd());
15194
15197
  try {
15195
- modifiedTrackedFiles = checkGitModifiedTrackedFiles(effectiveProjectRoot ?? process.cwd());
15198
+ modifiedTrackedFiles = checkGitModifiedTrackedFiles(effectiveProjectRoot ?? process.cwd(), baselineHeadSha);
15196
15199
  } catch {
15197
15200
  modifiedTrackedFiles = void 0;
15198
15201
  }
@@ -16102,6 +16105,34 @@ function createImplementationOrchestrator(deps) {
16102
16105
  err: gateErr instanceof Error ? gateErr.message : String(gateErr)
16103
16106
  }, "merge-to-main pre-flight verification failed — proceeding with merge phase");
16104
16107
  }
16108
+ {
16109
+ const norm = (f$1) => f$1.replace(/\\/g, "/").replace(/^\.\//, "");
16110
+ const disclosed = new Set((devFilesModified ?? []).map(norm));
16111
+ const mergedFiles = recaptureChangedFiles(effectiveProjectRoot ?? process.cwd());
16112
+ const { artifactOnly } = classifyImplementationDiff(mergedFiles);
16113
+ const artifactSet = new Set(artifactOnly.map(norm));
16114
+ const undisclosed = mergedFiles.map(norm).filter((f$1) => !artifactSet.has(f$1) && !disclosed.has(f$1));
16115
+ if (undisclosed.length > 0) {
16116
+ logger$27.error({
16117
+ storyKey,
16118
+ undisclosed,
16119
+ disclosed: [...disclosed]
16120
+ }, "H7: refusing to merge — committed implementation files were never disclosed by the dev agent (files_modified) and thus never reviewed");
16121
+ updateStory(storyKey, {
16122
+ phase: "ESCALATED",
16123
+ error: "undisclosed-files-in-merge",
16124
+ completedAt: new Date().toISOString()
16125
+ });
16126
+ await emitEscalation({
16127
+ storyKey,
16128
+ lastVerdict: "undisclosed-files-in-merge",
16129
+ reviewCycles: completedReviewCycles,
16130
+ issues: [`${undisclosed.length} implementation file(s) are committed on the story branch but were NOT in the dev agent's files_modified (so no review cycle inspected them): ${undisclosed.join(", ")}. A merge would land unreviewed code. Inspect the branch; if the changes are legitimate, re-dispatch with accurate files_modified or merge manually.`]
16131
+ });
16132
+ await persistState();
16133
+ return "terminal";
16134
+ }
16135
+ }
16105
16136
  const finalizationMode = config.finalizationMode ?? "merge";
16106
16137
  const epicGateCommand = config.epicGateCommand;
16107
16138
  if (epicGateCommand !== void 0 && epicGateCommand.trim() !== "" && finalizationMode !== "branch") {
@@ -47796,7 +47827,7 @@ async function runFullPipeline(options) {
47796
47827
  */
47797
47828
  async function emitPreDispatchVersionAdvisory(currentVersion) {
47798
47829
  if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
47799
- const { createVersionManager } = await import("./version-manager-impl--XXnwjMd.js");
47830
+ const { createVersionManager } = await import("./version-manager-impl-f4r2s_Nv.js");
47800
47831
  const vm = createVersionManager();
47801
47832
  const result = await vm.checkForUpdates(true);
47802
47833
  const gap = classifyVersionGap(currentVersion, result.latestVersion);
@@ -47903,4 +47934,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47903
47934
 
47904
47935
  //#endregion
47905
47936
  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 };
47906
- //# sourceMappingURL=run-DbT2-Wzg.js.map
47937
+ //# sourceMappingURL=run-CNzfjk92.js.map
@@ -1,5 +1,5 @@
1
- import "./dist-90byyGPp.js";
1
+ import "./dist-Dl3vBZil.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-Dw6jKkH3.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-DGqUA_5f.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./dist-90byyGPp.js";
1
+ import { createVersionManager } from "./dist-Dl3vBZil.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-Dw6jKkH3.js.map
126
+ //# sourceMappingURL=upgrade-DGqUA_5f.js.map
@@ -1,4 +1,4 @@
1
- import { VersionManagerImpl, createVersionManager } from "./dist-90byyGPp.js";
1
+ import { VersionManagerImpl, createVersionManager } from "./dist-Dl3vBZil.js";
2
2
  import "./version-manager-impl-qFBiO4Eh.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.152",
3
+ "version": "0.20.154",
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-90byyGPp.js";
2
- import "./adapter-registry-DXLMTmfD.js";
3
-
4
- export { AdapterRegistry };