substrate-ai 0.19.42 → 0.19.44
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
|
@@ -4,7 +4,7 @@ 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-sNh9XQ6V.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-DZB3taGX.js";
|
|
8
8
|
import "../errors-RupuC-ES.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -4833,7 +4833,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
4833
4833
|
await initSchema(expAdapter);
|
|
4834
4834
|
const { runRunAction: runPipeline } = await import(
|
|
4835
4835
|
/* @vite-ignore */
|
|
4836
|
-
"../run-
|
|
4836
|
+
"../run-4TqorN-B.js"
|
|
4837
4837
|
);
|
|
4838
4838
|
const runStoryFn = async (opts) => {
|
|
4839
4839
|
const exitCode = await runPipeline({
|
|
@@ -2,7 +2,7 @@ import "./health-BbsWlD8o.js";
|
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
4
|
import "./dist-sNh9XQ6V.js";
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-DZB3taGX.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|
|
@@ -4709,7 +4709,7 @@ const DEFAULT_TIMEOUTS = {
|
|
|
4709
4709
|
"create-story": 6e5,
|
|
4710
4710
|
"dev-story": 18e5,
|
|
4711
4711
|
"code-review": 9e5,
|
|
4712
|
-
"minor-fixes":
|
|
4712
|
+
"minor-fixes": 6e5,
|
|
4713
4713
|
"major-rework": 9e5,
|
|
4714
4714
|
"readiness-check": 6e5,
|
|
4715
4715
|
"elicitation": 9e5,
|
|
@@ -18448,6 +18448,36 @@ async function loadContractVerification(adapter, runId) {
|
|
|
18448
18448
|
return void 0;
|
|
18449
18449
|
}
|
|
18450
18450
|
}
|
|
18451
|
+
async function loadEscalationDiagnoses(adapter, runId) {
|
|
18452
|
+
const results = {};
|
|
18453
|
+
try {
|
|
18454
|
+
const rows = await adapter.query(`SELECT key, value FROM decisions WHERE pipeline_run_id = ? AND category = 'escalation-diagnosis'`, [runId]);
|
|
18455
|
+
for (const row of rows) try {
|
|
18456
|
+
const parsed = JSON.parse(row.value);
|
|
18457
|
+
const storyKey = row.key.split(":")[0] ?? "unknown";
|
|
18458
|
+
const issueDescriptions = (parsed.issues ?? []).map((i) => i.description ? `[${i.severity ?? "unknown"}] ${i.description}` : "").filter(Boolean);
|
|
18459
|
+
results[storyKey] = {
|
|
18460
|
+
finding: {
|
|
18461
|
+
storyKey,
|
|
18462
|
+
...parsed.totalIssues !== void 0 && { totalIssues: parsed.totalIssues },
|
|
18463
|
+
...parsed.blockerCount !== void 0 && { blockerCount: parsed.blockerCount },
|
|
18464
|
+
...parsed.majorCount !== void 0 && { majorCount: parsed.majorCount },
|
|
18465
|
+
...parsed.minorCount !== void 0 && { minorCount: parsed.minorCount },
|
|
18466
|
+
...parsed.issueDistribution && { issueDistribution: parsed.issueDistribution },
|
|
18467
|
+
...parsed.severityProfile && { severityProfile: parsed.severityProfile },
|
|
18468
|
+
...parsed.affectedFiles && parsed.affectedFiles.length > 0 && { affectedFiles: parsed.affectedFiles },
|
|
18469
|
+
...parsed.recommendedAction && { recommendedAction: parsed.recommendedAction },
|
|
18470
|
+
...parsed.rationale && { rationale: parsed.rationale }
|
|
18471
|
+
},
|
|
18472
|
+
reason: parsed.recommendedAction ?? "unknown",
|
|
18473
|
+
issues: issueDescriptions
|
|
18474
|
+
};
|
|
18475
|
+
} catch {}
|
|
18476
|
+
} catch {
|
|
18477
|
+
logger$2.debug("Could not query escalation-diagnosis decisions — skipping");
|
|
18478
|
+
}
|
|
18479
|
+
return results;
|
|
18480
|
+
}
|
|
18451
18481
|
async function buildRunReport(adapter, runId, opts) {
|
|
18452
18482
|
const runMetrics = await getRunMetrics(adapter, runId);
|
|
18453
18483
|
if (!runMetrics) {
|
|
@@ -18461,6 +18491,7 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18461
18491
|
const verificationResults = await loadVerificationResults(runId, runsDir);
|
|
18462
18492
|
const efficiencyScores = await loadEfficiencyScores(adapter, storyKeys);
|
|
18463
18493
|
const contractVerification = await loadContractVerification(adapter, runId);
|
|
18494
|
+
const escalationDiagnoses = await loadEscalationDiagnoses(adapter, runId);
|
|
18464
18495
|
const warnings = [];
|
|
18465
18496
|
try {
|
|
18466
18497
|
const warnRows = await adapter.query(`SELECT key, value FROM decisions WHERE pipeline_run_id = ? AND category = 'INTERFACE_WARNING'`, [runId]);
|
|
@@ -18508,17 +18539,26 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18508
18539
|
phaseDurations = JSON.parse(s$1.phase_durations_json);
|
|
18509
18540
|
} catch {}
|
|
18510
18541
|
const vr = verificationResults[s$1.story_key];
|
|
18511
|
-
const
|
|
18542
|
+
const rawQualityScore = efficiencyScores[s$1.story_key];
|
|
18543
|
+
const escalation = escalationDiagnoses[s$1.story_key];
|
|
18544
|
+
const normalizedStoryResult = normalizeResult(s$1.result);
|
|
18545
|
+
const qualityScore = rawQualityScore !== void 0 ? normalizedStoryResult === "ESCALATED" || normalizedStoryResult === "FAILED" ? Math.min(rawQualityScore, 40) : rawQualityScore : void 0;
|
|
18512
18546
|
return {
|
|
18513
18547
|
storyKey: s$1.story_key,
|
|
18514
|
-
result:
|
|
18548
|
+
result: normalizedStoryResult,
|
|
18515
18549
|
wallClockSeconds: s$1.wall_clock_seconds,
|
|
18550
|
+
...s$1.started_at && { startedAt: s$1.started_at },
|
|
18551
|
+
...s$1.completed_at && { completedAt: s$1.completed_at },
|
|
18516
18552
|
inputTokens: s$1.input_tokens,
|
|
18517
18553
|
outputTokens: s$1.output_tokens,
|
|
18518
18554
|
costUsd: s$1.cost_usd,
|
|
18519
18555
|
reviewCycles: s$1.review_cycles,
|
|
18520
18556
|
dispatches: s$1.dispatches,
|
|
18521
18557
|
...phaseDurations !== void 0 && { phaseDurations },
|
|
18558
|
+
...escalation !== void 0 && {
|
|
18559
|
+
escalationReason: escalation.reason,
|
|
18560
|
+
...escalation.issues.length > 0 && { escalationIssues: escalation.issues }
|
|
18561
|
+
},
|
|
18522
18562
|
...vr !== void 0 && {
|
|
18523
18563
|
verificationStatus: vr.status,
|
|
18524
18564
|
verificationChecks: vr.checks
|
|
@@ -18540,11 +18580,15 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18540
18580
|
const rawStatus = runMetrics.status.toLowerCase();
|
|
18541
18581
|
const status = rawStatus === "completed" ? "completed" : rawStatus === "failed" ? "failed" : "partial";
|
|
18542
18582
|
const projectId = opts.projectId ?? (opts.projectRoot ? basename$1(opts.projectRoot) : "unknown");
|
|
18583
|
+
const escalationFindings = Object.values(escalationDiagnoses).map((d) => d.finding);
|
|
18584
|
+
const timestamp = runMetrics.completed_at ?? new Date().toISOString();
|
|
18543
18585
|
return {
|
|
18544
18586
|
runId,
|
|
18545
18587
|
projectId,
|
|
18546
18588
|
substrateVersion: opts.substrateVersion ?? getSubstrateVersion(),
|
|
18547
|
-
timestamp
|
|
18589
|
+
timestamp,
|
|
18590
|
+
...runMetrics.started_at && { startedAt: runMetrics.started_at },
|
|
18591
|
+
...runMetrics.completed_at && { completedAt: runMetrics.completed_at },
|
|
18548
18592
|
status,
|
|
18549
18593
|
wallClockSeconds: runMetrics.wall_clock_seconds,
|
|
18550
18594
|
totalInputTokens: runMetrics.total_input_tokens,
|
|
@@ -18558,12 +18602,14 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18558
18602
|
totalDispatches: runMetrics.total_dispatches,
|
|
18559
18603
|
restarts: runMetrics.restarts,
|
|
18560
18604
|
stories,
|
|
18605
|
+
...escalationFindings.length > 0 && { escalationFindings },
|
|
18561
18606
|
...contractVerification !== void 0 && { contractVerification },
|
|
18562
18607
|
...warnings.length > 0 && { warnings },
|
|
18563
18608
|
...avgEfficiencyScore !== void 0 && { efficiencyScore: avgEfficiencyScore },
|
|
18564
18609
|
agentBackend: opts.agentBackend ?? "claude-code",
|
|
18565
18610
|
engineType: opts.engineType ?? "linear",
|
|
18566
|
-
concurrency: opts.concurrency ?? runMetrics.concurrency_setting
|
|
18611
|
+
concurrency: opts.concurrency ?? runMetrics.concurrency_setting,
|
|
18612
|
+
...runMetrics.max_concurrent_actual !== void 0 && runMetrics.max_concurrent_actual !== null && { maxConcurrentActual: runMetrics.max_concurrent_actual }
|
|
18567
18613
|
};
|
|
18568
18614
|
}
|
|
18569
18615
|
/**
|
|
@@ -42750,4 +42796,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
42750
42796
|
|
|
42751
42797
|
//#endregion
|
|
42752
42798
|
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 };
|
|
42753
|
-
//# sourceMappingURL=run-
|
|
42799
|
+
//# sourceMappingURL=run-DZB3taGX.js.map
|