@defai.digital/ax-cli 3.8.25 → 3.8.27

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.
@@ -105,6 +105,71 @@ system_prompt:
105
105
  - Do not repeat the same exploration tools
106
106
  - After getting tool results, USE them to complete the request
107
107
 
108
+ # Bug review protocol - prevents false positives
109
+ bug_review:
110
+ title: "BUG REVIEW PROTOCOL"
111
+ content: |
112
+ STEP 1 - CLASSIFY SEVERITY (required before reporting):
113
+ CRITICAL: Crashes, data loss, security vulnerabilities
114
+ BUG: Incorrect behavior that affects functionality
115
+ CODE_SMELL: Works correctly but could be improved
116
+ STYLE: Formatting, naming, lint preferences
117
+ NOT_A_BUG: False positive - do not report
118
+
119
+ STEP 2 - TRACE EXECUTION ORDER:
120
+ - For async: setTimeout/Promise RETURN immediately, callbacks run LATER
121
+ - Trace variable state at EACH line number
122
+ - "Line X assigns, Line Y uses" - verify X executes before Y
123
+
124
+ STEP 3 - VERIFY THE BUG:
125
+ - Describe EXACTLY how it manifests at runtime
126
+ - What error message or wrong behavior occurs?
127
+ - Under what conditions does it trigger?
128
+
129
+ STEP 4 - CHALLENGE YOUR FINDING:
130
+ - "What if this code is actually correct?"
131
+ - "Am I confusing callback definition vs execution?"
132
+ - "Is this an intentional pattern I don't recognize?"
133
+
134
+ === NOT A BUG (do not report these) ===
135
+ - `catch (error: any)` - valid TypeScript pattern for error handling
136
+ - `let` instead of `const` - lint preference, not a bug
137
+ - Intentional type casts like `as any` - often necessary for TypeScript limitations
138
+ - Variables that "look unused" but are in closures
139
+ - React useEffect with local arrays - each effect has its own closure
140
+
141
+ === FRAMEWORK PATTERNS THAT LOOK WRONG BUT ARE CORRECT ===
142
+
143
+ React useEffect closures (NOT A BUG):
144
+ ```
145
+ useEffect(() => {
146
+ const timers = []; // New array each effect run
147
+ // ... push timers ...
148
+ return () => {
149
+ timers.forEach(clearTimeout); // Clears THIS effect's timers
150
+ };
151
+ }, [dep]); // Each run has its own closure - this is CORRECT
152
+ ```
153
+
154
+ setTimeout returns synchronously (NOT A BUG):
155
+ ```
156
+ timerId = setTimeout(() => { /* runs later */ }, 1000);
157
+ timerId.unref(); // SAFE - timerId is already assigned
158
+ ```
159
+
160
+ Promise executor runs synchronously (NOT A BUG):
161
+ ```
162
+ let value;
163
+ new Promise((resolve) => { value = 1; resolve(); });
164
+ console.log(value); // 1 - executor ran synchronously
165
+ ```
166
+
167
+ === ONLY REPORT IF ===
168
+ - Classification is CRITICAL or BUG (not CODE_SMELL, STYLE, or NOT_A_BUG)
169
+ - You can describe exact runtime manifestation
170
+ - You traced execution order and confirmed the issue
171
+ - You challenged your finding and still believe it's a bug
172
+
108
173
  # Code conventions
109
174
  code_conventions:
110
175
  title: "CODE CONVENTIONS"
@@ -10,15 +10,37 @@ export class DebugAgent extends Subagent {
10
10
  super(SubagentRole.DEBUG, configOverrides);
11
11
  }
12
12
  buildSystemPrompt() {
13
- return `Debugging agent. Fix the assigned bug.
13
+ return `Debugging agent. Fix verified bugs only.
14
+
15
+ STEP 1 - CLASSIFY (required):
16
+ CRITICAL: Crashes, data loss, security
17
+ BUG: Incorrect behavior
18
+ CODE_SMELL: Works but improvable (do NOT fix unless asked)
19
+ STYLE/NOT_A_BUG: Do NOT report or fix
20
+
21
+ STEP 2 - VERIFY before fixing:
22
+ - TRACE execution order line by line
23
+ - DESCRIBE exact runtime manifestation
24
+ - CHALLENGE: "What if this is actually correct?"
25
+
26
+ NOT A BUG (ignore these):
27
+ - catch (error: any) - valid TS pattern
28
+ - let vs const - lint preference
29
+ - Intentional type casts (as any)
30
+ - React useEffect local arrays - each effect has own closure
31
+ - setTimeout/setInterval return IMMEDIATELY (sync), callback runs later
32
+
33
+ ONLY FIX if:
34
+ - Classification is CRITICAL or BUG
35
+ - You traced execution and confirmed issue
36
+ - You can describe exact error/behavior
14
37
 
15
38
  Requirements:
16
- - Identify root cause before fixing
17
- - Make minimal changes to fix the issue
18
- - Add error handling if missing
19
- - Test the fix to verify it works
39
+ - Verify bug exists before fixing
40
+ - Make minimal changes
41
+ - Test the fix
20
42
 
21
- Be brief. Focus only on debugging.`;
43
+ Be brief. Focus only on CRITICAL and BUG classifications.`;
22
44
  }
23
45
  }
24
46
  //# sourceMappingURL=debug-agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug-agent.js","sourceRoot":"","sources":["../../../src/agent/specialized/debug-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAEzE,MAAM,OAAO,UAAW,SAAQ,QAAQ;IACtC,YAAY,eAAyC;QACnD,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAC7C,CAAC;IAES,iBAAiB;QACzB,OAAO;;;;;;;;mCAQwB,CAAC;IAClC,CAAC;CACF"}
1
+ {"version":3,"file":"debug-agent.js","sourceRoot":"","sources":["../../../src/agent/specialized/debug-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAEzE,MAAM,OAAO,UAAW,SAAQ,QAAQ;IACtC,YAAY,eAAyC;QACnD,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAC7C,CAAC;IAES,iBAAiB;QACzB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA8B+C,CAAC;IACzD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defai.digital/ax-cli",
3
- "version": "3.8.25",
3
+ "version": "3.8.27",
4
4
  "sdkVersion": "1.2.0",
5
5
  "description": "Enterprise-Class AI Command Line Interface - Primary support for GLM (General Language Model) with multi-provider AI orchestration powered by AutomatosX.",
6
6
  "type": "module",