substrate-ai 0.20.17 → 0.20.18

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-xQLHet2Y.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-DgaY0RP2.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-CZW8qqr5.js"
5201
+ "../run-Ds4q0vfb.js"
5202
5202
  );
5203
5203
  const runStoryFn = async (opts) => {
5204
5204
  const exitCode = await runPipeline({
@@ -5968,27 +5968,24 @@ function getEpicShard(decisions, epicId, projectRoot, storyKey) {
5968
5968
  }
5969
5969
  const epicShard = decisions.find((d) => d.category === "epic-shard" && d.key === epicId);
5970
5970
  const shardContent = epicShard?.value;
5971
- if (shardContent) {
5972
- if (storyKey) {
5973
- const storySection = extractStorySection(shardContent, storyKey);
5974
- if (storySection) {
5975
- logger$18.debug({
5976
- epicId,
5977
- storyKey
5978
- }, "Extracted per-story section from epic shard (pre-37-0 fallback)");
5979
- return storySection;
5980
- }
5971
+ if (shardContent && storyKey) {
5972
+ const storySection = extractStorySection(shardContent, storyKey);
5973
+ if (storySection) {
5981
5974
  logger$18.debug({
5982
5975
  epicId,
5983
5976
  storyKey
5984
- }, "No matching story section found using full epic shard");
5977
+ }, "Extracted per-story section from epic shard (pre-37-0 fallback)");
5978
+ return storySection;
5985
5979
  }
5986
- return shardContent;
5980
+ logger$18.info({
5981
+ epicId,
5982
+ storyKey
5983
+ }, "Story section absent in decisions-store shard — attempting file-based fallback before returning stale shard");
5987
5984
  }
5988
5985
  if (projectRoot) {
5989
5986
  const fallback = readEpicShardFromFile(projectRoot, epicId);
5990
5987
  if (fallback) {
5991
- logger$18.info({ epicId }, "Using file-based fallback for epic shard (decisions table empty)");
5988
+ logger$18.info({ epicId }, "Using file-based fallback for epic shard");
5992
5989
  if (storyKey) {
5993
5990
  const storySection = extractStorySection(fallback, storyKey);
5994
5991
  if (storySection) {
@@ -6002,6 +5999,7 @@ function getEpicShard(decisions, epicId, projectRoot, storyKey) {
6002
5999
  return fallback;
6003
6000
  }
6004
6001
  }
6002
+ if (shardContent) return shardContent;
6005
6003
  return "";
6006
6004
  } catch (err) {
6007
6005
  logger$18.warn({
@@ -43291,11 +43289,11 @@ async function runRunAction(options) {
43291
43289
  });
43292
43290
  process.on("SIGINT", () => {
43293
43291
  ingestionServer.stop();
43294
- process.exit(130);
43292
+ setTimeout(() => process.exit(130), 6e3).unref();
43295
43293
  });
43296
43294
  process.on("SIGTERM", () => {
43297
43295
  ingestionServer.stop();
43298
- process.exit(143);
43296
+ setTimeout(() => process.exit(143), 6e3).unref();
43299
43297
  });
43300
43298
  }
43301
43299
  if (telemetryPersistence !== void 0) {
@@ -43825,11 +43823,11 @@ async function runFullPipeline(options) {
43825
43823
  });
43826
43824
  process.on("SIGINT", () => {
43827
43825
  fpIngestionServer.stop();
43828
- process.exit(130);
43826
+ setTimeout(() => process.exit(130), 6e3).unref();
43829
43827
  });
43830
43828
  process.on("SIGTERM", () => {
43831
43829
  fpIngestionServer.stop();
43832
- process.exit(143);
43830
+ setTimeout(() => process.exit(143), 6e3).unref();
43833
43831
  });
43834
43832
  }
43835
43833
  const fpTelemetryPersistence = fullTelemetryEnabled ? new AdapterTelemetryPersistence(adapter) : void 0;
@@ -44052,4 +44050,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
44052
44050
 
44053
44051
  //#endregion
44054
44052
  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 };
44055
- //# sourceMappingURL=run-xQLHet2Y.js.map
44053
+ //# sourceMappingURL=run-DgaY0RP2.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-xQLHet2Y.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-DgaY0RP2.js";
6
6
  import "./routing-CcBOCuC9.js";
7
7
  import "./decisions-C0pz9Clx.js";
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.20.17",
3
+ "version": "0.20.18",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,6 +29,24 @@ Using the context above, write a complete, implementation-ready story file for s
29
29
  Use the title, description, and acceptance criteria from the Story Definition — do NOT substitute
30
30
  a different story from the epic scope. The story key, title, and core scope are non-negotiable.
31
31
 
32
+ ## Input Validation (fail-loud)
33
+
34
+ Before anything else, verify the input contains the source Acceptance Criteria for story `{{story_key}}`. Scan `Epic Scope` and `Story Definition` for BOTH:
35
+
36
+ - A heading matching `Story {{story_key}}` (separators: `-`, `.`, `_`, space).
37
+ - An AC-bearing block within that section (`## Acceptance Criteria`, `### Acceptance Criteria`, `**Acceptance Criteria:**`, etc.).
38
+
39
+ If either is missing — shard truncated, context about other stories only — **do not infer, guess, or hallucinate an AC from the story key or domain priors**. A prior substrate session recorded a shape-specific drift exactly here: no source AC for a "graph builder" story → the agent invented a LanceDB+class-based spec, contradicting the author's explicit "plain JSON adjacency list" directive, purely from a trained pattern.
40
+
41
+ Instead, emit immediately per the Output Contract below:
42
+
43
+ ```yaml
44
+ result: failure
45
+ error: source-ac-content-missing
46
+ ```
47
+
48
+ Do NOT write a partial story file. Do NOT paraphrase surrounding context. Do NOT dispatch Write. The orchestrator treats this as terminal — the correct outcome when the input pipeline has degraded.
49
+
32
50
  ## Instructions
33
51
 
34
52
  1. **Use the Story Definition as your primary input** — it specifies exactly what this story builds. The epic scope provides surrounding context only.