execution-agent 0.1.0__py3-none-any.whl
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.
- execution_agent/__init__.py +8 -0
- execution_agent/__main__.py +5 -0
- execution_agent/agent.py +955 -0
- execution_agent/commands_interface.json +7 -0
- execution_agent/config.py +21 -0
- execution_agent/context.py +1565 -0
- execution_agent/docker_helpers_static.py +593 -0
- execution_agent/env.py +61 -0
- execution_agent/exceptions.py +17 -0
- execution_agent/exit_artifacts.py +350 -0
- execution_agent/main.py +1234 -0
- execution_agent/prompt_files/c_guidelines +481 -0
- execution_agent/prompt_files/command_stuck +7 -0
- execution_agent/prompt_files/cpp_guidelines +481 -0
- execution_agent/prompt_files/cycle_instruction +51 -0
- execution_agent/prompt_files/java_guidelines +37 -0
- execution_agent/prompt_files/javascript_guidelines +69 -0
- execution_agent/prompt_files/latest_containter_technology +7 -0
- execution_agent/prompt_files/python_guidelines +48 -0
- execution_agent/prompt_files/remove_progress_bars +1 -0
- execution_agent/prompt_files/rust_guidelines +53 -0
- execution_agent/prompt_files/search_workflows_summary +121 -0
- execution_agent/prompt_files/steps_list.json +32 -0
- execution_agent/prompt_files/summarize_cycle +13 -0
- execution_agent/prompt_files/tools_list +99 -0
- execution_agent/prompt_logging.py +311 -0
- execution_agent/repetition.py +39 -0
- execution_agent/shared_utils.py +507 -0
- execution_agent/state_persistence.py +286 -0
- execution_agent/tools.py +1611 -0
- execution_agent/trace_to_bash.py +281 -0
- execution_agent-0.1.0.dist-info/METADATA +231 -0
- execution_agent-0.1.0.dist-info/RECORD +37 -0
- execution_agent-0.1.0.dist-info/WHEEL +5 -0
- execution_agent-0.1.0.dist-info/entry_points.txt +2 -0
- execution_agent-0.1.0.dist-info/licenses/LICENSE.md +46 -0
- execution_agent-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
## General Guidelines :
|
|
2
|
+
**General C/C++ Project Guidelines**
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
**General C/C++ Project Guidelines**
|
|
6
|
+
|
|
7
|
+
1. **Read README**
|
|
8
|
+
|
|
9
|
+
* Contains install, usage, and project-specific notes.
|
|
10
|
+
|
|
11
|
+
2. **Check Dependencies**
|
|
12
|
+
|
|
13
|
+
* Look in README, `CMakeLists.txt`, `Makefile`, or `vcpkg.json`.
|
|
14
|
+
* Install required compiler and “-dev” packages.
|
|
15
|
+
|
|
16
|
+
3. **Identify Build Tool**
|
|
17
|
+
|
|
18
|
+
* Find `Makefile` (Make) or `CMakeLists.txt` (CMake).
|
|
19
|
+
|
|
20
|
+
4. **Build**
|
|
21
|
+
|
|
22
|
+
* **Make**:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
make
|
|
26
|
+
```
|
|
27
|
+
* **CMake** (out-of-source):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
mkdir -p build && cd build
|
|
31
|
+
cmake .. # add -DCMAKE_BUILD_TYPE=Debug/Release or -G Ninja as needed
|
|
32
|
+
make -j$(nproc)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
5. **Configuration**
|
|
36
|
+
|
|
37
|
+
* Check for `.conf` or `config.h`.
|
|
38
|
+
* Pass paths/flags if needed, e.g. `-DFoo_DIR=/path`.
|
|
39
|
+
|
|
40
|
+
6. **Run Tests**
|
|
41
|
+
|
|
42
|
+
* **CTest**:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
ctest --output-on-failure
|
|
46
|
+
```
|
|
47
|
+
* Or run test executables directly.
|
|
48
|
+
|
|
49
|
+
7. **Run Executable**
|
|
50
|
+
|
|
51
|
+
* Follow README (e.g., `./myapp` or server start commands).
|
|
52
|
+
|
|
53
|
+
8. **Troubleshoot**
|
|
54
|
+
|
|
55
|
+
* Search GitHub issues or web.
|
|
56
|
+
* Rebuild clean, enable verbose (`make VERBOSE=1`, `ninja -v`), grep for “error:”/“warning:”.
|
|
57
|
+
|
|
58
|
+
9. **Documentation**
|
|
59
|
+
|
|
60
|
+
* Read Doxygen/API docs or inline comments for structure and usage.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
**Make/CMake–Specific Guide**
|
|
65
|
+
|
|
66
|
+
### 1. Basic Workflow
|
|
67
|
+
|
|
68
|
+
1. **Locate Build Files**
|
|
69
|
+
|
|
70
|
+
* CMake: top-level `CMakeLists.txt`.
|
|
71
|
+
* Make: root or subdirectory `Makefile`.
|
|
72
|
+
|
|
73
|
+
2. **Prepare Build Directory**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mkdir -p build && cd build
|
|
77
|
+
# If it exists:
|
|
78
|
+
rm -rf CMakeCache.txt CMakeFiles/*
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. **Configure (CMake)**
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
cmake .. # default
|
|
85
|
+
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
|
86
|
+
cmake -G Ninja .. # if using Ninja
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. **Build**
|
|
90
|
+
|
|
91
|
+
* **Make**:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
make -j$(nproc) # parallel
|
|
95
|
+
make -j1 # fail-fast
|
|
96
|
+
```
|
|
97
|
+
* **Ninja**:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
ninja # stops on first error
|
|
101
|
+
ninja -v # verbose
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
5. **Run Tests**
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
ctest -j$(nproc) --output-on-failure
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Or:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
make test # or make check
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Custom runners: follow README or look in `tests/`.
|
|
117
|
+
|
|
118
|
+
6. **Check Exit Codes**
|
|
119
|
+
|
|
120
|
+
* Nonzero from `make`/`ninja`/`ctest` → failure; inspect logs or verbosity.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### 2. Common CMake Issues
|
|
125
|
+
|
|
126
|
+
1. **Cannot Find Package X**
|
|
127
|
+
|
|
128
|
+
* **Symptom**:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
CMake Error: find_package(Foo) didn't find Foo
|
|
132
|
+
```
|
|
133
|
+
* **Fix**:
|
|
134
|
+
|
|
135
|
+
* Install “foo-dev” (e.g. `sudo apt-get install libfoo-dev`).
|
|
136
|
+
* Or:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cmake -DFoo_DIR=/path/to/foo/cmake ..
|
|
140
|
+
cmake -DCMAKE_PREFIX_PATH=/opt/foo ..
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
2. **Stale Cache / Persisting Options**
|
|
144
|
+
|
|
145
|
+
* **Symptom**: Changes not applied; missing headers despite install.
|
|
146
|
+
* **Fix**:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
cd build
|
|
150
|
+
rm -rf CMakeCache.txt CMakeFiles
|
|
151
|
+
cmake ..
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Or override with `-DVAR=…` on the command line.
|
|
155
|
+
|
|
156
|
+
3. **Missing/Incorrect Include Directories**
|
|
157
|
+
|
|
158
|
+
* **Symptom**:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
fatal error: bar.h: No such file or directory
|
|
162
|
+
```
|
|
163
|
+
* **Fix**:
|
|
164
|
+
|
|
165
|
+
* Check `target_include_directories(...)`:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
grep -R "target_include_directories" -n ../CMakeLists.txt
|
|
169
|
+
```
|
|
170
|
+
* Build verbosely to inspect `-I` flags:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
make VERBOSE=1 # or ninja -v
|
|
174
|
+
```
|
|
175
|
+
* Test manually:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
g++ -I/path/to/bar/include -c foo.cpp
|
|
179
|
+
```
|
|
180
|
+
* Then add e.g.
|
|
181
|
+
|
|
182
|
+
```cmake
|
|
183
|
+
target_include_directories(myTarget PUBLIC /path/to/bar/include)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
4. **Undefined Reference (Linker)**
|
|
187
|
+
|
|
188
|
+
* **Symptom**:
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
undefined reference to `Bar::baz()`
|
|
192
|
+
```
|
|
193
|
+
* **Fix**:
|
|
194
|
+
|
|
195
|
+
* Ensure `target_link_libraries(foo PRIVATE BarLib)` in CMake.
|
|
196
|
+
* For static libs:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
g++ foo.o -o foo libbar.a
|
|
200
|
+
```
|
|
201
|
+
* Avoid circular static-library dependencies; split or use shared libs.
|
|
202
|
+
|
|
203
|
+
5. **No Tests Found / CTest Shows 0 Tests**
|
|
204
|
+
|
|
205
|
+
* **Symptom**:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
No tests were found!!!
|
|
209
|
+
```
|
|
210
|
+
* **Fix**:
|
|
211
|
+
|
|
212
|
+
* In `CMakeLists.txt`, enable tests if behind an option:
|
|
213
|
+
|
|
214
|
+
```cmake
|
|
215
|
+
option(ENABLE_TESTS "Enable tests" OFF)
|
|
216
|
+
if(ENABLE_TESTS)
|
|
217
|
+
add_subdirectory(tests)
|
|
218
|
+
endif()
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Then:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
cmake -DENABLE_TESTS=ON ..
|
|
225
|
+
make && ctest --output-on-failure
|
|
226
|
+
```
|
|
227
|
+
* Verify test executables in `build/tests/`.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### 3. Common Make Issues
|
|
232
|
+
|
|
233
|
+
1. **Wrong Compiler Flags**
|
|
234
|
+
|
|
235
|
+
* **Symptom**:
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
gcc: error: unrecognized command line option ‘-std=c++17’
|
|
239
|
+
```
|
|
240
|
+
* **Fix**:
|
|
241
|
+
|
|
242
|
+
* Edit Makefile:
|
|
243
|
+
|
|
244
|
+
```makefile
|
|
245
|
+
CXX := g++
|
|
246
|
+
CXXFLAGS := -Wall -Wextra -std=c++17
|
|
247
|
+
```
|
|
248
|
+
* Or override:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
make CXX=clang++ CXXFLAGS="-std=c++17 -O2"
|
|
252
|
+
```
|
|
253
|
+
* Ensure toolchain consistency:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
export CC=gcc CXX=g++
|
|
257
|
+
make clean && make
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
2. **Stale Builds / Missing Dependencies**
|
|
261
|
+
|
|
262
|
+
* **Symptom**: Header change doesn’t recompile dependent objects.
|
|
263
|
+
* **Fix**:
|
|
264
|
+
|
|
265
|
+
* Add auto-generated `.d` files:
|
|
266
|
+
|
|
267
|
+
```makefile
|
|
268
|
+
SRCS := $(wildcard src/*.cpp)
|
|
269
|
+
DEPS := $(SRCS:.cpp=.d)
|
|
270
|
+
OBJS := $(SRCS:.cpp=.o)
|
|
271
|
+
|
|
272
|
+
-include $(DEPS)
|
|
273
|
+
|
|
274
|
+
%.o: %.cpp
|
|
275
|
+
$(CXX) $(CXXFLAGS) -MMD -MF $(@:.o=.d) -c $< -o $@
|
|
276
|
+
|
|
277
|
+
myapp: $(OBJS)
|
|
278
|
+
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
|
|
279
|
+
```
|
|
280
|
+
* If unmodifiable, force clean rebuild:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
make clean && make -j$(nproc)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
or delete objects:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
find . -name '*.o' -delete && make
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
3. **Parallel Race Conditions**
|
|
293
|
+
|
|
294
|
+
* **Symptom**:
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
No rule to make target 'moduleA/libbar.a'
|
|
298
|
+
```
|
|
299
|
+
* **Fix**:
|
|
300
|
+
|
|
301
|
+
* Confirm serial build:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
make -j1
|
|
305
|
+
```
|
|
306
|
+
* Add missing dependencies in Makefile, e.g.:
|
|
307
|
+
|
|
308
|
+
```makefile
|
|
309
|
+
moduleB/foo.o: ../moduleA/libbar.a
|
|
310
|
+
```
|
|
311
|
+
* If no write access, build `-j1`.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### 4. Spotting Errors Quickly
|
|
316
|
+
|
|
317
|
+
1. **Grep for Errors/Warnings**
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
make -j$(nproc) 2>&1 | tee build.log | grep --color -i "error:\|warning:"
|
|
321
|
+
grep -n "error:" build.log
|
|
322
|
+
grep -n "warning:" build.log
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
2. **Enable Verbose Mode**
|
|
326
|
+
|
|
327
|
+
* **Make**: `make VERBOSE=1`
|
|
328
|
+
* **Ninja**: `ninja -v`
|
|
329
|
+
|
|
330
|
+
3. **Fail-Fast Builds**
|
|
331
|
+
|
|
332
|
+
* **Make**:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
make -j1 # stops on first error
|
|
336
|
+
make -k -j$(nproc) # continues despite errors
|
|
337
|
+
```
|
|
338
|
+
* **Ninja**: stops on first error by default.
|
|
339
|
+
|
|
340
|
+
4. **CTest Output**
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
ctest --output-on-failure
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### 5. Common Pitfalls & Prevention
|
|
349
|
+
|
|
350
|
+
1. **Mixing Build Artifacts with Source**
|
|
351
|
+
|
|
352
|
+
* **Issue**: `.o` or generated files in source tree → clutter and stale artifacts.
|
|
353
|
+
* **Tip**: Always do out-of-source builds:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
mkdir build && cd build && cmake ../ && make
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
If forced in-source, run `make clean` or delete files manually.
|
|
360
|
+
|
|
361
|
+
2. **Silent Failures in Scripts/Tests**
|
|
362
|
+
|
|
363
|
+
* **Issue**: Test scripts hide exit codes (`set -e` missing).
|
|
364
|
+
* **Tip**:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
./run_tests.sh 2>&1 | tee test_run.log
|
|
368
|
+
grep -i "fail" test_run.log
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
3. **Mismatched Compiler Versions/ABI**
|
|
372
|
+
|
|
373
|
+
* **Issue**: Project expects GCC 8 but system has GCC 5.
|
|
374
|
+
* **Tip**:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
cd build
|
|
378
|
+
grep "CMAKE_CXX_COMPILER" CMakeCache.txt
|
|
379
|
+
export CC=gcc-9 CXX=g++-9
|
|
380
|
+
cmake ..
|
|
381
|
+
make
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
For Makefiles:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
make CC=gcc-9 CXX=g++-9
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
4. **Circular/Missing Submodule Dependencies**
|
|
391
|
+
|
|
392
|
+
* **Issue**: `moduleA` needs `moduleB` but scripts omit linkage.
|
|
393
|
+
* **Tip**:
|
|
394
|
+
|
|
395
|
+
* **Make**: add `moduleB/libB.a` as a prerequisite.
|
|
396
|
+
* **CMake**: `target_link_libraries(moduleA PUBLIC moduleB)`.
|
|
397
|
+
* If unmodifiable, build sequentially:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
(cd moduleB && make)
|
|
401
|
+
(cd moduleA && make)
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
5. **Outdated CMakeLists (Using `file(GLOB ...)`)**
|
|
405
|
+
|
|
406
|
+
* **Issue**: New `.cpp` files aren’t detected until CMake reruns.
|
|
407
|
+
* **Tip**:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
cd build
|
|
411
|
+
rm -rf CMakeCache.txt CMakeFiles
|
|
412
|
+
cmake ..
|
|
413
|
+
make -j$(nproc)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
### 6. Quick Error-Fix Recipes
|
|
419
|
+
|
|
420
|
+
1. **“Could not find package XYZ”**
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
sudo apt-get update
|
|
424
|
+
sudo apt-get install libxyz-dev
|
|
425
|
+
cd build
|
|
426
|
+
rm -rf CMakeCache.txt CMakeFiles
|
|
427
|
+
cmake ..
|
|
428
|
+
make -j$(nproc)
|
|
429
|
+
# If in custom prefix:
|
|
430
|
+
cmake -DCMAKE_PREFIX_PATH=/opt/xyz ..
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
2. **Missing Headers (“No such file or directory”)**
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
cd build
|
|
437
|
+
make VERBOSE=1 2>&1 | tee verbose.log
|
|
438
|
+
grep -n "fatal error: .* No such file or directory" verbose.log
|
|
439
|
+
# Add missing include via CMakeLists or Makefile once identified.
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
3. **“Undefined Reference …” (Linker)**
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
cd build
|
|
446
|
+
make VERBOSE=1 -j1 2>&1 | tee link.log
|
|
447
|
+
grep -n "undefined reference" link.log
|
|
448
|
+
# Ensure the library supplying the symbol appears after objects; adjust CMakeLists or rebuild.
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
4. **Tests Fail Silently (Exit Code 0 But Wrong Behavior)**
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
cd build
|
|
455
|
+
ctest --output-on-failure | tee test.log
|
|
456
|
+
grep -i "fail" test.log
|
|
457
|
+
grep -i "error" test.log
|
|
458
|
+
# If none, run test binaries manually:
|
|
459
|
+
./tests/test_moduleA
|
|
460
|
+
valgrind ./tests/test_moduleA
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
5. **CMake Not Picking Up New Files (`file(GLOB)`)**
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
cd build
|
|
467
|
+
rm -rf CMakeCache.txt CMakeFiles
|
|
468
|
+
cmake ..
|
|
469
|
+
make -j$(nproc)
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
### 7. Test Suite Results
|
|
475
|
+
|
|
476
|
+
When running a test suite, it is normal for some test cases to fail. If the percentage of failing test cases is less than 20% of the total number, it is considered acceptable, and further investigation is not necessary.
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
---
|
|
480
|
+
END OF LANGUAGE SPECIFIC GUIDELINES SETCTION
|
|
481
|
+
---
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[INSTRUCTIONS:
|
|
2
|
+
You can interact with the terminal again either by calling terminal with special command TERMINATE as input to terminate the stuck command. Or you can give WAIT as input to wait more. Or you can type in something to the terminal in case the stuck command is waiting for some extra input. You can do this by passing WRITE:HERE_YOU_GIVE_THE_INPUT_TO_THE_STUCK_COMMAND
|
|
3
|
+
Examples:
|
|
4
|
+
{"command": {"name": "linux_terminal", "args": {"command": "TERMINATE"}}}
|
|
5
|
+
{"command": {"name": "linux_terminal", "args": {"command": "WAIT"}}}
|
|
6
|
+
{"command": {"name": "linux_terminal", "args": {"command": "WRITE:yes"}}}
|
|
7
|
+
]
|