substrate-ai 0.20.98 → 0.20.100
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-CW-0HEBL.js +4 -0
- package/dist/cli/index.js +17 -72
- package/dist/{decisions-DdTaohqm.js → decisions-DfMQDPz3.js} +1 -1
- package/dist/{dist-CR_3fEG2.js → dist-BWwy_6uv.js} +36 -76
- package/dist/{errors-Bd-WQnjg.js → errors-u3LnOLzz.js} +2 -2
- package/dist/{experimenter-BUdyuKsL.js → experimenter-47l2ssez.js} +1 -1
- package/dist/{health-OOK3rjFF.js → health-BUfapi3C.js} +6 -176
- package/dist/{health-B2rUCaye.js → health-CMHssIjh.js} +3 -3
- package/dist/index.d.ts +0 -5
- package/dist/index.js +2 -2
- package/dist/{interactive-prompt-CZkKFDXD.js → interactive-prompt-BUDDSIRy.js} +2 -2
- package/dist/{manifest-read-6xIFhnb7.js → manifest-read-C1IQ75EP.js} +2 -2
- package/dist/modules/interactive-prompt/index.js +3 -3
- package/dist/{routing-B8rnc4Ns.js → routing-DiUnQeFC.js} +1 -1
- package/dist/{run-CiQed8OE.js → run-BGWWSefD.js} +5 -5
- package/dist/{run-CrxAXEBv.js → run-BHDVWJVt.js} +6 -24
- package/dist/src/modules/recovery-engine/index.d.ts +0 -5
- package/dist/{upgrade-BVXcLYQL.js → upgrade-BEZi9_nw.js} +2 -2
- package/dist/{upgrade-BxiW5XLZ.js → upgrade-CR13HV7X.js} +2 -2
- package/dist/{version-manager-impl-DUxNv_A5.js → version-manager-impl-DxNTLWOT.js} +1 -1
- package/package.json +1 -1
- package/dist/adapter-registry-CAw8hY6r.js +0 -4
package/dist/cli/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-
|
|
2
|
+
import { FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createDatabaseAdapter, createDoltOperatorReader, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion } from "../health-BUfapi3C.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, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, 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, createDoltClient, createPipelineRun, 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-BWwy_6uv.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-BHDVWJVt.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-C1IQ75EP.js";
|
|
9
|
+
import "../errors-u3LnOLzz.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-DblHY8se.js";
|
|
14
|
-
import "../interactive-prompt-
|
|
14
|
+
import "../interactive-prompt-BUDDSIRy.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-BEZi9_nw.js";
|
|
18
18
|
import { Command } from "commander";
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
20
|
import { dirname, join, resolve } from "path";
|
|
@@ -6887,7 +6887,7 @@ async function runStatusAction(options) {
|
|
|
6887
6887
|
logger$15.debug({ err }, "Work graph query failed, continuing without work graph data");
|
|
6888
6888
|
}
|
|
6889
6889
|
if (run === void 0) {
|
|
6890
|
-
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-
|
|
6890
|
+
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CMHssIjh.js");
|
|
6891
6891
|
const substrateDirPath = join(projectRoot, ".substrate");
|
|
6892
6892
|
const processInfo = inspectProcessTree$1({
|
|
6893
6893
|
projectRoot,
|
|
@@ -7835,7 +7835,7 @@ function defaultSupervisorDeps() {
|
|
|
7835
7835
|
if (cached === null) {
|
|
7836
7836
|
const { AdapterRegistry: AR } = await import(
|
|
7837
7837
|
/* @vite-ignore */
|
|
7838
|
-
"../adapter-registry-
|
|
7838
|
+
"../adapter-registry-CW-0HEBL.js"
|
|
7839
7839
|
);
|
|
7840
7840
|
cached = new AR();
|
|
7841
7841
|
await cached.discoverAndRegister();
|
|
@@ -8402,11 +8402,11 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
8402
8402
|
try {
|
|
8403
8403
|
const { createExperimenter } = await import(
|
|
8404
8404
|
/* @vite-ignore */
|
|
8405
|
-
"../experimenter-
|
|
8405
|
+
"../experimenter-47l2ssez.js"
|
|
8406
8406
|
);
|
|
8407
8407
|
const { getLatestRun: getLatest } = await import(
|
|
8408
8408
|
/* @vite-ignore */
|
|
8409
|
-
"../decisions-
|
|
8409
|
+
"../decisions-DfMQDPz3.js"
|
|
8410
8410
|
);
|
|
8411
8411
|
const expAdapter = createDatabaseAdapter({
|
|
8412
8412
|
backend: "auto",
|
|
@@ -8416,7 +8416,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
8416
8416
|
await initSchema(expAdapter);
|
|
8417
8417
|
const { runRunAction: runPipeline } = await import(
|
|
8418
8418
|
/* @vite-ignore */
|
|
8419
|
-
"../run-
|
|
8419
|
+
"../run-BGWWSefD.js"
|
|
8420
8420
|
);
|
|
8421
8421
|
const runStoryFn = async (opts) => {
|
|
8422
8422
|
const exitCode = await runPipeline({
|
|
@@ -8944,7 +8944,7 @@ async function runMetricsAction(options) {
|
|
|
8944
8944
|
const routingConfigPath = join(dbDir, "routing.yml");
|
|
8945
8945
|
let routingConfig = null;
|
|
8946
8946
|
if (existsSync$1(routingConfigPath)) try {
|
|
8947
|
-
const { loadModelRoutingConfig } = await import("../routing-
|
|
8947
|
+
const { loadModelRoutingConfig } = await import("../routing-DiUnQeFC.js");
|
|
8948
8948
|
routingConfig = loadModelRoutingConfig(routingConfigPath);
|
|
8949
8949
|
} catch {}
|
|
8950
8950
|
if (routingConfig === null) routingConfig = {
|
|
@@ -11956,59 +11956,6 @@ function registerRoutingCommand(program) {
|
|
|
11956
11956
|
});
|
|
11957
11957
|
}
|
|
11958
11958
|
|
|
11959
|
-
//#endregion
|
|
11960
|
-
//#region src/modules/work-graph/schema.ts
|
|
11961
|
-
/**
|
|
11962
|
-
* Work-graph schema — legacy DDL constant exports.
|
|
11963
|
-
*
|
|
11964
|
-
* The canonical DDL lives in packages/core/src/persistence/work-graph-schema.ts
|
|
11965
|
-
* as `initWorkGraphSchema(adapter)`. This file is preserved as a thin shim
|
|
11966
|
-
* so the existing callers in `ingest-epic.ts` and `epic-status.ts` keep
|
|
11967
|
-
* working — they `await adapter.exec(CREATE_STORIES_TABLE)` directly rather
|
|
11968
|
-
* than invoking the function form.
|
|
11969
|
-
*
|
|
11970
|
-
* Post-Ship-5 (2026-05): the legacy constants here MUST stay in sync with
|
|
11971
|
-
* the function form in @substrate-ai/core. Future ports should consider
|
|
11972
|
-
* migrating callers to `initWorkGraphSchema(adapter)` and deleting this file
|
|
11973
|
-
* entirely.
|
|
11974
|
-
*/
|
|
11975
|
-
const CREATE_STORIES_TABLE = `
|
|
11976
|
-
CREATE TABLE IF NOT EXISTS wg_stories (
|
|
11977
|
-
story_key VARCHAR(20) NOT NULL,
|
|
11978
|
-
epic VARCHAR(20) NOT NULL,
|
|
11979
|
-
title VARCHAR(255),
|
|
11980
|
-
status VARCHAR(30) NOT NULL DEFAULT 'planned',
|
|
11981
|
-
spec_path VARCHAR(500),
|
|
11982
|
-
created_at DATETIME,
|
|
11983
|
-
updated_at DATETIME,
|
|
11984
|
-
completed_at DATETIME,
|
|
11985
|
-
PRIMARY KEY (story_key)
|
|
11986
|
-
)
|
|
11987
|
-
`.trim();
|
|
11988
|
-
const CREATE_STORY_DEPENDENCIES_TABLE = `
|
|
11989
|
-
CREATE TABLE IF NOT EXISTS story_dependencies (
|
|
11990
|
-
story_key VARCHAR(50) NOT NULL,
|
|
11991
|
-
depends_on VARCHAR(50) NOT NULL,
|
|
11992
|
-
dependency_type VARCHAR(50) NOT NULL DEFAULT 'blocks',
|
|
11993
|
-
source VARCHAR(50) NOT NULL DEFAULT 'explicit',
|
|
11994
|
-
created_at DATETIME,
|
|
11995
|
-
PRIMARY KEY (story_key, depends_on)
|
|
11996
|
-
)
|
|
11997
|
-
`.trim();
|
|
11998
|
-
const CREATE_READY_STORIES_VIEW = `
|
|
11999
|
-
CREATE VIEW IF NOT EXISTS ready_stories AS
|
|
12000
|
-
SELECT s.*
|
|
12001
|
-
FROM wg_stories s
|
|
12002
|
-
WHERE s.status IN ('planned', 'ready')
|
|
12003
|
-
AND NOT EXISTS (
|
|
12004
|
-
SELECT 1 FROM story_dependencies sd
|
|
12005
|
-
JOIN wg_stories blocking ON sd.depends_on = blocking.story_key
|
|
12006
|
-
WHERE sd.story_key = s.story_key
|
|
12007
|
-
AND sd.dependency_type = 'blocks'
|
|
12008
|
-
AND blocking.status <> 'complete'
|
|
12009
|
-
)
|
|
12010
|
-
`.trim();
|
|
12011
|
-
|
|
12012
11959
|
//#endregion
|
|
12013
11960
|
//#region src/modules/work-graph/epic-parser.ts
|
|
12014
11961
|
/** Regex for sprint header lines: `**Sprint 1 —` or `Sprint 1 —` (with or without bold markers) */
|
|
@@ -12143,8 +12090,7 @@ function registerIngestEpicCommand(program) {
|
|
|
12143
12090
|
basePath: process.cwd()
|
|
12144
12091
|
});
|
|
12145
12092
|
try {
|
|
12146
|
-
await adapter
|
|
12147
|
-
await adapter.exec(CREATE_STORY_DEPENDENCIES_TABLE);
|
|
12093
|
+
await initWorkGraphSchema(adapter);
|
|
12148
12094
|
const ingester = new EpicIngester(adapter);
|
|
12149
12095
|
const result = await ingester.ingest(stories, dependencies);
|
|
12150
12096
|
const epicNum = stories[0].epic_num;
|
|
@@ -12188,8 +12134,7 @@ async function runEpicStatusAction(epicNum, opts) {
|
|
|
12188
12134
|
basePath: process.cwd()
|
|
12189
12135
|
});
|
|
12190
12136
|
try {
|
|
12191
|
-
await adapter
|
|
12192
|
-
await adapter.exec(CREATE_STORY_DEPENDENCIES_TABLE);
|
|
12137
|
+
await initWorkGraphSchema(adapter);
|
|
12193
12138
|
const repo = new WorkGraphRepository(adapter);
|
|
12194
12139
|
const rawStories = await repo.listStories({ epic: epicNum });
|
|
12195
12140
|
if (rawStories.length === 0) {
|
|
@@ -13326,8 +13271,8 @@ async function createProgram() {
|
|
|
13326
13271
|
/** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
|
|
13327
13272
|
function checkForUpdatesInBackground(currentVersion) {
|
|
13328
13273
|
if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
|
|
13329
|
-
import("../upgrade-
|
|
13330
|
-
const { createVersionManager } = await import("../version-manager-impl-
|
|
13274
|
+
import("../upgrade-CR13HV7X.js").then(async () => {
|
|
13275
|
+
const { createVersionManager } = await import("../version-manager-impl-DxNTLWOT.js");
|
|
13331
13276
|
const vm = createVersionManager();
|
|
13332
13277
|
const result = await vm.checkForUpdates();
|
|
13333
13278
|
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-BWwy_6uv.js";
|
|
2
2
|
import "./decisions-CzSIEeGP.js";
|
|
3
3
|
|
|
4
4
|
export { getLatestRun };
|
|
@@ -2963,82 +2963,42 @@ async function initMonitorSchema(adapter) {
|
|
|
2963
2963
|
|
|
2964
2964
|
//#endregion
|
|
2965
2965
|
//#region packages/core/dist/persistence/state-schema.js
|
|
2966
|
+
/**
|
|
2967
|
+
* Legacy state-table cleanup — pre-2026-Q1 orchestrator state tables.
|
|
2968
|
+
*
|
|
2969
|
+
* Historical context: `stories`, `contracts`, `metrics`, `dispatch_log`,
|
|
2970
|
+
* `build_results`, `review_verdicts` (+ vestigial `_schema_version`) were
|
|
2971
|
+
* defined as the substrate-state surface in `schema.sql`. Ship 1 (v0.20.92)
|
|
2972
|
+
* excised the corresponding DoltStateStore CRUD methods after auditing every
|
|
2973
|
+
* production project (ynab, quant) and finding all six tables empty — the
|
|
2974
|
+
* orchestrator wires `FileStateStore` (in-memory), so DoltStateStore's write
|
|
2975
|
+
* methods never fired and these tables were perpetually empty.
|
|
2976
|
+
*
|
|
2977
|
+
* Ship 7 (v0.20.98) deleted the vestigial `_schema_version` table the same
|
|
2978
|
+
* way; Ship 8 (v0.20.99) extends that pattern to the remaining six legacy
|
|
2979
|
+
* tables. This module owns NO tables now — it survives only to drop the
|
|
2980
|
+
* legacy tables on existing repos (ynab, quant) at next `substrate run`.
|
|
2981
|
+
*
|
|
2982
|
+
* Fresh repos never see any of these tables; existing repos lose them on
|
|
2983
|
+
* next init via the DROP TABLE IF EXISTS block below.
|
|
2984
|
+
*
|
|
2985
|
+
* Note: monitor.db's `_schema_version` (in `.substrate/monitor.db`) is
|
|
2986
|
+
* intentionally distinct from the substrate-state `_schema_version` we
|
|
2987
|
+
* dropped — see monitor-database.ts.
|
|
2988
|
+
*/
|
|
2989
|
+
const LEGACY_TABLES = [
|
|
2990
|
+
"_schema_version",
|
|
2991
|
+
"stories",
|
|
2992
|
+
"contracts",
|
|
2993
|
+
"metrics",
|
|
2994
|
+
"dispatch_log",
|
|
2995
|
+
"build_results",
|
|
2996
|
+
"review_verdicts"
|
|
2997
|
+
];
|
|
2966
2998
|
async function initStateSchema(adapter) {
|
|
2967
|
-
try {
|
|
2968
|
-
await adapter.exec(
|
|
2999
|
+
for (const table of LEGACY_TABLES) try {
|
|
3000
|
+
await adapter.exec(`DROP TABLE IF EXISTS ${table}`);
|
|
2969
3001
|
} catch {}
|
|
2970
|
-
await adapter.exec(`
|
|
2971
|
-
CREATE TABLE IF NOT EXISTS stories (
|
|
2972
|
-
story_key VARCHAR(100) NOT NULL,
|
|
2973
|
-
sprint VARCHAR(50),
|
|
2974
|
-
status VARCHAR(30) NOT NULL DEFAULT 'PENDING',
|
|
2975
|
-
phase VARCHAR(30) NOT NULL DEFAULT 'PENDING',
|
|
2976
|
-
ac_results JSON,
|
|
2977
|
-
error_message TEXT,
|
|
2978
|
-
created_at DATETIME,
|
|
2979
|
-
updated_at DATETIME,
|
|
2980
|
-
completed_at DATETIME,
|
|
2981
|
-
PRIMARY KEY (story_key)
|
|
2982
|
-
)
|
|
2983
|
-
`);
|
|
2984
|
-
await adapter.exec(`
|
|
2985
|
-
CREATE TABLE IF NOT EXISTS contracts (
|
|
2986
|
-
story_key VARCHAR(100) NOT NULL,
|
|
2987
|
-
name VARCHAR(200) NOT NULL,
|
|
2988
|
-
direction VARCHAR(20) NOT NULL,
|
|
2989
|
-
schema_path VARCHAR(500),
|
|
2990
|
-
transport VARCHAR(200),
|
|
2991
|
-
recorded_at DATETIME,
|
|
2992
|
-
PRIMARY KEY (story_key, name, direction)
|
|
2993
|
-
)
|
|
2994
|
-
`);
|
|
2995
|
-
await adapter.exec(`
|
|
2996
|
-
CREATE TABLE IF NOT EXISTS metrics (
|
|
2997
|
-
story_key VARCHAR(100) NOT NULL,
|
|
2998
|
-
task_type VARCHAR(100) NOT NULL,
|
|
2999
|
-
recorded_at DATETIME NOT NULL,
|
|
3000
|
-
model VARCHAR(100),
|
|
3001
|
-
tokens_in BIGINT NOT NULL DEFAULT 0,
|
|
3002
|
-
tokens_out BIGINT NOT NULL DEFAULT 0,
|
|
3003
|
-
cache_read_tokens BIGINT NOT NULL DEFAULT 0,
|
|
3004
|
-
cost_usd DECIMAL(10,6) NOT NULL DEFAULT 0,
|
|
3005
|
-
wall_clock_ms BIGINT NOT NULL DEFAULT 0,
|
|
3006
|
-
review_cycles INT NOT NULL DEFAULT 0,
|
|
3007
|
-
stall_count INT NOT NULL DEFAULT 0,
|
|
3008
|
-
result VARCHAR(30),
|
|
3009
|
-
PRIMARY KEY (story_key, task_type, recorded_at)
|
|
3010
|
-
)
|
|
3011
|
-
`);
|
|
3012
|
-
await adapter.exec(`
|
|
3013
|
-
CREATE TABLE IF NOT EXISTS dispatch_log (
|
|
3014
|
-
story_key VARCHAR(100) NOT NULL,
|
|
3015
|
-
dispatched_at DATETIME NOT NULL,
|
|
3016
|
-
branch VARCHAR(200),
|
|
3017
|
-
worker_id VARCHAR(100),
|
|
3018
|
-
result VARCHAR(30),
|
|
3019
|
-
PRIMARY KEY (story_key, dispatched_at)
|
|
3020
|
-
)
|
|
3021
|
-
`);
|
|
3022
|
-
await adapter.exec(`
|
|
3023
|
-
CREATE TABLE IF NOT EXISTS build_results (
|
|
3024
|
-
story_key VARCHAR(100) NOT NULL,
|
|
3025
|
-
timestamp DATETIME NOT NULL,
|
|
3026
|
-
command VARCHAR(500),
|
|
3027
|
-
exit_code INT,
|
|
3028
|
-
stdout_hash VARCHAR(64),
|
|
3029
|
-
PRIMARY KEY (story_key, timestamp)
|
|
3030
|
-
)
|
|
3031
|
-
`);
|
|
3032
|
-
await adapter.exec(`
|
|
3033
|
-
CREATE TABLE IF NOT EXISTS review_verdicts (
|
|
3034
|
-
story_key VARCHAR(100) NOT NULL,
|
|
3035
|
-
timestamp DATETIME NOT NULL,
|
|
3036
|
-
verdict VARCHAR(30),
|
|
3037
|
-
issues_count INT NOT NULL DEFAULT 0,
|
|
3038
|
-
notes TEXT,
|
|
3039
|
-
PRIMARY KEY (story_key, timestamp)
|
|
3040
|
-
)
|
|
3041
|
-
`);
|
|
3042
3002
|
}
|
|
3043
3003
|
|
|
3044
3004
|
//#endregion
|
|
@@ -11292,5 +11252,5 @@ async function callLLM(params) {
|
|
|
11292
11252
|
}
|
|
11293
11253
|
|
|
11294
11254
|
//#endregion
|
|
11295
|
-
export { ADVISORY_NOTES, AdapterRegistry, AdtError, BudgetConfigSchema, 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, createDoltClient, createExperimenter, createPipelineRun, createRequirement, createVersionManager, detectInterfaceChanges, determineVerdict, getActiveDecisions, getAllCostEntriesFiltered, getArtifactByTypeForRun, getArtifactsByRun, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getModelTier, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRequirements, listRunMetrics, loadModelRoutingConfig, loadParentRunDecisions, registerArtifact, resolvePromptFile, supersedeDecision, swallowDebug, tagRunAsBaseline, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics };
|
|
11296
|
-
//# sourceMappingURL=dist-
|
|
11255
|
+
export { ADVISORY_NOTES, AdapterRegistry, AdtError, BudgetConfigSchema, 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, createDoltClient, createExperimenter, createPipelineRun, createRequirement, createVersionManager, 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 };
|
|
11256
|
+
//# sourceMappingURL=dist-BWwy_6uv.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdtError } from "./dist-
|
|
1
|
+
import { AdtError } from "./dist-BWwy_6uv.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-u3LnOLzz.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-BWwy_6uv.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-
|
|
3
|
-
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-
|
|
2
|
+
import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-BWwy_6uv.js";
|
|
3
|
+
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-C1IQ75EP.js";
|
|
4
4
|
import { createRequire } from "module";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -137,7 +137,7 @@ const BMAD_BASELINE_TOKENS_FULL = 56800;
|
|
|
137
137
|
/** BMAD baseline token total for create+dev+review comparison */
|
|
138
138
|
const BMAD_BASELINE_TOKENS = 23800;
|
|
139
139
|
/** Story key pattern: e.g. "10-1", "1-1a", "NEW-26", "E6" */
|
|
140
|
-
const STORY_KEY_PATTERN
|
|
140
|
+
const STORY_KEY_PATTERN = /^[A-Za-z0-9]+(-[A-Za-z0-9]+)?$/;
|
|
141
141
|
/**
|
|
142
142
|
* Top-level keys in .claude/settings.json that substrate owns.
|
|
143
143
|
* On init, these are set/updated unconditionally.
|
|
@@ -197,7 +197,7 @@ function formatTokenTelemetry(summary, baselineTokens = BMAD_BASELINE_TOKENS) {
|
|
|
197
197
|
* Validate a story key has the expected format: <epic>-<story> (e.g., "10-1").
|
|
198
198
|
*/
|
|
199
199
|
function validateStoryKey(key) {
|
|
200
|
-
return STORY_KEY_PATTERN
|
|
200
|
+
return STORY_KEY_PATTERN.test(key);
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* Build the AC5 JSON status schema for a pipeline run.
|
|
@@ -491,63 +491,17 @@ var FileStateStore = class {
|
|
|
491
491
|
await writeFile(filePath, JSON.stringify(serialized, null, 2), "utf-8");
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
async branchForStory(_storyKey) {}
|
|
495
|
-
async mergeStory(_storyKey) {}
|
|
496
|
-
async rollbackStory(_storyKey) {}
|
|
497
494
|
async getHistory(_limit) {
|
|
498
495
|
return [];
|
|
499
496
|
}
|
|
500
497
|
};
|
|
501
498
|
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region src/modules/state/errors.ts
|
|
504
|
-
/**
|
|
505
|
-
* Typed error classes for the Dolt state store.
|
|
506
|
-
*/
|
|
507
|
-
var StateStoreError = class extends Error {
|
|
508
|
-
code;
|
|
509
|
-
constructor(code, message) {
|
|
510
|
-
super(message);
|
|
511
|
-
this.name = "StateStoreError";
|
|
512
|
-
this.code = code;
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var DoltMergeConflictError = class extends StateStoreError {
|
|
516
|
-
table;
|
|
517
|
-
conflictingKeys;
|
|
518
|
-
rowKey;
|
|
519
|
-
ourValue;
|
|
520
|
-
theirValue;
|
|
521
|
-
constructor(table, conflictingKeys, options) {
|
|
522
|
-
super("DOLT_MERGE_CONFLICT", `Merge conflict in table '${table}' on keys: ${conflictingKeys.join(", ")}`);
|
|
523
|
-
this.name = "DoltMergeConflictError";
|
|
524
|
-
this.table = table;
|
|
525
|
-
this.conflictingKeys = conflictingKeys;
|
|
526
|
-
if (options) {
|
|
527
|
-
this.rowKey = options.rowKey;
|
|
528
|
-
this.ourValue = options.ourValue;
|
|
529
|
-
this.theirValue = options.theirValue;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
/** Alias for DoltMergeConflictError — used by orchestrator branch lifecycle. */
|
|
534
|
-
const DoltMergeConflict = DoltMergeConflictError;
|
|
535
|
-
|
|
536
499
|
//#endregion
|
|
537
500
|
//#region src/modules/state/dolt-store.ts
|
|
538
501
|
const log = createLogger("modules:state:dolt");
|
|
539
|
-
/**
|
|
540
|
-
* Validate that a story key matches the expected pattern (e.g. "26-7", "1-1a", "NEW-26", "E6").
|
|
541
|
-
* Prevents SQL injection via string-interpolated identifiers.
|
|
542
|
-
*/
|
|
543
|
-
const STORY_KEY_PATTERN = /^[A-Za-z0-9]+(-[A-Za-z0-9]+)?$/;
|
|
544
|
-
function assertValidStoryKey(storyKey) {
|
|
545
|
-
if (!STORY_KEY_PATTERN.test(storyKey)) throw new DoltQueryError("assertValidStoryKey", `Invalid story key: '${storyKey}'. Must match pattern <key> or <epic>-<story> (e.g. "E6", "10-1", "1-1a", "NEW-26").`);
|
|
546
|
-
}
|
|
547
502
|
var DoltStateStore = class {
|
|
548
503
|
_repoPath;
|
|
549
504
|
_client;
|
|
550
|
-
_storyBranches = new Map();
|
|
551
505
|
/** In-memory KV store for per-run arbitrary metrics. Not persisted to Dolt. */
|
|
552
506
|
_kvMetrics = new Map();
|
|
553
507
|
constructor(options) {
|
|
@@ -556,135 +510,11 @@ var DoltStateStore = class {
|
|
|
556
510
|
}
|
|
557
511
|
async initialize() {
|
|
558
512
|
await this._client.connect();
|
|
559
|
-
await this._runMigrations();
|
|
560
|
-
await this.flush("substrate: schema migrations");
|
|
561
513
|
log.debug("DoltStateStore initialized at %s", this._repoPath);
|
|
562
514
|
}
|
|
563
515
|
async close() {
|
|
564
516
|
await this._client.close();
|
|
565
517
|
}
|
|
566
|
-
/**
|
|
567
|
-
* Idempotent runtime migration: add `repo_map_symbols.dependencies` JSON column
|
|
568
|
-
* if the table exists and the column doesn't. Skips silently when the table
|
|
569
|
-
* is absent (fresh DB or non-Dolt env).
|
|
570
|
-
*/
|
|
571
|
-
async _runMigrations() {
|
|
572
|
-
try {
|
|
573
|
-
const colRows = await this._client.query(`SHOW COLUMNS FROM repo_map_symbols LIKE 'dependencies'`);
|
|
574
|
-
if (colRows.length === 0) {
|
|
575
|
-
await this._client.query(`ALTER TABLE repo_map_symbols ADD COLUMN dependencies JSON`);
|
|
576
|
-
log.info({
|
|
577
|
-
component: "dolt-state",
|
|
578
|
-
migration: "v5-to-v6",
|
|
579
|
-
column: "dependencies",
|
|
580
|
-
table: "repo_map_symbols"
|
|
581
|
-
}, "Applied migration v5-to-v6: added dependencies column to repo_map_symbols");
|
|
582
|
-
}
|
|
583
|
-
} catch {
|
|
584
|
-
log.debug("Skipping repo_map_symbols migration: table not yet created");
|
|
585
|
-
}
|
|
586
|
-
log.debug("Schema migrations applied");
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Commit pending Dolt changes on the current branch.
|
|
590
|
-
* Callers can invoke this after a batch of writes for explicit durability.
|
|
591
|
-
*/
|
|
592
|
-
async flush(message = "substrate: auto-commit") {
|
|
593
|
-
try {
|
|
594
|
-
await this._client.execArgs(["add", "."]);
|
|
595
|
-
await this._client.execArgs([
|
|
596
|
-
"commit",
|
|
597
|
-
"--allow-empty",
|
|
598
|
-
"-m",
|
|
599
|
-
message
|
|
600
|
-
]);
|
|
601
|
-
log.debug("Dolt flush committed: %s", message);
|
|
602
|
-
} catch (err) {
|
|
603
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
604
|
-
log.warn({ detail }, "Dolt flush failed (non-fatal)");
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
async branchForStory(storyKey) {
|
|
608
|
-
assertValidStoryKey(storyKey);
|
|
609
|
-
const branchName = `story/${storyKey}`;
|
|
610
|
-
try {
|
|
611
|
-
await this._client.query(`CALL DOLT_BRANCH('${branchName}')`, [], "main");
|
|
612
|
-
this._storyBranches.set(storyKey, branchName);
|
|
613
|
-
log.debug("Created Dolt branch %s for story %s", branchName, storyKey);
|
|
614
|
-
} catch (err) {
|
|
615
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
616
|
-
throw new DoltQueryError(`CALL DOLT_BRANCH('${branchName}')`, detail);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
async mergeStory(storyKey) {
|
|
620
|
-
assertValidStoryKey(storyKey);
|
|
621
|
-
const branchName = this._storyBranches.get(storyKey);
|
|
622
|
-
if (branchName === void 0) {
|
|
623
|
-
log.warn({ storyKey }, "mergeStory called but no branch registered — no-op");
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
try {
|
|
627
|
-
try {
|
|
628
|
-
await this._client.query(`CALL DOLT_ADD('-A')`, [], branchName);
|
|
629
|
-
await this._client.query(`CALL DOLT_COMMIT('-m', 'Story ${storyKey}: pre-merge commit', '--allow-empty')`, [], branchName);
|
|
630
|
-
} catch {}
|
|
631
|
-
try {
|
|
632
|
-
await this._client.query(`CALL DOLT_ADD('-A')`, [], "main");
|
|
633
|
-
await this._client.query(`CALL DOLT_COMMIT('-m', 'substrate: pre-merge auto-commit', '--allow-empty')`, [], "main");
|
|
634
|
-
} catch {}
|
|
635
|
-
const mergeRows = await this._client.query(`CALL DOLT_MERGE('${branchName}')`, [], "main");
|
|
636
|
-
const mergeResult = mergeRows[0];
|
|
637
|
-
if (mergeResult && (mergeResult.conflicts ?? 0) > 0) {
|
|
638
|
-
let table = "unknown";
|
|
639
|
-
let rowKey = "unknown";
|
|
640
|
-
let ourValue;
|
|
641
|
-
let theirValue;
|
|
642
|
-
try {
|
|
643
|
-
const conflictRows = await this._client.query(`SELECT table_name FROM dolt_conflicts LIMIT 1`, [], "main");
|
|
644
|
-
if (conflictRows.length > 0) table = String(conflictRows[0]["table_name"] ?? "unknown");
|
|
645
|
-
} catch {}
|
|
646
|
-
this._storyBranches.delete(storyKey);
|
|
647
|
-
throw new DoltMergeConflictError(table, [rowKey], {
|
|
648
|
-
rowKey,
|
|
649
|
-
ourValue,
|
|
650
|
-
theirValue
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
try {
|
|
654
|
-
await this._client.query(`CALL DOLT_COMMIT('-m', 'Merge story ${storyKey}: COMPLETE')`, [], "main");
|
|
655
|
-
} catch (commitErr) {
|
|
656
|
-
const msg = commitErr instanceof Error ? commitErr.message : String(commitErr);
|
|
657
|
-
if (!msg.includes("nothing to commit")) throw commitErr;
|
|
658
|
-
}
|
|
659
|
-
this._storyBranches.delete(storyKey);
|
|
660
|
-
log.debug("Merged branch %s into main for story %s", branchName, storyKey);
|
|
661
|
-
} catch (err) {
|
|
662
|
-
if (err instanceof DoltMergeConflictError) throw err;
|
|
663
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
664
|
-
throw new DoltQueryError(`CALL DOLT_MERGE('${branchName}')`, detail);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
async rollbackStory(storyKey) {
|
|
668
|
-
assertValidStoryKey(storyKey);
|
|
669
|
-
const branchName = this._storyBranches.get(storyKey);
|
|
670
|
-
if (branchName === void 0) {
|
|
671
|
-
log.warn({ storyKey }, "rollbackStory called but no branch registered — no-op");
|
|
672
|
-
return;
|
|
673
|
-
}
|
|
674
|
-
try {
|
|
675
|
-
await this._client.query(`CALL DOLT_BRANCH('-D', '${branchName}')`, [], "main");
|
|
676
|
-
this._storyBranches.delete(storyKey);
|
|
677
|
-
log.debug("Rolled back (deleted) branch %s for story %s", branchName, storyKey);
|
|
678
|
-
} catch (err) {
|
|
679
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
680
|
-
log.warn({
|
|
681
|
-
detail,
|
|
682
|
-
storyKey,
|
|
683
|
-
branchName
|
|
684
|
-
}, "rollbackStory failed (non-fatal)");
|
|
685
|
-
this._storyBranches.delete(storyKey);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
518
|
async setMetric(runId, key, value) {
|
|
689
519
|
let runMap = this._kvMetrics.get(runId);
|
|
690
520
|
if (runMap === void 0) {
|
|
@@ -1230,5 +1060,5 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
1230
1060
|
}
|
|
1231
1061
|
|
|
1232
1062
|
//#endregion
|
|
1233
|
-
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS,
|
|
1234
|
-
//# sourceMappingURL=health-
|
|
1063
|
+
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDoltOperatorReader, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, runHealthAction, validateStoryKey };
|
|
1064
|
+
//# sourceMappingURL=health-BUfapi3C.js.map
|
|
@@ -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-BUfapi3C.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
|
-
import "./dist-
|
|
4
|
-
import "./manifest-read-
|
|
3
|
+
import "./dist-BWwy_6uv.js";
|
|
4
|
+
import "./manifest-read-C1IQ75EP.js";
|
|
5
5
|
import "./work-graph-repository-DZyJv5pV.js";
|
|
6
6
|
import "./decisions-CzSIEeGP.js";
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1697,11 +1697,6 @@ interface OrchestratorEvents {
|
|
|
1697
1697
|
modifiedInterfaces: string[];
|
|
1698
1698
|
potentiallyAffectedTests: string[];
|
|
1699
1699
|
};
|
|
1700
|
-
/** Dolt merge conflict detected when merging a story branch into main */
|
|
1701
|
-
'pipeline:state-conflict': {
|
|
1702
|
-
storyKey: string;
|
|
1703
|
-
conflict: unknown;
|
|
1704
|
-
};
|
|
1705
1700
|
/**
|
|
1706
1701
|
* Emitted at pipeline startup when the repo-map symbol index is detected as
|
|
1707
1702
|
* stale (HEAD SHA has changed since the last index update). Non-blocking —
|
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-BWwy_6uv.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-u3LnOLzz.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-C1IQ75EP.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-BUDDSIRy.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-BWwy_6uv.js";
|
|
3
3
|
import * as path$1 from "path";
|
|
4
4
|
import { join } from "path";
|
|
5
5
|
import { readFile } from "fs/promises";
|
|
@@ -5845,4 +5845,4 @@ async function resolveRunManifest(dbRoot, runId) {
|
|
|
5845
5845
|
|
|
5846
5846
|
//#endregion
|
|
5847
5847
|
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 };
|
|
5848
|
-
//# sourceMappingURL=manifest-read-
|
|
5848
|
+
//# sourceMappingURL=manifest-read-C1IQ75EP.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-BWwy_6uv.js";
|
|
3
|
+
import "../../manifest-read-C1IQ75EP.js";
|
|
4
|
+
import { runInteractivePrompt } from "../../interactive-prompt-BUDDSIRy.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-BWwy_6uv.js";
|
|
2
2
|
import "./routing-DFxoKHDt.js";
|
|
3
3
|
|
|
4
4
|
export { loadModelRoutingConfig };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-BUfapi3C.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-BWwy_6uv.js";
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BHDVWJVt.js";
|
|
6
|
+
import "./manifest-read-C1IQ75EP.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-DblHY8se.js";
|
|
11
|
-
import "./interactive-prompt-
|
|
11
|
+
import "./interactive-prompt-BUDDSIRy.js";
|
|
12
12
|
import "./recovery-engine-BKGBeBnW.js";
|
|
13
13
|
|
|
14
14
|
export { runRunAction };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BMAD_BASELINE_TOKENS_FULL,
|
|
1
|
+
import { BMAD_BASELINE_TOKENS_FULL, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, validateStoryKey } from "./health-BUfapi3C.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, 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, 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, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-
|
|
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, classifyVersionGap, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, swallowDebug, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-BWwy_6uv.js";
|
|
5
|
+
import { FindingsInjector, RunManifest, RuntimeProbeListSchema, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, renderFindings, resolveGraphPath, resolveMainRepoRoot, runAcTraceabilityCheck, runStaleVerificationRecovery } from "./manifest-read-C1IQ75EP.js";
|
|
6
6
|
import { WorkGraphRepository, detectCycles } from "./work-graph-repository-DZyJv5pV.js";
|
|
7
7
|
import { deriveExitCode, routeDecision } from "./decision-router-DblHY8se.js";
|
|
8
|
-
import { runInteractivePrompt } from "./interactive-prompt-
|
|
8
|
+
import { runInteractivePrompt } from "./interactive-prompt-BUDDSIRy.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";
|
|
@@ -13699,20 +13699,6 @@ function createImplementationOrchestrator(deps) {
|
|
|
13699
13699
|
err,
|
|
13700
13700
|
storyKey
|
|
13701
13701
|
}, "StateStore write failed after updateStory"));
|
|
13702
|
-
if (updates.phase === "COMPLETE") stateStore?.mergeStory(storyKey).catch((err) => {
|
|
13703
|
-
if (err instanceof DoltMergeConflict) eventBus.emit("pipeline:state-conflict", {
|
|
13704
|
-
storyKey,
|
|
13705
|
-
conflict: err
|
|
13706
|
-
});
|
|
13707
|
-
else logger$27.warn({
|
|
13708
|
-
err,
|
|
13709
|
-
storyKey
|
|
13710
|
-
}, "mergeStory failed");
|
|
13711
|
-
});
|
|
13712
|
-
else if (updates.phase === "ESCALATED" || updates.phase === "VERIFICATION_FAILED") stateStore?.rollbackStory(storyKey).catch((err) => logger$27.warn({
|
|
13713
|
-
err,
|
|
13714
|
-
storyKey
|
|
13715
|
-
}, "rollbackStory failed — branch may persist"));
|
|
13716
13702
|
if (updates.phase !== void 0) {
|
|
13717
13703
|
const targetStatus = wgStatusForPhase(updates.phase);
|
|
13718
13704
|
if (targetStatus !== null) if (targetStatus === "in_progress" && _wgInProgressWritten.has(storyKey)) {} else {
|
|
@@ -13983,10 +13969,6 @@ function createImplementationOrchestrator(deps) {
|
|
|
13983
13969
|
let _capturedStoryTitle;
|
|
13984
13970
|
await waitIfPaused();
|
|
13985
13971
|
if (_state !== "RUNNING") return;
|
|
13986
|
-
stateStore?.branchForStory(storyKey).catch((err) => logger$27.warn({
|
|
13987
|
-
err,
|
|
13988
|
-
storyKey
|
|
13989
|
-
}, "branchForStory failed — continuing without branch isolation"));
|
|
13990
13972
|
startPhase(storyKey, "create-story");
|
|
13991
13973
|
updateStory(storyKey, {
|
|
13992
13974
|
phase: "IN_STORY_CREATION",
|
|
@@ -47137,7 +47119,7 @@ async function runFullPipeline(options) {
|
|
|
47137
47119
|
*/
|
|
47138
47120
|
async function emitPreDispatchVersionAdvisory(currentVersion) {
|
|
47139
47121
|
if (process.env["SUBSTRATE_NO_UPDATE_CHECK"] === "1") return;
|
|
47140
|
-
const { createVersionManager } = await import("./version-manager-impl-
|
|
47122
|
+
const { createVersionManager } = await import("./version-manager-impl-DxNTLWOT.js");
|
|
47141
47123
|
const vm = createVersionManager();
|
|
47142
47124
|
const result = await vm.checkForUpdates(true);
|
|
47143
47125
|
const gap = classifyVersionGap(currentVersion, result.latestVersion);
|
|
@@ -47234,4 +47216,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
|
|
|
47234
47216
|
|
|
47235
47217
|
//#endregion
|
|
47236
47218
|
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 };
|
|
47237
|
-
//# sourceMappingURL=run-
|
|
47219
|
+
//# sourceMappingURL=run-BHDVWJVt.js.map
|
|
@@ -404,11 +404,6 @@ type SdlcEvents = CoreEvents & {
|
|
|
404
404
|
/** 'pass' if zero mismatches, 'fail' otherwise */
|
|
405
405
|
verdict: 'pass' | 'fail';
|
|
406
406
|
};
|
|
407
|
-
/** Dolt merge conflict detected when merging a story branch into main */
|
|
408
|
-
'pipeline:state-conflict': {
|
|
409
|
-
storyKey: string;
|
|
410
|
-
conflict: unknown;
|
|
411
|
-
};
|
|
412
407
|
/**
|
|
413
408
|
* Emitted at pipeline startup when the repo-map symbol index is detected as stale.
|
|
414
409
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVersionManager } from "./dist-
|
|
1
|
+
import { createVersionManager } from "./dist-BWwy_6uv.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-BEZi9_nw.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-BWwy_6uv.js";
|
|
2
2
|
import "./version-manager-impl-qFBiO4Eh.js";
|
|
3
|
-
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-
|
|
3
|
+
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-BEZi9_nw.js";
|
|
4
4
|
|
|
5
5
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|
package/package.json
CHANGED