substrate-ai 0.20.10 → 0.20.12
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-0jqPFBEL.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-B6qbsy-F.js";
|
|
8
8
|
import "../errors-1uLGqnvr.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -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-C401hYzi.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-DEyd1p7U.js"
|
|
5202
5202
|
);
|
|
5203
5203
|
const runStoryFn = async (opts) => {
|
|
5204
5204
|
const exitCode = await runPipeline({
|
|
@@ -3442,21 +3442,52 @@ const RuntimeProbeListSchema = z.array(RuntimeProbeSchema);
|
|
|
3442
3442
|
//#endregion
|
|
3443
3443
|
//#region packages/sdlc/dist/verification/probes/parser.js
|
|
3444
3444
|
const SECTION_HEADING = /^##\s+Runtime\s+Probes\s*$/i;
|
|
3445
|
+
const FENCE_DELIMITER = /^\s*```/;
|
|
3445
3446
|
/**
|
|
3446
3447
|
* Return the raw text of the story's `## Runtime Probes` section (excluding
|
|
3447
3448
|
* the heading line itself), or `undefined` if the section is not present.
|
|
3448
3449
|
*
|
|
3449
3450
|
* The section ends at the next `##` heading or end-of-file. Sub-headings
|
|
3450
3451
|
* (`###`, `####`) remain part of the section body.
|
|
3452
|
+
*
|
|
3453
|
+
* Story 58-4: the scan tracks code-fence depth so a `## Runtime Probes`
|
|
3454
|
+
* heading that appears *inside* an outer ``` block is ignored. Stories that
|
|
3455
|
+
* DOCUMENT probes in prose — regression fixtures, how-to-author docs, the
|
|
3456
|
+
* Epic 58 e2e test spec — contain illustrative `## Runtime Probes` examples
|
|
3457
|
+
* inside outer fences. Without fence-awareness the parser matches those
|
|
3458
|
+
* illustrations as the story's own section, fails to find a terminated
|
|
3459
|
+
* yaml block (the inner fences are typically escaped), and emits a spurious
|
|
3460
|
+
* `runtime-probe-parse-error`. Hit live during the Epic 58 substrate
|
|
3461
|
+
* dispatch on 58-3's artifact.
|
|
3451
3462
|
*/
|
|
3452
3463
|
function extractRuntimeProbesSection(storyContent) {
|
|
3453
3464
|
const lines = storyContent.split(/\r?\n/);
|
|
3454
|
-
|
|
3465
|
+
let inCodeFence = false;
|
|
3466
|
+
let start = -1;
|
|
3467
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
3468
|
+
const line = lines[i] ?? "";
|
|
3469
|
+
if (FENCE_DELIMITER.test(line)) {
|
|
3470
|
+
inCodeFence = !inCodeFence;
|
|
3471
|
+
continue;
|
|
3472
|
+
}
|
|
3473
|
+
if (!inCodeFence && SECTION_HEADING.test(line.trim())) {
|
|
3474
|
+
start = i;
|
|
3475
|
+
break;
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3455
3478
|
if (start === -1) return void 0;
|
|
3456
3479
|
let end = lines.length;
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3480
|
+
inCodeFence = false;
|
|
3481
|
+
for (let i = start + 1; i < lines.length; i += 1) {
|
|
3482
|
+
const line = lines[i] ?? "";
|
|
3483
|
+
if (FENCE_DELIMITER.test(line)) {
|
|
3484
|
+
inCodeFence = !inCodeFence;
|
|
3485
|
+
continue;
|
|
3486
|
+
}
|
|
3487
|
+
if (!inCodeFence && /^##\s+\S/.test(line)) {
|
|
3488
|
+
end = i;
|
|
3489
|
+
break;
|
|
3490
|
+
}
|
|
3460
3491
|
}
|
|
3461
3492
|
return lines.slice(start + 1, end).join("\n");
|
|
3462
3493
|
}
|
|
@@ -3732,6 +3763,113 @@ var RuntimeProbeCheck = class {
|
|
|
3732
3763
|
}
|
|
3733
3764
|
};
|
|
3734
3765
|
|
|
3766
|
+
//#endregion
|
|
3767
|
+
//#region packages/sdlc/dist/verification/source-ac-fidelity-check.js
|
|
3768
|
+
/**
|
|
3769
|
+
* Extract the story's section from the full epic content.
|
|
3770
|
+
*
|
|
3771
|
+
* Uses the same heading pattern as `isImplicitlyCovered` in the monolith:
|
|
3772
|
+
* `### Story <storyKey>:` or `### Story <storyKey> ` or `### Story <storyKey>\n`
|
|
3773
|
+
*
|
|
3774
|
+
* Returns the extracted section text (from the heading match through to the
|
|
3775
|
+
* next `### Story` heading or end of file), or the full content if no
|
|
3776
|
+
* matching heading is found.
|
|
3777
|
+
*/
|
|
3778
|
+
function extractStorySection(epicContent, storyKey) {
|
|
3779
|
+
const escapedKey = storyKey.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3780
|
+
const headingPattern = new RegExp(`^###\\s+Story\\s+${escapedKey}[:\\s]`, "m");
|
|
3781
|
+
const match = headingPattern.exec(epicContent);
|
|
3782
|
+
if (!match) return epicContent;
|
|
3783
|
+
const start = match.index;
|
|
3784
|
+
const nextHeading = /\n### Story /m.exec(epicContent.slice(start + 1));
|
|
3785
|
+
if (nextHeading) return epicContent.slice(start, start + 1 + nextHeading.index);
|
|
3786
|
+
return epicContent.slice(start);
|
|
3787
|
+
}
|
|
3788
|
+
/**
|
|
3789
|
+
* Extract hard clauses from a story section of an epic file.
|
|
3790
|
+
*
|
|
3791
|
+
* Hard clauses:
|
|
3792
|
+
* 1. Lines containing MUST NOT / MUST / SHALL NOT / SHALL as standalone keywords (case-sensitive)
|
|
3793
|
+
* 2. Backtick-wrapped paths with at least one `/` (excludes bare filenames)
|
|
3794
|
+
* 3. The presence of `## Runtime Probes` heading followed by a fenced yaml block
|
|
3795
|
+
* (represented as a single "runtime-probes-section" clause)
|
|
3796
|
+
*/
|
|
3797
|
+
function extractHardClauses(sectionContent) {
|
|
3798
|
+
const clauses = [];
|
|
3799
|
+
const mustPattern = /\b(MUST NOT|MUST|SHALL NOT|SHALL)\b/;
|
|
3800
|
+
const lines = sectionContent.split("\n");
|
|
3801
|
+
for (const line of lines) {
|
|
3802
|
+
const match = mustPattern.exec(line);
|
|
3803
|
+
if (match) {
|
|
3804
|
+
const keyword = match[1];
|
|
3805
|
+
clauses.push({
|
|
3806
|
+
type: keyword,
|
|
3807
|
+
text: line.trim()
|
|
3808
|
+
});
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
const pathPattern = /`([a-zA-Z0-9_./-]+\/[a-zA-Z0-9_./-]+)`/g;
|
|
3812
|
+
let pathMatch;
|
|
3813
|
+
while ((pathMatch = pathPattern.exec(sectionContent)) !== null) clauses.push({
|
|
3814
|
+
type: "path",
|
|
3815
|
+
text: `\`${pathMatch[1]}\``
|
|
3816
|
+
});
|
|
3817
|
+
const probesPattern = /^##\s+Runtime Probes[\s\S]*?```yaml/m;
|
|
3818
|
+
if (probesPattern.test(sectionContent)) clauses.push({
|
|
3819
|
+
type: "runtime-probes-section",
|
|
3820
|
+
text: "## Runtime Probes"
|
|
3821
|
+
});
|
|
3822
|
+
return clauses;
|
|
3823
|
+
}
|
|
3824
|
+
var SourceAcFidelityCheck = class {
|
|
3825
|
+
name = "source-ac-fidelity";
|
|
3826
|
+
tier = "A";
|
|
3827
|
+
async run(context) {
|
|
3828
|
+
const start = Date.now();
|
|
3829
|
+
if (!context.sourceEpicContent) {
|
|
3830
|
+
const findings$1 = [{
|
|
3831
|
+
category: "source-ac-source-unavailable",
|
|
3832
|
+
severity: "warn",
|
|
3833
|
+
message: "source epic content unavailable — skipping fidelity check"
|
|
3834
|
+
}];
|
|
3835
|
+
return {
|
|
3836
|
+
status: "pass",
|
|
3837
|
+
details: renderFindings(findings$1),
|
|
3838
|
+
duration_ms: Date.now() - start,
|
|
3839
|
+
findings: findings$1
|
|
3840
|
+
};
|
|
3841
|
+
}
|
|
3842
|
+
const storySection = extractStorySection(context.sourceEpicContent, context.storyKey);
|
|
3843
|
+
const hardClauses = extractHardClauses(storySection);
|
|
3844
|
+
const findings = [];
|
|
3845
|
+
const storyContent = context.storyContent ?? "";
|
|
3846
|
+
for (const clause of hardClauses) if (clause.type === "runtime-probes-section") {
|
|
3847
|
+
if (!storyContent.includes("## Runtime Probes")) {
|
|
3848
|
+
const truncated = clause.text.length > 120 ? clause.text.slice(0, 120) : clause.text;
|
|
3849
|
+
findings.push({
|
|
3850
|
+
category: "source-ac-drift",
|
|
3851
|
+
severity: "error",
|
|
3852
|
+
message: `runtime-probes-section: "${truncated}" present in epics source but absent in story artifact`
|
|
3853
|
+
});
|
|
3854
|
+
}
|
|
3855
|
+
} else if (!storyContent.includes(clause.text)) {
|
|
3856
|
+
const truncated = clause.text.length > 120 ? clause.text.slice(0, 120) : clause.text;
|
|
3857
|
+
findings.push({
|
|
3858
|
+
category: "source-ac-drift",
|
|
3859
|
+
severity: "error",
|
|
3860
|
+
message: `${clause.type}: "${truncated}" present in epics source but absent in story artifact`
|
|
3861
|
+
});
|
|
3862
|
+
}
|
|
3863
|
+
const status = findings.some((f) => f.severity === "error") ? "fail" : "pass";
|
|
3864
|
+
return {
|
|
3865
|
+
status,
|
|
3866
|
+
details: findings.length > 0 ? renderFindings(findings) : `source-ac-fidelity: ${hardClauses.length} hard clause(s) verified — all present`,
|
|
3867
|
+
duration_ms: Date.now() - start,
|
|
3868
|
+
findings
|
|
3869
|
+
};
|
|
3870
|
+
}
|
|
3871
|
+
};
|
|
3872
|
+
|
|
3735
3873
|
//#endregion
|
|
3736
3874
|
//#region packages/sdlc/dist/verification/verification-pipeline.js
|
|
3737
3875
|
/**
|
|
@@ -3839,12 +3977,14 @@ var VerificationPipeline = class {
|
|
|
3839
3977
|
* Create a VerificationPipeline pre-loaded with the canonical check set.
|
|
3840
3978
|
*
|
|
3841
3979
|
* Canonical Tier A check order:
|
|
3842
|
-
* 1. PhantomReviewCheck
|
|
3843
|
-
* 2. TrivialOutputCheck
|
|
3980
|
+
* 1. PhantomReviewCheck — story 51-2 (runs first: unreviewed stories skipped)
|
|
3981
|
+
* 2. TrivialOutputCheck — story 51-3
|
|
3844
3982
|
* 3. AcceptanceCriteriaEvidenceCheck
|
|
3845
|
-
* 4. BuildCheck
|
|
3846
|
-
* 5. RuntimeProbeCheck
|
|
3847
|
-
*
|
|
3983
|
+
* 4. BuildCheck — story 51-4
|
|
3984
|
+
* 5. RuntimeProbeCheck — Epic 55 Phase 2: runtime behavior gate; runs last
|
|
3985
|
+
* in Tier A because probes may depend on built artifacts
|
|
3986
|
+
* 6. SourceAcFidelityCheck — Story 58-2: cross-references rendered story artifact
|
|
3987
|
+
* against the source epic's hard clauses (MUST/SHALL/paths)
|
|
3848
3988
|
*
|
|
3849
3989
|
* @param bus Typed event bus for verification events.
|
|
3850
3990
|
* @param config Optional config (used to forward threshold to TrivialOutputCheck).
|
|
@@ -3855,7 +3995,8 @@ function createDefaultVerificationPipeline(bus, config) {
|
|
|
3855
3995
|
new TrivialOutputCheck(config),
|
|
3856
3996
|
new AcceptanceCriteriaEvidenceCheck(),
|
|
3857
3997
|
new BuildCheck(),
|
|
3858
|
-
new RuntimeProbeCheck()
|
|
3998
|
+
new RuntimeProbeCheck(),
|
|
3999
|
+
new SourceAcFidelityCheck()
|
|
3859
4000
|
];
|
|
3860
4001
|
return new VerificationPipeline(bus, checks);
|
|
3861
4002
|
}
|
|
@@ -5336,4 +5477,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
5336
5477
|
|
|
5337
5478
|
//#endregion
|
|
5338
5479
|
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 };
|
|
5339
|
-
//# sourceMappingURL=health-
|
|
5480
|
+
//# sourceMappingURL=health-0jqPFBEL.js.map
|
|
@@ -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-0jqPFBEL.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./dist-CqtWS9wF.js";
|
|
4
4
|
import "./decisions-C0pz9Clx.js";
|
|
@@ -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-0jqPFBEL.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";
|
|
@@ -5911,13 +5911,14 @@ async function getImplementationDecisions(deps, pipelineRunId) {
|
|
|
5911
5911
|
*/
|
|
5912
5912
|
function extractStorySection(shardContent, storyKey) {
|
|
5913
5913
|
if (!shardContent || !storyKey) return null;
|
|
5914
|
-
const
|
|
5915
|
-
const
|
|
5914
|
+
const parts = storyKey.split(/[-._ ]/);
|
|
5915
|
+
const normalized = parts.map((p) => p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("[-._ ]");
|
|
5916
|
+
const headingPattern = new RegExp(`(?:^#{2,4}\\s+Story\\s+${normalized}\\b|^Story\\s+${normalized}:|^\\*\\*${normalized}\\*\\*|^${normalized}:)`, "mi");
|
|
5916
5917
|
const match$2 = headingPattern.exec(shardContent);
|
|
5917
5918
|
if (!match$2) return null;
|
|
5918
5919
|
const startIdx = match$2.index;
|
|
5919
5920
|
const rest = shardContent.slice(startIdx + match$2[0].length);
|
|
5920
|
-
const nextStoryPattern = new RegExp(`(?:^#{2,4}\\s+Story\\s+[\\d]|^Story\\s+[\\d][\\d-]*:|^\\*\\*[\\d][\\d-]*\\*\\*|^[\\d][\\d-]*:)`, "mi");
|
|
5921
|
+
const nextStoryPattern = new RegExp(`(?:^#{2,4}\\s+Story\\s+[\\d]|^Story\\s+[\\d][\\d.\\-_a-z]*:|^\\*\\*[\\d][\\d.\\-_a-z]*\\*\\*|^[\\d][\\d.\\-_a-z]*:)`, "mi");
|
|
5921
5922
|
const nextMatch = nextStoryPattern.exec(rest);
|
|
5922
5923
|
const endIdx = nextMatch !== null ? startIdx + match$2[0].length + nextMatch.index : shardContent.length;
|
|
5923
5924
|
const section = shardContent.slice(startIdx, endIdx).trim();
|
|
@@ -10429,7 +10430,8 @@ function assembleVerificationContext(opts) {
|
|
|
10429
10430
|
reviewResult: opts.reviewResult,
|
|
10430
10431
|
storyContent: opts.storyContent,
|
|
10431
10432
|
devStoryResult: opts.devStoryResult,
|
|
10432
|
-
outputTokenCount: opts.outputTokenCount
|
|
10433
|
+
outputTokenCount: opts.outputTokenCount,
|
|
10434
|
+
sourceEpicContent: opts.sourceEpicContent
|
|
10433
10435
|
};
|
|
10434
10436
|
}
|
|
10435
10437
|
/**
|
|
@@ -13258,13 +13260,21 @@ function createImplementationOrchestrator(deps) {
|
|
|
13258
13260
|
error: reviewResult.error,
|
|
13259
13261
|
rawOutput: reviewResult.rawOutput
|
|
13260
13262
|
} : void 0;
|
|
13263
|
+
let sourceEpicContent;
|
|
13264
|
+
const epicsPath1 = findEpicsFile(projectRoot ?? process.cwd());
|
|
13265
|
+
if (epicsPath1) try {
|
|
13266
|
+
const epicFull = readFileSync(epicsPath1, "utf-8");
|
|
13267
|
+
const section = extractStorySection(epicFull, storyKey);
|
|
13268
|
+
if (section) sourceEpicContent = section;
|
|
13269
|
+
} catch {}
|
|
13261
13270
|
const verifContext = assembleVerificationContext({
|
|
13262
13271
|
storyKey,
|
|
13263
13272
|
workingDir: projectRoot ?? process.cwd(),
|
|
13264
13273
|
reviewResult: latestReviewSignals,
|
|
13265
13274
|
storyContent: storyContentForVerification,
|
|
13266
13275
|
devStoryResult: devStorySignals,
|
|
13267
|
-
outputTokenCount: devOutputTokenCount
|
|
13276
|
+
outputTokenCount: devOutputTokenCount,
|
|
13277
|
+
sourceEpicContent
|
|
13268
13278
|
});
|
|
13269
13279
|
const verifSummary = await verificationPipeline.run(verifContext, "A");
|
|
13270
13280
|
verificationStore.set(storyKey, verifSummary);
|
|
@@ -13522,13 +13532,21 @@ function createImplementationOrchestrator(deps) {
|
|
|
13522
13532
|
error: reviewResult.error,
|
|
13523
13533
|
rawOutput: reviewResult.rawOutput
|
|
13524
13534
|
} : void 0;
|
|
13535
|
+
let sourceEpicContent2;
|
|
13536
|
+
const epicsPath2 = findEpicsFile(projectRoot ?? process.cwd());
|
|
13537
|
+
if (epicsPath2) try {
|
|
13538
|
+
const epicFull2 = readFileSync(epicsPath2, "utf-8");
|
|
13539
|
+
const section2 = extractStorySection(epicFull2, storyKey);
|
|
13540
|
+
if (section2) sourceEpicContent2 = section2;
|
|
13541
|
+
} catch {}
|
|
13525
13542
|
const verifContext = assembleVerificationContext({
|
|
13526
13543
|
storyKey,
|
|
13527
13544
|
workingDir: projectRoot ?? process.cwd(),
|
|
13528
13545
|
reviewResult: latestReviewSignals,
|
|
13529
13546
|
storyContent: storyContentForVerification,
|
|
13530
13547
|
devStoryResult: devStorySignals,
|
|
13531
|
-
outputTokenCount: devOutputTokenCount
|
|
13548
|
+
outputTokenCount: devOutputTokenCount,
|
|
13549
|
+
sourceEpicContent: sourceEpicContent2
|
|
13532
13550
|
});
|
|
13533
13551
|
const verifSummary = await verificationPipeline.run(verifContext, "A");
|
|
13534
13552
|
verificationStore.set(storyKey, verifSummary);
|
|
@@ -43840,4 +43858,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
43840
43858
|
|
|
43841
43859
|
//#endregion
|
|
43842
43860
|
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 };
|
|
43843
|
-
//# sourceMappingURL=run-
|
|
43861
|
+
//# sourceMappingURL=run-B6qbsy-F.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-0jqPFBEL.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-B6qbsy-F.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|