substrate-ai 0.3.4 → 0.3.7
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-CctHT8ZH.js +3 -0
- package/dist/{adapter-registry-DHl0W-YB.js → adapter-registry-rSOJ9Kvz.js} +6 -4
- package/dist/cli/index.js +20 -5
- package/dist/index.d.ts +38 -3
- package/dist/index.js +1 -1
- package/dist/{run-Dul2DU3D.js → run-C_hKt2wY.js} +1 -1
- package/dist/{run-8ygA8hgY.js → run-N7voPS_k.js} +77 -14
- package/package.json +7 -1
- package/packs/bmad/manifest.yaml +1 -0
- package/dist/adapter-registry-eyyVr21J.js +0 -3
|
@@ -56,14 +56,14 @@ var ClaudeCodeAdapter = class {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Build spawn command for a coding task.
|
|
59
|
-
* Uses: `claude -p
|
|
59
|
+
* Uses: `claude -p --model <model> --dangerously-skip-permissions --system-prompt <minimal>`
|
|
60
|
+
* Prompt is delivered via stdin (not CLI arg) to avoid E2BIG on large prompts.
|
|
60
61
|
*/
|
|
61
62
|
buildCommand(prompt, options) {
|
|
62
63
|
const model = options.model ?? DEFAULT_MODEL$1;
|
|
63
64
|
const systemPrompt = "You are an autonomous coding agent executing a single pipeline task. Ignore all session startup context, memory notes, and \"Next Up\" indicators. Follow the instructions in the user message exactly. Emit ONLY the YAML output specified in the Output Contract — no other text.";
|
|
64
65
|
const args = [
|
|
65
66
|
"-p",
|
|
66
|
-
prompt,
|
|
67
67
|
"--model",
|
|
68
68
|
model,
|
|
69
69
|
"--dangerously-skip-permissions",
|
|
@@ -82,6 +82,9 @@ var ClaudeCodeAdapter = class {
|
|
|
82
82
|
envEntries.OTEL_METRICS_EXPORTER = "otlp";
|
|
83
83
|
envEntries.OTEL_EXPORTER_OTLP_PROTOCOL = "http/json";
|
|
84
84
|
envEntries.OTEL_EXPORTER_OTLP_ENDPOINT = options.otlpEndpoint;
|
|
85
|
+
envEntries.OTEL_LOG_TOOL_DETAILS = "1";
|
|
86
|
+
envEntries.OTEL_METRIC_EXPORT_INTERVAL = "10000";
|
|
87
|
+
if (options.storyKey !== void 0) envEntries.OTEL_RESOURCE_ATTRIBUTES = `substrate.story_key=${options.storyKey}`;
|
|
85
88
|
}
|
|
86
89
|
return {
|
|
87
90
|
binary: "claude",
|
|
@@ -100,7 +103,6 @@ var ClaudeCodeAdapter = class {
|
|
|
100
103
|
const planningPrompt = this._buildPlanningPrompt(request);
|
|
101
104
|
const args = [
|
|
102
105
|
"-p",
|
|
103
|
-
planningPrompt,
|
|
104
106
|
"--model",
|
|
105
107
|
model
|
|
106
108
|
];
|
|
@@ -822,4 +824,4 @@ var AdapterRegistry = class {
|
|
|
822
824
|
|
|
823
825
|
//#endregion
|
|
824
826
|
export { AdapterRegistry, ClaudeCodeAdapter, CodexCLIAdapter, GeminiCLIAdapter };
|
|
825
|
-
//# sourceMappingURL=adapter-registry-
|
|
827
|
+
//# sourceMappingURL=adapter-registry-rSOJ9Kvz.js.map
|
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DatabaseWrapper, DoltNotInstalled, FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, TelemetryPersistence, VALID_PHASES, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDispatcher, createDoltClient, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initializeDolt, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
2
|
+
import { DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DatabaseWrapper, DoltNotInstalled, FileStateStore, IngestionServer, SUBSTRATE_OWNED_SETTINGS_KEYS, TelemetryPersistence, VALID_PHASES, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDispatcher, createDoltClient, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initializeDolt, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-N7voPS_k.js";
|
|
3
3
|
import { createLogger } from "../logger-D2fS2ccL.js";
|
|
4
|
-
import { AdapterRegistry } from "../adapter-registry-
|
|
4
|
+
import { AdapterRegistry } from "../adapter-registry-rSOJ9Kvz.js";
|
|
5
5
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-DtZW1maj.js";
|
|
6
6
|
import { ConfigError, createEventBus } from "../helpers-BihqWgVe.js";
|
|
7
7
|
import { addTokenUsage, createDecision, createPipelineRun, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestRun, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-CdpiJIm5.js";
|
|
@@ -1197,6 +1197,19 @@ async function runFullPipelineFromPhase(options) {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
if (outputFormat === "human") process.stdout.write(`[SOLUTIONING] Complete\n`);
|
|
1199
1199
|
} else if (currentPhase === "implementation") {
|
|
1200
|
+
let telemetryEnabled = false;
|
|
1201
|
+
let telemetryPort = 4318;
|
|
1202
|
+
try {
|
|
1203
|
+
const configSystem = createConfigSystem({ projectConfigDir: dbDir });
|
|
1204
|
+
await configSystem.load();
|
|
1205
|
+
const cfg = configSystem.getConfig();
|
|
1206
|
+
if (cfg.telemetry?.enabled === true) {
|
|
1207
|
+
telemetryEnabled = true;
|
|
1208
|
+
telemetryPort = cfg.telemetry.port ?? 4318;
|
|
1209
|
+
}
|
|
1210
|
+
} catch {}
|
|
1211
|
+
const ingestionServer = telemetryEnabled ? new IngestionServer({ port: telemetryPort }) : void 0;
|
|
1212
|
+
const telemetryPersistence = telemetryEnabled ? new TelemetryPersistence(db) : void 0;
|
|
1200
1213
|
const orchestrator = createImplementationOrchestrator({
|
|
1201
1214
|
db,
|
|
1202
1215
|
pack,
|
|
@@ -1208,7 +1221,9 @@ async function runFullPipelineFromPhase(options) {
|
|
|
1208
1221
|
maxReviewCycles: 2,
|
|
1209
1222
|
pipelineRunId: runId
|
|
1210
1223
|
},
|
|
1211
|
-
projectRoot
|
|
1224
|
+
projectRoot,
|
|
1225
|
+
...ingestionServer !== void 0 ? { ingestionServer } : {},
|
|
1226
|
+
...telemetryPersistence !== void 0 ? { telemetryPersistence } : {}
|
|
1212
1227
|
});
|
|
1213
1228
|
eventBus.on("orchestrator:story-phase-complete", (payload) => {
|
|
1214
1229
|
try {
|
|
@@ -2284,7 +2299,7 @@ function defaultSupervisorDeps() {
|
|
|
2284
2299
|
if (cached === null) {
|
|
2285
2300
|
const { AdapterRegistry: AR } = await import(
|
|
2286
2301
|
/* @vite-ignore */
|
|
2287
|
-
"../adapter-registry-
|
|
2302
|
+
"../adapter-registry-CctHT8ZH.js"
|
|
2288
2303
|
);
|
|
2289
2304
|
cached = new AR();
|
|
2290
2305
|
await cached.discoverAndRegister();
|
|
@@ -2681,7 +2696,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
2681
2696
|
const expDb = expDbWrapper.db;
|
|
2682
2697
|
const { runRunAction: runPipeline } = await import(
|
|
2683
2698
|
/* @vite-ignore */
|
|
2684
|
-
"../run-
|
|
2699
|
+
"../run-C_hKt2wY.js"
|
|
2685
2700
|
);
|
|
2686
2701
|
const runStoryFn = async (opts) => {
|
|
2687
2702
|
const exitCode = await runPipeline({
|
package/dist/index.d.ts
CHANGED
|
@@ -534,6 +534,23 @@ interface PipelineContractMismatchEvent {
|
|
|
534
534
|
/** Human-readable description of the mismatch (e.g., missing file, type error) */
|
|
535
535
|
mismatchDescription: string;
|
|
536
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* Emitted once after post-sprint contract verification completes.
|
|
539
|
+
* Consolidates results into a single event instead of per-mismatch noise.
|
|
540
|
+
*/
|
|
541
|
+
interface PipelineContractVerificationSummaryEvent {
|
|
542
|
+
type: 'pipeline:contract-verification-summary';
|
|
543
|
+
/** ISO-8601 timestamp generated at emit time */
|
|
544
|
+
ts: string;
|
|
545
|
+
/** Number of contract declarations verified (current sprint only) */
|
|
546
|
+
verified: number;
|
|
547
|
+
/** Number of stale declarations pruned (from previous epics) */
|
|
548
|
+
stalePruned: number;
|
|
549
|
+
/** Number of real mismatches found */
|
|
550
|
+
mismatches: number;
|
|
551
|
+
/** 'pass' if zero mismatches, 'fail' otherwise */
|
|
552
|
+
verdict: 'pass' | 'fail';
|
|
553
|
+
}
|
|
537
554
|
/**
|
|
538
555
|
* Discriminated union of all pipeline event types.
|
|
539
556
|
*
|
|
@@ -546,7 +563,7 @@ interface PipelineContractMismatchEvent {
|
|
|
546
563
|
* }
|
|
547
564
|
* ```
|
|
548
565
|
*/
|
|
549
|
-
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineContractMismatchEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent; //#endregion
|
|
566
|
+
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent; //#endregion
|
|
550
567
|
//#region src/core/errors.d.ts
|
|
551
568
|
|
|
552
569
|
/**
|
|
@@ -1214,6 +1231,17 @@ interface OrchestratorEvents {
|
|
|
1214
1231
|
/** Human-readable description of the mismatch */
|
|
1215
1232
|
mismatchDescription: string;
|
|
1216
1233
|
};
|
|
1234
|
+
/** Consolidated contract verification summary (emitted once per verification pass) */
|
|
1235
|
+
'pipeline:contract-verification-summary': {
|
|
1236
|
+
/** Number of contract declarations verified (current sprint only) */
|
|
1237
|
+
verified: number;
|
|
1238
|
+
/** Number of stale declarations pruned (from previous epics) */
|
|
1239
|
+
stalePruned: number;
|
|
1240
|
+
/** Number of real mismatches found */
|
|
1241
|
+
mismatches: number;
|
|
1242
|
+
/** 'pass' if zero mismatches, 'fail' otherwise */
|
|
1243
|
+
verdict: 'pass' | 'fail';
|
|
1244
|
+
};
|
|
1217
1245
|
/** Build verification command failed with non-zero exit or timeout */
|
|
1218
1246
|
'story:build-verification-failed': {
|
|
1219
1247
|
storyKey: string;
|
|
@@ -1418,11 +1446,17 @@ interface AdapterOptions {
|
|
|
1418
1446
|
maxTurns?: number;
|
|
1419
1447
|
/**
|
|
1420
1448
|
* Optional OTLP endpoint URL for telemetry export (Story 27-9).
|
|
1421
|
-
* When set, injects
|
|
1449
|
+
* When set, injects OTLP env vars into the spawned process so that
|
|
1422
1450
|
* Claude Code exports telemetry to the local IngestionServer.
|
|
1423
1451
|
* Example: "http://localhost:4318"
|
|
1424
1452
|
*/
|
|
1425
1453
|
otlpEndpoint?: string;
|
|
1454
|
+
/**
|
|
1455
|
+
* Optional story key for OTEL resource attribute tagging.
|
|
1456
|
+
* Injected as `substrate.story_key` via OTEL_RESOURCE_ATTRIBUTES
|
|
1457
|
+
* so the telemetry pipeline can group spans/events per story.
|
|
1458
|
+
*/
|
|
1459
|
+
storyKey?: string;
|
|
1426
1460
|
}
|
|
1427
1461
|
/**
|
|
1428
1462
|
* Capabilities reported by an adapter for this CLI agent.
|
|
@@ -1749,7 +1783,8 @@ declare class ClaudeCodeAdapter implements WorkerAdapter {
|
|
|
1749
1783
|
healthCheck(): Promise<AdapterHealthResult>;
|
|
1750
1784
|
/**
|
|
1751
1785
|
* Build spawn command for a coding task.
|
|
1752
|
-
* Uses: `claude -p
|
|
1786
|
+
* Uses: `claude -p --model <model> --dangerously-skip-permissions --system-prompt <minimal>`
|
|
1787
|
+
* Prompt is delivered via stdin (not CLI arg) to avoid E2BIG on large prompts.
|
|
1753
1788
|
*/
|
|
1754
1789
|
buildCommand(prompt: string, options: AdapterOptions): SpawnCommand;
|
|
1755
1790
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { childLogger, createLogger, logger } from "./logger-D2fS2ccL.js";
|
|
2
|
-
import { AdapterRegistry, ClaudeCodeAdapter, CodexCLIAdapter, GeminiCLIAdapter } from "./adapter-registry-
|
|
2
|
+
import { AdapterRegistry, ClaudeCodeAdapter, CodexCLIAdapter, GeminiCLIAdapter } from "./adapter-registry-rSOJ9Kvz.js";
|
|
3
3
|
import { AdtError, BudgetExceededError, ConfigError, ConfigIncompatibleFormatError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError, assertDefined, createEventBus, createTuiApp, deepClone, formatDuration, generateId, isPlainObject, isTuiCapable, printNonTtyWarning, sleep, withRetry } from "./helpers-BihqWgVe.js";
|
|
4
4
|
|
|
5
5
|
//#region src/core/di.ts
|
|
@@ -2966,6 +2966,38 @@ const PIPELINE_EVENT_METADATA = [
|
|
|
2966
2966
|
description: "Mismatch details (missing file, type error)."
|
|
2967
2967
|
}
|
|
2968
2968
|
]
|
|
2969
|
+
},
|
|
2970
|
+
{
|
|
2971
|
+
type: "pipeline:contract-verification-summary",
|
|
2972
|
+
description: "Contract verification summary. Consolidates pass/fail into a single event.",
|
|
2973
|
+
when: "After all stories complete, before pipeline:complete. Emitted once per verification pass.",
|
|
2974
|
+
fields: [
|
|
2975
|
+
{
|
|
2976
|
+
name: "ts",
|
|
2977
|
+
type: "string",
|
|
2978
|
+
description: "Timestamp."
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
name: "verified",
|
|
2982
|
+
type: "number",
|
|
2983
|
+
description: "Declarations verified (current sprint)."
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
name: "stalePruned",
|
|
2987
|
+
type: "number",
|
|
2988
|
+
description: "Stale declarations pruned (previous epics)."
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
name: "mismatches",
|
|
2992
|
+
type: "number",
|
|
2993
|
+
description: "Real mismatches found."
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
name: "verdict",
|
|
2997
|
+
type: "pass|fail",
|
|
2998
|
+
description: "Overall verification result."
|
|
2999
|
+
}
|
|
3000
|
+
]
|
|
2969
3001
|
}
|
|
2970
3002
|
];
|
|
2971
3003
|
/**
|
|
@@ -3920,7 +3952,7 @@ var DispatcherImpl = class {
|
|
|
3920
3952
|
logger$22.info("Dispatcher shutdown complete");
|
|
3921
3953
|
}
|
|
3922
3954
|
async _startDispatch(id, request, resolve$2) {
|
|
3923
|
-
const { prompt, agent, taskType, timeout, outputSchema, workingDirectory, model, maxTurns, otlpEndpoint } = request;
|
|
3955
|
+
const { prompt, agent, taskType, timeout, outputSchema, workingDirectory, model, maxTurns, otlpEndpoint, storyKey } = request;
|
|
3924
3956
|
const adapter = this._adapterRegistry.get(agent);
|
|
3925
3957
|
if (adapter === void 0) {
|
|
3926
3958
|
logger$22.warn({
|
|
@@ -3951,7 +3983,8 @@ var DispatcherImpl = class {
|
|
|
3951
3983
|
billingMode: "subscription",
|
|
3952
3984
|
...model !== void 0 ? { model } : {},
|
|
3953
3985
|
...resolvedMaxTurns !== void 0 ? { maxTurns: resolvedMaxTurns } : {},
|
|
3954
|
-
...otlpEndpoint !== void 0 ? { otlpEndpoint } : {}
|
|
3986
|
+
...otlpEndpoint !== void 0 ? { otlpEndpoint } : {},
|
|
3987
|
+
...storyKey !== void 0 ? { storyKey } : {}
|
|
3955
3988
|
});
|
|
3956
3989
|
const timeoutMs = timeout ?? this._config.defaultTimeouts[taskType] ?? DEFAULT_TIMEOUTS[taskType] ?? 3e5;
|
|
3957
3990
|
const env = { ...process.env };
|
|
@@ -4946,7 +4979,8 @@ async function runCreateStory(deps, params) {
|
|
|
4946
4979
|
taskType: "create-story",
|
|
4947
4980
|
outputSchema: CreateStoryResultSchema,
|
|
4948
4981
|
...deps.projectRoot !== void 0 ? { workingDirectory: deps.projectRoot } : {},
|
|
4949
|
-
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {}
|
|
4982
|
+
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {},
|
|
4983
|
+
storyKey
|
|
4950
4984
|
});
|
|
4951
4985
|
let dispatchResult;
|
|
4952
4986
|
try {
|
|
@@ -5837,7 +5871,8 @@ async function runDevStory(deps, params) {
|
|
|
5837
5871
|
outputSchema: DevStoryResultSchema,
|
|
5838
5872
|
maxTurns: resolvedMaxTurns,
|
|
5839
5873
|
...deps.projectRoot !== void 0 ? { workingDirectory: deps.projectRoot } : {},
|
|
5840
|
-
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {}
|
|
5874
|
+
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {},
|
|
5875
|
+
storyKey
|
|
5841
5876
|
});
|
|
5842
5877
|
dispatchResult = await handle.result;
|
|
5843
5878
|
} catch (err) {
|
|
@@ -6241,7 +6276,8 @@ async function runCodeReview(deps, params) {
|
|
|
6241
6276
|
taskType: "code-review",
|
|
6242
6277
|
outputSchema: CodeReviewResultSchema,
|
|
6243
6278
|
workingDirectory: deps.projectRoot,
|
|
6244
|
-
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {}
|
|
6279
|
+
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {},
|
|
6280
|
+
storyKey
|
|
6245
6281
|
});
|
|
6246
6282
|
let dispatchResult;
|
|
6247
6283
|
try {
|
|
@@ -6430,7 +6466,8 @@ async function runTestPlan(deps, params) {
|
|
|
6430
6466
|
timeout: DEFAULT_TIMEOUT_MS,
|
|
6431
6467
|
outputSchema: TestPlanResultSchema,
|
|
6432
6468
|
...deps.projectRoot !== void 0 ? { workingDirectory: deps.projectRoot } : {},
|
|
6433
|
-
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {}
|
|
6469
|
+
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {},
|
|
6470
|
+
storyKey
|
|
6434
6471
|
});
|
|
6435
6472
|
dispatchResult = await handle.result;
|
|
6436
6473
|
} catch (err) {
|
|
@@ -6677,7 +6714,8 @@ async function runTestExpansion(deps, params) {
|
|
|
6677
6714
|
taskType: "test-expansion",
|
|
6678
6715
|
outputSchema: TestExpansionResultSchema,
|
|
6679
6716
|
workingDirectory: deps.projectRoot,
|
|
6680
|
-
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {}
|
|
6717
|
+
...deps.otlpEndpoint !== void 0 ? { otlpEndpoint: deps.otlpEndpoint } : {},
|
|
6718
|
+
storyKey
|
|
6681
6719
|
});
|
|
6682
6720
|
let dispatchResult;
|
|
6683
6721
|
try {
|
|
@@ -12842,7 +12880,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
12842
12880
|
taskType: "minor-fixes",
|
|
12843
12881
|
workingDirectory: projectRoot,
|
|
12844
12882
|
...autoApproveMaxTurns !== void 0 ? { maxTurns: autoApproveMaxTurns } : {},
|
|
12845
|
-
..._otlpEndpoint !== void 0 ? { otlpEndpoint: _otlpEndpoint } : {}
|
|
12883
|
+
..._otlpEndpoint !== void 0 ? { otlpEndpoint: _otlpEndpoint } : {},
|
|
12884
|
+
storyKey
|
|
12846
12885
|
});
|
|
12847
12886
|
const fixResult = await handle.result;
|
|
12848
12887
|
eventBus.emit("orchestrator:story-phase-complete", {
|
|
@@ -13285,7 +13324,15 @@ function createImplementationOrchestrator(deps) {
|
|
|
13285
13324
|
_state = "COMPLETE";
|
|
13286
13325
|
_completedAt = new Date().toISOString();
|
|
13287
13326
|
if (projectRoot !== void 0 && contractDeclarations.length > 0) try {
|
|
13288
|
-
const
|
|
13327
|
+
const totalDeclarations = contractDeclarations.length;
|
|
13328
|
+
const currentSprintDeclarations = contractDeclarations.filter((d) => storyKeys.includes(d.storyKey));
|
|
13329
|
+
const stalePruned = totalDeclarations - currentSprintDeclarations.length;
|
|
13330
|
+
if (stalePruned > 0) logger$27.info({
|
|
13331
|
+
stalePruned,
|
|
13332
|
+
remaining: currentSprintDeclarations.length
|
|
13333
|
+
}, "Pruned stale contract declarations from previous epics");
|
|
13334
|
+
let mismatches = [];
|
|
13335
|
+
if (currentSprintDeclarations.length > 0) mismatches = verifyContracts(currentSprintDeclarations, projectRoot);
|
|
13289
13336
|
if (mismatches.length > 0) {
|
|
13290
13337
|
_contractMismatches = mismatches;
|
|
13291
13338
|
for (const mismatch of mismatches) eventBus.emit("pipeline:contract-mismatch", {
|
|
@@ -13298,12 +13345,18 @@ function createImplementationOrchestrator(deps) {
|
|
|
13298
13345
|
mismatchCount: mismatches.length,
|
|
13299
13346
|
mismatches
|
|
13300
13347
|
}, "Post-sprint contract verification found mismatches — manual review required");
|
|
13301
|
-
} else logger$27.info("Post-sprint contract verification passed — all declared contracts satisfied");
|
|
13348
|
+
} else if (currentSprintDeclarations.length > 0) logger$27.info("Post-sprint contract verification passed — all declared contracts satisfied");
|
|
13349
|
+
eventBus.emit("pipeline:contract-verification-summary", {
|
|
13350
|
+
verified: currentSprintDeclarations.length,
|
|
13351
|
+
stalePruned,
|
|
13352
|
+
mismatches: mismatches.length,
|
|
13353
|
+
verdict: mismatches.length === 0 ? "pass" : "fail"
|
|
13354
|
+
});
|
|
13302
13355
|
if (stateStore !== void 0) try {
|
|
13303
|
-
const
|
|
13356
|
+
const currentSprintContracts = (await stateStore.queryContracts()).filter((cr) => storyKeys.includes(cr.storyKey));
|
|
13304
13357
|
const verifiedAt = new Date().toISOString();
|
|
13305
13358
|
const contractsByStory = new Map();
|
|
13306
|
-
for (const cr of
|
|
13359
|
+
for (const cr of currentSprintContracts) {
|
|
13307
13360
|
const existing = contractsByStory.get(cr.storyKey) ?? [];
|
|
13308
13361
|
existing.push(cr);
|
|
13309
13362
|
contractsByStory.set(cr.storyKey, existing);
|
|
@@ -18120,6 +18173,16 @@ async function runRunAction(options) {
|
|
|
18120
18173
|
mismatchDescription: payload.mismatchDescription
|
|
18121
18174
|
});
|
|
18122
18175
|
});
|
|
18176
|
+
eventBus.on("pipeline:contract-verification-summary", (payload) => {
|
|
18177
|
+
ndjsonEmitter.emit({
|
|
18178
|
+
type: "pipeline:contract-verification-summary",
|
|
18179
|
+
ts: new Date().toISOString(),
|
|
18180
|
+
verified: payload.verified,
|
|
18181
|
+
stalePruned: payload.stalePruned,
|
|
18182
|
+
mismatches: payload.mismatches,
|
|
18183
|
+
verdict: payload.verdict
|
|
18184
|
+
});
|
|
18185
|
+
});
|
|
18123
18186
|
}
|
|
18124
18187
|
const ingestionServer = telemetryEnabled ? new IngestionServer({ port: telemetryPort }) : void 0;
|
|
18125
18188
|
const telemetryPersistence = telemetryEnabled ? new TelemetryPersistence(db) : void 0;
|
|
@@ -18586,5 +18649,5 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
18586
18649
|
}
|
|
18587
18650
|
|
|
18588
18651
|
//#endregion
|
|
18589
|
-
export { DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DatabaseWrapper, DoltNotInstalled, FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, TelemetryPersistence, VALID_PHASES, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDispatcher, createDoltClient, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initializeDolt, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runMigrations, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
18590
|
-
//# sourceMappingURL=run-
|
|
18652
|
+
export { DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DatabaseWrapper, DoltNotInstalled, FileStateStore, IngestionServer, SUBSTRATE_OWNED_SETTINGS_KEYS, TelemetryPersistence, VALID_PHASES, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDispatcher, createDoltClient, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initializeDolt, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runMigrations, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
18653
|
+
//# sourceMappingURL=run-N7voPS_k.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "substrate-ai",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Substrate — multi-agent orchestration daemon for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -72,6 +72,12 @@
|
|
|
72
72
|
"substrate-ai": "^0.1.22",
|
|
73
73
|
"zod": "^4.3.6"
|
|
74
74
|
},
|
|
75
|
+
"optionalDependencies": {
|
|
76
|
+
"tree-sitter": "^0.21.1",
|
|
77
|
+
"tree-sitter-typescript": "^0.21.2",
|
|
78
|
+
"tree-sitter-javascript": "^0.21.4",
|
|
79
|
+
"tree-sitter-python": "^0.21.0"
|
|
80
|
+
},
|
|
75
81
|
"devDependencies": {
|
|
76
82
|
"@eslint/js": "^9.17.0",
|
|
77
83
|
"@types/js-yaml": "^4.0.9",
|
package/packs/bmad/manifest.yaml
CHANGED