substrate-ai 0.2.17 → 0.2.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Substrate
6
6
 
7
- Substrate is an autonomous software development pipeline you operate from Claude Code. Describe your project, and Substrate coordinates multiple AI coding agents (Claude Code, Codex, Gemini CLI) working in parallel across isolated branches from concept through implementation and code review. A built-in supervisor watches for stalls, auto-recovers, and after each run analyzes what happened and experiments with improvements closing the loop automatically.
7
+ Most multi-agent coding tools help you run AI sessions in parallel — but leave planning, quality control, and learning up to you. Substrate is different: it packages structured planning methodology, multi-agent parallel execution, automated code review cycles, and self-improvement into a single pipeline. Describe your project concept, and Substrate takes it from analysis through implementation and review — coordinating multiple AI coding agents (Claude Code, Codex, Gemini CLI) across isolated worktree branches while a supervisor watches for stalls, auto-recovers, and after each run experiments with improvements to close the loop automatically.
8
8
 
9
9
  Unlike API-based orchestrators, Substrate routes work through the CLI tools you already have installed, maximizing your existing AI subscriptions before falling back to pay-per-token billing. Runs are persistent and resumable with full cost visibility across every provider.
10
10
 
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-CLpXJNQ8.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-BBr-wMHS.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-DPrhfU2T.js"
2845
+ "../run-cxQgjit7.js"
2846
2846
  );
2847
2847
  const runStoryFn = async (opts) => {
2848
2848
  const exitCode = await runPipeline({
@@ -2920,7 +2920,12 @@ const MEMORY_PRESSURE_POLL_MS = 1e4;
2920
2920
  *
2921
2921
  * New approach:
2922
2922
  * 1. Check kern.memorystatus_vm_pressure_level — the kernel's own assessment.
2923
- * Level >= 2 (warn/critical) means the system is already pressured.
2923
+ * Level 4 (critical) = hard gate, return 0.
2924
+ * Level 2 (warn) = halve the vm_stat estimate as a conservative signal.
2925
+ * Level 1 (normal) = trust vm_stat as-is.
2926
+ * Note: level 2 fires frequently on macOS when the compressor is active,
2927
+ * even with gigabytes of reclaimable memory. Hard-gating at 2 caused
2928
+ * false stalls on 24GB+ machines with >50% free RAM.
2924
2929
  * 2. Use a conservative page calculation: free + purgeable + speculative.
2925
2930
  * These categories are truly reclaimable without I/O or decompression.
2926
2931
  * Inactive pages are excluded because they may require disk I/O,
@@ -2928,13 +2933,14 @@ const MEMORY_PRESSURE_POLL_MS = 1e4;
2928
2933
  */
2929
2934
  function getAvailableMemory() {
2930
2935
  if (platform() === "darwin") {
2936
+ let pressureLevel = 0;
2931
2937
  try {
2932
- const pressureLevel = parseInt(execSync("sysctl -n kern.memorystatus_vm_pressure_level", {
2938
+ pressureLevel = parseInt(execSync("sysctl -n kern.memorystatus_vm_pressure_level", {
2933
2939
  timeout: 1e3,
2934
2940
  encoding: "utf-8"
2935
2941
  }).trim(), 10);
2936
- if (pressureLevel >= 2) {
2937
- logger$13.warn({ pressureLevel }, "macOS kernel reports memory pressure");
2942
+ if (pressureLevel >= 4) {
2943
+ logger$13.warn({ pressureLevel }, "macOS kernel reports critical memory pressure");
2938
2944
  return 0;
2939
2945
  }
2940
2946
  } catch {}
@@ -2947,7 +2953,15 @@ function getAvailableMemory() {
2947
2953
  const free = parseInt(vmstat.match(/Pages free:\s+(\d+)/)?.[1] ?? "0", 10);
2948
2954
  const purgeable = parseInt(vmstat.match(/Pages purgeable:\s+(\d+)/)?.[1] ?? "0", 10);
2949
2955
  const speculative = parseInt(vmstat.match(/Pages speculative:\s+(\d+)/)?.[1] ?? "0", 10);
2950
- return (free + purgeable + speculative) * pageSize;
2956
+ const available = (free + purgeable + speculative) * pageSize;
2957
+ if (pressureLevel >= 2) {
2958
+ logger$13.warn({
2959
+ pressureLevel,
2960
+ availableBeforeDiscount: available
2961
+ }, "macOS kernel reports memory pressure — discounting estimate");
2962
+ return Math.floor(available / 2);
2963
+ }
2964
+ return available;
2951
2965
  } catch {
2952
2966
  return freemem();
2953
2967
  }
@@ -11473,4 +11487,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
11473
11487
 
11474
11488
  //#endregion
11475
11489
  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 };
11476
- //# sourceMappingURL=run-CLpXJNQ8.js.map
11490
+ //# sourceMappingURL=run-BBr-wMHS.js.map
@@ -1,4 +1,4 @@
1
- import { registerRunCommand, runRunAction } from "./run-CLpXJNQ8.js";
1
+ import { registerRunCommand, runRunAction } from "./run-BBr-wMHS.js";
2
2
  import "./logger-D2fS2ccL.js";
3
3
  import "./event-bus-BMxhfxfT.js";
4
4
  import "./decisions-Dq4cAA2L.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",