devagent-ai 0.3.1__tar.gz

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.
Files changed (51) hide show
  1. devagent_ai-0.3.1/LICENSE +21 -0
  2. devagent_ai-0.3.1/NOTICE +10 -0
  3. devagent_ai-0.3.1/PKG-INFO +415 -0
  4. devagent_ai-0.3.1/README.md +384 -0
  5. devagent_ai-0.3.1/agent/__init__.py +5 -0
  6. devagent_ai-0.3.1/agent/llm.py +6 -0
  7. devagent_ai-0.3.1/agent/loop.py +16 -0
  8. devagent_ai-0.3.1/agent/memory.py +5 -0
  9. devagent_ai-0.3.1/agent/prompts.py +3 -0
  10. devagent_ai-0.3.1/agent/tools.py +6 -0
  11. devagent_ai-0.3.1/devagent/__init__.py +3 -0
  12. devagent_ai-0.3.1/devagent/__main__.py +4 -0
  13. devagent_ai-0.3.1/devagent/artifacts.py +46 -0
  14. devagent_ai-0.3.1/devagent/cli.py +164 -0
  15. devagent_ai-0.3.1/devagent/config.py +72 -0
  16. devagent_ai-0.3.1/devagent/discovery.py +504 -0
  17. devagent_ai-0.3.1/devagent/evaluation.py +388 -0
  18. devagent_ai-0.3.1/devagent/memory.py +51 -0
  19. devagent_ai-0.3.1/devagent/models.py +251 -0
  20. devagent_ai-0.3.1/devagent/orchestrator.py +887 -0
  21. devagent_ai-0.3.1/devagent/providers.py +344 -0
  22. devagent_ai-0.3.1/devagent/report.py +52 -0
  23. devagent_ai-0.3.1/devagent/retrieval.py +478 -0
  24. devagent_ai-0.3.1/devagent/safety.py +131 -0
  25. devagent_ai-0.3.1/devagent/state_machine.py +45 -0
  26. devagent_ai-0.3.1/devagent/tasking.py +83 -0
  27. devagent_ai-0.3.1/devagent/workspace.py +199 -0
  28. devagent_ai-0.3.1/devagent/worktree.py +151 -0
  29. devagent_ai-0.3.1/devagent_ai.egg-info/PKG-INFO +415 -0
  30. devagent_ai-0.3.1/devagent_ai.egg-info/SOURCES.txt +49 -0
  31. devagent_ai-0.3.1/devagent_ai.egg-info/dependency_links.txt +1 -0
  32. devagent_ai-0.3.1/devagent_ai.egg-info/entry_points.txt +2 -0
  33. devagent_ai-0.3.1/devagent_ai.egg-info/requires.txt +9 -0
  34. devagent_ai-0.3.1/devagent_ai.egg-info/top_level.txt +2 -0
  35. devagent_ai-0.3.1/pyproject.toml +47 -0
  36. devagent_ai-0.3.1/setup.cfg +4 -0
  37. devagent_ai-0.3.1/tests/test_benchmark_catalog.py +28 -0
  38. devagent_ai-0.3.1/tests/test_capability_discovery.py +59 -0
  39. devagent_ai-0.3.1/tests/test_cli.py +29 -0
  40. devagent_ai-0.3.1/tests/test_discovery_memory.py +55 -0
  41. devagent_ai-0.3.1/tests/test_e2e_fake_provider.py +387 -0
  42. devagent_ai-0.3.1/tests/test_evaluation_harness.py +196 -0
  43. devagent_ai-0.3.1/tests/test_evaluation_matrix.py +45 -0
  44. devagent_ai-0.3.1/tests/test_evaluation_regression_evidence.py +30 -0
  45. devagent_ai-0.3.1/tests/test_packaging_metadata.py +25 -0
  46. devagent_ai-0.3.1/tests/test_production_hardening.py +99 -0
  47. devagent_ai-0.3.1/tests/test_retrieval.py +114 -0
  48. devagent_ai-0.3.1/tests/test_safety_workspace.py +95 -0
  49. devagent_ai-0.3.1/tests/test_structured_provider_contract.py +313 -0
  50. devagent_ai-0.3.1/tests/test_tasking_state.py +40 -0
  51. devagent_ai-0.3.1/tests/test_worktree.py +142 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tom Ha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ DevAgent
2
+
3
+ Copyright (c) 2026 Tom Ha
4
+
5
+ DevAgent was originally designed and developed by Tom Ha.
6
+ Original project: https://github.com/tomha85/devagent
7
+
8
+ DevAgent is open source software licensed under the MIT License. See LICENSE for the complete terms.
9
+
10
+ Third-party components, if any, remain subject to their respective licenses and notices.
@@ -0,0 +1,415 @@
1
+ Metadata-Version: 2.4
2
+ Name: devagent-ai
3
+ Version: 0.3.1
4
+ Summary: Evidence-driven local autonomous software engineering agent
5
+ Author: Tom Ha
6
+ Maintainer: Tom Ha
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/tomha85/devagent
9
+ Project-URL: Repository, https://github.com/tomha85/devagent
10
+ Project-URL: Issues, https://github.com/tomha85/devagent/issues
11
+ Project-URL: Changelog, https://github.com/tomha85/devagent/blob/main/CHANGELOG.md
12
+ Keywords: ai,agent,developer-tools,software-engineering,verification,local-first
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: openai>=1.40.0
25
+ Requires-Dist: anthropic>=0.34.0
26
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=8.0; extra == "dev"
29
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # DevAgent
33
+
34
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
35
+ [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/)
36
+ [![Status: Alpha](https://img.shields.io/badge/status-alpha-orange.svg)](#project-status)
37
+ [![Production CI](https://github.com/tomha85/devagent/actions/workflows/ci.yml/badge.svg)](https://github.com/tomha85/devagent/actions/workflows/ci.yml)
38
+
39
+ **A local, evidence-driven software engineering agent that turns a requirement into a tested, reviewed patch — while leaving commit, push, merge, and deploy decisions to the developer.**
40
+
41
+ DevAgent runs against a local repository. It discovers the application, gathers source evidence, compiles acceptance criteria, plans a bounded change, creates backups, implements the minimum necessary patch, runs repository-supported verification, reviews the final diff, and returns one final engineering report.
42
+
43
+ > **From requirement to verified local branch.**
44
+ >
45
+ > DevAgent can modify software. It does not publish software.
46
+
47
+ ## Why DevAgent?
48
+
49
+ Many coding agents optimize for generating code quickly. DevAgent is designed around a different question:
50
+
51
+ **Can the change be supported by repository evidence and verified locally?**
52
+
53
+ Core principles:
54
+
55
+ - **Local-first** — works against the developer's local repository and environment.
56
+ - **Evidence before modification** — implementation is blocked when source evidence is insufficient.
57
+ - **Minimal-change discipline** — prefer the smallest correct diff over broad refactors.
58
+ - **Backups before edits** — existing files are backed up before first modification.
59
+ - **Repository-native verification** — use commands supported by manifests, package scripts, tests, and CI evidence.
60
+ - **Independent review** — the final diff is reviewed separately from implementation.
61
+ - **Provider choice** — OpenAI, Anthropic/Claude, xAI/Grok, and OpenAI-compatible local endpoints.
62
+ - **No automatic publishing** — DevAgent does not commit, push, merge, rebase, or deploy.
63
+ - **Evidence-backed outcomes** — final status is `VERIFIED`, `PARTIALLY_VERIFIED`, or `BLOCKED`.
64
+
65
+ ## Quick start
66
+
67
+ ### Install
68
+
69
+ From PyPI:
70
+
71
+ ```bash
72
+ python -m pip install devagent-ai
73
+ ```
74
+
75
+ For an isolated CLI installation, `pipx` is recommended:
76
+
77
+ ```bash
78
+ pipx install devagent-ai
79
+ ```
80
+
81
+ Or install and develop directly from a source checkout:
82
+
83
+ ```bash
84
+ git clone https://github.com/tomha85/devagent.git
85
+ cd devagent
86
+ python -m venv .venv
87
+ source .venv/bin/activate
88
+ python -m pip install -e ".[dev]"
89
+ pytest -q
90
+ ```
91
+
92
+ Both installation paths expose the same `devagent` CLI. The PyPI distribution is named `devagent-ai`; a source checkout remains the best option for contributors.
93
+
94
+ ### Configure an AI provider
95
+
96
+ OpenAI example:
97
+
98
+ ```bash
99
+ devagent setup --provider openai --model YOUR_MODEL
100
+ export OPENAI_API_KEY=...
101
+ devagent doctor
102
+ ```
103
+
104
+ Anthropic example:
105
+
106
+ ```bash
107
+ devagent setup --provider anthropic --model YOUR_MODEL
108
+ export ANTHROPIC_API_KEY=...
109
+ devagent doctor
110
+ ```
111
+
112
+ OpenAI-compatible local endpoint:
113
+
114
+ ```bash
115
+ devagent setup \
116
+ --provider compatible \
117
+ --model local-model \
118
+ --base-url http://127.0.0.1:11434/v1
119
+ ```
120
+
121
+ DevAgent stores provider configuration and the **name** of the API-key environment variable. It does not store the API key itself.
122
+
123
+ ### Run
124
+
125
+ From the application repository you want DevAgent to work on:
126
+
127
+ ```bash
128
+ devagent "Fix websocket reconnect bug and add regression tests"
129
+ ```
130
+
131
+ Other inputs:
132
+
133
+ ```bash
134
+ devagent "Add CSV export to reports"
135
+ devagent --input error.log
136
+ pytest 2>&1 | devagent
137
+ devagent
138
+ ```
139
+
140
+ Useful commands:
141
+
142
+ ```bash
143
+ devagent --help
144
+ devagent --version
145
+ devagent setup --help
146
+ devagent doctor
147
+ devagent status
148
+ ```
149
+
150
+ Normal mode stays quiet apart from state updates and the final engineering report. `--verbose` exposes operational diagnostics, not hidden chain-of-thought.
151
+
152
+ ## What DevAgent does
153
+
154
+ A normal engineering run follows a deterministic lifecycle:
155
+
156
+ ```text
157
+ PREFLIGHT
158
+
159
+ DISCOVER
160
+
161
+ UNDERSTAND
162
+
163
+ TASK_SPEC / ACCEPTANCE CRITERIA
164
+
165
+ BASELINE
166
+
167
+ PLAN
168
+
169
+ GATHER_CONTEXT
170
+
171
+ REPRODUCE
172
+
173
+ IMPLEMENT MINIMAL PATCH
174
+
175
+ VERIFY_TARGETED
176
+
177
+ DIAGNOSE / REPLAN when needed
178
+
179
+ VERIFY_BROAD
180
+
181
+ INDEPENDENT REVIEW
182
+
183
+ QUALITY_CHECK
184
+
185
+ FINAL_VERIFY
186
+
187
+ LEARN
188
+
189
+ REPORT
190
+ ```
191
+
192
+ Python owns deterministic state transitions, safety gates, filesystem operations, verification validity, retry bounds, and final status. The model reasons inside bounded roles.
193
+
194
+ ## Evidence gate
195
+
196
+ DevAgent does not treat model confidence as evidence.
197
+
198
+ Before implementation, it expects enough repository evidence to support:
199
+
200
+ - the engineering problem,
201
+ - expected behavior,
202
+ - affected paths,
203
+ - likely root cause or design location,
204
+ - a minimal proposed solution,
205
+ - source evidence tying those claims to the repository.
206
+
207
+ If the evidence is insufficient, `BLOCKED` is the correct result.
208
+
209
+ ## Verification model
210
+
211
+ Verification is evidence-driven and revision-aware.
212
+
213
+ Depending on the repository, DevAgent can run:
214
+
215
+ - baseline tests,
216
+ - targeted tests,
217
+ - broader unit/component tests,
218
+ - functional or integration checks,
219
+ - build commands,
220
+ - lint/type checks,
221
+ - `git diff --check`,
222
+ - final current-revision verification.
223
+
224
+ Each verification result records the command, exit code, duration, output, failure classification, phase, and workspace revision.
225
+
226
+ A code modification invalidates prior successful verification for the old revision.
227
+
228
+ ## Outcome contract
229
+
230
+ ### `VERIFIED`
231
+
232
+ Used only when the current implementation has sufficient acceptance evidence, applicable verification passes, no known new regression remains, scope is acceptable, and independent review approves the final diff.
233
+
234
+ ### `PARTIALLY_VERIFIED`
235
+
236
+ Used when implementation evidence exists but meaningful verification cannot be completed, commonly because of environmental, hardware, VPN, credential, or external-service limitations.
237
+
238
+ ### `BLOCKED`
239
+
240
+ Used when DevAgent cannot safely understand, implement, or verify the task.
241
+
242
+ DevAgent is intentionally conservative: a truthful `BLOCKED` is better than a false `VERIFIED`.
243
+
244
+ ## Safety boundary
245
+
246
+ DevAgent uses defense-in-depth controls around repository modification and command execution.
247
+
248
+ - Clean Git repositories use a retained detached worktree by default.
249
+ - Pre-existing dirty developer files are protected.
250
+ - Existing files are backed up before their first modification.
251
+ - Workspace paths are confined and checked against symlink escape.
252
+ - Secret-like paths such as `.env*`, private keys, SSH/AWS credentials, and generated dependency trees are excluded from automatic reads.
253
+ - Commands run as argv without a shell.
254
+ - Credential environment variables are scrubbed from verification subprocesses where appropriate.
255
+ - Publishing and destructive operations are blocked.
256
+ - DevAgent never automatically commits, pushes, merges, rebases, or deploys.
257
+
258
+ DevAgent is **not** an operating-system sandbox. Always review the final report and diff before publishing changes.
259
+
260
+ ## Repository intelligence
261
+
262
+ DevAgent discovers repository structure from source files and repository-native evidence such as:
263
+
264
+ - `README` / contribution documentation,
265
+ - `pyproject.toml`, `requirements.txt`, `pytest.ini`,
266
+ - `package.json`, lockfiles, TypeScript configuration,
267
+ - `Cargo.toml`, `go.mod`,
268
+ - Maven and Gradle files,
269
+ - CMake / Make / Meson,
270
+ - `.sln` / `.csproj`,
271
+ - Docker and Compose files,
272
+ - GitHub Actions, Jenkins, GitLab CI, and Azure Pipelines.
273
+
274
+ Current discovery supports Python, JavaScript/TypeScript, React-style projects, Go, Rust, Java, C/C++, .NET, Make-based projects, and multi-component repositories.
275
+
276
+ CI is treated as executable documentation when it provides safe, bounded command evidence.
277
+
278
+ ## Provider architecture
279
+
280
+ The engineering workflow is model-independent. Providers implement a common request contract.
281
+
282
+ Currently supported:
283
+
284
+ | Provider | Configuration |
285
+ | --- | --- |
286
+ | OpenAI | `--provider openai` |
287
+ | Anthropic / Claude | `--provider anthropic` |
288
+ | xAI / Grok | `--provider xai` |
289
+ | Local / compatible | `--provider compatible --base-url ...` |
290
+
291
+ The goal is to let developers choose the model that fits their accuracy, privacy, latency, and cost requirements without changing the core engineering workflow.
292
+
293
+ ## Example final report
294
+
295
+ ```text
296
+ DEVAGENT REPORT
297
+
298
+ STATUS
299
+ VERIFIED
300
+
301
+ TASK
302
+ Handle division by zero safely and add a regression test.
303
+
304
+ ROOT CAUSE
305
+ The divide path did not explicitly handle a zero divisor.
306
+
307
+ IMPLEMENTATION
308
+ - Added bounded zero-divisor handling
309
+ - Added regression coverage
310
+
311
+ FILES CHANGED
312
+ calculator.py
313
+ test_calculator.py
314
+
315
+ VERIFICATION
316
+ PASS targeted tests
317
+ PASS broader tests
318
+ PASS git diff --check
319
+
320
+ NEW REGRESSIONS
321
+ None detected
322
+
323
+ SOURCE CONTROL
324
+ No commit
325
+ No push
326
+ No merge
327
+
328
+ DEVELOPER ACTION
329
+ Review the diff before publishing.
330
+ ```
331
+
332
+ ## Local run data
333
+
334
+ DevAgent keeps run artifacts under the target repository's `.devagent/` state:
335
+
336
+ ```text
337
+ .devagent/
338
+ ├── runs/<run-id>/
339
+ │ ├── metadata.json
340
+ │ ├── backups/
341
+ │ ├── observations.jsonl
342
+ │ ├── verification.json
343
+ │ └── report.json
344
+ ├── worktrees/<run-id>/
345
+ └── memory/
346
+ ├── repository.json
347
+ └── strategies.json
348
+ ```
349
+
350
+ Repository facts are tied to evidence fingerprints and can be invalidated when their source changes.
351
+
352
+ ## Development
353
+
354
+ Run the test suite:
355
+
356
+ ```bash
357
+ python -m compileall devagent
358
+ pytest -q
359
+ git diff --check
360
+ ```
361
+
362
+ Install the current checkout in editable mode:
363
+
364
+ ```bash
365
+ pip install -e ".[dev]"
366
+ ```
367
+
368
+ Automated tests use a deterministic fake provider and do not consume cloud-model credits.
369
+
370
+ ## Project status
371
+
372
+ DevAgent is currently **alpha software**. The core evidence-driven workflow is functional, but real-provider behavior and repository coverage are still being hardened through disposable end-to-end engineering fixtures.
373
+
374
+ Near-term focus:
375
+
376
+ - real-provider contract hardening,
377
+ - stronger repository context retrieval,
378
+ - safer verification-capability discovery,
379
+ - worktree lifecycle improvements,
380
+ - more realistic multi-language evaluation fixtures,
381
+ - packaging and release quality.
382
+
383
+ The project intentionally prioritizes trustworthy outcomes over feature count.
384
+
385
+ ## Contributing
386
+
387
+ Contributions are welcome.
388
+
389
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. In particular, changes to DevAgent's safety or verification behavior should include regression tests and must not weaken the no-publish boundary.
390
+
391
+ For bugs and feature requests, use the [GitHub issue tracker](https://github.com/tomha85/devagent/issues).
392
+
393
+ ## Security
394
+
395
+ Please do not publish sensitive vulnerability details in a public issue.
396
+
397
+ See [SECURITY.md](SECURITY.md) for the current reporting process and security scope.
398
+
399
+ ## License
400
+
401
+ DevAgent is open source under the [MIT License](LICENSE).
402
+
403
+ ```text
404
+ Copyright (c) 2026 Tom Ha
405
+ ```
406
+
407
+ The MIT license permits use, copying, modification, merging, publishing, distribution, sublicensing, and sale of copies, provided the copyright and permission notice are retained as required by the license.
408
+
409
+ ## Author and original project
410
+
411
+ DevAgent was created by **Tom Ha**.
412
+
413
+ Original repository: **https://github.com/tomha85/devagent**
414
+
415
+ See [NOTICE](NOTICE) and [COPYRIGHT](COPYRIGHT) for project attribution.