substrate-ai 0.20.144 → 0.20.146
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/adapter-registry-BPwWmPjJ.js +4 -0
- package/dist/cli/index.js +15 -15
- package/dist/{decisions-Dvw5HhyM.js → decisions-D_HEApFV.js} +1 -1
- package/dist/{dist-DiNK6QOD.js → dist-D2mJXElX.js} +117 -1
- package/dist/{errors-B21JUhcc.js → errors-CIBnPmzQ.js} +2 -2
- package/dist/{experimenter-D55L011w.js → experimenter-BZ17IbjW.js} +1 -1
- package/dist/{health-P6IZuE0b.js → health-RQmFEmIC.js} +3 -3
- package/dist/{health-0kOtC07t.js → health-eGHKiGlU.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/{interactive-prompt-DTLnCbk2.js → interactive-prompt-opOBwMDU.js} +2 -2
- package/dist/{manifest-read-DPN4jjTc.js → manifest-read-7kyDfQAK.js} +58 -4
- package/dist/modules/interactive-prompt/index.js +3 -3
- package/dist/{routing-_PGfe_cD.js → routing-CLVK4nBN.js} +1 -1
- package/dist/{run-CUcRdKFK.js → run-BhoAW6dJ.js} +97 -6
- package/dist/{run-B5KqcL9T.js → run-CJHnHg3o.js} +5 -5
- package/dist/{upgrade-DB7KzD9c.js → upgrade-Djo0dJak.js} +2 -2
- package/dist/{upgrade-CTj4hi8J.js → upgrade-DnB0p8b5.js} +2 -2
- package/dist/{version-manager-impl-HJMonRJi.js → version-manager-impl-CKsauG6T.js} +1 -1
- package/package.json +1 -1
- package/dist/adapter-registry-qU0IkbbQ.js +0 -4
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-
|
|
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-eGHKiGlU.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, 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-
|
|
6
|
-
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-
|
|
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, 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-D2mJXElX.js";
|
|
6
|
+
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-BhoAW6dJ.js";
|
|
7
7
|
import "../adapter-registry-DIcrxjH8.js";
|
|
8
|
-
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-
|
|
9
|
-
import "../errors-
|
|
8
|
+
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-7kyDfQAK.js";
|
|
9
|
+
import "../errors-CIBnPmzQ.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-
|
|
14
|
+
import "../interactive-prompt-opOBwMDU.js";
|
|
15
15
|
import "../recovery-engine-BKGBeBnW.js";
|
|
16
16
|
import "../version-manager-impl-qFBiO4Eh.js";
|
|
17
|
-
import { registerUpgradeCommand } from "../upgrade-
|
|
17
|
+
import { registerUpgradeCommand } from "../upgrade-Djo0dJak.js";
|
|
18
18
|
import { Command } from "commander";
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
20
|
import { dirname, join, resolve } from "path";
|
|
@@ -7052,7 +7052,7 @@ async function runStatusAction(options) {
|
|
|
7052
7052
|
logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
|
|
7053
7053
|
}
|
|
7054
7054
|
if (run === void 0) {
|
|
7055
|
-
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-
|
|
7055
|
+
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-RQmFEmIC.js");
|
|
7056
7056
|
const substrateDirPath = join(projectRoot, ".substrate");
|
|
7057
7057
|
const processInfo = inspectProcessTree$1({
|
|
7058
7058
|
projectRoot,
|
|
@@ -8000,7 +8000,7 @@ function defaultSupervisorDeps() {
|
|
|
8000
8000
|
if (cached === null) {
|
|
8001
8001
|
const { AdapterRegistry: AR } = await import(
|
|
8002
8002
|
/* @vite-ignore */
|
|
8003
|
-
"../adapter-registry-
|
|
8003
|
+
"../adapter-registry-BPwWmPjJ.js"
|
|
8004
8004
|
);
|
|
8005
8005
|
cached = new AR();
|
|
8006
8006
|
await cached.discoverAndRegister();
|
|
@@ -8567,11 +8567,11 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
8567
8567
|
try {
|
|
8568
8568
|
const { createExperimenter } = await import(
|
|
8569
8569
|
/* @vite-ignore */
|
|
8570
|
-
"../experimenter-
|
|
8570
|
+
"../experimenter-BZ17IbjW.js"
|
|
8571
8571
|
);
|
|
8572
8572
|
const { getLatestRun: getLatest } = await import(
|
|
8573
8573
|
/* @vite-ignore */
|
|
8574
|
-
"../decisions-
|
|
8574
|
+
"../decisions-D_HEApFV.js"
|
|
8575
8575
|
);
|
|
8576
8576
|
const expAdapter = createDatabaseAdapter({
|
|
8577
8577
|
backend: "auto",
|
|
@@ -8581,7 +8581,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
8581
8581
|
await initSchema(expAdapter);
|
|
8582
8582
|
const { runRunAction: runPipeline } = await import(
|
|
8583
8583
|
/* @vite-ignore */
|
|
8584
|
-
"../run-
|
|
8584
|
+
"../run-CJHnHg3o.js"
|
|
8585
8585
|
);
|
|
8586
8586
|
const runStoryFn = async (opts) => {
|
|
8587
8587
|
const exitCode = await runPipeline({
|
|
@@ -9106,7 +9106,7 @@ async function runMetricsAction(options) {
|
|
|
9106
9106
|
const routingConfigPath = join(dbDir, "routing.yml");
|
|
9107
9107
|
let routingConfig = null;
|
|
9108
9108
|
if (existsSync$1(routingConfigPath)) try {
|
|
9109
|
-
const { loadModelRoutingConfig } = await import("../routing-
|
|
9109
|
+
const { loadModelRoutingConfig } = await import("../routing-CLVK4nBN.js");
|
|
9110
9110
|
routingConfig = loadModelRoutingConfig(routingConfigPath);
|
|
9111
9111
|
} catch {}
|
|
9112
9112
|
if (routingConfig === null) routingConfig = {
|
|
@@ -13420,8 +13420,8 @@ async function createProgram() {
|
|
|
13420
13420
|
/** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
|
|
13421
13421
|
function checkForUpdatesInBackground(currentVersion) {
|
|
13422
13422
|
if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
|
|
13423
|
-
import("../upgrade-
|
|
13424
|
-
const { createVersionManager } = await import("../version-manager-impl-
|
|
13423
|
+
import("../upgrade-DnB0p8b5.js").then(async () => {
|
|
13424
|
+
const { createVersionManager } = await import("../version-manager-impl-CKsauG6T.js");
|
|
13425
13425
|
const vm = createVersionManager();
|
|
13426
13426
|
const result = await vm.checkForUpdates();
|
|
13427
13427
|
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-
|
|
1
|
+
import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./dist-D2mJXElX.js";
|
|
2
2
|
import "./decisions-CzSIEeGP.js";
|
|
3
3
|
|
|
4
4
|
export { getLatestRun };
|
|
@@ -10414,6 +10414,121 @@ var GeminiCLIAdapter = class GeminiCLIAdapter {
|
|
|
10414
10414
|
}
|
|
10415
10415
|
};
|
|
10416
10416
|
|
|
10417
|
+
//#endregion
|
|
10418
|
+
//#region packages/core/dist/adapters/stub-adapter.js
|
|
10419
|
+
var StubAdapter = class {
|
|
10420
|
+
id = "stub";
|
|
10421
|
+
displayName = "Stub Agent (e2e harness)";
|
|
10422
|
+
adapterVersion = "1.0.0";
|
|
10423
|
+
async healthCheck() {
|
|
10424
|
+
if (process.env.SUBSTRATE_STUB_ADAPTER !== "1") return {
|
|
10425
|
+
healthy: false,
|
|
10426
|
+
error: "stub adapter is gated behind SUBSTRATE_STUB_ADAPTER=1 (e2e harness only)",
|
|
10427
|
+
supportsHeadless: true
|
|
10428
|
+
};
|
|
10429
|
+
const script = process.env.SUBSTRATE_STUB_SCRIPT;
|
|
10430
|
+
if (script === void 0 || script === "") return {
|
|
10431
|
+
healthy: false,
|
|
10432
|
+
error: "SUBSTRATE_STUB_SCRIPT must point at the scenario script",
|
|
10433
|
+
supportsHeadless: true
|
|
10434
|
+
};
|
|
10435
|
+
try {
|
|
10436
|
+
await access$1(script);
|
|
10437
|
+
} catch {
|
|
10438
|
+
return {
|
|
10439
|
+
healthy: false,
|
|
10440
|
+
error: `SUBSTRATE_STUB_SCRIPT not readable: ${script}`,
|
|
10441
|
+
supportsHeadless: true
|
|
10442
|
+
};
|
|
10443
|
+
}
|
|
10444
|
+
return {
|
|
10445
|
+
healthy: true,
|
|
10446
|
+
version: "stub-1.0.0",
|
|
10447
|
+
supportsHeadless: true
|
|
10448
|
+
};
|
|
10449
|
+
}
|
|
10450
|
+
buildCommand(prompt, options) {
|
|
10451
|
+
return {
|
|
10452
|
+
binary: process.execPath,
|
|
10453
|
+
args: [process.env.SUBSTRATE_STUB_SCRIPT ?? "/nonexistent-stub-script", options.taskType ?? "unknown"],
|
|
10454
|
+
env: {
|
|
10455
|
+
SUBSTRATE_STUB_SCENARIO: process.env.SUBSTRATE_STUB_SCENARIO ?? "success",
|
|
10456
|
+
SUBSTRATE_STUB_STORY_KEY: options.storyKey ?? ""
|
|
10457
|
+
},
|
|
10458
|
+
cwd: options.worktreePath,
|
|
10459
|
+
stdin: prompt
|
|
10460
|
+
};
|
|
10461
|
+
}
|
|
10462
|
+
buildPlanningCommand(_request, options) {
|
|
10463
|
+
return {
|
|
10464
|
+
binary: process.execPath,
|
|
10465
|
+
args: [process.env.SUBSTRATE_STUB_SCRIPT ?? "/nonexistent-stub-script", "planning"],
|
|
10466
|
+
env: { SUBSTRATE_STUB_SCENARIO: process.env.SUBSTRATE_STUB_SCENARIO ?? "success" },
|
|
10467
|
+
cwd: options.worktreePath,
|
|
10468
|
+
stdin: ""
|
|
10469
|
+
};
|
|
10470
|
+
}
|
|
10471
|
+
parseOutput(stdout, stderr, exitCode) {
|
|
10472
|
+
if (exitCode !== 0) return {
|
|
10473
|
+
success: false,
|
|
10474
|
+
output: stdout,
|
|
10475
|
+
error: stderr || `stub exited with code ${String(exitCode)}`,
|
|
10476
|
+
exitCode
|
|
10477
|
+
};
|
|
10478
|
+
return {
|
|
10479
|
+
success: true,
|
|
10480
|
+
output: stdout,
|
|
10481
|
+
exitCode
|
|
10482
|
+
};
|
|
10483
|
+
}
|
|
10484
|
+
parsePlanOutput(stdout, stderr, exitCode) {
|
|
10485
|
+
if (exitCode !== 0) return {
|
|
10486
|
+
success: false,
|
|
10487
|
+
tasks: [],
|
|
10488
|
+
error: stderr || `stub exited ${String(exitCode)}`
|
|
10489
|
+
};
|
|
10490
|
+
return {
|
|
10491
|
+
success: false,
|
|
10492
|
+
tasks: [],
|
|
10493
|
+
error: "stub adapter does not generate plans"
|
|
10494
|
+
};
|
|
10495
|
+
}
|
|
10496
|
+
estimateTokens(text) {
|
|
10497
|
+
const input = Math.ceil(text.length / 4);
|
|
10498
|
+
return {
|
|
10499
|
+
input,
|
|
10500
|
+
output: 0,
|
|
10501
|
+
total: input
|
|
10502
|
+
};
|
|
10503
|
+
}
|
|
10504
|
+
getCapabilities() {
|
|
10505
|
+
return {
|
|
10506
|
+
supportsJsonOutput: false,
|
|
10507
|
+
supportsStreaming: false,
|
|
10508
|
+
supportsSubscriptionBilling: true,
|
|
10509
|
+
supportsApiBilling: false,
|
|
10510
|
+
supportsPlanGeneration: false,
|
|
10511
|
+
maxContextTokens: 1e6,
|
|
10512
|
+
supportedTaskTypes: [
|
|
10513
|
+
"create-story",
|
|
10514
|
+
"dev-story",
|
|
10515
|
+
"code-review",
|
|
10516
|
+
"fix-story",
|
|
10517
|
+
"test-plan",
|
|
10518
|
+
"probe-author",
|
|
10519
|
+
"test-expansion"
|
|
10520
|
+
],
|
|
10521
|
+
supportedLanguages: [
|
|
10522
|
+
"python",
|
|
10523
|
+
"typescript",
|
|
10524
|
+
"go"
|
|
10525
|
+
],
|
|
10526
|
+
timeoutMultiplier: 1,
|
|
10527
|
+
defaultModel: "stub"
|
|
10528
|
+
};
|
|
10529
|
+
}
|
|
10530
|
+
};
|
|
10531
|
+
|
|
10417
10532
|
//#endregion
|
|
10418
10533
|
//#region packages/core/dist/adapters/adapter-registry.js
|
|
10419
10534
|
/**
|
|
@@ -10468,6 +10583,7 @@ var AdapterRegistry = class {
|
|
|
10468
10583
|
new CodexCLIAdapter(),
|
|
10469
10584
|
new GeminiCLIAdapter()
|
|
10470
10585
|
];
|
|
10586
|
+
if (process.env.SUBSTRATE_STUB_ADAPTER === "1") builtInAdapters.push(new StubAdapter());
|
|
10471
10587
|
const results = [];
|
|
10472
10588
|
let registeredCount = 0;
|
|
10473
10589
|
let failedCount = 0;
|
|
@@ -11520,4 +11636,4 @@ async function callLLM(params) {
|
|
|
11520
11636
|
|
|
11521
11637
|
//#endregion
|
|
11522
11638
|
export { ADVISORY_NOTES, AdapterRegistry, AdtError, 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, 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 };
|
|
11523
|
-
//# sourceMappingURL=dist-
|
|
11639
|
+
//# sourceMappingURL=dist-D2mJXElX.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdtError } from "./dist-
|
|
1
|
+
import { AdtError } from "./dist-D2mJXElX.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-
|
|
74
|
+
//# sourceMappingURL=errors-CIBnPmzQ.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-
|
|
1
|
+
import { buildAuditLogEntry, buildBranchName, buildModificationDirective, buildPRBody, buildWorktreePath, createExperimenter, determineVerdict, resolvePromptFile } from "./dist-D2mJXElX.js";
|
|
2
2
|
|
|
3
3
|
export { createExperimenter };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-
|
|
1
|
+
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-eGHKiGlU.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
|
-
import "./dist-
|
|
4
|
-
import "./manifest-read-
|
|
3
|
+
import "./dist-D2mJXElX.js";
|
|
4
|
+
import "./manifest-read-7kyDfQAK.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
|
-
import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-
|
|
3
|
-
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-
|
|
2
|
+
import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-D2mJXElX.js";
|
|
3
|
+
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-7kyDfQAK.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-
|
|
1003
|
+
//# sourceMappingURL=health-eGHKiGlU.js.map
|
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-
|
|
3
|
+
import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-D2mJXElX.js";
|
|
4
4
|
import "./adapter-registry-DIcrxjH8.js";
|
|
5
|
-
import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-
|
|
5
|
+
import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-CIBnPmzQ.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-
|
|
2
|
+
import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-7kyDfQAK.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-
|
|
183
|
+
//# sourceMappingURL=interactive-prompt-opOBwMDU.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
2
|
-
import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-
|
|
2
|
+
import { LEARNING_FINDING, createDecision, getDecisionsByCategory } from "./dist-D2mJXElX.js";
|
|
3
3
|
import * as path$1 from "path";
|
|
4
4
|
import { join } from "path";
|
|
5
5
|
import { readFile } from "fs/promises";
|
|
@@ -1737,6 +1737,16 @@ function extractAcceptanceCriteriaIds(storyContent) {
|
|
|
1737
1737
|
if (id !== void 0) ids.add(id);
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
|
+
if (ids.size === 0) {
|
|
1741
|
+
const lines = acceptanceSection.split(/\r?\n/);
|
|
1742
|
+
const scenarioHeadings = lines.filter((l) => /^\s*(?:#+\s*)?(?:\*\*)?Scenario\b/i.test(l)).length;
|
|
1743
|
+
let scenarioCount = scenarioHeadings;
|
|
1744
|
+
if (scenarioCount === 0) scenarioCount = lines.filter((l) => /^\s*(?:\*\*)?Given\b/i.test(l)).length;
|
|
1745
|
+
for (let i = 1; i <= scenarioCount; i++) {
|
|
1746
|
+
const id = normalizeAcId(String(i));
|
|
1747
|
+
if (id !== void 0) ids.add(id);
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1740
1750
|
}
|
|
1741
1751
|
return sortAcIds(ids);
|
|
1742
1752
|
}
|
|
@@ -1783,7 +1793,7 @@ var AcceptanceCriteriaEvidenceCheck = class {
|
|
|
1783
1793
|
const findings = [{
|
|
1784
1794
|
category: "ac-context-missing",
|
|
1785
1795
|
severity: "warn",
|
|
1786
|
-
message: "no
|
|
1796
|
+
message: "no acceptance criteria could be extracted from the story (numbered, AC-ref, bullet, and Gherkin scenario forms all matched nothing) — AC-EVIDENCE ENFORCEMENT IS SKIPPED for this story. If the story genuinely has ACs, their format is unrecognized; number them (1. / AC1) or use Given/When/Then scenarios."
|
|
1787
1797
|
}];
|
|
1788
1798
|
return {
|
|
1789
1799
|
status: "warn",
|
|
@@ -2345,6 +2355,11 @@ var TestSuiteCheck = class {
|
|
|
2345
2355
|
stderrTail: tail$1(stderr),
|
|
2346
2356
|
durationMs: duration
|
|
2347
2357
|
}];
|
|
2358
|
+
if (context.devStoryResult?.tests === "pass") findings.push({
|
|
2359
|
+
category: "tests-claim-mismatch",
|
|
2360
|
+
severity: "error",
|
|
2361
|
+
message: `dev-story self-reported tests: pass, but the real suite failed (exit ${String(code)}) — the claim is contradicted by ground truth`
|
|
2362
|
+
});
|
|
2348
2363
|
resolve$2({
|
|
2349
2364
|
status: "fail",
|
|
2350
2365
|
details: renderFindings(findings),
|
|
@@ -2517,6 +2532,44 @@ var ContaminationCheck = class {
|
|
|
2517
2532
|
}
|
|
2518
2533
|
};
|
|
2519
2534
|
|
|
2535
|
+
//#endregion
|
|
2536
|
+
//#region packages/sdlc/dist/verification/checks/test-mutation-check.js
|
|
2537
|
+
/** Heuristic: is this path a test file? Covers the JS/TS/Python/Go idioms. */
|
|
2538
|
+
function isTestPath(file) {
|
|
2539
|
+
const norm = file.replace(/\\/g, "/").toLowerCase();
|
|
2540
|
+
const base = norm.split("/").pop() ?? "";
|
|
2541
|
+
if (/(^|\/)(__tests__|tests?)\//.test(norm)) return true;
|
|
2542
|
+
if (/\.(test|spec)\.[a-z]+$/.test(base)) return true;
|
|
2543
|
+
if (/^test_.*\.py$/.test(base) || /_test\.(py|go)$/.test(base)) return true;
|
|
2544
|
+
return false;
|
|
2545
|
+
}
|
|
2546
|
+
var TestMutationCheck = class {
|
|
2547
|
+
name = "test-mutation";
|
|
2548
|
+
tier = "A";
|
|
2549
|
+
async run(context) {
|
|
2550
|
+
const start = Date.now();
|
|
2551
|
+
const modified = context.modifiedTrackedFiles ?? [];
|
|
2552
|
+
const mutatedTests = modified.filter(isTestPath);
|
|
2553
|
+
if (mutatedTests.length === 0) return {
|
|
2554
|
+
status: "pass",
|
|
2555
|
+
details: "no pre-existing test files were modified",
|
|
2556
|
+
duration_ms: Date.now() - start,
|
|
2557
|
+
findings: []
|
|
2558
|
+
};
|
|
2559
|
+
const findings = [{
|
|
2560
|
+
category: "test-mutation",
|
|
2561
|
+
severity: "warn",
|
|
2562
|
+
message: `story MODIFIED ${String(mutatedTests.length)} pre-existing test file(s): ${mutatedTests.slice(0, 10).join(", ")}` + (mutatedTests.length > 10 ? ` (+${String(mutatedTests.length - 10)} more)` : "") + ". Editing existing tests to satisfy a suite is the measured reward-hack pattern — review whether these edits weaken assertions the story was supposed to satisfy."
|
|
2563
|
+
}];
|
|
2564
|
+
return {
|
|
2565
|
+
status: "warn",
|
|
2566
|
+
details: renderFindings(findings),
|
|
2567
|
+
duration_ms: Date.now() - start,
|
|
2568
|
+
findings
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2520
2573
|
//#endregion
|
|
2521
2574
|
//#region packages/sdlc/dist/verification/probes/types.js
|
|
2522
2575
|
/**
|
|
@@ -4006,7 +4059,7 @@ var SourceAcFidelityCheck = class {
|
|
|
4006
4059
|
}
|
|
4007
4060
|
}
|
|
4008
4061
|
const existsInCode = pathSatisfiedByCode(context.workingDir, clause.text);
|
|
4009
|
-
const modifiedFiles = context.devStoryResult?.files_modified ?? [];
|
|
4062
|
+
const modifiedFiles = context.changedFiles !== void 0 && context.changedFiles.length > 0 ? context.changedFiles : context.devStoryResult?.files_modified ?? [];
|
|
4010
4063
|
const referencedByStory = pathReferencedInModifiedFiles(context.workingDir, clause.text, modifiedFiles);
|
|
4011
4064
|
let severity;
|
|
4012
4065
|
let driftMessage;
|
|
@@ -4453,6 +4506,7 @@ function createDefaultVerificationPipeline(bus, config) {
|
|
|
4453
4506
|
new BuildCheck(),
|
|
4454
4507
|
new TestSuiteCheck(),
|
|
4455
4508
|
new ContaminationCheck(),
|
|
4509
|
+
new TestMutationCheck(),
|
|
4456
4510
|
new RuntimeProbeCheck(),
|
|
4457
4511
|
new SourceAcFidelityCheck(),
|
|
4458
4512
|
new SourceAcShelloutCheck(),
|
|
@@ -6236,4 +6290,4 @@ async function resolveRunManifest(dbRoot, runId) {
|
|
|
6236
6290
|
|
|
6237
6291
|
//#endregion
|
|
6238
6292
|
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 };
|
|
6239
|
-
//# sourceMappingURL=manifest-read-
|
|
6293
|
+
//# sourceMappingURL=manifest-read-7kyDfQAK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../logger-KeHncl-f.js";
|
|
2
|
-
import "../../dist-
|
|
3
|
-
import "../../manifest-read-
|
|
4
|
-
import { runInteractivePrompt } from "../../interactive-prompt-
|
|
2
|
+
import "../../dist-D2mJXElX.js";
|
|
3
|
+
import "../../manifest-read-7kyDfQAK.js";
|
|
4
|
+
import { runInteractivePrompt } from "../../interactive-prompt-opOBwMDU.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-
|
|
1
|
+
import { ModelRoutingConfigSchema, ProviderPolicySchema, RoutingConfigError, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, TASK_TYPE_PHASE_MAP, getModelTier, loadModelRoutingConfig } from "./dist-D2mJXElX.js";
|
|
2
2
|
import "./routing-DFxoKHDt.js";
|
|
3
3
|
|
|
4
4
|
export { loadModelRoutingConfig };
|
|
@@ -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-
|
|
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-eGHKiGlU.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, 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, createPipelineRun, createRequirement, createStderrLogger, 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-
|
|
5
|
-
import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-
|
|
4
|
+
import { ADVISORY_NOTES, 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, createPipelineRun, createRequirement, createStderrLogger, 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-D2mJXElX.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-7kyDfQAK.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-
|
|
8
|
+
import { runInteractivePrompt } from "./interactive-prompt-opOBwMDU.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";
|
|
@@ -5999,6 +5999,43 @@ function runBuildVerification(options) {
|
|
|
5999
5999
|
* @param workingDir - Directory to run git commands in (defaults to process.cwd())
|
|
6000
6000
|
* @returns Array of changed file paths; empty when nothing changed
|
|
6001
6001
|
*/
|
|
6002
|
+
/**
|
|
6003
|
+
* H1.7 (hardening program): the PRE-EXISTING files this story modified or
|
|
6004
|
+
* deleted — the tracked-diff portion of the working-tree change (unstaged
|
|
6005
|
+
* HEAD diff + staged), deliberately EXCLUDING untracked/new files. A tracked
|
|
6006
|
+
* file in this list existed before the dispatch; new tests the story wrote
|
|
6007
|
+
* never appear here. Feeds the reward-hack tripwire (agents editing existing
|
|
6008
|
+
* tests to go green — the measured exploit pattern).
|
|
6009
|
+
*/
|
|
6010
|
+
function checkGitModifiedTrackedFiles(workingDir = process.cwd()) {
|
|
6011
|
+
const results = new Set();
|
|
6012
|
+
try {
|
|
6013
|
+
execSync("git rev-parse --verify HEAD", {
|
|
6014
|
+
cwd: workingDir,
|
|
6015
|
+
stdio: [
|
|
6016
|
+
"ignore",
|
|
6017
|
+
"pipe",
|
|
6018
|
+
"pipe"
|
|
6019
|
+
],
|
|
6020
|
+
timeout: 3e3
|
|
6021
|
+
});
|
|
6022
|
+
} catch {
|
|
6023
|
+
return [];
|
|
6024
|
+
}
|
|
6025
|
+
for (const args of ["git diff --name-only HEAD", "git diff --cached --name-only"]) try {
|
|
6026
|
+
execSync(args, {
|
|
6027
|
+
cwd: workingDir,
|
|
6028
|
+
encoding: "utf-8",
|
|
6029
|
+
timeout: 5e3,
|
|
6030
|
+
stdio: [
|
|
6031
|
+
"ignore",
|
|
6032
|
+
"pipe",
|
|
6033
|
+
"pipe"
|
|
6034
|
+
]
|
|
6035
|
+
}).split("\n").map((l) => l.trim()).filter((l) => l.length > 0).forEach((f$1) => results.add(f$1));
|
|
6036
|
+
} catch {}
|
|
6037
|
+
return [...results];
|
|
6038
|
+
}
|
|
6002
6039
|
function checkGitDiffFiles(workingDir = process.cwd()) {
|
|
6003
6040
|
const results = new Set();
|
|
6004
6041
|
let repoHasCommits = true;
|
|
@@ -12634,6 +12671,7 @@ function assembleVerificationContext(opts) {
|
|
|
12634
12671
|
sourceEpicContent: opts.sourceEpicContent,
|
|
12635
12672
|
runId: opts.runId,
|
|
12636
12673
|
...opts.changedFiles !== void 0 ? { changedFiles: opts.changedFiles } : {},
|
|
12674
|
+
...opts.modifiedTrackedFiles !== void 0 ? { modifiedTrackedFiles: opts.modifiedTrackedFiles } : {},
|
|
12637
12675
|
...profileBuildCommand !== void 0 ? { buildCommand: profileBuildCommand } : {},
|
|
12638
12676
|
...profileTestCommand !== void 0 ? { testCommand: profileTestCommand } : {}
|
|
12639
12677
|
};
|
|
@@ -14729,6 +14767,33 @@ function createImplementationOrchestrator(deps) {
|
|
|
14729
14767
|
await persistState();
|
|
14730
14768
|
return;
|
|
14731
14769
|
}
|
|
14770
|
+
if (effectiveProjectRoot !== void 0 && effectiveProjectRoot !== projectRoot && isAbsolute(createResult.story_file)) {
|
|
14771
|
+
const relToWorktree = relative(effectiveProjectRoot, createResult.story_file);
|
|
14772
|
+
const outsideWorktree = relToWorktree.startsWith("..") || isAbsolute(relToWorktree);
|
|
14773
|
+
if (outsideWorktree) {
|
|
14774
|
+
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.`;
|
|
14775
|
+
logger$27.error({
|
|
14776
|
+
storyKey,
|
|
14777
|
+
storyFile: createResult.story_file,
|
|
14778
|
+
worktree: effectiveProjectRoot
|
|
14779
|
+
}, "create-story artifact outside worktree — escalating");
|
|
14780
|
+
updateStory(storyKey, {
|
|
14781
|
+
phase: "ESCALATED",
|
|
14782
|
+
error: "create-story-outside-project",
|
|
14783
|
+
completedAt: new Date().toISOString()
|
|
14784
|
+
});
|
|
14785
|
+
await writeStoryMetricsBestEffort(storyKey, "escalated", 0);
|
|
14786
|
+
await emitEscalation({
|
|
14787
|
+
storyKey,
|
|
14788
|
+
lastVerdict: "create-story-outside-project",
|
|
14789
|
+
reviewCycles: 0,
|
|
14790
|
+
issues: [errMsg],
|
|
14791
|
+
escalationReason: "create-story-outside-project"
|
|
14792
|
+
});
|
|
14793
|
+
await persistState();
|
|
14794
|
+
return;
|
|
14795
|
+
}
|
|
14796
|
+
}
|
|
14732
14797
|
if (effectiveProjectRoot !== void 0) {
|
|
14733
14798
|
const expectedArtifactsDir = join$1(effectiveProjectRoot, "_bmad-output", "implementation-artifacts");
|
|
14734
14799
|
const escapedExpectedDir = expectedArtifactsDir.replace("/_bmad-output/", "/\\_bmad-output/");
|
|
@@ -15675,8 +15740,14 @@ function createImplementationOrchestrator(deps) {
|
|
|
15675
15740
|
return;
|
|
15676
15741
|
}
|
|
15677
15742
|
let gitDiffFiles;
|
|
15743
|
+
let modifiedTrackedFiles;
|
|
15678
15744
|
if (devStoryWasSuccess) {
|
|
15679
15745
|
gitDiffFiles = checkGitDiffFiles(effectiveProjectRoot ?? process.cwd());
|
|
15746
|
+
try {
|
|
15747
|
+
modifiedTrackedFiles = checkGitModifiedTrackedFiles(effectiveProjectRoot ?? process.cwd());
|
|
15748
|
+
} catch {
|
|
15749
|
+
modifiedTrackedFiles = void 0;
|
|
15750
|
+
}
|
|
15680
15751
|
if (gitDiffFiles.length === 0) {
|
|
15681
15752
|
let hasNewCommits = false;
|
|
15682
15753
|
if (baselineHeadSha) try {
|
|
@@ -16099,6 +16170,23 @@ function createImplementationOrchestrator(deps) {
|
|
|
16099
16170
|
let schemaValidationRetries = 0;
|
|
16100
16171
|
let previousIterationWasMalformed = false;
|
|
16101
16172
|
const MAX_SCHEMA_VALIDATION_RETRIES = 3;
|
|
16173
|
+
function recaptureChangedFiles(root) {
|
|
16174
|
+
const files = new Set();
|
|
16175
|
+
if (baselineHeadSha) try {
|
|
16176
|
+
execSync(`git diff --name-only ${baselineHeadSha}..HEAD`, {
|
|
16177
|
+
cwd: root,
|
|
16178
|
+
encoding: "utf-8",
|
|
16179
|
+
timeout: 5e3,
|
|
16180
|
+
stdio: [
|
|
16181
|
+
"ignore",
|
|
16182
|
+
"pipe",
|
|
16183
|
+
"pipe"
|
|
16184
|
+
]
|
|
16185
|
+
}).split("\n").map((l) => l.trim()).filter((l) => l.length > 0).forEach((f$1) => files.add(f$1));
|
|
16186
|
+
} catch {}
|
|
16187
|
+
for (const f$1 of checkGitDiffFiles(root)) files.add(f$1);
|
|
16188
|
+
return [...files];
|
|
16189
|
+
}
|
|
16102
16190
|
async function runVerificationAndComplete(args) {
|
|
16103
16191
|
const { recordedVerdict, finalReviewCycles, reviewResult, autoApprove } = args;
|
|
16104
16192
|
endPhase(storyKey, "code-review");
|
|
@@ -16125,6 +16213,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
16125
16213
|
outputTokenCount: devOutputTokenCount,
|
|
16126
16214
|
sourceEpicContent,
|
|
16127
16215
|
...gitDiffFiles !== void 0 ? { changedFiles: gitDiffFiles } : {},
|
|
16216
|
+
...modifiedTrackedFiles !== void 0 ? { modifiedTrackedFiles } : {},
|
|
16128
16217
|
runId: config.pipelineRunId
|
|
16129
16218
|
});
|
|
16130
16219
|
const verifSummary = await verificationPipeline.run(verifContext, "A");
|
|
@@ -16213,6 +16302,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
16213
16302
|
devStoryResult: devStorySignals,
|
|
16214
16303
|
outputTokenCount: devOutputTokenCount,
|
|
16215
16304
|
sourceEpicContent,
|
|
16305
|
+
...effectiveProjectRoot !== void 0 ? { changedFiles: recaptureChangedFiles(effectiveProjectRoot) } : {},
|
|
16306
|
+
...modifiedTrackedFiles !== void 0 ? { modifiedTrackedFiles } : {},
|
|
16216
16307
|
runId: config.pipelineRunId
|
|
16217
16308
|
});
|
|
16218
16309
|
const retryVerifSummary = await verificationPipeline.run(retryVerifContext, "A");
|
|
@@ -48040,7 +48131,7 @@ async function runFullPipeline(options) {
|
|
|
48040
48131
|
*/
|
|
48041
48132
|
async function emitPreDispatchVersionAdvisory(currentVersion) {
|
|
48042
48133
|
if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
|
|
48043
|
-
const { createVersionManager } = await import("./version-manager-impl-
|
|
48134
|
+
const { createVersionManager } = await import("./version-manager-impl-CKsauG6T.js");
|
|
48044
48135
|
const vm = createVersionManager();
|
|
48045
48136
|
const result = await vm.checkForUpdates(true);
|
|
48046
48137
|
const gap = classifyVersionGap(currentVersion, result.latestVersion);
|
|
@@ -48137,4 +48228,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
|
|
|
48137
48228
|
|
|
48138
48229
|
//#endregion
|
|
48139
48230
|
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, createGitWorktreeManager, 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 };
|
|
48140
|
-
//# sourceMappingURL=run-
|
|
48231
|
+
//# sourceMappingURL=run-BhoAW6dJ.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-eGHKiGlU.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
|
-
import "./dist-
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-
|
|
6
|
-
import "./manifest-read-
|
|
4
|
+
import "./dist-D2mJXElX.js";
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BhoAW6dJ.js";
|
|
6
|
+
import "./manifest-read-7kyDfQAK.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-
|
|
11
|
+
import "./interactive-prompt-opOBwMDU.js";
|
|
12
12
|
import "./recovery-engine-BKGBeBnW.js";
|
|
13
13
|
|
|
14
14
|
export { runRunAction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVersionManager } from "./dist-
|
|
1
|
+
import { createVersionManager } from "./dist-D2mJXElX.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-
|
|
126
|
+
//# sourceMappingURL=upgrade-Djo0dJak.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-D2mJXElX.js";
|
|
2
2
|
import "./version-manager-impl-qFBiO4Eh.js";
|
|
3
|
-
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-
|
|
3
|
+
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-Djo0dJak.js";
|
|
4
4
|
|
|
5
5
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|
package/package.json
CHANGED