substrate-ai 0.2.18 → 0.2.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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BBr-wMHS.js";
2
+ import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-mFmS2pw6.js";
3
3
  import { createLogger, deepMask } from "../logger-D2fS2ccL.js";
4
4
  import { AdapterRegistry, createEventBus } from "../event-bus-BMxhfxfT.js";
5
5
  import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema, defaultConfigMigrator } from "../version-manager-impl-CZ6KF1Ds.js";
@@ -2842,7 +2842,7 @@ async function runSupervisorAction(options, deps = {}) {
2842
2842
  const expDb = expDbWrapper.db;
2843
2843
  const { runRunAction: runPipeline } = await import(
2844
2844
  /* @vite-ignore */
2845
- "../run-cxQgjit7.js"
2845
+ "../run-CUGB4FQx.js"
2846
2846
  );
2847
2847
  const runStoryFn = async (opts) => {
2848
2848
  const exitCode = await runPipeline({
@@ -1,4 +1,4 @@
1
- import { registerRunCommand, runRunAction } from "./run-BBr-wMHS.js";
1
+ import { registerRunCommand, runRunAction } from "./run-mFmS2pw6.js";
2
2
  import "./logger-D2fS2ccL.js";
3
3
  import "./event-bus-BMxhfxfT.js";
4
4
  import "./decisions-Dq4cAA2L.js";
@@ -2806,7 +2806,24 @@ function extractYamlBlock(output) {
2806
2806
  if (!output || output.trim() === "") return null;
2807
2807
  const fencedResult = extractLastFencedYaml(output);
2808
2808
  if (fencedResult !== null) return fencedResult;
2809
- return extractUnfencedYaml(output);
2809
+ const stripped = stripTrailingFence(output);
2810
+ return extractUnfencedYaml(stripped);
2811
+ }
2812
+ /**
2813
+ * Strip a trailing markdown fence that wraps the entire remaining output.
2814
+ * Handles: "```yaml\nverdict: ...\n```" → "verdict: ..."
2815
+ */
2816
+ function stripTrailingFence(output) {
2817
+ const trimmed = output.trimEnd();
2818
+ if (!trimmed.endsWith("```")) return output;
2819
+ const body = trimmed.slice(0, -3).trimEnd();
2820
+ const lastOpen = body.lastIndexOf("```");
2821
+ if (lastOpen === -1) return output;
2822
+ const beforeFence = body.slice(0, lastOpen);
2823
+ const fenceLine = body.slice(lastOpen);
2824
+ if (beforeFence.length > 0 && !beforeFence.endsWith("\n")) return output;
2825
+ const afterOpen = fenceLine.replace(/^```(?:yaml)?\s*\n?/, "");
2826
+ return beforeFence + afterOpen;
2810
2827
  }
2811
2828
  /**
2812
2829
  * Find all fenced YAML blocks (```yaml...``` or ```...```) and return the last one.
@@ -2907,7 +2924,7 @@ const MIN_FREE_MEMORY_BYTES = (() => {
2907
2924
  const parsed = parseInt(envMB, 10);
2908
2925
  if (!isNaN(parsed) && parsed >= 0) return parsed * 1024 * 1024;
2909
2926
  }
2910
- return 512 * 1024 * 1024;
2927
+ return 256 * 1024 * 1024;
2911
2928
  })();
2912
2929
  const MEMORY_PRESSURE_POLL_MS = 1e4;
2913
2930
  /**
@@ -4472,10 +4489,13 @@ const logger$8 = createLogger("compiled-workflows:code-review");
4472
4489
  const TOKEN_CEILING = 1e5;
4473
4490
  /**
4474
4491
  * Default fallback result when dispatch fails or times out.
4492
+ * Uses NEEDS_MINOR_FIXES (not NEEDS_MAJOR_REWORK) so a parse/schema failure
4493
+ * doesn't trigger a full rework cycle. The orchestrator's phantom-review
4494
+ * detection handles retries, and escalation kicks in at max review cycles.
4475
4495
  */
4476
4496
  function defaultFailResult(error, tokenUsage) {
4477
4497
  return {
4478
- verdict: "NEEDS_MAJOR_REWORK",
4498
+ verdict: "NEEDS_MINOR_FIXES",
4479
4499
  issues: 0,
4480
4500
  issue_list: [],
4481
4501
  error,
@@ -4663,7 +4683,7 @@ async function runCodeReview(deps, params) {
4663
4683
  details
4664
4684
  }, "Code-review output schema validation failed");
4665
4685
  return {
4666
- verdict: "NEEDS_MAJOR_REWORK",
4686
+ verdict: "NEEDS_MINOR_FIXES",
4667
4687
  issues: 0,
4668
4688
  issue_list: [],
4669
4689
  error: "schema_validation_failed",
@@ -4680,7 +4700,7 @@ async function runCodeReview(deps, params) {
4680
4700
  details
4681
4701
  }, "Code-review output failed schema validation");
4682
4702
  return {
4683
- verdict: "NEEDS_MAJOR_REWORK",
4703
+ verdict: "NEEDS_MINOR_FIXES",
4684
4704
  issues: 0,
4685
4705
  issue_list: [],
4686
4706
  error: "schema_validation_failed",
@@ -5589,6 +5609,7 @@ function createImplementationOrchestrator(deps) {
5589
5609
  storyKey,
5590
5610
  storyFilePath
5591
5611
  }, "Found existing story file — skipping create-story");
5612
+ endPhase(storyKey, "create-story");
5592
5613
  eventBus.emit("orchestrator:story-phase-complete", {
5593
5614
  storyKey,
5594
5615
  phase: "IN_STORY_CREATION",
@@ -11487,4 +11508,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
11487
11508
 
11488
11509
  //#endregion
11489
11510
  export { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
11490
- //# sourceMappingURL=run-BBr-wMHS.js.map
11511
+ //# sourceMappingURL=run-mFmS2pw6.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@ Adversarial code review. Find what's wrong. Validate story claims against actual
45
45
 
46
46
  ## Output Contract
47
47
 
48
- After completing the review, emit ONLY this YAML block — no other text:
48
+ After completing the review, emit ONLY raw YAML — no markdown fences, no ``` wrappers, no other text:
49
49
 
50
50
  ```yaml
51
51
  verdict: SHIP_IT