substrate-ai 0.19.42 → 0.19.43
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-kiI4y78c.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-BzRTI2mg.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-kiI4y78c.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|
|
@@ -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]);
|
|
@@ -18509,16 +18540,23 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18509
18540
|
} catch {}
|
|
18510
18541
|
const vr = verificationResults[s$1.story_key];
|
|
18511
18542
|
const qualityScore = efficiencyScores[s$1.story_key];
|
|
18543
|
+
const escalation = escalationDiagnoses[s$1.story_key];
|
|
18512
18544
|
return {
|
|
18513
18545
|
storyKey: s$1.story_key,
|
|
18514
18546
|
result: normalizeResult(s$1.result),
|
|
18515
18547
|
wallClockSeconds: s$1.wall_clock_seconds,
|
|
18548
|
+
...s$1.started_at && { startedAt: s$1.started_at },
|
|
18549
|
+
...s$1.completed_at && { completedAt: s$1.completed_at },
|
|
18516
18550
|
inputTokens: s$1.input_tokens,
|
|
18517
18551
|
outputTokens: s$1.output_tokens,
|
|
18518
18552
|
costUsd: s$1.cost_usd,
|
|
18519
18553
|
reviewCycles: s$1.review_cycles,
|
|
18520
18554
|
dispatches: s$1.dispatches,
|
|
18521
18555
|
...phaseDurations !== void 0 && { phaseDurations },
|
|
18556
|
+
...escalation !== void 0 && {
|
|
18557
|
+
escalationReason: escalation.reason,
|
|
18558
|
+
...escalation.issues.length > 0 && { escalationIssues: escalation.issues }
|
|
18559
|
+
},
|
|
18522
18560
|
...vr !== void 0 && {
|
|
18523
18561
|
verificationStatus: vr.status,
|
|
18524
18562
|
verificationChecks: vr.checks
|
|
@@ -18540,11 +18578,15 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18540
18578
|
const rawStatus = runMetrics.status.toLowerCase();
|
|
18541
18579
|
const status = rawStatus === "completed" ? "completed" : rawStatus === "failed" ? "failed" : "partial";
|
|
18542
18580
|
const projectId = opts.projectId ?? (opts.projectRoot ? basename$1(opts.projectRoot) : "unknown");
|
|
18581
|
+
const escalationFindings = Object.values(escalationDiagnoses).map((d) => d.finding);
|
|
18582
|
+
const timestamp = runMetrics.completed_at ?? new Date().toISOString();
|
|
18543
18583
|
return {
|
|
18544
18584
|
runId,
|
|
18545
18585
|
projectId,
|
|
18546
18586
|
substrateVersion: opts.substrateVersion ?? getSubstrateVersion(),
|
|
18547
|
-
timestamp
|
|
18587
|
+
timestamp,
|
|
18588
|
+
...runMetrics.started_at && { startedAt: runMetrics.started_at },
|
|
18589
|
+
...runMetrics.completed_at && { completedAt: runMetrics.completed_at },
|
|
18548
18590
|
status,
|
|
18549
18591
|
wallClockSeconds: runMetrics.wall_clock_seconds,
|
|
18550
18592
|
totalInputTokens: runMetrics.total_input_tokens,
|
|
@@ -18558,12 +18600,14 @@ async function buildRunReport(adapter, runId, opts) {
|
|
|
18558
18600
|
totalDispatches: runMetrics.total_dispatches,
|
|
18559
18601
|
restarts: runMetrics.restarts,
|
|
18560
18602
|
stories,
|
|
18603
|
+
...escalationFindings.length > 0 && { escalationFindings },
|
|
18561
18604
|
...contractVerification !== void 0 && { contractVerification },
|
|
18562
18605
|
...warnings.length > 0 && { warnings },
|
|
18563
18606
|
...avgEfficiencyScore !== void 0 && { efficiencyScore: avgEfficiencyScore },
|
|
18564
18607
|
agentBackend: opts.agentBackend ?? "claude-code",
|
|
18565
18608
|
engineType: opts.engineType ?? "linear",
|
|
18566
|
-
concurrency: opts.concurrency ?? runMetrics.concurrency_setting
|
|
18609
|
+
concurrency: opts.concurrency ?? runMetrics.concurrency_setting,
|
|
18610
|
+
...runMetrics.max_concurrent_actual !== void 0 && runMetrics.max_concurrent_actual !== null && { maxConcurrentActual: runMetrics.max_concurrent_actual }
|
|
18567
18611
|
};
|
|
18568
18612
|
}
|
|
18569
18613
|
/**
|
|
@@ -42750,4 +42794,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
42750
42794
|
|
|
42751
42795
|
//#endregion
|
|
42752
42796
|
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-
|
|
42797
|
+
//# sourceMappingURL=run-kiI4y78c.js.map
|