substrate-ai 0.20.15 → 0.20.16
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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts } from "../health-
|
|
2
|
+
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts } from "../health-ZGa9E0D2.js";
|
|
3
3
|
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-CqtWS9wF.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-DRYcfcJG.js";
|
|
8
8
|
import "../errors-1uLGqnvr.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -25,7 +25,7 @@ import { randomUUID } from "node:crypto";
|
|
|
25
25
|
import { z } from "zod";
|
|
26
26
|
import * as fs from "node:fs/promises";
|
|
27
27
|
import { access as access$1, readFile as readFile$1, readdir as readdir$1 } from "node:fs/promises";
|
|
28
|
-
import { appendFileSync, chmodSync, cpSync, existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
28
|
+
import { appendFileSync, chmodSync, cpSync, existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync as statSync$1, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
29
29
|
import { homedir } from "os";
|
|
30
30
|
import { createRequire } from "node:module";
|
|
31
31
|
import { fileURLToPath as fileURLToPath$1 } from "node:url";
|
|
@@ -3667,7 +3667,7 @@ async function runStatusAction(options) {
|
|
|
3667
3667
|
logger$12.debug({ err }, "Work graph query failed, continuing without work graph data");
|
|
3668
3668
|
}
|
|
3669
3669
|
if (run === void 0) {
|
|
3670
|
-
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-
|
|
3670
|
+
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-CeVz5k99.js");
|
|
3671
3671
|
const substrateDirPath = join(projectRoot, ".substrate");
|
|
3672
3672
|
const processInfo = inspectProcessTree$1({
|
|
3673
3673
|
projectRoot,
|
|
@@ -5198,7 +5198,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
5198
5198
|
await initSchema(expAdapter);
|
|
5199
5199
|
const { runRunAction: runPipeline } = await import(
|
|
5200
5200
|
/* @vite-ignore */
|
|
5201
|
-
"../run-
|
|
5201
|
+
"../run-B7d0fB8W.js"
|
|
5202
5202
|
);
|
|
5203
5203
|
const runStoryFn = async (opts) => {
|
|
5204
5204
|
const exitCode = await runPipeline({
|
|
@@ -6801,7 +6801,7 @@ async function runMonitorStatusAction(options) {
|
|
|
6801
6801
|
const { earliest: earliestDate, latest: latestDate } = monitorDb.getTaskMetricsDateRange();
|
|
6802
6802
|
let dbSizeBytes = 0;
|
|
6803
6803
|
try {
|
|
6804
|
-
dbSizeBytes = statSync(dbPath).size;
|
|
6804
|
+
dbSizeBytes = statSync$1(dbPath).size;
|
|
6805
6805
|
} catch {}
|
|
6806
6806
|
const statusData = {
|
|
6807
6807
|
total_tasks: totalTasks,
|
|
@@ -1,4 +1,4 @@
|
|
|
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-ZGa9E0D2.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./dist-CqtWS9wF.js";
|
|
4
4
|
import "./decisions-C0pz9Clx.js";
|
|
@@ -5,9 +5,9 @@ import { dirname, join } from "path";
|
|
|
5
5
|
import { readFile } from "fs/promises";
|
|
6
6
|
import { EventEmitter } from "node:events";
|
|
7
7
|
import { YAMLException, load } from "js-yaml";
|
|
8
|
-
import { existsSync, promises, readFileSync } from "node:fs";
|
|
8
|
+
import { existsSync, promises, readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
9
|
import { spawn, spawnSync } from "node:child_process";
|
|
10
|
-
import { dirname as dirname$1, join as join$1, resolve as resolve$1 } from "node:path";
|
|
10
|
+
import { basename as basename$1, dirname as dirname$1, join as join$1, resolve as resolve$1 } from "node:path";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { mkdir as mkdir$1, open, readFile as readFile$1, unlink, writeFile as writeFile$1 } from "node:fs/promises";
|
|
13
13
|
import { existsSync as existsSync$1 } from "fs";
|
|
@@ -3767,6 +3767,86 @@ var RuntimeProbeCheck = class {
|
|
|
3767
3767
|
//#endregion
|
|
3768
3768
|
//#region packages/sdlc/dist/verification/source-ac-fidelity-check.js
|
|
3769
3769
|
/**
|
|
3770
|
+
* Directory names that should never be searched when doing the basename-glob
|
|
3771
|
+
* fallback for a relative path clause. Prevents the check from spending time
|
|
3772
|
+
* in the node_modules tree (which frequently has files whose basenames
|
|
3773
|
+
* collide with project source) and from descending into build or VCS output.
|
|
3774
|
+
*/
|
|
3775
|
+
const SKIP_DIRS = new Set([
|
|
3776
|
+
"node_modules",
|
|
3777
|
+
".git",
|
|
3778
|
+
"dist",
|
|
3779
|
+
"build",
|
|
3780
|
+
".substrate",
|
|
3781
|
+
"_bmad-output",
|
|
3782
|
+
"coverage",
|
|
3783
|
+
".next",
|
|
3784
|
+
".cache"
|
|
3785
|
+
]);
|
|
3786
|
+
/** Max depth for the basename walk. Prevents pathological traversal. */
|
|
3787
|
+
const MAX_WALK_DEPTH = 8;
|
|
3788
|
+
/**
|
|
3789
|
+
* Return true if `base` (a filename like `discover.ts`) exists somewhere under
|
|
3790
|
+
* `root` within MAX_WALK_DEPTH levels, skipping SKIP_DIRS. The walk is
|
|
3791
|
+
* synchronous and bounded; finding a single match exits early.
|
|
3792
|
+
*/
|
|
3793
|
+
function existsAnywhereUnderRoot(root, base) {
|
|
3794
|
+
const stack = [{
|
|
3795
|
+
path: root,
|
|
3796
|
+
depth: 0
|
|
3797
|
+
}];
|
|
3798
|
+
while (stack.length > 0) {
|
|
3799
|
+
const { path: path$1, depth } = stack.pop();
|
|
3800
|
+
if (depth > MAX_WALK_DEPTH) continue;
|
|
3801
|
+
let entries;
|
|
3802
|
+
try {
|
|
3803
|
+
entries = readdirSync(path$1);
|
|
3804
|
+
} catch {
|
|
3805
|
+
continue;
|
|
3806
|
+
}
|
|
3807
|
+
for (const entry of entries) {
|
|
3808
|
+
if (SKIP_DIRS.has(entry)) continue;
|
|
3809
|
+
if (entry === base) return true;
|
|
3810
|
+
const full = join$1(path$1, entry);
|
|
3811
|
+
try {
|
|
3812
|
+
const s = statSync(full);
|
|
3813
|
+
if (s.isDirectory()) stack.push({
|
|
3814
|
+
path: full,
|
|
3815
|
+
depth: depth + 1
|
|
3816
|
+
});
|
|
3817
|
+
} catch {
|
|
3818
|
+
continue;
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
return false;
|
|
3823
|
+
}
|
|
3824
|
+
/**
|
|
3825
|
+
* Check whether a path clause extracted from the source AC is satisfied by
|
|
3826
|
+
* the actual code under `workingDir`. Story 58-9c: handles relative paths
|
|
3827
|
+
* (e.g., `./discover.ts`) that the v0.20.15 literal `join(workingDir, path)`
|
|
3828
|
+
* check mis-resolved.
|
|
3829
|
+
*
|
|
3830
|
+
* Resolution strategy (in order):
|
|
3831
|
+
* 1. Literal `workingDir/path` — handles absolute paths and dot-stripped relatives.
|
|
3832
|
+
* 2. If the original started with `./`, strip the prefix and retry step 1.
|
|
3833
|
+
* 3. Basename search under workingDir — finds paths that live in an
|
|
3834
|
+
* unstated directory context (common for relative imports in ACs).
|
|
3835
|
+
*
|
|
3836
|
+
* Any hit is treated as "code satisfies" (stylistic drift → warn). No hit
|
|
3837
|
+
* means architectural drift → error.
|
|
3838
|
+
*/
|
|
3839
|
+
function pathSatisfiedByCode(workingDir, pathClause) {
|
|
3840
|
+
const raw = pathClause.replace(/^`/, "").replace(/`$/, "");
|
|
3841
|
+
if (existsSync(join$1(workingDir, raw))) return true;
|
|
3842
|
+
if (raw.startsWith("./")) {
|
|
3843
|
+
if (existsSync(join$1(workingDir, raw.slice(2)))) return true;
|
|
3844
|
+
}
|
|
3845
|
+
const isLikelyRelative = raw.startsWith("./") || !raw.includes("/");
|
|
3846
|
+
if (isLikelyRelative) return existsAnywhereUnderRoot(workingDir, basename$1(raw));
|
|
3847
|
+
return false;
|
|
3848
|
+
}
|
|
3849
|
+
/**
|
|
3770
3850
|
* Extract the story's section from the full epic content.
|
|
3771
3851
|
*
|
|
3772
3852
|
* Uses the same heading pattern as `isImplicitlyCovered` in the monolith:
|
|
@@ -3856,8 +3936,7 @@ var SourceAcFidelityCheck = class {
|
|
|
3856
3936
|
} else if (!storyContent.includes(clause.text)) {
|
|
3857
3937
|
const truncated = clause.text.length > 120 ? clause.text.slice(0, 120) : clause.text;
|
|
3858
3938
|
if (clause.type === "path") {
|
|
3859
|
-
const
|
|
3860
|
-
const existsInCode = existsSync(join$1(context.workingDir, pathOnly));
|
|
3939
|
+
const existsInCode = pathSatisfiedByCode(context.workingDir, clause.text);
|
|
3861
3940
|
findings.push({
|
|
3862
3941
|
category: "source-ac-drift",
|
|
3863
3942
|
severity: existsInCode ? "warn" : "error",
|
|
@@ -5543,4 +5622,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
5543
5622
|
|
|
5544
5623
|
//#endregion
|
|
5545
5624
|
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDING_COUNTS, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, createStateStore, detectCycles, extractTargetFilesFromStoryContent, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, renderFindings, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, runHealthAction, validateStoryKey };
|
|
5546
|
-
//# sourceMappingURL=health-
|
|
5625
|
+
//# sourceMappingURL=health-ZGa9E0D2.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-ZGa9E0D2.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
4
|
import "./dist-CqtWS9wF.js";
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-DRYcfcJG.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-
|
|
1
|
+
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-ZGa9E0D2.js";
|
|
2
2
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
3
3
|
import { TypedEventBusImpl, createEventBus, createTuiApp, isTuiCapable, printNonTtyWarning, sleep } from "./helpers-CElYrONe.js";
|
|
4
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-CqtWS9wF.js";
|
|
@@ -7,7 +7,7 @@ import { access, readFile, readdir, stat } from "fs/promises";
|
|
|
7
7
|
import { EventEmitter } from "node:events";
|
|
8
8
|
import yaml from "js-yaml";
|
|
9
9
|
import * as actualFS from "node:fs";
|
|
10
|
-
import { accessSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, unlinkSync, unwatchFile, watchFile, writeFileSync } from "node:fs";
|
|
10
|
+
import { accessSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, unlinkSync, unwatchFile, watchFile, writeFileSync } from "node:fs";
|
|
11
11
|
import { exec, execFile, execFileSync, execSync, spawn } from "node:child_process";
|
|
12
12
|
import path, { basename as basename$1, dirname as dirname$1, extname as extname$1, isAbsolute, join as join$1, posix, resolve as resolve$1, win32 } from "node:path";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
@@ -12114,6 +12114,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12114
12114
|
}
|
|
12115
12115
|
if (storyFilePath === void 0) try {
|
|
12116
12116
|
incrementDispatches(storyKey);
|
|
12117
|
+
const dispatchStartMs = Date.now();
|
|
12117
12118
|
const createResult = await runCreateStory({
|
|
12118
12119
|
db,
|
|
12119
12120
|
pack,
|
|
@@ -12186,6 +12187,68 @@ function createImplementationOrchestrator(deps) {
|
|
|
12186
12187
|
await persistState();
|
|
12187
12188
|
return;
|
|
12188
12189
|
}
|
|
12190
|
+
if (projectRoot !== void 0) {
|
|
12191
|
+
const expectedArtifactsDir = join$1(projectRoot, "_bmad-output", "implementation-artifacts");
|
|
12192
|
+
const claimedPath = createResult.story_file;
|
|
12193
|
+
if (claimedPath.startsWith(expectedArtifactsDir)) try {
|
|
12194
|
+
if (!existsSync(claimedPath)) {
|
|
12195
|
+
const outputTokens = createResult.tokenUsage?.output ?? 0;
|
|
12196
|
+
const errMsg = `create-story claimed success (story_file: ${claimedPath}) but the file does not exist on disk (output tokens: ${outputTokens})`;
|
|
12197
|
+
logger$24.error({
|
|
12198
|
+
storyKey,
|
|
12199
|
+
claimedPath,
|
|
12200
|
+
outputTokens
|
|
12201
|
+
}, errMsg);
|
|
12202
|
+
updateStory(storyKey, {
|
|
12203
|
+
phase: "ESCALATED",
|
|
12204
|
+
error: errMsg,
|
|
12205
|
+
completedAt: new Date().toISOString()
|
|
12206
|
+
});
|
|
12207
|
+
await writeStoryMetricsBestEffort(storyKey, "failed", 0);
|
|
12208
|
+
await emitEscalation({
|
|
12209
|
+
storyKey,
|
|
12210
|
+
lastVerdict: "create-story-fraud-success",
|
|
12211
|
+
reviewCycles: 0,
|
|
12212
|
+
issues: [errMsg]
|
|
12213
|
+
});
|
|
12214
|
+
await persistState();
|
|
12215
|
+
return;
|
|
12216
|
+
}
|
|
12217
|
+
const claimedStat = statSync(claimedPath);
|
|
12218
|
+
if (claimedStat.mtimeMs < dispatchStartMs) {
|
|
12219
|
+
const outputTokens = createResult.tokenUsage?.output ?? 0;
|
|
12220
|
+
const mtimeISO = new Date(claimedStat.mtimeMs).toISOString();
|
|
12221
|
+
const dispatchStartISO = new Date(dispatchStartMs).toISOString();
|
|
12222
|
+
const errMsg = `create-story claimed success but did not rewrite ${claimedPath} during this dispatch (file mtime ${mtimeISO} predates dispatch start ${dispatchStartISO}; output tokens: ${outputTokens})`;
|
|
12223
|
+
logger$24.error({
|
|
12224
|
+
storyKey,
|
|
12225
|
+
claimedPath,
|
|
12226
|
+
mtimeISO,
|
|
12227
|
+
dispatchStartISO,
|
|
12228
|
+
outputTokens
|
|
12229
|
+
}, errMsg);
|
|
12230
|
+
updateStory(storyKey, {
|
|
12231
|
+
phase: "ESCALATED",
|
|
12232
|
+
error: errMsg,
|
|
12233
|
+
completedAt: new Date().toISOString()
|
|
12234
|
+
});
|
|
12235
|
+
await writeStoryMetricsBestEffort(storyKey, "failed", 0);
|
|
12236
|
+
await emitEscalation({
|
|
12237
|
+
storyKey,
|
|
12238
|
+
lastVerdict: "create-story-fraud-success",
|
|
12239
|
+
reviewCycles: 0,
|
|
12240
|
+
issues: [errMsg]
|
|
12241
|
+
});
|
|
12242
|
+
await persistState();
|
|
12243
|
+
return;
|
|
12244
|
+
}
|
|
12245
|
+
} catch (verifyErr) {
|
|
12246
|
+
logger$24.warn({
|
|
12247
|
+
storyKey,
|
|
12248
|
+
err: verifyErr
|
|
12249
|
+
}, "create-story post-dispatch file verification threw; proceeding with claimed path");
|
|
12250
|
+
}
|
|
12251
|
+
}
|
|
12189
12252
|
storyFilePath = createResult.story_file;
|
|
12190
12253
|
if (createResult.story_title) try {
|
|
12191
12254
|
const epicId = storyKey.split("-")[0] ?? storyKey;
|
|
@@ -43977,4 +44040,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
43977
44040
|
|
|
43978
44041
|
//#endregion
|
|
43979
44042
|
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 };
|
|
43980
|
-
//# sourceMappingURL=run
|
|
44043
|
+
//# sourceMappingURL=run-DRYcfcJG.js.map
|