substrate-ai 0.2.21 → 0.2.24

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.
@@ -0,0 +1,93 @@
1
+ # BMAD Compiled Rework-Story Agent
2
+
3
+ ## Context (pre-assembled by pipeline)
4
+
5
+ ### Story File Content
6
+ {{story_content}}
7
+
8
+ ### Issues from Previous Review that MUST be Addressed
9
+ {{review_findings}}
10
+
11
+ ### Architecture Constraints
12
+ {{arch_constraints}}
13
+
14
+ ### Previous Implementation Diff
15
+ {{git_diff}}
16
+
17
+ ---
18
+
19
+ ## Mission
20
+
21
+ This is a FULL re-implementation. The previous implementation had fundamental issues identified in a code review. You must address ALL review findings above while implementing the story from scratch.
22
+
23
+ Do NOT patch the existing implementation. Re-implement the story completely, using the review findings as guidance on what went wrong previously.
24
+
25
+ ## Instructions
26
+
27
+ 1. **Parse the review findings** to understand:
28
+ - Each issue's severity (blocker, major, minor)
29
+ - Each issue's description, file, and line number (if provided)
30
+ - The root causes that led to the previous implementation's failure
31
+
32
+ 2. **Re-read the story file** to understand:
33
+ - Acceptance Criteria (AC1, AC2, etc.)
34
+ - Tasks/Subtasks (ordered list with `[ ]` checkboxes)
35
+ - Dev Notes (file paths, import patterns, test requirements)
36
+
37
+ 3. **Re-implement each task in order** (Red-Green-Refactor):
38
+ - Write failing tests first
39
+ - Make tests pass with minimal code
40
+ - Refactor while keeping tests green
41
+ - Ensure each review finding is addressed
42
+
43
+ 4. **After each task**:
44
+ - Verify tests pass
45
+ - Run the full test suite to check for regressions
46
+ - Mark the task `[x]` in the story file
47
+ - Update the story File List with all new/modified files
48
+
49
+ 5. **After all tasks complete**:
50
+ - Run the full test suite one final time
51
+ - Verify ALL review findings have been addressed
52
+ - Update story Status to `review`
53
+
54
+ ## CRITICAL: Output Contract Emission
55
+
56
+ **You MUST emit the YAML output block (see Output Contract below) as the very last thing you produce.** The downstream pipeline depends on `files_modified` to generate scoped code-review diffs. If you exhaust your turns without emitting the YAML block, the pipeline cannot review your work properly.
57
+
58
+ - If you are running low on turns, **stop implementation and emit the YAML block immediately** with whatever progress you have made. A partial `files_modified` list is far more valuable than none at all.
59
+ - The YAML block must be the final output — no summary text, no explanation after it.
60
+
61
+ ## HALT Conditions (stop and report as failed)
62
+
63
+ - New dependency required beyond story spec
64
+ - 3 consecutive implementation failures with no progress
65
+ - Story requirements are ambiguous with no way to resolve
66
+ - Review findings contradict the story requirements
67
+
68
+ ## Output Contract
69
+
70
+ After completing all tasks (or hitting a HALT condition), emit ONLY this YAML block — no other text:
71
+
72
+ ```yaml
73
+ result: success
74
+ ac_met:
75
+ - AC1
76
+ - AC2
77
+ ac_failures: []
78
+ files_modified:
79
+ - <absolute path to modified file>
80
+ tests: pass
81
+ ```
82
+
83
+ If a HALT condition was hit:
84
+
85
+ ```yaml
86
+ result: failed
87
+ ac_met: []
88
+ ac_failures:
89
+ - <which AC could not be met>
90
+ files_modified: []
91
+ tests: fail
92
+ notes: <reason for failure>
93
+ ```
@@ -1,111 +0,0 @@
1
- //#region src/core/errors.ts
2
- /**
3
- * Error definitions for Substrate
4
- * Provides structured error hierarchy for all toolkit operations
5
- */
6
- /** Base error class for all Substrate errors */
7
- var AdtError = class AdtError extends Error {
8
- code;
9
- context;
10
- constructor(message, code, context = {}) {
11
- super(message);
12
- this.name = "AdtError";
13
- this.code = code;
14
- this.context = context;
15
- if (Error.captureStackTrace) Error.captureStackTrace(this, AdtError);
16
- }
17
- toJSON() {
18
- return {
19
- name: this.name,
20
- message: this.message,
21
- code: this.code,
22
- context: this.context,
23
- stack: this.stack
24
- };
25
- }
26
- };
27
- /** Error thrown when task configuration is invalid */
28
- var TaskConfigError = class extends AdtError {
29
- constructor(message, context = {}) {
30
- super(message, "TASK_CONFIG_ERROR", context);
31
- this.name = "TaskConfigError";
32
- }
33
- };
34
- /** Error thrown when a worker/agent operation fails */
35
- var WorkerError = class extends AdtError {
36
- constructor(message, context = {}) {
37
- super(message, "WORKER_ERROR", context);
38
- this.name = "WorkerError";
39
- }
40
- };
41
- /** Error thrown when a worker/agent cannot be found */
42
- var WorkerNotFoundError = class extends AdtError {
43
- constructor(agentId) {
44
- super(`Worker agent not found: ${agentId}`, "WORKER_NOT_FOUND", { agentId });
45
- this.name = "WorkerNotFoundError";
46
- }
47
- };
48
- /** Error thrown when a task graph is invalid */
49
- var TaskGraphError = class extends AdtError {
50
- constructor(message, context = {}) {
51
- super(message, "TASK_GRAPH_ERROR", context);
52
- this.name = "TaskGraphError";
53
- }
54
- };
55
- /** Error thrown when a task graph has cycles (deadlock) */
56
- var TaskGraphCycleError = class extends TaskGraphError {
57
- constructor(cycle) {
58
- super(`Circular dependency detected in task graph: ${cycle.join(" -> ")}`, { cycle });
59
- this.name = "TaskGraphCycleError";
60
- }
61
- };
62
- /** Error thrown when a budget limit is exceeded */
63
- var BudgetExceededError = class extends AdtError {
64
- constructor(limit, current, context = {}) {
65
- super(`Budget cap exceeded: current=${String(current)}, limit=${String(limit)}`, "BUDGET_EXCEEDED", {
66
- limit,
67
- current,
68
- ...context
69
- });
70
- this.name = "BudgetExceededError";
71
- }
72
- };
73
- /** Error thrown when git operations fail */
74
- var GitError = class extends AdtError {
75
- constructor(message, context = {}) {
76
- super(message, "GIT_ERROR", context);
77
- this.name = "GitError";
78
- }
79
- };
80
- /** Error thrown when configuration is invalid or missing */
81
- var ConfigError = class extends AdtError {
82
- constructor(message, context = {}) {
83
- super(message, "CONFIG_ERROR", context);
84
- this.name = "ConfigError";
85
- }
86
- };
87
- /** Error thrown when state recovery fails */
88
- var RecoveryError = class extends AdtError {
89
- constructor(message, context = {}) {
90
- super(message, "RECOVERY_ERROR", context);
91
- this.name = "RecoveryError";
92
- }
93
- };
94
- /** Error thrown when a config file uses an incompatible format version */
95
- var ConfigIncompatibleFormatError = class extends AdtError {
96
- constructor(message, context = {}) {
97
- super(message, "CONFIG_INCOMPATIBLE_FORMAT", context);
98
- this.name = "ConfigIncompatibleFormatError";
99
- }
100
- };
101
- /** Error thrown when a task graph file uses an incompatible format version */
102
- var TaskGraphIncompatibleFormatError = class extends AdtError {
103
- constructor(message, context = {}) {
104
- super(message, "TASK_GRAPH_INCOMPATIBLE_FORMAT", context);
105
- this.name = "TaskGraphIncompatibleFormatError";
106
- }
107
- };
108
-
109
- //#endregion
110
- export { AdtError, BudgetExceededError, ConfigError, ConfigIncompatibleFormatError, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError };
111
- //# sourceMappingURL=errors-BPqtzQ4U.js.map
@@ -1,7 +0,0 @@
1
- import { registerRunCommand, runRunAction } from "./run-BLIgARum.js";
2
- import "./logger-D2fS2ccL.js";
3
- import "./event-bus-BMxhfxfT.js";
4
- import "./decisions-Dq4cAA2L.js";
5
- import "./operational-CnMlvWqc.js";
6
-
7
- export { runRunAction };