substrate-ai 0.20.124 → 0.20.126

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
@@ -3,7 +3,7 @@ import { FileKvStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipeline
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, InMemoryDatabaseAdapter, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createPipelineRun, createStderrLogger, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initWorkGraphSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, swallowDebug, tagRunAsBaseline, updatePipelineRun } from "../dist-Bc0-6VcX.js";
6
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-DKrGXAOH.js";
6
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR, GitClient, GrammarLoader, Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, unescape, validateStopAfterFromConflict } from "../run-BKkbPXIv.js";
7
7
  import "../adapter-registry-DIcrxjH8.js";
8
8
  import { RunManifest, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, parseRuntimeProbes, readCurrentRunId, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck } from "../manifest-read-CDjNmdVW.js";
9
9
  import "../errors-CwQM_6Yk.js";
@@ -8419,7 +8419,7 @@ async function runSupervisorAction(options, deps = {}) {
8419
8419
  await initSchema(expAdapter);
8420
8420
  const { runRunAction: runPipeline } = await import(
8421
8421
  /* @vite-ignore */
8422
- "../run-IWXFDemI.js"
8422
+ "../run-CDJ_HXyv.js"
8423
8423
  );
8424
8424
  const runStoryFn = async (opts) => {
8425
8425
  const exitCode = await runPipeline({
@@ -12141,6 +12141,15 @@ function registerFactoryCommand$1(program) {
12141
12141
  //#endregion
12142
12142
  //#region src/cli/commands/reconcile-from-disk.ts
12143
12143
  const logger$2 = createLogger("reconcile-from-disk");
12144
+ /**
12145
+ * The reconcile write (obs_2026-05-26_031). Keyed on `story_key` ALONE —
12146
+ * `wg_stories` has no `run_id` column (cols: story_key, epic, title, status,
12147
+ * spec_path, created_at, updated_at, completed_at), so the prior `AND run_id=?`
12148
+ * predicate threw DoltQueryError and the recovery write never landed, leaving
12149
+ * the Path-A primitive non-functional. Exported so the schema/SQL guard test
12150
+ * runs the EXACT statement against a real wg_stories (no drift). Params: [now, now, story_key].
12151
+ */
12152
+ const RECONCILE_WG_STORIES_UPDATE = "UPDATE wg_stories SET status='complete', updated_at=?, completed_at=? WHERE story_key=?";
12144
12153
  /** 64KB tail window for capturing subprocess stderr/stdout (Story 66-5 pattern). */
12145
12154
  const MAX_OUTPUT_BYTES = 64 * 1024;
12146
12155
  /**
@@ -12469,10 +12478,10 @@ async function runReconcileFromDiskAction(options) {
12469
12478
  await initSchema(adapter);
12470
12479
  const now = new Date().toISOString();
12471
12480
  await adapter.transaction(async (tx) => {
12472
- for (const record of reconcilableRecords) await tx.query("UPDATE wg_stories SET status='complete', updated_at=? WHERE story_key=? AND run_id=?", [
12481
+ for (const record of reconcilableRecords) await tx.query(RECONCILE_WG_STORIES_UPDATE, [
12482
+ now,
12473
12483
  now,
12474
- record.storyKey,
12475
- resolvedRunId
12484
+ record.storyKey
12476
12485
  ]);
12477
12486
  });
12478
12487
  logger$2.info({
@@ -6804,7 +6804,14 @@ function extractStorySection(shardContent, storyKey) {
6804
6804
  const rest = shardContent.slice(startIdx + match$2[0].length);
6805
6805
  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");
6806
6806
  const nextMatch = nextStoryPattern.exec(rest);
6807
- const endIdx = nextMatch !== null ? startIdx + match$2[0].length + nextMatch.index : shardContent.length;
6807
+ const headingLevel = /^(#{1,6})/.exec(match$2[0].trimStart())?.[1].length;
6808
+ let nextSectionIdx = null;
6809
+ if (headingLevel !== void 0) {
6810
+ const nextSectionMatch = new RegExp(`^#{1,${headingLevel}}\\s`, "m").exec(rest);
6811
+ if (nextSectionMatch !== null) nextSectionIdx = nextSectionMatch.index;
6812
+ }
6813
+ const boundaryOffsets = [nextMatch?.index, nextSectionIdx].filter((i) => typeof i === "number");
6814
+ const endIdx = boundaryOffsets.length > 0 ? startIdx + match$2[0].length + Math.min(...boundaryOffsets) : shardContent.length;
6808
6815
  const section = shardContent.slice(startIdx, endIdx).trim();
6809
6816
  return section.length > 0 ? section : null;
6810
6817
  }
@@ -14376,7 +14383,7 @@ function createImplementationOrchestrator(deps) {
14376
14383
  const fidelityImplDecisions = await getDecisionsByPhase(db, "implementation");
14377
14384
  let fidelitySourceContent;
14378
14385
  const fidelityPerStoryShard = fidelityImplDecisions.find((d) => d.category === "epic-shard" && d.key === storyKey);
14379
- if (fidelityPerStoryShard?.value) fidelitySourceContent = fidelityPerStoryShard.value;
14386
+ if (fidelityPerStoryShard?.value) fidelitySourceContent = extractStorySection(fidelityPerStoryShard.value, storyKey) ?? fidelityPerStoryShard.value;
14380
14387
  else {
14381
14388
  const epicShardForFidelity = fidelityImplDecisions.find((d) => d.category === "epic-shard" && d.key === epicId);
14382
14389
  if (epicShardForFidelity?.value) fidelitySourceContent = extractStorySection(epicShardForFidelity.value, storyKey) ?? void 0;
@@ -47302,4 +47309,4 @@ function registerRunCommand(program, version = "0.0.0", projectRoot = process.cw
47302
47309
 
47303
47310
  //#endregion
47304
47311
  export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GLOBSTAR$1 as GLOBSTAR, GitClient, GrammarLoader, Minimatch$1 as Minimatch, Minipass, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createGitWorktreeManager, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, escape$1 as escape, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runRunAction, runSolutioningPhase, unescape$1 as unescape, validateStopAfterFromConflict, wireNdjsonEmitter };
47305
- //# sourceMappingURL=run-DKrGXAOH.js.map
47312
+ //# sourceMappingURL=run-BKkbPXIv.js.map
@@ -2,7 +2,7 @@ import "./health-B4NhX--T.js";
2
2
  import "./logger-KeHncl-f.js";
3
3
  import "./helpers-CElYrONe.js";
4
4
  import "./dist-Bc0-6VcX.js";
5
- import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-DKrGXAOH.js";
5
+ import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, resolveProbeAuthorStateIntegrating, runRunAction, wireNdjsonEmitter } from "./run-BKkbPXIv.js";
6
6
  import "./manifest-read-CDjNmdVW.js";
7
7
  import "./routing-DFxoKHDt.js";
8
8
  import "./work-graph-repository-DZyJv5pV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.20.124",
3
+ "version": "0.20.126",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",