substrate-ai 0.20.18 → 0.20.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createLogger } from "../logger-KeHncl-f.js";
|
|
|
4
4
|
import { createEventBus } from "../helpers-CElYrONe.js";
|
|
5
5
|
import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-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-2nI3qh0-.js";
|
|
8
8
|
import "../errors-1uLGqnvr.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -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-BNCfGm5V.js"
|
|
5202
5202
|
);
|
|
5203
5203
|
const runStoryFn = async (opts) => {
|
|
5204
5204
|
const exitCode = await runPipeline({
|
|
@@ -5737,6 +5737,19 @@ async function runCreateStory(deps, params) {
|
|
|
5737
5737
|
}
|
|
5738
5738
|
const implementationDecisions = await getImplementationDecisions(deps, pipelineRunId);
|
|
5739
5739
|
const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.projectRoot, storyKey);
|
|
5740
|
+
let effectiveSourceAcHash = source_ac_hash;
|
|
5741
|
+
if (epicShardContent.length > 0) {
|
|
5742
|
+
const storySection = extractStorySection(epicShardContent, storyKey);
|
|
5743
|
+
if (storySection !== null) {
|
|
5744
|
+
const computedHash = hashSourceAcSection(storySection);
|
|
5745
|
+
if (source_ac_hash !== void 0 && source_ac_hash !== computedHash) logger$18.debug({
|
|
5746
|
+
storyKey,
|
|
5747
|
+
suppliedHash: source_ac_hash,
|
|
5748
|
+
computedHash
|
|
5749
|
+
}, "Orchestrator-supplied source_ac_hash differs from epic_shard content hash — using computed (Story 58-18)");
|
|
5750
|
+
effectiveSourceAcHash = computedHash;
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5740
5753
|
const prevDevNotesContent = getPrevDevNotes(implementationDecisions, epicId);
|
|
5741
5754
|
let storyDefinitionContent = "";
|
|
5742
5755
|
try {
|
|
@@ -5780,9 +5793,9 @@ async function runCreateStory(deps, params) {
|
|
|
5780
5793
|
content: storyTemplateContent,
|
|
5781
5794
|
priority: "important"
|
|
5782
5795
|
},
|
|
5783
|
-
...
|
|
5796
|
+
...effectiveSourceAcHash !== void 0 ? [{
|
|
5784
5797
|
name: "source_ac_hash",
|
|
5785
|
-
content:
|
|
5798
|
+
content: effectiveSourceAcHash,
|
|
5786
5799
|
priority: "required"
|
|
5787
5800
|
}] : []
|
|
5788
5801
|
], TOKEN_CEILING);
|
|
@@ -8774,6 +8787,13 @@ async function seedEpicShards(db, projectRoot) {
|
|
|
8774
8787
|
for (const shard of shards) {
|
|
8775
8788
|
const subsections = parseStorySubsections(shard.epicId, shard.content);
|
|
8776
8789
|
for (const subsection of subsections) {
|
|
8790
|
+
if (subsection.content.length > MAX_EPIC_SHARD_CHARS) logger$11.warn({
|
|
8791
|
+
epicId: shard.epicId,
|
|
8792
|
+
storyKey: subsection.key,
|
|
8793
|
+
originalLength: subsection.content.length,
|
|
8794
|
+
truncatedLength: MAX_EPIC_SHARD_CHARS,
|
|
8795
|
+
droppedChars: subsection.content.length - MAX_EPIC_SHARD_CHARS
|
|
8796
|
+
}, `Epic shard for ${subsection.key} exceeded ${MAX_EPIC_SHARD_CHARS}-char cap and was truncated; tail content lost from decisions store. Consider splitting the story or raising MAX_EPIC_SHARD_CHARS.`);
|
|
8777
8797
|
await createDecision(db, {
|
|
8778
8798
|
pipeline_run_id: null,
|
|
8779
8799
|
phase: "implementation",
|
|
@@ -8895,25 +8915,46 @@ function parseEpicShards(content) {
|
|
|
8895
8915
|
* Parse an epic section's content into per-story subsections.
|
|
8896
8916
|
*
|
|
8897
8917
|
* Matches story headings using three patterns:
|
|
8898
|
-
* - Markdown headings: #{2,6} Story \d
|
|
8899
|
-
* - Bold: **Story \d
|
|
8900
|
-
* - Bare key: \d
|
|
8918
|
+
* - Markdown headings: #{2,6} Story \d+[-._ ]\d+ (e.g., ### Story 37-1: Title or ### Story 1.1)
|
|
8919
|
+
* - Bold: **Story \d+[-._ ]\d+** (e.g., **Story 37-1**)
|
|
8920
|
+
* - Bare key: \d+[-._ ]\d+:\s (e.g., 37-1: Title — must start at line start)
|
|
8901
8921
|
*
|
|
8902
8922
|
* Each subsection spans from its heading to the next matching heading or EOF.
|
|
8903
8923
|
*
|
|
8924
|
+
* Story 58-17: separator normalization. The original regex required `\d+-\d+`
|
|
8925
|
+
* (dash-only). Strata uses `### Story 1.1` (dot-separated) per its BMAD-template
|
|
8926
|
+
* convention. Without separator-agnostic parsing, every Story 1.X heading was
|
|
8927
|
+
* silently invisible to this parser, the matches.length === 0 fallback path
|
|
8928
|
+
* fired, the entire epic was stored as ONE per-epic decision (key=epicId)
|
|
8929
|
+
* truncated at 12K chars. All stories past the truncation point (1.6, 1.8,
|
|
8930
|
+
* 1.9+ in strata's case) were lost from the decisions store, which is the
|
|
8931
|
+
* actual root cause of strata obs_2026-04-20_001 — create-story received
|
|
8932
|
+
* empty input for those stories and hallucinated specs from domain priors.
|
|
8933
|
+
*
|
|
8934
|
+
* Epic 58-5 already made `extractStorySection` separator-agnostic for the
|
|
8935
|
+
* same reason; this matches that precedent at the seed-time parser.
|
|
8936
|
+
*
|
|
8937
|
+
* Captured storyKey is normalized to canonical dash-form (`1.1` → `1-1`) so
|
|
8938
|
+
* decision keys are consistent regardless of the source heading style — a
|
|
8939
|
+
* `--stories 1-9` CLI invocation finds the shard whether the epic used dot,
|
|
8940
|
+
* dash, underscore, or space separators.
|
|
8941
|
+
*
|
|
8904
8942
|
* AC3: If no story headings are found, returns a single per-epic fallback entry
|
|
8905
8943
|
* keyed by epicId — preserving backward-compatible behaviour for unstructured epics.
|
|
8906
8944
|
*/
|
|
8907
8945
|
function parseStorySubsections(epicId, epicContent) {
|
|
8908
|
-
const storyPattern = /(?:^#{2,6}\s+Story\s+(\d
|
|
8946
|
+
const storyPattern = /(?:^#{2,6}\s+Story\s+(\d+[-._ ]\d+)|^\*\*Story\s+(\d+[-._ ]\d+)\*\*|^(\d+[-._ ]\d+):\s)/gim;
|
|
8909
8947
|
const matches = [];
|
|
8910
8948
|
let match$2;
|
|
8911
8949
|
while ((match$2 = storyPattern.exec(epicContent)) !== null) {
|
|
8912
|
-
const
|
|
8913
|
-
if (
|
|
8914
|
-
storyKey,
|
|
8915
|
-
|
|
8916
|
-
|
|
8950
|
+
const rawKey = match$2[1] ?? match$2[2] ?? match$2[3];
|
|
8951
|
+
if (rawKey !== void 0) {
|
|
8952
|
+
const storyKey = rawKey.replace(/[._ ]/g, "-");
|
|
8953
|
+
matches.push({
|
|
8954
|
+
storyKey,
|
|
8955
|
+
startIdx: match$2.index
|
|
8956
|
+
});
|
|
8957
|
+
}
|
|
8917
8958
|
}
|
|
8918
8959
|
if (matches.length === 0) return [{
|
|
8919
8960
|
key: epicId,
|
|
@@ -44050,4 +44091,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
44050
44091
|
|
|
44051
44092
|
//#endregion
|
|
44052
44093
|
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 };
|
|
44053
|
-
//# sourceMappingURL=run-
|
|
44094
|
+
//# sourceMappingURL=run-2nI3qh0-.js.map
|
|
@@ -2,7 +2,7 @@ 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-2nI3qh0-.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|