substrate-ai 0.20.78 → 0.20.81
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 +7 -0
- package/dist/adapter-registry-BgfwxcSY.js +4 -0
- package/dist/cli/index.js +40 -641
- package/dist/cli/templates/agents-md-substrate-section.md +5 -0
- package/dist/cli/templates/claude-md-substrate-section.md +5 -0
- package/dist/cli/templates/gemini-md-substrate-section.md +5 -0
- package/dist/{health-EyALt_76.js → health-CuKzY0Fn.js} +2 -2
- package/dist/{health-CUPkzJ8b.js → health-D_2Tesme.js} +2 -2
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/{interactive-prompt-DqvUvzPv.js → interactive-prompt-CsvMelhG.js} +2 -2
- package/dist/{manifest-read-DP4lBymM.js → manifest-read-Boipz5aP.js} +7 -3
- package/dist/modules/interactive-prompt/index.js +2 -2
- package/dist/{run-5R5ZPgSw.js → run-CElciHC1.js} +1413 -435
- package/dist/{run-E6tr8jf3.js → run-DWIVzH_N.js} +4 -4
- package/dist/src/modules/recovery-engine/index.d.ts +12 -1
- package/package.json +1 -1
- package/dist/adapter-registry-B42bBpfj.js +0 -4
- /package/dist/{adapter-registry-DXLMTmfD.js → adapter-registry-DIcrxjH8.js} +0 -0
|
@@ -67,6 +67,10 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
67
67
|
- On reported failure with coherent working tree: run `substrate reconcile-from-disk --dry-run` first; treat its output as source of truth before re-dispatching
|
|
68
68
|
- Never re-run a failed story without explicit user confirmation
|
|
69
69
|
|
|
70
|
+
### Per-Story Worktree Behavior
|
|
71
|
+
|
|
72
|
+
Each dispatched story runs in `.substrate-worktrees/story-<key>` on its own branch (`substrate/story-<key>`). The agent's auto-commit (e.g., `feat(story-N-M): ...`) lands on the branch, not main. Merge to main happens after verification SHIP_IT; the worktree is then removed. After verification failure, the worktree and branch are preserved for `substrate reconcile-from-disk` inspection. Use `--no-worktree` if your project doesn't support worktrees (submodules, bare repos).
|
|
73
|
+
|
|
70
74
|
### Key Commands
|
|
71
75
|
|
|
72
76
|
| Command | Purpose |
|
|
@@ -74,6 +78,7 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
74
78
|
| `substrate run --events` | Run pipeline with NDJSON event stream |
|
|
75
79
|
| `substrate run --halt-on <severity>` | Halt policy: `all` / `critical` (default) / `none` |
|
|
76
80
|
| `substrate run --non-interactive` | Suppress stdin prompts |
|
|
81
|
+
| `substrate run --no-worktree` | Disable per-story git worktrees (use for submodules or bare repos) |
|
|
77
82
|
| `substrate report [--run <id\|latest>]` | Per-run completion report |
|
|
78
83
|
| `substrate report --verify-ac` | Append AC-to-Test traceability matrix |
|
|
79
84
|
| `substrate reconcile-from-disk [--dry-run] [--yes]` | Path A reconciliation when tree is coherent |
|
|
@@ -79,6 +79,10 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
79
79
|
- **On reported failure with coherent working tree**: run `substrate reconcile-from-disk --dry-run` first; treat the dry-run output as the source of truth before re-dispatching the story
|
|
80
80
|
- **Never re-run a failed story** without explicit user confirmation
|
|
81
81
|
|
|
82
|
+
### Per-Story Worktree Behavior
|
|
83
|
+
|
|
84
|
+
Each dispatched story runs in `.substrate-worktrees/story-<key>` on its own branch (`substrate/story-<key>`). The agent's auto-commit (e.g., `feat(story-N-M): ...`) lands on the branch, not main. Merge to main happens after verification SHIP_IT; the worktree is then removed. After verification failure, the worktree and branch are preserved for `substrate reconcile-from-disk` inspection. Use `--no-worktree` if your project doesn't support worktrees (submodules, bare repos).
|
|
85
|
+
|
|
82
86
|
### Key Commands Reference
|
|
83
87
|
|
|
84
88
|
| Command | Purpose |
|
|
@@ -87,6 +91,7 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
87
91
|
| `substrate run --halt-on <severity>` | Decision Router halt policy: `all` / `critical` (default) / `none` |
|
|
88
92
|
| `substrate run --non-interactive` | Suppress stdin prompts; combine with `--halt-on none` for fully autonomous |
|
|
89
93
|
| `substrate run --verify-ac` | On-demand AC-to-Test traceability matrix |
|
|
94
|
+
| `substrate run --no-worktree` | Disable per-story git worktrees (use for submodules or bare repos) |
|
|
90
95
|
| `substrate report [--run <id\|latest>]` | Per-run completion report — outcomes, cost, escalation diagnostics, halt notifications |
|
|
91
96
|
| `substrate report --verify-ac` | Append AC-to-Test traceability matrix to the report |
|
|
92
97
|
| `substrate reconcile-from-disk [--dry-run] [--yes]` | Path A reconciliation when pipeline reports failed but tree is coherent |
|
|
@@ -67,6 +67,10 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
67
67
|
- On reported failure with coherent working tree: run `substrate reconcile-from-disk --dry-run` first; treat its output as source of truth before re-dispatching
|
|
68
68
|
- Never re-run a failed story without explicit user confirmation
|
|
69
69
|
|
|
70
|
+
### Per-Story Worktree Behavior
|
|
71
|
+
|
|
72
|
+
Each dispatched story runs in `.substrate-worktrees/story-<key>` on its own branch (`substrate/story-<key>`). The agent's auto-commit (e.g., `feat(story-N-M): ...`) lands on the branch, not main. Merge to main happens after verification SHIP_IT; the worktree is then removed. After verification failure, the worktree and branch are preserved for `substrate reconcile-from-disk` inspection. Use `--no-worktree` if your project doesn't support worktrees (submodules, bare repos).
|
|
73
|
+
|
|
70
74
|
### Key Commands
|
|
71
75
|
|
|
72
76
|
| Command | Purpose |
|
|
@@ -74,6 +78,7 @@ The Recovery Engine runs a 3-tier auto-fix ladder before any halt — Tier A ret
|
|
|
74
78
|
| `substrate run --events` | Run pipeline with NDJSON event stream |
|
|
75
79
|
| `substrate run --halt-on <severity>` | Halt policy: `all` / `critical` (default) / `none` |
|
|
76
80
|
| `substrate run --non-interactive` | Suppress stdin prompts |
|
|
81
|
+
| `substrate run --no-worktree` | Disable per-story git worktrees (use for submodules or bare repos) |
|
|
77
82
|
| `substrate report [--run <id\|latest>]` | Per-run completion report |
|
|
78
83
|
| `substrate report --verify-ac` | Append AC-to-Test traceability matrix |
|
|
79
84
|
| `substrate reconcile-from-disk [--dry-run] [--yes]` | Path A reconciliation when tree is coherent |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
2
2
|
import { DoltClient, DoltQueryError, createDatabaseAdapter$1 as createDatabaseAdapter, getLatestRun, getPipelineRunById, initSchema } from "./dist-DCBSXUiX.js";
|
|
3
|
-
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-
|
|
3
|
+
import { resolveMainRepoRoot, resolveRunManifest } from "./manifest-read-Boipz5aP.js";
|
|
4
4
|
import { createRequire } from "module";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1712,4 +1712,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
1712
1712
|
|
|
1713
1713
|
//#endregion
|
|
1714
1714
|
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, __commonJS, __require, __toESM, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, runHealthAction, validateStoryKey };
|
|
1715
|
-
//# sourceMappingURL=health-
|
|
1715
|
+
//# sourceMappingURL=health-CuKzY0Fn.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-
|
|
1
|
+
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-CuKzY0Fn.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./dist-DCBSXUiX.js";
|
|
4
|
-
import "./manifest-read-
|
|
4
|
+
import "./manifest-read-Boipz5aP.js";
|
|
5
5
|
import "./work-graph-repository-DZyJv5pV.js";
|
|
6
6
|
import "./decisions-CzSIEeGP.js";
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -755,6 +755,22 @@ interface DecisionHaltSkippedNonInteractiveEvent {
|
|
|
755
755
|
/** Human-readable reason for skipping */
|
|
756
756
|
reason: string;
|
|
757
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Emitted when a 3-way merge fails due to conflicts between the story branch
|
|
760
|
+
* and the base branch (typically main). The worktree and branch are preserved
|
|
761
|
+
* for operator inspection. Story 75-2 (merge-to-main phase).
|
|
762
|
+
*/
|
|
763
|
+
interface PipelineMergeConflictDetectedEvent {
|
|
764
|
+
type: 'pipeline:merge-conflict-detected';
|
|
765
|
+
/** ISO-8601 timestamp generated at emit time */
|
|
766
|
+
ts: string;
|
|
767
|
+
/** Story key whose branch could not be merged (e.g., "75-2") */
|
|
768
|
+
storyKey: string;
|
|
769
|
+
/** Branch name that was being merged (e.g., "substrate/story-75-2") */
|
|
770
|
+
branchName: string;
|
|
771
|
+
/** Files with unresolved merge conflicts */
|
|
772
|
+
conflictingFiles: string[];
|
|
773
|
+
}
|
|
758
774
|
/**
|
|
759
775
|
* Discriminated union of all pipeline event types.
|
|
760
776
|
*
|
|
@@ -767,7 +783,7 @@ interface DecisionHaltSkippedNonInteractiveEvent {
|
|
|
767
783
|
* }
|
|
768
784
|
* ```
|
|
769
785
|
*/
|
|
770
|
-
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent | PipelinePhaseStartEvent | PipelinePhaseCompleteEvent | StoryAutoApprovedEvent | VerificationCheckCompleteEvent | VerificationStoryCompleteEvent | CostWarningEvent | CostCeilingReachedEvent | DecisionHaltSkippedNonInteractiveEvent; //#endregion
|
|
786
|
+
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent | PipelinePhaseStartEvent | PipelinePhaseCompleteEvent | StoryAutoApprovedEvent | VerificationCheckCompleteEvent | VerificationStoryCompleteEvent | CostWarningEvent | CostCeilingReachedEvent | DecisionHaltSkippedNonInteractiveEvent | PipelineMergeConflictDetectedEvent; //#endregion
|
|
771
787
|
//#region src/core/errors.d.ts
|
|
772
788
|
|
|
773
789
|
/**
|
|
@@ -1904,6 +1920,23 @@ interface OrchestratorEvents {
|
|
|
1904
1920
|
runId: string;
|
|
1905
1921
|
pendingProposalsCount: number;
|
|
1906
1922
|
};
|
|
1923
|
+
/**
|
|
1924
|
+
* Story 75-2: 3-way merge failed due to conflicts between the story branch
|
|
1925
|
+
* and the base branch (typically main). Worktree and branch are preserved
|
|
1926
|
+
* for operator inspection. Story is marked ESCALATED with reason
|
|
1927
|
+
* 'merge-conflict-detected'.
|
|
1928
|
+
*
|
|
1929
|
+
* Mirror of PipelineMergeConflictDetectedEvent in event-types.ts;
|
|
1930
|
+
* both must stay in sync.
|
|
1931
|
+
*/
|
|
1932
|
+
'pipeline:merge-conflict-detected': {
|
|
1933
|
+
/** Story key whose branch could not be merged (e.g., "75-2") */
|
|
1934
|
+
storyKey: string;
|
|
1935
|
+
/** Branch name that was being merged (e.g., "substrate/story-75-2") */
|
|
1936
|
+
branchName: string;
|
|
1937
|
+
/** Files with unresolved merge conflicts */
|
|
1938
|
+
conflictingFiles: string[];
|
|
1939
|
+
};
|
|
1907
1940
|
} //#endregion
|
|
1908
1941
|
//#region src/core/event-bus.d.ts
|
|
1909
1942
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { childLogger, createLogger, logger } from "./logger-KeHncl-f.js";
|
|
2
2
|
import { assertDefined, createEventBus, createTuiApp, deepClone, formatDuration, generateId, isPlainObject, isTuiCapable, printNonTtyWarning, sleep, withRetry } from "./helpers-CElYrONe.js";
|
|
3
3
|
import { AdapterRegistry, AdtError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter } from "./dist-DCBSXUiX.js";
|
|
4
|
-
import "./adapter-registry-
|
|
4
|
+
import "./adapter-registry-DIcrxjH8.js";
|
|
5
5
|
import { BudgetExceededError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError } from "./errors-D7xD-utp.js";
|
|
6
6
|
|
|
7
7
|
//#region src/core/di.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
2
|
-
import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-
|
|
2
|
+
import { readCurrentRunId, resolveMainRepoRoot } from "./manifest-read-Boipz5aP.js";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
5
|
import * as readline from "node:readline";
|
|
@@ -180,4 +180,4 @@ async function runInteractivePrompt(decisionContext) {
|
|
|
180
180
|
|
|
181
181
|
//#endregion
|
|
182
182
|
export { runInteractivePrompt };
|
|
183
|
-
//# sourceMappingURL=interactive-prompt-
|
|
183
|
+
//# sourceMappingURL=interactive-prompt-CsvMelhG.js.map
|
|
@@ -4483,7 +4483,8 @@ const CliFlagsSchema = z.object({
|
|
|
4483
4483
|
defaultAction: z.string(),
|
|
4484
4484
|
reason: z.string(),
|
|
4485
4485
|
skippedAt: z.string()
|
|
4486
|
-
})).optional()
|
|
4486
|
+
})).optional(),
|
|
4487
|
+
no_worktree: z.boolean().optional()
|
|
4487
4488
|
});
|
|
4488
4489
|
|
|
4489
4490
|
//#endregion
|
|
@@ -4760,6 +4761,7 @@ const RunManifestSchema = z.object({
|
|
|
4760
4761
|
run_total: 0
|
|
4761
4762
|
}),
|
|
4762
4763
|
pending_proposals: z.array(ProposalSchema),
|
|
4764
|
+
orchestrator_start_branch: z.string().optional(),
|
|
4763
4765
|
stopped_reason: z.string().optional(),
|
|
4764
4766
|
stopped_at: z.string().optional(),
|
|
4765
4767
|
generation: z.number().int().nonnegative(),
|
|
@@ -5133,6 +5135,7 @@ var RunManifest = class RunManifest {
|
|
|
5133
5135
|
if (updates.run_status !== void 0) merged.run_status = updates.run_status;
|
|
5134
5136
|
if (updates.stopped_reason !== void 0) merged.stopped_reason = updates.stopped_reason;
|
|
5135
5137
|
if (updates.stopped_at !== void 0) merged.stopped_at = updates.stopped_at;
|
|
5138
|
+
if (updates.orchestrator_start_branch !== void 0) merged.orchestrator_start_branch = updates.orchestrator_start_branch;
|
|
5136
5139
|
await this._writeImpl(merged);
|
|
5137
5140
|
}
|
|
5138
5141
|
/**
|
|
@@ -5146,7 +5149,8 @@ var RunManifest = class RunManifest {
|
|
|
5146
5149
|
* (preserves the single-writer guarantee from Epic 57-1).
|
|
5147
5150
|
* Non-fatal: callers MUST wrap in `.catch((err) => logger.warn(...))`.
|
|
5148
5151
|
*
|
|
5149
|
-
* @param updates - Top-level status fields to merge (run_status, stopped_reason, stopped_at
|
|
5152
|
+
* @param updates - Top-level status fields to merge (run_status, stopped_reason, stopped_at,
|
|
5153
|
+
* orchestrator_start_branch)
|
|
5150
5154
|
*/
|
|
5151
5155
|
async patchRunStatus(updates) {
|
|
5152
5156
|
return this._enqueue(() => this._patchRunStatusImpl(updates));
|
|
@@ -5841,4 +5845,4 @@ async function resolveRunManifest(dbRoot, runId) {
|
|
|
5841
5845
|
|
|
5842
5846
|
//#endregion
|
|
5843
5847
|
export { FindingsInjector, RunManifest, RuntimeProbeListSchema, SupervisorLock, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, applyConfigToGraph, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectsEventDrivenAC, detectsStateIntegratingAC, extractTargetFilesFromStoryContent, parseRuntimeProbes, readCurrentRunId, renderFindings, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorByClass, rollupProbeAuthorMetrics, runAcTraceabilityCheck, runStaleVerificationRecovery };
|
|
5844
|
-
//# sourceMappingURL=manifest-read-
|
|
5848
|
+
//# sourceMappingURL=manifest-read-Boipz5aP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../logger-KeHncl-f.js";
|
|
2
2
|
import "../../dist-DCBSXUiX.js";
|
|
3
|
-
import "../../manifest-read-
|
|
4
|
-
import { runInteractivePrompt } from "../../interactive-prompt-
|
|
3
|
+
import "../../manifest-read-Boipz5aP.js";
|
|
4
|
+
import { runInteractivePrompt } from "../../interactive-prompt-CsvMelhG.js";
|
|
5
5
|
|
|
6
6
|
export { runInteractivePrompt };
|