substrate-ai 0.20.33 → 0.20.34
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,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts } from "../health-
|
|
2
|
+
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts } from "../health-CnV6ndAb.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, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-BnMsd9hC.js";
|
|
6
6
|
import "../adapter-registry-DXLMTmfD.js";
|
|
7
|
-
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
7
|
+
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BQxm1Qix.js";
|
|
8
8
|
import "../errors-DSGhhrgv.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -3667,7 +3667,7 @@ async function runStatusAction(options) {
|
|
|
3667
3667
|
logger$12.debug({ err }, "Work graph query failed, continuing without work graph data");
|
|
3668
3668
|
}
|
|
3669
3669
|
if (run === void 0) {
|
|
3670
|
-
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-
|
|
3670
|
+
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-Bqzqu6zC.js");
|
|
3671
3671
|
const substrateDirPath = join(projectRoot, ".substrate");
|
|
3672
3672
|
const processInfo = inspectProcessTree$1({
|
|
3673
3673
|
projectRoot,
|
|
@@ -5198,7 +5198,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
5198
5198
|
await initSchema(expAdapter);
|
|
5199
5199
|
const { runRunAction: runPipeline } = await import(
|
|
5200
5200
|
/* @vite-ignore */
|
|
5201
|
-
"../run-
|
|
5201
|
+
"../run-B7jP4apv.js"
|
|
5202
5202
|
);
|
|
5203
5203
|
const runStoryFn = async (opts) => {
|
|
5204
5204
|
const exitCode = await runPipeline({
|
|
@@ -1,4 +1,4 @@
|
|
|
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-CnV6ndAb.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./dist-BnMsd9hC.js";
|
|
4
4
|
import "./decisions-C0pz9Clx.js";
|
|
@@ -3831,6 +3831,40 @@ function tail(text, bytes = PROBE_TAIL_BYTES) {
|
|
|
3831
3831
|
* way a typo in one author's probe surfaces as a deterministic finding,
|
|
3832
3832
|
* not a pipeline crash that masks the rest of the run.
|
|
3833
3833
|
*/
|
|
3834
|
+
/**
|
|
3835
|
+
* Story 63-2: canonical error-envelope shapes that signal the tool
|
|
3836
|
+
* responded with a structured error despite exiting 0. Detected
|
|
3837
|
+
* regardless of whether the author declared an assertion — defense-in-depth
|
|
3838
|
+
* against under-test probes that count tool advertisement but don't check
|
|
3839
|
+
* response shape (the obs_012 REOPENED class).
|
|
3840
|
+
*
|
|
3841
|
+
* Patterns are matched against the FULL captured stdout (not the tailed
|
|
3842
|
+
* excerpt) so error envelopes deeper than `PROBE_TAIL_BYTES` aren't
|
|
3843
|
+
* missed when a probe runs multiple sub-commands and the error surfaces
|
|
3844
|
+
* partway through.
|
|
3845
|
+
*
|
|
3846
|
+
* Match keys are JSON-shape only (case-sensitive); we do not try to
|
|
3847
|
+
* detect prose-form errors ("ERROR:" log lines) because those produce
|
|
3848
|
+
* far too many false positives — many tools log informational warnings
|
|
3849
|
+
* to stdout that contain the word "error".
|
|
3850
|
+
*/
|
|
3851
|
+
const ERROR_SHAPE_PATTERNS = [{
|
|
3852
|
+
pattern: /"isError"\s*:\s*true\b/,
|
|
3853
|
+
description: "\"isError\": true (MCP / Anthropic tool error envelope)"
|
|
3854
|
+
}, {
|
|
3855
|
+
pattern: /"status"\s*:\s*"error"/,
|
|
3856
|
+
description: "\"status\": \"error\" (REST / RPC error envelope)"
|
|
3857
|
+
}];
|
|
3858
|
+
/**
|
|
3859
|
+
* Story 63-2: scan stdout for canonical error-envelope shapes. Returns
|
|
3860
|
+
* an array of human-readable descriptions of detected patterns; empty
|
|
3861
|
+
* array when the response shape looks clean.
|
|
3862
|
+
*/
|
|
3863
|
+
function detectErrorShapeIndicators(stdout) {
|
|
3864
|
+
const indicators = [];
|
|
3865
|
+
for (const { pattern, description } of ERROR_SHAPE_PATTERNS) if (pattern.test(stdout)) indicators.push(description);
|
|
3866
|
+
return indicators;
|
|
3867
|
+
}
|
|
3834
3868
|
function evaluateStdoutAssertions(probe, stdout) {
|
|
3835
3869
|
const failures = [];
|
|
3836
3870
|
for (const pattern of probe.expect_stdout_no_regex ?? []) {
|
|
@@ -3931,11 +3965,18 @@ function executeProbeOnHost(probe, options = {}) {
|
|
|
3931
3965
|
const duration = Date.now() - start;
|
|
3932
3966
|
let outcome = code === 0 ? "pass" : "fail";
|
|
3933
3967
|
let assertionFailures;
|
|
3968
|
+
let errorShapeIndicators;
|
|
3934
3969
|
if (outcome === "pass") {
|
|
3935
3970
|
const failures = evaluateStdoutAssertions(probe, stdout);
|
|
3936
3971
|
if (failures.length > 0) {
|
|
3937
3972
|
outcome = "fail";
|
|
3938
3973
|
assertionFailures = failures;
|
|
3974
|
+
} else {
|
|
3975
|
+
const indicators = detectErrorShapeIndicators(stdout);
|
|
3976
|
+
if (indicators.length > 0) {
|
|
3977
|
+
outcome = "fail";
|
|
3978
|
+
errorShapeIndicators = indicators;
|
|
3979
|
+
}
|
|
3939
3980
|
}
|
|
3940
3981
|
}
|
|
3941
3982
|
finalize({
|
|
@@ -3945,7 +3986,8 @@ function executeProbeOnHost(probe, options = {}) {
|
|
|
3945
3986
|
stdoutTail: tail(stdout),
|
|
3946
3987
|
stderrTail: tail(stderr),
|
|
3947
3988
|
durationMs: duration,
|
|
3948
|
-
...assertionFailures !== void 0 ? { assertionFailures } : {}
|
|
3989
|
+
...assertionFailures !== void 0 ? { assertionFailures } : {},
|
|
3990
|
+
...errorShapeIndicators !== void 0 ? { errorShapeIndicators } : {}
|
|
3949
3991
|
});
|
|
3950
3992
|
});
|
|
3951
3993
|
});
|
|
@@ -3966,6 +4008,16 @@ const CATEGORY_TIMEOUT = "runtime-probe-timeout";
|
|
|
3966
4008
|
*/
|
|
3967
4009
|
const CATEGORY_ASSERTION_FAIL = "runtime-probe-assertion-fail";
|
|
3968
4010
|
/**
|
|
4011
|
+
* Story 63-2: command exited 0 and no author-declared assertion tripped,
|
|
4012
|
+
* but the captured stdout contains a canonical error-envelope shape
|
|
4013
|
+
* (`"isError": true`, `"status": "error"`). Defense-in-depth against
|
|
4014
|
+
* under-test probes that count tool advertisement without checking
|
|
4015
|
+
* response shape — the structural fix for obs_2026-04-25_012 (REOPENED).
|
|
4016
|
+
* Distinct from CATEGORY_ASSERTION_FAIL because the author DIDN'T declare
|
|
4017
|
+
* an assertion; the executor caught the error envelope automatically.
|
|
4018
|
+
*/
|
|
4019
|
+
const CATEGORY_ERROR_RESPONSE = "runtime-probe-error-response";
|
|
4020
|
+
/**
|
|
3969
4021
|
* Story 60-11: source AC describes an event-driven mechanism (hook, timer,
|
|
3970
4022
|
* signal, webhook) but no probe's command invokes a known production-trigger
|
|
3971
4023
|
* pattern. Strata Run 13 (Story 1-12, 2026-04-26): vault conflict hook
|
|
@@ -4103,11 +4155,12 @@ var RuntimeProbeCheck = class {
|
|
|
4103
4155
|
}
|
|
4104
4156
|
const result = await this._executors.host(probe);
|
|
4105
4157
|
if (result.outcome === "pass") continue;
|
|
4106
|
-
const category = result.outcome === "timeout" ? CATEGORY_TIMEOUT : result.assertionFailures !== void 0 ? CATEGORY_ASSERTION_FAIL : CATEGORY_FAIL;
|
|
4158
|
+
const category = result.outcome === "timeout" ? CATEGORY_TIMEOUT : result.assertionFailures !== void 0 ? CATEGORY_ASSERTION_FAIL : result.errorShapeIndicators !== void 0 ? CATEGORY_ERROR_RESPONSE : CATEGORY_FAIL;
|
|
4107
4159
|
const descriptor = probe.description ? ` (${probe.description})` : "";
|
|
4108
4160
|
let message;
|
|
4109
4161
|
if (result.outcome === "timeout") message = `probe "${probe.name}"${descriptor} timed out after ${result.durationMs}ms`;
|
|
4110
4162
|
else if (result.assertionFailures !== void 0) message = `probe "${probe.name}"${descriptor} exit 0 but stdout assertion failed: ` + result.assertionFailures.join("; ");
|
|
4163
|
+
else if (result.errorShapeIndicators !== void 0) message = `probe "${probe.name}"${descriptor} exit 0 but response contained error envelope: ` + result.errorShapeIndicators.join("; ") + " — the tool returned an error-shaped JSON response despite a clean exit code. This is structural evidence the implementation didn't actually work; add an explicit `expect_stdout_no_regex` assertion to make the failure surface earlier in author-controlled form.";
|
|
4111
4164
|
else message = `probe "${probe.name}"${descriptor} failed with exit ${result.exitCode ?? "unknown"}`;
|
|
4112
4165
|
findings.push({
|
|
4113
4166
|
category,
|
|
@@ -6291,4 +6344,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
6291
6344
|
|
|
6292
6345
|
//#endregion
|
|
6293
6346
|
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, createStateStore, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, renderFindings, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, runHealthAction, validateStoryKey };
|
|
6294
|
-
//# sourceMappingURL=health-
|
|
6347
|
+
//# sourceMappingURL=health-CnV6ndAb.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-CnV6ndAb.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
4
|
import "./dist-BnMsd9hC.js";
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-BQxm1Qix.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-
|
|
1
|
+
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-CnV6ndAb.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, 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, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-BnMsd9hC.js";
|
|
@@ -45201,4 +45201,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
45201
45201
|
|
|
45202
45202
|
//#endregion
|
|
45203
45203
|
export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict, wireNdjsonEmitter };
|
|
45204
|
-
//# sourceMappingURL=run-
|
|
45204
|
+
//# sourceMappingURL=run-BQxm1Qix.js.map
|