substrate-ai 0.20.56 → 0.20.57
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-k7ZX3Bz6.js +4 -0
- package/dist/cli/index.js +3846 -20
- package/dist/{decisions-8q99K5w4.js → decisions-4F91LrVD.js} +1 -1
- package/dist/{dist-ARkfvp4m.js → dist-W2emvN3F.js} +31 -3
- package/dist/{errors-DJdIXYoN.js → errors-CKFu8YI9.js} +2 -2
- package/dist/{experimenter-BxPyegZX.js → experimenter-DxxwicpK.js} +1 -1
- package/dist/{health-BdLCJORK.js → health-HmyFdWEf.js} +2 -2
- package/dist/{health-CTXosAp0.js → health-PdI4-96I.js} +129 -11
- package/dist/index.d.ts +51 -0
- package/dist/index.js +2 -2
- package/dist/{routing-BUTffPcL.js → routing-0ykvBl_4.js} +1 -1
- package/dist/{run-BnD0zCgV.js → run-BF8oeJhG.js} +3 -3
- package/dist/{run-XCd2tF_T.js → run-DcDoaG12.js} +76 -34
- package/dist/{upgrade-CAc1itQK.js → upgrade-C8LAnB6W.js} +2 -2
- package/dist/{upgrade-CqKuWLIO.js → upgrade-CAqLkNUP.js} +2 -2
- package/dist/{version-manager-impl-DJ89OlJD.js → version-manager-impl-DaA_ALYK.js} +1 -1
- package/package.json +1 -1
- package/dist/adapter-registry-BU6ncoq1.js +0 -4
|
@@ -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-W2emvN3F.js";
|
|
2
2
|
import "./decisions-C0pz9Clx.js";
|
|
3
3
|
|
|
4
4
|
export { getLatestRun };
|
|
@@ -861,6 +861,7 @@ function extractJsonAsYaml(text) {
|
|
|
861
861
|
const SHUTDOWN_GRACE_MS = 1e4;
|
|
862
862
|
const SHUTDOWN_MAX_WAIT_MS = 3e4;
|
|
863
863
|
const CHARS_PER_TOKEN$3 = 4;
|
|
864
|
+
const MAX_TAIL_BUFFER = 64 * 1024;
|
|
864
865
|
/**
|
|
865
866
|
* Extract top-level field names from a Zod schema for prompt injection.
|
|
866
867
|
* Returns field names with type hints (e.g., "result: <string>", "files_modified: <list>").
|
|
@@ -1132,7 +1133,7 @@ var DispatcherImpl = class {
|
|
|
1132
1133
|
this._logger.info("Dispatcher shutdown complete");
|
|
1133
1134
|
}
|
|
1134
1135
|
async _startDispatch(id, request, resolve$2) {
|
|
1135
|
-
const { prompt, agent, taskType, timeout, outputSchema, workingDirectory, model, maxTurns, maxContextTokens, otlpEndpoint, storyKey, optimizationDirectives } = request;
|
|
1136
|
+
const { prompt, agent, taskType, timeout, outputSchema, workingDirectory, model, maxTurns, maxContextTokens, otlpEndpoint, storyKey, optimizationDirectives, attemptNumber } = request;
|
|
1136
1137
|
let effectiveModel = model;
|
|
1137
1138
|
if (effectiveModel === void 0 && this._config.routingResolver !== void 0) {
|
|
1138
1139
|
const resolution = this._config.routingResolver.resolveModel(taskType);
|
|
@@ -1235,8 +1236,15 @@ var DispatcherImpl = class {
|
|
|
1235
1236
|
}
|
|
1236
1237
|
const stdoutChunks = [];
|
|
1237
1238
|
const stderrChunks = [];
|
|
1239
|
+
let stdoutSize = 0;
|
|
1240
|
+
let stderrSize = 0;
|
|
1238
1241
|
if (proc.stdout !== null) proc.stdout.on("data", (chunk) => {
|
|
1239
1242
|
stdoutChunks.push(chunk);
|
|
1243
|
+
stdoutSize += chunk.length;
|
|
1244
|
+
while (stdoutSize > MAX_TAIL_BUFFER && stdoutChunks.length > 1) {
|
|
1245
|
+
const dropped = stdoutChunks.shift();
|
|
1246
|
+
stdoutSize -= dropped.length;
|
|
1247
|
+
}
|
|
1240
1248
|
const dataStr = chunk.toString("utf-8");
|
|
1241
1249
|
this._eventBus.emit("agent:output", {
|
|
1242
1250
|
dispatchId: id,
|
|
@@ -1245,6 +1253,11 @@ var DispatcherImpl = class {
|
|
|
1245
1253
|
});
|
|
1246
1254
|
if (proc.stderr !== null) proc.stderr.on("data", (chunk) => {
|
|
1247
1255
|
stderrChunks.push(chunk);
|
|
1256
|
+
stderrSize += chunk.length;
|
|
1257
|
+
while (stderrSize > MAX_TAIL_BUFFER && stderrChunks.length > 1) {
|
|
1258
|
+
const dropped = stderrChunks.shift();
|
|
1259
|
+
stderrSize -= dropped.length;
|
|
1260
|
+
}
|
|
1248
1261
|
});
|
|
1249
1262
|
const activeDispatch = {
|
|
1250
1263
|
id,
|
|
@@ -1273,8 +1286,9 @@ var DispatcherImpl = class {
|
|
|
1273
1286
|
}, "Agent dispatched");
|
|
1274
1287
|
activeDispatch.timeoutHandle = setTimeout(() => {
|
|
1275
1288
|
activeDispatch.timedOut = true;
|
|
1289
|
+
const elapsedAtKill = Date.now() - startedAt;
|
|
1276
1290
|
proc.kill("SIGTERM");
|
|
1277
|
-
const durationMs =
|
|
1291
|
+
const durationMs = elapsedAtKill;
|
|
1278
1292
|
const output = Buffer.concat(stdoutChunks).toString("utf-8");
|
|
1279
1293
|
const inputTokens = Math.ceil(prompt.length / CHARS_PER_TOKEN$3);
|
|
1280
1294
|
const outputTokens = Math.ceil(output.length / CHARS_PER_TOKEN$3);
|
|
@@ -1282,6 +1296,20 @@ var DispatcherImpl = class {
|
|
|
1282
1296
|
dispatchId: id,
|
|
1283
1297
|
timeoutMs
|
|
1284
1298
|
});
|
|
1299
|
+
const stderrTail = Buffer.concat(stderrChunks).toString("utf8");
|
|
1300
|
+
const stdoutTail = Buffer.concat(stdoutChunks).toString("utf8");
|
|
1301
|
+
this._eventBus.emit("dispatch:spawnsync-timeout", {
|
|
1302
|
+
type: "dispatch:spawnsync-timeout",
|
|
1303
|
+
storyKey: storyKey ?? "unknown",
|
|
1304
|
+
taskType,
|
|
1305
|
+
attemptNumber: attemptNumber ?? 1,
|
|
1306
|
+
timeoutMs,
|
|
1307
|
+
elapsedAtKill,
|
|
1308
|
+
...proc.pid != null && proc.pid > 0 ? { pid: proc.pid } : {},
|
|
1309
|
+
occurredAt: new Date().toISOString(),
|
|
1310
|
+
stderrTail,
|
|
1311
|
+
stdoutTail
|
|
1312
|
+
});
|
|
1285
1313
|
this._logger.warn({
|
|
1286
1314
|
id,
|
|
1287
1315
|
agent,
|
|
@@ -11014,4 +11042,4 @@ async function callLLM(params) {
|
|
|
11014
11042
|
|
|
11015
11043
|
//#endregion
|
|
11016
11044
|
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, 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, tagRunAsBaseline, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics };
|
|
11017
|
-
//# sourceMappingURL=dist-
|
|
11045
|
+
//# sourceMappingURL=dist-W2emvN3F.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdtError } from "./dist-
|
|
1
|
+
import { AdtError } from "./dist-W2emvN3F.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-CKFu8YI9.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-W2emvN3F.js";
|
|
2
2
|
|
|
3
3
|
export { createExperimenter };
|
|
@@ -1,6 +1,6 @@
|
|
|
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-PdI4-96I.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
|
-
import "./dist-
|
|
3
|
+
import "./dist-W2emvN3F.js";
|
|
4
4
|
import "./decisions-C0pz9Clx.js";
|
|
5
5
|
|
|
6
6
|
export { inspectProcessTree };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
2
|
-
import { DoltClient, DoltQueryError, LEARNING_FINDING, createDatabaseAdapter$1 as createDatabaseAdapter, createDecision, getDecisionsByCategory, getLatestRun, getPipelineRunById, initSchema } from "./dist-
|
|
2
|
+
import { DoltClient, DoltQueryError, LEARNING_FINDING, createDatabaseAdapter$1 as createDatabaseAdapter, createDecision, getDecisionsByCategory, getLatestRun, getPipelineRunById, initSchema } from "./dist-W2emvN3F.js";
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
import { dirname, join } from "path";
|
|
5
5
|
import { readFile } from "fs/promises";
|
|
@@ -3819,6 +3819,30 @@ function tail(text, bytes = PROBE_TAIL_BYTES) {
|
|
|
3819
3819
|
return text.length <= bytes ? text : text.slice(text.length - bytes);
|
|
3820
3820
|
}
|
|
3821
3821
|
/**
|
|
3822
|
+
* Story 66-6 / obs_2026-05-04_024 fix #1:
|
|
3823
|
+
* Substitute `<REPO_ROOT>` and `$REPO_ROOT` placeholder tokens in a probe
|
|
3824
|
+
* command string with the actual project root path before shell invocation.
|
|
3825
|
+
*
|
|
3826
|
+
* Rules:
|
|
3827
|
+
* - Every literal `<REPO_ROOT>` substring is replaced with `projectRoot`.
|
|
3828
|
+
* - Every `$REPO_ROOT` token that is NOT immediately followed by an
|
|
3829
|
+
* alphanumeric character or underscore is replaced with `projectRoot`
|
|
3830
|
+
* (so `$REPO_ROOT_EXTRA` is left untouched).
|
|
3831
|
+
* - All other `<...>` placeholders (e.g. `<UNKNOWN_PLACEHOLDER>`) are
|
|
3832
|
+
* passed through unchanged — Story 66-7 handles the unknown-placeholder
|
|
3833
|
+
* finding category separately.
|
|
3834
|
+
* - Probes without any placeholder are returned byte-for-byte identical.
|
|
3835
|
+
*
|
|
3836
|
+
* Backward-compat note: any existing probe command that contained the
|
|
3837
|
+
* literal text `<REPO_ROOT>` (none expected in practice) will now have that
|
|
3838
|
+
* text replaced with the project root path. This is the intended behavior.
|
|
3839
|
+
*/
|
|
3840
|
+
function substituteRuntimePlaceholders(command, projectRoot) {
|
|
3841
|
+
let result = command.replaceAll("<REPO_ROOT>", projectRoot);
|
|
3842
|
+
result = result.replace(/\$REPO_ROOT(?=[^A-Za-z0-9_]|$)/g, projectRoot);
|
|
3843
|
+
return result;
|
|
3844
|
+
}
|
|
3845
|
+
/**
|
|
3822
3846
|
* Story 60-4: evaluate `expect_stdout_no_regex` and `expect_stdout_regex`
|
|
3823
3847
|
* patterns against the captured stdout. Runs against the full (un-tailed)
|
|
3824
3848
|
* stdout so authors can match payload shape even when the response is
|
|
@@ -3913,11 +3937,12 @@ function executeProbeOnHost(probe, options = {}) {
|
|
|
3913
3937
|
const cwd = options.cwd ?? process.cwd();
|
|
3914
3938
|
const env = options.env ?? process.env;
|
|
3915
3939
|
const start = Date.now();
|
|
3940
|
+
const resolvedCommand = substituteRuntimePlaceholders(probe.command, cwd);
|
|
3916
3941
|
return new Promise((resolve$2) => {
|
|
3917
3942
|
let stdout = "";
|
|
3918
3943
|
let stderr = "";
|
|
3919
3944
|
let settled = false;
|
|
3920
|
-
const child = spawn(
|
|
3945
|
+
const child = spawn(resolvedCommand, [], {
|
|
3921
3946
|
cwd,
|
|
3922
3947
|
env,
|
|
3923
3948
|
detached: true,
|
|
@@ -4090,6 +4115,16 @@ const CATEGORY_MISSING_TRIGGER = "runtime-probe-missing-production-trigger";
|
|
|
4090
4115
|
*/
|
|
4091
4116
|
const CATEGORY_MISSING_PROBES_DECLARED = "runtime-probe-missing-declared-probes";
|
|
4092
4117
|
/**
|
|
4118
|
+
* Story 66-7: probe exited non-zero AND stderr/stdout contained a placeholder
|
|
4119
|
+
* token that was never substituted before execution (e.g. `<REPO_ROOT>`,
|
|
4120
|
+
* `<CONFIG_DIR>`, `<UNKNOWN_VAR>`). Distinct from `runtime-probe-fail`
|
|
4121
|
+
* (genuine runtime failure) so operators and probe-author quality dashboards
|
|
4122
|
+
* can carve placeholder substitution failures out for cleaner triage and
|
|
4123
|
+
* metrics. Severity: `error` (matches `runtime-probe-fail` baseline).
|
|
4124
|
+
* Closes obs_2026-05-04_024 fix #3.
|
|
4125
|
+
*/
|
|
4126
|
+
const CATEGORY_PLACEHOLDER_NOT_SUBSTITUTED = "runtime-probe-placeholder-not-substituted";
|
|
4127
|
+
/**
|
|
4093
4128
|
* Source-AC keywords that signal an event-driven implementation. Word-boundary
|
|
4094
4129
|
* matched, case-insensitive. When any of these appears in source AC text AND
|
|
4095
4130
|
* no probe's command invokes a known production trigger, the check emits a
|
|
@@ -4230,6 +4265,37 @@ function detectsStateIntegratingAC(sourceContent) {
|
|
|
4230
4265
|
return false;
|
|
4231
4266
|
}
|
|
4232
4267
|
/**
|
|
4268
|
+
* Detects whether a probe's combined output (stderr + stdout) contains an
|
|
4269
|
+
* unrecognized placeholder token that was not substituted before execution.
|
|
4270
|
+
*
|
|
4271
|
+
* Two shapes are handled:
|
|
4272
|
+
*
|
|
4273
|
+
* Shape 1 — command-line tool "no such file" with placeholder argument:
|
|
4274
|
+
* `grep: <REPO_ROOT>: No such file or directory`
|
|
4275
|
+
* `bash: <CONFIG_DIR>: command not found`
|
|
4276
|
+
* Regex (multiline): `/^[\w]*:\s*(<[A-Z_]+>):?/m`
|
|
4277
|
+
*
|
|
4278
|
+
* Shape 2 — shell syntax error adjacent to a placeholder token:
|
|
4279
|
+
* Combined output contains `Syntax error: "&&" unexpected` AND a `<TOKEN>`.
|
|
4280
|
+
*
|
|
4281
|
+
* Returns the captured `<TOKEN>` string if the placeholder leakage pattern
|
|
4282
|
+
* fires, or `null` if no placeholder is detected (allowing the existing
|
|
4283
|
+
* `CATEGORY_FAIL` path to proceed unmodified).
|
|
4284
|
+
*
|
|
4285
|
+
* Exported (mirrors the export pattern of `detectNegationContextLines`,
|
|
4286
|
+
* `detectDependencyContextLines`, `detectsEventDrivenAC`) so tests and
|
|
4287
|
+
* downstream consumers can call it directly.
|
|
4288
|
+
*/
|
|
4289
|
+
function detectPlaceholderLeakage(output) {
|
|
4290
|
+
const shape1Match = /^[\w]*:\s*(<[A-Z_]+>):?/m.exec(output);
|
|
4291
|
+
if (shape1Match !== null) return shape1Match[1] ?? null;
|
|
4292
|
+
if (output.includes("Syntax error: \"&&\" unexpected")) {
|
|
4293
|
+
const tokenMatch = /(<[A-Z_]+>)/.exec(output);
|
|
4294
|
+
if (tokenMatch !== null) return tokenMatch[1] ?? null;
|
|
4295
|
+
}
|
|
4296
|
+
return null;
|
|
4297
|
+
}
|
|
4298
|
+
/**
|
|
4233
4299
|
* Returns true if any probe's command line invokes a known production trigger.
|
|
4234
4300
|
*/
|
|
4235
4301
|
function probesInvokeProductionTrigger(probes) {
|
|
@@ -4323,17 +4389,69 @@ var RuntimeProbeCheck = class {
|
|
|
4323
4389
|
}
|
|
4324
4390
|
const result = await this._executors.host(probe);
|
|
4325
4391
|
if (result.outcome === "pass") continue;
|
|
4326
|
-
const category = result.outcome === "timeout" ? CATEGORY_TIMEOUT : result.assertionFailures !== void 0 ? CATEGORY_ASSERTION_FAIL : result.errorShapeIndicators !== void 0 ? CATEGORY_ERROR_RESPONSE : CATEGORY_FAIL;
|
|
4327
4392
|
const descriptor = probe.description ? ` (${probe.description})` : "";
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4393
|
+
if (result.outcome === "timeout") {
|
|
4394
|
+
findings.push({
|
|
4395
|
+
category: CATEGORY_TIMEOUT,
|
|
4396
|
+
severity: "error",
|
|
4397
|
+
message: `probe "${probe.name}"${descriptor} timed out after ${result.durationMs}ms`,
|
|
4398
|
+
command: result.command,
|
|
4399
|
+
stdoutTail: result.stdoutTail,
|
|
4400
|
+
stderrTail: result.stderrTail,
|
|
4401
|
+
durationMs: result.durationMs,
|
|
4402
|
+
_authoredBy: probe._authoredBy ?? "create-story-ac-transfer"
|
|
4403
|
+
});
|
|
4404
|
+
continue;
|
|
4405
|
+
}
|
|
4406
|
+
if (result.assertionFailures !== void 0) {
|
|
4407
|
+
findings.push({
|
|
4408
|
+
category: CATEGORY_ASSERTION_FAIL,
|
|
4409
|
+
severity: "error",
|
|
4410
|
+
message: `probe "${probe.name}"${descriptor} exit 0 but stdout assertion failed: ` + result.assertionFailures.join("; "),
|
|
4411
|
+
command: result.command,
|
|
4412
|
+
...result.exitCode !== void 0 ? { exitCode: result.exitCode } : {},
|
|
4413
|
+
stdoutTail: result.stdoutTail,
|
|
4414
|
+
stderrTail: result.stderrTail,
|
|
4415
|
+
durationMs: result.durationMs,
|
|
4416
|
+
_authoredBy: probe._authoredBy ?? "create-story-ac-transfer"
|
|
4417
|
+
});
|
|
4418
|
+
continue;
|
|
4419
|
+
}
|
|
4420
|
+
if (result.errorShapeIndicators !== void 0) {
|
|
4421
|
+
findings.push({
|
|
4422
|
+
category: CATEGORY_ERROR_RESPONSE,
|
|
4423
|
+
severity: "error",
|
|
4424
|
+
message: `probe "${probe.name}"${descriptor} exit 0 but response contained error envelope: ` + result.errorShapeIndicators.join("; ") + " — the tool returned an error-shaped JSON response despite a clean exit code. This is structural evidence the implementation didn't actually work; add an explicit `expect_stdout_no_regex` assertion to make the failure surface earlier in author-controlled form.",
|
|
4425
|
+
command: result.command,
|
|
4426
|
+
...result.exitCode !== void 0 ? { exitCode: result.exitCode } : {},
|
|
4427
|
+
stdoutTail: result.stdoutTail,
|
|
4428
|
+
stderrTail: result.stderrTail,
|
|
4429
|
+
durationMs: result.durationMs,
|
|
4430
|
+
_authoredBy: probe._authoredBy ?? "create-story-ac-transfer"
|
|
4431
|
+
});
|
|
4432
|
+
continue;
|
|
4433
|
+
}
|
|
4434
|
+
const outputForDetection = `${result.stderrTail ?? ""}\n${result.stdoutTail ?? ""}`;
|
|
4435
|
+
const placeholderToken = detectPlaceholderLeakage(outputForDetection);
|
|
4436
|
+
if (placeholderToken !== null) {
|
|
4437
|
+
findings.push({
|
|
4438
|
+
category: CATEGORY_PLACEHOLDER_NOT_SUBSTITUTED,
|
|
4439
|
+
severity: "error",
|
|
4440
|
+
message: `Probe failed: unrecognized placeholder token "${placeholderToken}" was not substituted before execution`,
|
|
4441
|
+
command: result.command,
|
|
4442
|
+
...result.exitCode !== void 0 ? { exitCode: result.exitCode } : {},
|
|
4443
|
+
stdoutTail: result.stdoutTail,
|
|
4444
|
+
stderrTail: result.stderrTail,
|
|
4445
|
+
durationMs: result.durationMs,
|
|
4446
|
+
unrecognizedPlaceholder: placeholderToken,
|
|
4447
|
+
_authoredBy: probe._authoredBy ?? "create-story-ac-transfer"
|
|
4448
|
+
});
|
|
4449
|
+
continue;
|
|
4450
|
+
}
|
|
4333
4451
|
findings.push({
|
|
4334
|
-
category,
|
|
4452
|
+
category: CATEGORY_FAIL,
|
|
4335
4453
|
severity: "error",
|
|
4336
|
-
message
|
|
4454
|
+
message: `probe "${probe.name}"${descriptor} failed with exit ${result.exitCode ?? "unknown"}`,
|
|
4337
4455
|
command: result.command,
|
|
4338
4456
|
...result.exitCode !== void 0 ? { exitCode: result.exitCode } : {},
|
|
4339
4457
|
stdoutTail: result.stdoutTail,
|
|
@@ -6912,4 +7030,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
6912
7030
|
|
|
6913
7031
|
//#endregion
|
|
6914
7032
|
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, __commonJS, __require, __toESM, aggregateProbeAuthorMetrics, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, createStateStore, detectCycles, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, parseRuntimeProbes, registerHealthCommand, renderFindings, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runHealthAction, validateStoryKey };
|
|
6915
|
-
//# sourceMappingURL=health-
|
|
7033
|
+
//# sourceMappingURL=health-PdI4-96I.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -317,9 +317,25 @@ interface StoryLogEvent {
|
|
|
317
317
|
/** Log message */
|
|
318
318
|
msg: string;
|
|
319
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Snapshot entry for a single story within a heartbeat event.
|
|
322
|
+
* Both fields are strings so the event schema stays language-agnostic.
|
|
323
|
+
*
|
|
324
|
+
* - `phase` — raw orchestrator StoryPhase value (e.g. 'IN_DEV', 'COMPLETE').
|
|
325
|
+
* - `status` — consumer-facing status derived from phase (e.g. 'dispatched', 'complete').
|
|
326
|
+
*
|
|
327
|
+
* Story 66-2: obs_2026-05-03_022 fix #2.
|
|
328
|
+
*/
|
|
329
|
+
type HeartbeatStorySnapshot = {
|
|
330
|
+
phase: string;
|
|
331
|
+
status: string;
|
|
332
|
+
};
|
|
320
333
|
/**
|
|
321
334
|
* Emitted periodically (every 30s) when no other progress events have fired.
|
|
322
335
|
* Allows parent agents to distinguish "working silently" from "stuck".
|
|
336
|
+
*
|
|
337
|
+
* Story 66-2: gains optional `per_story_state` field for real-time drift detection
|
|
338
|
+
* between in-memory orchestrator state and the persisted manifest (obs_2026-05-03_022 fix #2).
|
|
323
339
|
*/
|
|
324
340
|
interface PipelineHeartbeatEvent {
|
|
325
341
|
type: 'pipeline:heartbeat';
|
|
@@ -333,6 +349,13 @@ interface PipelineHeartbeatEvent {
|
|
|
333
349
|
completed_dispatches: number;
|
|
334
350
|
/** Number of dispatches waiting to start */
|
|
335
351
|
queued_dispatches: number;
|
|
352
|
+
/**
|
|
353
|
+
* Snapshot of in-memory phase and derived status for each story.
|
|
354
|
+
* Omitted (or empty object) when no stories are dispatched.
|
|
355
|
+
* Additive and optional — existing heartbeat consumers require no changes.
|
|
356
|
+
* Story 66-2: obs_2026-05-03_022 fix #2.
|
|
357
|
+
*/
|
|
358
|
+
per_story_state?: Record<string, HeartbeatStorySnapshot>;
|
|
336
359
|
}
|
|
337
360
|
/**
|
|
338
361
|
* Emitted when the watchdog timer detects no progress for an extended period.
|
|
@@ -2211,6 +2234,34 @@ interface OrchestratorEvents {
|
|
|
2211
2234
|
activeDispatches: number;
|
|
2212
2235
|
completedDispatches: number;
|
|
2213
2236
|
queuedDispatches: number;
|
|
2237
|
+
/**
|
|
2238
|
+
* Per-story phase and derived status snapshot from in-memory orchestrator state.
|
|
2239
|
+
* Omitted when no stories are dispatched. Story 66-2: obs_2026-05-03_022 fix #2.
|
|
2240
|
+
*/
|
|
2241
|
+
perStoryState?: Record<string, {
|
|
2242
|
+
phase: string;
|
|
2243
|
+
status: string;
|
|
2244
|
+
}>;
|
|
2245
|
+
};
|
|
2246
|
+
/**
|
|
2247
|
+
* Story 66-4 / obs_2026-05-04_023 fix #3: dispatcher subprocess hit ETIMEDOUT.
|
|
2248
|
+
* Emitted for both the initial attempt (attemptNumber: 1) and retry (attemptNumber: 2).
|
|
2249
|
+
* Story 66-5 adds optional stderrTail/stdoutTail forensic capture.
|
|
2250
|
+
* Mirror of CoreEvents['dispatch:spawnsync-timeout']; both must stay in sync.
|
|
2251
|
+
*/
|
|
2252
|
+
'dispatch:spawnsync-timeout': {
|
|
2253
|
+
type: 'dispatch:spawnsync-timeout';
|
|
2254
|
+
storyKey: string;
|
|
2255
|
+
taskType: string;
|
|
2256
|
+
attemptNumber: 1 | 2;
|
|
2257
|
+
timeoutMs: number;
|
|
2258
|
+
elapsedAtKill: number;
|
|
2259
|
+
pid?: number;
|
|
2260
|
+
occurredAt: string;
|
|
2261
|
+
/** Tail of subprocess stderr captured at kill time (~64KB max, UTF-8) */
|
|
2262
|
+
stderrTail?: string;
|
|
2263
|
+
/** Tail of subprocess stdout captured at kill time (~64KB max, UTF-8) */
|
|
2264
|
+
stdoutTail?: string;
|
|
2214
2265
|
};
|
|
2215
2266
|
/** Watchdog detected no progress for an extended period */
|
|
2216
2267
|
'orchestrator:stall': {
|
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-W2emvN3F.js";
|
|
4
4
|
import "./adapter-registry-DXLMTmfD.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-CKFu8YI9.js";
|
|
6
6
|
|
|
7
7
|
//#region src/core/di.ts
|
|
8
8
|
/**
|
|
@@ -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-W2emvN3F.js";
|
|
2
2
|
import "./routing-CcBOCuC9.js";
|
|
3
3
|
|
|
4
4
|
export { loadModelRoutingConfig };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-PdI4-96I.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-
|
|
4
|
+
import "./dist-W2emvN3F.js";
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DcDoaG12.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-
|
|
1
|
+
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-PdI4-96I.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, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-
|
|
4
|
+
import { ADVISORY_NOTES, Categorizer, ConsumerAnalyzer, DEFAULT_GLOBAL_SETTINGS, DispatcherImpl, DoltClient, ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, EfficiencyScorer, IngestionServer, LogTurnAnalyzer, OPERATIONAL_FINDING, Recommender, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, STORY_METRICS, STORY_OUTCOME, SubstrateConfigSchema, TEST_EXPANSION_FINDING, TEST_PLAN, TelemetryNormalizer, TelemetryPipeline, TurnAnalyzer, addTokenUsage, aggregateTokenUsageForRun, aggregateTokenUsageForStory, callLLM, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-W2emvN3F.js";
|
|
5
5
|
import { basename, dirname, extname, join } from "path";
|
|
6
6
|
import { access, readFile, readdir, stat } from "fs/promises";
|
|
7
7
|
import { EventEmitter } from "node:events";
|
|
@@ -12749,6 +12749,13 @@ function createImplementationOrchestrator(deps) {
|
|
|
12749
12749
|
err,
|
|
12750
12750
|
storyKey
|
|
12751
12751
|
}, `patchStoryState(${manifestStatus}) failed — pipeline continues`));
|
|
12752
|
+
} else {
|
|
12753
|
+
const intermediatePhase = updates.phase;
|
|
12754
|
+
runManifest.patchStoryState(storyKey, { phase: String(intermediatePhase) }).catch((err) => logger$26.warn({
|
|
12755
|
+
err,
|
|
12756
|
+
storyKey,
|
|
12757
|
+
phase: intermediatePhase
|
|
12758
|
+
}, "phase-persistence-write-failed — pipeline continues"));
|
|
12752
12759
|
}
|
|
12753
12760
|
}
|
|
12754
12761
|
}
|
|
@@ -12801,6 +12808,22 @@ function createImplementationOrchestrator(deps) {
|
|
|
12801
12808
|
function getStallThresholdMs(phase) {
|
|
12802
12809
|
return phase === "IN_DEV" ? DEV_STORY_STALL_THRESHOLD_MS : DEFAULT_STALL_THRESHOLD_MS;
|
|
12803
12810
|
}
|
|
12811
|
+
/**
|
|
12812
|
+
* Map an internal StoryPhase to a consumer-facing manifest-compatible status string.
|
|
12813
|
+
* Mirrors the PerStoryStatus values in per-story-state.ts.
|
|
12814
|
+
* Story 66-2: obs_2026-05-03_022 fix #2.
|
|
12815
|
+
*/
|
|
12816
|
+
function storyPhaseToStatus(phase) {
|
|
12817
|
+
switch (phase) {
|
|
12818
|
+
case "COMPLETE": return "complete";
|
|
12819
|
+
case "ESCALATED": return "escalated";
|
|
12820
|
+
case "VERIFICATION_FAILED": return "verification-failed";
|
|
12821
|
+
case "IN_REVIEW":
|
|
12822
|
+
case "NEEDS_FIXES": return "in-review";
|
|
12823
|
+
case "PENDING": return "pending";
|
|
12824
|
+
default: return "dispatched";
|
|
12825
|
+
}
|
|
12826
|
+
}
|
|
12804
12827
|
function startHeartbeat() {
|
|
12805
12828
|
if (_heartbeatTimer !== null) return;
|
|
12806
12829
|
_heartbeatTimer = setInterval(() => {
|
|
@@ -12810,11 +12833,17 @@ function createImplementationOrchestrator(deps) {
|
|
|
12810
12833
|
for (const s$1 of _stories.values()) if (s$1.phase === "PENDING") queued++;
|
|
12811
12834
|
else if (s$1.phase !== "COMPLETE" && s$1.phase !== "ESCALATED" && s$1.phase !== "VERIFICATION_FAILED") active++;
|
|
12812
12835
|
const completed = _completedDispatches;
|
|
12836
|
+
const perStoryState = {};
|
|
12837
|
+
for (const [key, s$1] of _stories) perStoryState[key] = {
|
|
12838
|
+
phase: s$1.phase,
|
|
12839
|
+
status: storyPhaseToStatus(s$1.phase)
|
|
12840
|
+
};
|
|
12813
12841
|
eventBus.emit("orchestrator:heartbeat", {
|
|
12814
12842
|
runId: config.pipelineRunId ?? "",
|
|
12815
12843
|
activeDispatches: active,
|
|
12816
12844
|
completedDispatches: completed,
|
|
12817
|
-
queuedDispatches: queued
|
|
12845
|
+
queuedDispatches: queued,
|
|
12846
|
+
...Object.keys(perStoryState).length > 0 ? { perStoryState } : {}
|
|
12818
12847
|
});
|
|
12819
12848
|
if (config.pipelineRunId !== void 0) updatePipelineRun(db, config.pipelineRunId, { current_phase: "implementation" }).catch((err) => {
|
|
12820
12849
|
logger$26.debug({ err }, "Heartbeat: failed to touch updated_at (non-fatal)");
|
|
@@ -28141,43 +28170,43 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
28141
28170
|
}
|
|
28142
28171
|
return uriTokens.join("");
|
|
28143
28172
|
}
|
|
28144
|
-
function resolveComponents(base$1, relative) {
|
|
28173
|
+
function resolveComponents(base$1, relative$1) {
|
|
28145
28174
|
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
28146
28175
|
var skipNormalization = arguments[3];
|
|
28147
28176
|
var target = {};
|
|
28148
28177
|
if (!skipNormalization) {
|
|
28149
28178
|
base$1 = parse$1(serialize(base$1, options), options);
|
|
28150
|
-
relative = parse$1(serialize(relative, options), options);
|
|
28179
|
+
relative$1 = parse$1(serialize(relative$1, options), options);
|
|
28151
28180
|
}
|
|
28152
28181
|
options = options || {};
|
|
28153
|
-
if (!options.tolerant && relative.scheme) {
|
|
28154
|
-
target.scheme = relative.scheme;
|
|
28155
|
-
target.userinfo = relative.userinfo;
|
|
28156
|
-
target.host = relative.host;
|
|
28157
|
-
target.port = relative.port;
|
|
28158
|
-
target.path = removeDotSegments(relative.path || "");
|
|
28159
|
-
target.query = relative.query;
|
|
28182
|
+
if (!options.tolerant && relative$1.scheme) {
|
|
28183
|
+
target.scheme = relative$1.scheme;
|
|
28184
|
+
target.userinfo = relative$1.userinfo;
|
|
28185
|
+
target.host = relative$1.host;
|
|
28186
|
+
target.port = relative$1.port;
|
|
28187
|
+
target.path = removeDotSegments(relative$1.path || "");
|
|
28188
|
+
target.query = relative$1.query;
|
|
28160
28189
|
} else {
|
|
28161
|
-
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
28162
|
-
target.userinfo = relative.userinfo;
|
|
28163
|
-
target.host = relative.host;
|
|
28164
|
-
target.port = relative.port;
|
|
28165
|
-
target.path = removeDotSegments(relative.path || "");
|
|
28166
|
-
target.query = relative.query;
|
|
28190
|
+
if (relative$1.userinfo !== void 0 || relative$1.host !== void 0 || relative$1.port !== void 0) {
|
|
28191
|
+
target.userinfo = relative$1.userinfo;
|
|
28192
|
+
target.host = relative$1.host;
|
|
28193
|
+
target.port = relative$1.port;
|
|
28194
|
+
target.path = removeDotSegments(relative$1.path || "");
|
|
28195
|
+
target.query = relative$1.query;
|
|
28167
28196
|
} else {
|
|
28168
|
-
if (!relative.path) {
|
|
28197
|
+
if (!relative$1.path) {
|
|
28169
28198
|
target.path = base$1.path;
|
|
28170
|
-
if (relative.query !== void 0) target.query = relative.query;
|
|
28199
|
+
if (relative$1.query !== void 0) target.query = relative$1.query;
|
|
28171
28200
|
else target.query = base$1.query;
|
|
28172
28201
|
} else {
|
|
28173
|
-
if (relative.path.charAt(0) === "/") target.path = removeDotSegments(relative.path);
|
|
28202
|
+
if (relative$1.path.charAt(0) === "/") target.path = removeDotSegments(relative$1.path);
|
|
28174
28203
|
else {
|
|
28175
|
-
if ((base$1.userinfo !== void 0 || base$1.host !== void 0 || base$1.port !== void 0) && !base$1.path) target.path = "/" + relative.path;
|
|
28176
|
-
else if (!base$1.path) target.path = relative.path;
|
|
28177
|
-
else target.path = base$1.path.slice(0, base$1.path.lastIndexOf("/") + 1) + relative.path;
|
|
28204
|
+
if ((base$1.userinfo !== void 0 || base$1.host !== void 0 || base$1.port !== void 0) && !base$1.path) target.path = "/" + relative$1.path;
|
|
28205
|
+
else if (!base$1.path) target.path = relative$1.path;
|
|
28206
|
+
else target.path = base$1.path.slice(0, base$1.path.lastIndexOf("/") + 1) + relative$1.path;
|
|
28178
28207
|
target.path = removeDotSegments(target.path);
|
|
28179
28208
|
}
|
|
28180
|
-
target.query = relative.query;
|
|
28209
|
+
target.query = relative$1.query;
|
|
28181
28210
|
}
|
|
28182
28211
|
target.userinfo = base$1.userinfo;
|
|
28183
28212
|
target.host = base$1.host;
|
|
@@ -28185,7 +28214,7 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
28185
28214
|
}
|
|
28186
28215
|
target.scheme = base$1.scheme;
|
|
28187
28216
|
}
|
|
28188
|
-
target.fragment = relative.fragment;
|
|
28217
|
+
target.fragment = relative$1.fragment;
|
|
28189
28218
|
return target;
|
|
28190
28219
|
}
|
|
28191
28220
|
function resolve$6(baseURI, relativeURI, options) {
|
|
@@ -41030,16 +41059,16 @@ var Ignore = class {
|
|
|
41030
41059
|
ignored(p) {
|
|
41031
41060
|
const fullpath = p.fullpath();
|
|
41032
41061
|
const fullpaths = `${fullpath}/`;
|
|
41033
|
-
const relative = p.relative() || ".";
|
|
41034
|
-
const relatives = `${relative}/`;
|
|
41035
|
-
for (const m of this.relative) if (m.match(relative) || m.match(relatives)) return true;
|
|
41062
|
+
const relative$1 = p.relative() || ".";
|
|
41063
|
+
const relatives = `${relative$1}/`;
|
|
41064
|
+
for (const m of this.relative) if (m.match(relative$1) || m.match(relatives)) return true;
|
|
41036
41065
|
for (const m of this.absolute) if (m.match(fullpath) || m.match(fullpaths)) return true;
|
|
41037
41066
|
return false;
|
|
41038
41067
|
}
|
|
41039
41068
|
childrenIgnored(p) {
|
|
41040
41069
|
const fullpath = p.fullpath() + "/";
|
|
41041
|
-
const relative = (p.relative() || ".") + "/";
|
|
41042
|
-
for (const m of this.relativeChildren) if (m.match(relative)) return true;
|
|
41070
|
+
const relative$1 = (p.relative() || ".") + "/";
|
|
41071
|
+
for (const m of this.relativeChildren) if (m.match(relative$1)) return true;
|
|
41043
41072
|
for (const m of this.absoluteChildren) if (m.match(fullpath)) return true;
|
|
41044
41073
|
return false;
|
|
41045
41074
|
}
|
|
@@ -43878,7 +43907,8 @@ function wireNdjsonEmitter(eventBus, ndjsonEmitter) {
|
|
|
43878
43907
|
run_id: payload.runId,
|
|
43879
43908
|
active_dispatches: payload.activeDispatches,
|
|
43880
43909
|
completed_dispatches: payload.completedDispatches,
|
|
43881
|
-
queued_dispatches: payload.queuedDispatches
|
|
43910
|
+
queued_dispatches: payload.queuedDispatches,
|
|
43911
|
+
...payload.perStoryState !== void 0 ? { per_story_state: payload.perStoryState } : {}
|
|
43882
43912
|
});
|
|
43883
43913
|
});
|
|
43884
43914
|
eventBus.on("orchestrator:stall", (payload) => {
|
|
@@ -44655,6 +44685,12 @@ async function runRunAction(options) {
|
|
|
44655
44685
|
adapter_backend: adapter.backendType
|
|
44656
44686
|
});
|
|
44657
44687
|
wireNdjsonEmitter(eventBus, ndjsonEmitter);
|
|
44688
|
+
const heartbeatSnapshotPath = join(dbDir, "latest-heartbeat-per-story-state.json");
|
|
44689
|
+
eventBus.on("orchestrator:heartbeat", (payload) => {
|
|
44690
|
+
if (payload.perStoryState !== void 0 && Object.keys(payload.perStoryState).length > 0) try {
|
|
44691
|
+
writeFileSync$1(heartbeatSnapshotPath, JSON.stringify(payload.perStoryState), "utf-8");
|
|
44692
|
+
} catch {}
|
|
44693
|
+
});
|
|
44658
44694
|
}
|
|
44659
44695
|
const ingestionServer = telemetryEnabled ? new IngestionServer({ port: telemetryPort }) : void 0;
|
|
44660
44696
|
if (ingestionServer !== void 0) {
|
|
@@ -45033,6 +45069,12 @@ async function runFullPipeline(options) {
|
|
|
45033
45069
|
adapter_backend: adapter.backendType
|
|
45034
45070
|
});
|
|
45035
45071
|
wireNdjsonEmitter(eventBus, fullPipelineNdjsonEmitter);
|
|
45072
|
+
const heartbeatSnapshotPathFp = join(dbDir, "latest-heartbeat-per-story-state.json");
|
|
45073
|
+
eventBus.on("orchestrator:heartbeat", (payload) => {
|
|
45074
|
+
if (payload.perStoryState !== void 0 && Object.keys(payload.perStoryState).length > 0) try {
|
|
45075
|
+
writeFileSync$1(heartbeatSnapshotPathFp, JSON.stringify(payload.perStoryState), "utf-8");
|
|
45076
|
+
} catch {}
|
|
45077
|
+
});
|
|
45036
45078
|
}
|
|
45037
45079
|
const phaseOrder = [];
|
|
45038
45080
|
if (effectiveResearch) phaseOrder.push("research");
|
|
@@ -45429,5 +45471,5 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
45429
45471
|
}
|
|
45430
45472
|
|
|
45431
45473
|
//#endregion
|
|
45432
|
-
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, resolveProbeAuthorStateIntegrating, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runRunAction, runSolutioningPhase, validateStopAfterFromConflict, wireNdjsonEmitter };
|
|
45433
|
-
//# sourceMappingURL=run-
|
|
45474
|
+
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, 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 };
|
|
45475
|
+
//# sourceMappingURL=run-DcDoaG12.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./dist-
|
|
1
|
+
import "./dist-W2emvN3F.js";
|
|
2
2
|
import "./version-manager-impl-BmOWu8ml.js";
|
|
3
|
-
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-
|
|
3
|
+
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CAqLkNUP.js";
|
|
4
4
|
|
|
5
5
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|