substrate-ai 0.6.3 → 0.6.5

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 { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-GwwiCYXX.js";
2
+ import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BiREqhp_.js";
3
3
  import { createLogger } from "../logger-D2fS2ccL.js";
4
4
  import { AdapterRegistry } from "../adapter-registry-D2zdMwVu.js";
5
5
  import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-DtZW1maj.js";
@@ -3486,7 +3486,7 @@ async function runSupervisorAction(options, deps = {}) {
3486
3486
  await initSchema(expAdapter);
3487
3487
  const { runRunAction: runPipeline } = await import(
3488
3488
  /* @vite-ignore */
3489
- "../run-B5-a932y.js"
3489
+ "../run-DZpZt2zm.js"
3490
3490
  );
3491
3491
  const runStoryFn = async (opts) => {
3492
3492
  const exitCode = await runPipeline({
@@ -6638,6 +6638,7 @@ const MIN_FREE_MEMORY_BYTES = (() => {
6638
6638
  return 256 * 1024 * 1024;
6639
6639
  })();
6640
6640
  const MEMORY_PRESSURE_POLL_MS = 1e4;
6641
+ const MEMORY_PRESSURE_MAX_HOLD_MS = 3e5;
6641
6642
  let _lastKnownPressureLevel = 0;
6642
6643
  /**
6643
6644
  * Get available system memory in bytes, accounting for platform differences.
@@ -6684,13 +6685,10 @@ function getAvailableMemory() {
6684
6685
  const purgeable = parseInt(vmstat.match(/Pages purgeable:\s+(\d+)/)?.[1] ?? "0", 10);
6685
6686
  const speculative = parseInt(vmstat.match(/Pages speculative:\s+(\d+)/)?.[1] ?? "0", 10);
6686
6687
  const available = (free + purgeable + speculative) * pageSize;
6687
- if (pressureLevel >= 2) {
6688
- logger$23.warn({
6689
- pressureLevel,
6690
- availableBeforeDiscount: available
6691
- }, "macOS kernel reports memory pressure — discounting estimate");
6692
- return Math.floor(available / 2);
6693
- }
6688
+ if (pressureLevel >= 2) logger$23.debug({
6689
+ pressureLevel,
6690
+ available
6691
+ }, "macOS kernel reports memory pressure level 2 (warn) — using raw estimate");
6694
6692
  return available;
6695
6693
  } catch {
6696
6694
  return freemem();
@@ -6721,6 +6719,7 @@ var DispatcherImpl = class {
6721
6719
  _queue = [];
6722
6720
  _shuttingDown = false;
6723
6721
  _memoryPressureTimer = null;
6722
+ _memoryPressureHoldStart = null;
6724
6723
  constructor(eventBus, adapterRegistry, config) {
6725
6724
  this._eventBus = eventBus;
6726
6725
  this._adapterRegistry = adapterRegistry;
@@ -7134,13 +7133,28 @@ var DispatcherImpl = class {
7134
7133
  _isMemoryPressured() {
7135
7134
  const free = getAvailableMemory();
7136
7135
  if (free < MIN_FREE_MEMORY_BYTES) {
7136
+ const now = Date.now();
7137
+ if (this._memoryPressureHoldStart === null) this._memoryPressureHoldStart = now;
7138
+ const holdDurationMs = now - this._memoryPressureHoldStart;
7139
+ if (holdDurationMs >= MEMORY_PRESSURE_MAX_HOLD_MS) {
7140
+ logger$23.warn({
7141
+ freeMB: Math.round(free / 1024 / 1024),
7142
+ thresholdMB: Math.round(MIN_FREE_MEMORY_BYTES / 1024 / 1024),
7143
+ pressureLevel: _lastKnownPressureLevel,
7144
+ holdDurationMs
7145
+ }, "Memory pressure hold exceeded max duration — forcing dispatch");
7146
+ this._memoryPressureHoldStart = null;
7147
+ return false;
7148
+ }
7137
7149
  logger$23.warn({
7138
7150
  freeMB: Math.round(free / 1024 / 1024),
7139
7151
  thresholdMB: Math.round(MIN_FREE_MEMORY_BYTES / 1024 / 1024),
7140
- pressureLevel: _lastKnownPressureLevel
7152
+ pressureLevel: _lastKnownPressureLevel,
7153
+ holdDurationMs
7141
7154
  }, "Memory pressure detected — holding dispatch queue");
7142
7155
  return true;
7143
7156
  }
7157
+ this._memoryPressureHoldStart = null;
7144
7158
  return false;
7145
7159
  }
7146
7160
  /**
@@ -23691,4 +23705,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
23691
23705
 
23692
23706
  //#endregion
23693
23707
  export { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
23694
- //# sourceMappingURL=run-GwwiCYXX.js.map
23708
+ //# sourceMappingURL=run-BiREqhp_.js.map
@@ -1,4 +1,4 @@
1
- import { registerRunCommand, runRunAction } from "./run-GwwiCYXX.js";
1
+ import { registerRunCommand, runRunAction } from "./run-BiREqhp_.js";
2
2
  import "./logger-D2fS2ccL.js";
3
3
  import "./config-migrator-DtZW1maj.js";
4
4
  import "./helpers-BihqWgVe.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",