@defai.digital/ax-cli 3.8.26 → 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.
|
@@ -109,32 +109,66 @@ system_prompt:
|
|
|
109
109
|
bug_review:
|
|
110
110
|
title: "BUG REVIEW PROTOCOL"
|
|
111
111
|
content: |
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
116
121
|
- Trace variable state at EACH line number
|
|
117
|
-
- "Line X assigns
|
|
122
|
+
- "Line X assigns, Line Y uses" - verify X executes before Y
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
- Describe EXACTLY how
|
|
121
|
-
- What error message or wrong behavior
|
|
124
|
+
STEP 3 - VERIFY THE BUG:
|
|
125
|
+
- Describe EXACTLY how it manifests at runtime
|
|
126
|
+
- What error message or wrong behavior occurs?
|
|
122
127
|
- Under what conditions does it trigger?
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
STEP 4 - CHALLENGE YOUR FINDING:
|
|
125
130
|
- "What if this code is actually correct?"
|
|
126
131
|
- "Am I confusing callback definition vs execution?"
|
|
127
|
-
- "
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
138
172
|
|
|
139
173
|
# Code conventions
|
|
140
174
|
code_conventions:
|
|
@@ -10,26 +10,37 @@ export class DebugAgent extends Subagent {
|
|
|
10
10
|
super(SubagentRole.DEBUG, configOverrides);
|
|
11
11
|
}
|
|
12
12
|
buildSystemPrompt() {
|
|
13
|
-
return `Debugging agent. Fix
|
|
13
|
+
return `Debugging agent. Fix verified bugs only.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
20
|
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
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
|
|
24
37
|
|
|
25
38
|
Requirements:
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- Add error handling if missing
|
|
30
|
-
- Test the fix to verify it works
|
|
39
|
+
- Verify bug exists before fixing
|
|
40
|
+
- Make minimal changes
|
|
41
|
+
- Test the fix
|
|
31
42
|
|
|
32
|
-
Be brief. Focus only on
|
|
43
|
+
Be brief. Focus only on CRITICAL and BUG classifications.`;
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
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
|
|
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.
|
|
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",
|