substrate-ai 0.19.9 → 0.19.10

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, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-adzGUKPc.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-Dg_BEJB6.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-NJQHRIYt.js";
8
8
  import "../errors-CZdr5Wqb.js";
9
9
  import "../routing-CcBOCuC9.js";
10
10
  import "../decisions-C0pz9Clx.js";
@@ -4547,7 +4547,7 @@ async function runSupervisorAction(options, deps = {}) {
4547
4547
  await initSchema(expAdapter);
4548
4548
  const { runRunAction: runPipeline } = await import(
4549
4549
  /* @vite-ignore */
4550
- "../run-0y5KOffG.js"
4550
+ "../run-CAMKyu0F.js"
4551
4551
  );
4552
4552
  const runStoryFn = async (opts) => {
4553
4553
  const exitCode = await runPipeline({
package/dist/index.d.ts CHANGED
@@ -94,6 +94,8 @@ interface PipelineStartEvent {
94
94
  stories: string[];
95
95
  /** Maximum parallel conflict groups */
96
96
  concurrency: number;
97
+ /** Execution engine: 'linear' or 'graph' */
98
+ engine?: string;
97
99
  }
98
100
  /**
99
101
  * Emitted as the last event when the pipeline finishes.
@@ -2,7 +2,7 @@ import "./health-DJgGZhW-.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-adzGUKPc.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-Dg_BEJB6.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-NJQHRIYt.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8
 
@@ -5284,6 +5284,15 @@ async function runCreateStory(deps, params) {
5284
5284
  const implementationDecisions = await getImplementationDecisions(deps);
5285
5285
  const epicShardContent = getEpicShard(implementationDecisions, epicId, deps.projectRoot, storyKey);
5286
5286
  const prevDevNotesContent = getPrevDevNotes(implementationDecisions, epicId);
5287
+ let storyDefinitionContent = "";
5288
+ try {
5289
+ const storyDecisions = await getDecisionsByPhase(deps.db, "solutioning");
5290
+ const storyDef = storyDecisions.find((d) => d.category === "stories" && d.key === storyKey);
5291
+ if (storyDef) {
5292
+ storyDefinitionContent = storyDef.value;
5293
+ logger$18.debug({ storyKey }, "Injected story definition from solutioning decisions");
5294
+ }
5295
+ } catch {}
5287
5296
  const archConstraintsContent = await getArchConstraints$3(deps);
5288
5297
  const storyTemplateContent = await getStoryTemplate(deps);
5289
5298
  const { prompt, tokenCount, truncated } = assemblePrompt(template, [
@@ -5297,6 +5306,11 @@ async function runCreateStory(deps, params) {
5297
5306
  content: epicShardContent,
5298
5307
  priority: "required"
5299
5308
  },
5309
+ {
5310
+ name: "story_definition",
5311
+ content: storyDefinitionContent,
5312
+ priority: "required"
5313
+ },
5300
5314
  {
5301
5315
  name: "arch_constraints",
5302
5316
  content: archConstraintsContent,
@@ -41620,4 +41634,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
41620
41634
 
41621
41635
  //#endregion
41622
41636
  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, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
41623
- //# sourceMappingURL=run-Dg_BEJB6.js.map
41637
+ //# sourceMappingURL=run-NJQHRIYt.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.19.9",
3
+ "version": "0.19.10",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -16,13 +16,22 @@
16
16
 
17
17
  ---
18
18
 
19
+ ### Story Definition (from Solutioning Phase)
20
+ {{story_definition}}
21
+
22
+ ---
23
+
19
24
  ## Mission
20
25
 
21
26
  Using the context above, write a complete, implementation-ready story file for story **{{story_key}}**.
22
27
 
28
+ **CRITICAL**: The Story Definition above is the authoritative specification for this story's scope.
29
+ Use the title, description, and acceptance criteria from the Story Definition — do NOT substitute
30
+ a different story from the epic scope. The story key, title, and core scope are non-negotiable.
31
+
23
32
  ## Instructions
24
33
 
25
- 1. **Parse the epic scope** to understand what this epic is building and where this story fits
34
+ 1. **Use the Story Definition as your primary input** it specifies exactly what this story builds. The epic scope provides surrounding context only.
26
35
  2. **Apply architecture constraints** — every constraint listed above is mandatory (file paths, import style, test framework, etc.)
27
36
  3. **Use previous dev notes** as guardrails — don't repeat mistakes, build on patterns that worked
28
37
  4. **Fill out the story template** with:
@@ -88,7 +88,21 @@ For EVERY story with dependencies on other stories:
88
88
  3. Flag invalid references as **blocker** findings
89
89
  4. Flag potentially circular dependencies as **major** findings
90
90
 
91
- ### Step 7: Final Verdict
91
+ ### Step 7: Cross-Epic Story Duplication Check
92
+
93
+ For EVERY pair of stories from DIFFERENT epics:
94
+ 1. Do they implement the same core functionality? (e.g., both create a MatchRunner, both build a tournament CLI, both implement a logging module)
95
+ 2. Do they have overlapping acceptance criteria? (same testable condition appears in both)
96
+ 3. Does a later epic's story RE-IMPLEMENT what an earlier epic's story already built, rather than extending or depending on it?
97
+ 4. Flag duplicate stories as **major** findings with both story keys in affected_items
98
+ 5. Flag near-duplicates (>50% AC overlap) as **major** findings
99
+
100
+ Common duplication patterns:
101
+ - Infrastructure stories (logging, CLI, config) appearing in multiple epics
102
+ - Runner/harness classes duplicated across epics
103
+ - The same data model or service being created by stories in different epics
104
+
105
+ ### Step 8: Final Verdict
92
106
 
93
107
  Determine your verdict:
94
108
  - **NOT_READY**: Any of these conditions are true:
@@ -130,7 +144,7 @@ findings:
130
144
  ```
131
145
 
132
146
  Valid verdict values: READY, NEEDS_WORK, NOT_READY
133
- Valid category values: fr_coverage, architecture_compliance, story_quality, constraint_adherence, ux_alignment, dependency_validity
147
+ Valid category values: fr_coverage, architecture_compliance, story_quality, constraint_adherence, ux_alignment, dependency_validity, story_duplication
134
148
  Valid severity values: blocker, major, minor
135
149
 
136
150
  If you cannot perform the review:
@@ -42,12 +42,19 @@ Break down the requirements and architecture above into **epics and stories**
42
42
  - If architecture specifies a project structure, Epic 1 Story 1 should be project scaffolding
43
43
  - Database tables, API endpoints, and infrastructure are created in the epic where they are FIRST NEEDED
44
44
 
45
- 5. **Size stories appropriately:**
45
+ 5. **Eliminate cross-epic duplication (CRITICAL):**
46
+ - Before finalizing, compare EVERY story against stories in OTHER epics
47
+ - If two stories from different epics implement the same core functionality (e.g., both create a MatchRunner, both build a tournament CLI), consolidate into ONE story in the earliest epic that needs it
48
+ - The later epic should DEPEND ON the earlier epic's story, not re-implement it
49
+ - Common duplication patterns to watch for: logging infrastructure, CLI subcommands, runner/harness classes, configuration modules
50
+ - A story that "extends" functionality from an earlier epic is OK; a story that "re-implements" the same functionality is NOT
51
+
52
+ 6. **Size stories appropriately:**
46
53
  - Each story should be completable by one developer in 1-3 days
47
54
  - If a story feels too large, split it into multiple stories within the same epic
48
55
  - If an epic has more than 8 stories, consider splitting the epic
49
56
 
50
- 6. **Amendment awareness**: If amendment context from a parent run is provided below, generate stories for the NEW scope introduced by the amendment. Do not regenerate stories for unchanged requirements.
57
+ 7. **Amendment awareness**: If amendment context from a parent run is provided below, generate stories for the NEW scope introduced by the amendment. Do not regenerate stories for unchanged requirements.
51
58
 
52
59
  ## Output Contract
53
60