agent-self-edit 0.1.0__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 (59) hide show
  1. agent_self_edit-0.1.0/LICENSE +21 -0
  2. agent_self_edit-0.1.0/PKG-INFO +166 -0
  3. agent_self_edit-0.1.0/README.md +143 -0
  4. agent_self_edit-0.1.0/pyproject.toml +62 -0
  5. agent_self_edit-0.1.0/setup.cfg +4 -0
  6. agent_self_edit-0.1.0/src/agent_self_edit/__init__.py +1 -0
  7. agent_self_edit-0.1.0/src/agent_self_edit/ab_test.py +332 -0
  8. agent_self_edit-0.1.0/src/agent_self_edit/adapters/__init__.py +7 -0
  9. agent_self_edit-0.1.0/src/agent_self_edit/adapters/base.py +27 -0
  10. agent_self_edit-0.1.0/src/agent_self_edit/adapters/file.py +66 -0
  11. agent_self_edit-0.1.0/src/agent_self_edit/adapters/stdin.py +48 -0
  12. agent_self_edit-0.1.0/src/agent_self_edit/analyzer.py +399 -0
  13. agent_self_edit-0.1.0/src/agent_self_edit/cli/__init__.py +43 -0
  14. agent_self_edit-0.1.0/src/agent_self_edit/cli/diff.py +36 -0
  15. agent_self_edit-0.1.0/src/agent_self_edit/cli/guardrails.py +45 -0
  16. agent_self_edit-0.1.0/src/agent_self_edit/cli/ingest.py +44 -0
  17. agent_self_edit-0.1.0/src/agent_self_edit/cli/init.py +39 -0
  18. agent_self_edit-0.1.0/src/agent_self_edit/cli/lineage.py +32 -0
  19. agent_self_edit-0.1.0/src/agent_self_edit/cli/propose.py +121 -0
  20. agent_self_edit-0.1.0/src/agent_self_edit/cli/rollback.py +26 -0
  21. agent_self_edit-0.1.0/src/agent_self_edit/cli/run.py +125 -0
  22. agent_self_edit-0.1.0/src/agent_self_edit/cli/status.py +66 -0
  23. agent_self_edit-0.1.0/src/agent_self_edit/cli/validate.py +81 -0
  24. agent_self_edit-0.1.0/src/agent_self_edit/config.py +220 -0
  25. agent_self_edit-0.1.0/src/agent_self_edit/diff.py +298 -0
  26. agent_self_edit-0.1.0/src/agent_self_edit/gate.py +444 -0
  27. agent_self_edit-0.1.0/src/agent_self_edit/guardrails.py +334 -0
  28. agent_self_edit-0.1.0/src/agent_self_edit/llm/__init__.py +7 -0
  29. agent_self_edit-0.1.0/src/agent_self_edit/llm/base.py +26 -0
  30. agent_self_edit-0.1.0/src/agent_self_edit/llm/mock.py +62 -0
  31. agent_self_edit-0.1.0/src/agent_self_edit/llm/openai.py +138 -0
  32. agent_self_edit-0.1.0/src/agent_self_edit/registry.py +406 -0
  33. agent_self_edit-0.1.0/src/agent_self_edit/scorers.py +115 -0
  34. agent_self_edit-0.1.0/src/agent_self_edit/tasks.py +107 -0
  35. agent_self_edit-0.1.0/src/agent_self_edit/trace.py +280 -0
  36. agent_self_edit-0.1.0/src/agent_self_edit/types.py +161 -0
  37. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/PKG-INFO +166 -0
  38. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/SOURCES.txt +57 -0
  39. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/dependency_links.txt +1 -0
  40. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/entry_points.txt +2 -0
  41. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/requires.txt +13 -0
  42. agent_self_edit-0.1.0/src/agent_self_edit.egg-info/top_level.txt +1 -0
  43. agent_self_edit-0.1.0/tests/test_ab_test.py +244 -0
  44. agent_self_edit-0.1.0/tests/test_adapters.py +149 -0
  45. agent_self_edit-0.1.0/tests/test_analyzer.py +355 -0
  46. agent_self_edit-0.1.0/tests/test_cli.py +385 -0
  47. agent_self_edit-0.1.0/tests/test_config.py +385 -0
  48. agent_self_edit-0.1.0/tests/test_diff.py +290 -0
  49. agent_self_edit-0.1.0/tests/test_docker.py +563 -0
  50. agent_self_edit-0.1.0/tests/test_field_test.py +245 -0
  51. agent_self_edit-0.1.0/tests/test_gate.py +558 -0
  52. agent_self_edit-0.1.0/tests/test_guardrails.py +409 -0
  53. agent_self_edit-0.1.0/tests/test_llm.py +94 -0
  54. agent_self_edit-0.1.0/tests/test_registry.py +408 -0
  55. agent_self_edit-0.1.0/tests/test_scaffold.py +10 -0
  56. agent_self_edit-0.1.0/tests/test_scorers.py +163 -0
  57. agent_self_edit-0.1.0/tests/test_tasks.py +213 -0
  58. agent_self_edit-0.1.0/tests/test_trace.py +210 -0
  59. agent_self_edit-0.1.0/tests/test_types.py +109 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Debashish Ghosal
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,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-self-edit
3
+ Version: 0.1.0
4
+ Summary: An agent that rewrites its own system prompt from execution feedback
5
+ Author: Debashish Ghosal
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/deghosal-2026/agent-self-edit
8
+ Project-URL: Repository, https://github.com/deghosal-2026/agent-self-edit.git
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: click>=8.1
13
+ Requires-Dist: pyyaml>=6.0
14
+ Requires-Dist: numpy>=1.24
15
+ Requires-Dist: scipy>=1.10
16
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
17
+ Provides-Extra: dev
18
+ Requires-Dist: pytest>=7.4; extra == "dev"
19
+ Requires-Dist: pytest-cov>=4.1; extra == "dev"
20
+ Requires-Dist: ruff>=0.1; extra == "dev"
21
+ Requires-Dist: mypy>=1.7; extra == "dev"
22
+ Dynamic: license-file
23
+
24
+ # AgentSelfEdit
25
+
26
+ **An agent that rewrites its own system prompt from execution feedback — proposing edits, A/B testing them against a held-out task set, and promoting only statistically-proven winners under deterministic guardrails.**
27
+
28
+ The agentic ecosystem raced ahead on orchestration and retrieval, but skipped the capability that would make agents feel alive: the ability to get measurably better at their own job over time. AgentSelfEdit turns prompt optimization into a self-sustaining, evidence-driven loop with provenance, rollback, and guardrails.
29
+
30
+ ## Why
31
+
32
+ Most production agents are prompt-tuned once by hand — usually by the human who wrote them, usually once, then never again. The prompt freezes the moment it ships. Every recurring failure is silently absorbed until a human manually tunes again. And the agent that sees the most failure data is the least able to use it.
33
+
34
+ Two common answers are not enough:
35
+ - **"Reflection" is not learning.** Appending a paragraph of prose to context makes prompts longer, not better. The prompt itself never changes, so the same failure repeats tomorrow.
36
+ - **Sharing the raw prompt optimizer** with an LLM breaks everything. Unmanaged, LLM-judged edits poison the baseline within a few iterations.
37
+
38
+ AgentSelfEdit turns prompt optimization into a **self-sustaining, evidence-driven loop** with provenance, rollback, and guardrails — and it is designed as a **sidecar**. It does not modify the agent's runtime. It observes execution traces and proposes prompt edits.
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ # Install
44
+ pip install agent-self-edit
45
+
46
+ # Scaffold a project
47
+ agent-self-edit init
48
+
49
+ # Run the self-improvement loop
50
+ agent-self-edit run --once
51
+
52
+ # Or in Docker (requires local OMLX or OpenRouter key)
53
+ docker build -t agent-self-edit .
54
+ docker run --rm --network=host agent-self-edit run --once
55
+ ```
56
+
57
+ ## How It Works
58
+
59
+ ```
60
+ Agent executes task ──▶ Execution trace stored (SQLite)
61
+
62
+
63
+ Feedback Analyzer (LLM)
64
+ reviews traces, proposes concrete edits,
65
+ each with a written hypothesis
66
+
67
+
68
+ ───────────────────── A/B Test Engine ─────────────────────
69
+ candidate edit vs current prompt on a held-out task set:
70
+ win rate, bootstrap confidence interval, effect size,
71
+ permutation p-value, per-task breakdown
72
+ ────────────────────────────────────────────────────────────
73
+
74
+
75
+ Promotion Gate (deterministic checks)
76
+ 1. Sample floor 4. Frozen sections
77
+ 2. Effect size 5. Edit-distance limit
78
+ 3. Confidence p-val 6. Drift detection
79
+
80
+ ┌─────────────────┼─────────────────┐
81
+ ▼ ▼ ▼
82
+ Promoted Near-miss Rejected
83
+ prompt updated in logged for archived with
84
+ versioned Registry human review full reasoning
85
+ ```
86
+
87
+ 1. **Analyze** — After each task, an LLM reviews the execution trace and identifies what went wrong: the specific instruction that was missing, ambiguous, or wrong.
88
+ 2. **Propose** — It proposes one or more concrete, minimal prompt edits, each with a stated hypothesis about why it should improve outcomes.
89
+ 3. **Test** — Each candidate edit is A/B tested against the current prompt on a held-out task set, with confidence intervals, effect-size thresholds, and a minimum sample floor before any promotion decision.
90
+ 4. **Promote or Archive** — The statistically-proven winner becomes the new baseline. The loser is archived with its full reasoning.
91
+ 5. **Guard** — Frozen core sections, edit-distance limits, and drift detection keep the agent from rewriting itself into a worse version over hundreds of iterations.
92
+
93
+ ## Core Components
94
+
95
+ | Component | What it does |
96
+ |---|---|
97
+ | **Feedback Analyzer** | An LLM that reviews execution traces and produces structured failure diagnoses plus concrete prompt-edit proposals, each with a written hypothesis. **It has no authority** — it only proposes; every proposal goes through A/B test + gate. |
98
+ | **A/B Test Engine** | Compares a candidate prompt against the current one on a held-out task set. Reports win rate, bootstrap confidence intervals, effect size, permutation p-value, and per-task breakdown. |
99
+ | **Promotion Gate** | The safety-critical component. Six deterministic checks in fail-fast order: sample floor, effect size, confidence interval, frozen sections, edit-distance, drift. Outcomes: **promote**, **reject**, or **near-miss** (logged for human review). The gate is **code, not prompts** — verifiable, testable, non-negotiable. |
100
+ | **Prompt Registry** | File-based versioned store of every prompt with full lineage: diff from previous version, the analyzer's hypothesis, A/B test results, guardrail results, timestamp, model version, trigger trace IDs. Supports `diff`, `rollback`, `lineage`. SHA-256 integrity per version. |
101
+ | **Guardrail Module** | Frozen section annotations, edit-distance calculation, and TF-IDF drift (embedding drift in v0.2.0). |
102
+ | **Diff Visualization** | Side-by-side or inline diff showing exactly what changed between prompt versions, what stayed the same (frozen core), and why (guardrail evidence). |
103
+ | **CLI** | `agent-self-edit` with `init`, `run`, `status`, `diff`, `rollback`, `guardrails`, `lineage`, `propose`, `ingest`, `validate`. Shortest path from `pip install` to a working loop is under 5 minutes. |
104
+
105
+ ## Guardrails
106
+
107
+ The promotion gate is deterministic — never LLM-judged — and runs six checks before any edit is promoted:
108
+
109
+ 1. **Sample floor** — minimum number of A/B trials completed
110
+ 2. **Effect size** — improvement exceeds a configurable minimum threshold
111
+ 3. **Confidence interval** — p-value below the confidence threshold
112
+ 4. **Frozen core sections** — user-annotated sections the analyzer cannot modify
113
+ 5. **Edit-distance limit** — maximum lines changed per cycle (configurable)
114
+ 6. **Drift detection** — semantic similarity to the original prompt, alerts on divergence
115
+
116
+ Design target: < 1% of good edits rejected (false positives), < 0.1% of bad edits promoted (false negatives), 100% rollback success.
117
+
118
+ ## Trigger Modes
119
+
120
+ - **Batch** — analyze after N tasks (default: 50)
121
+ - **Time-based** — analyze every N hours
122
+ - **Manual** — analyze on demand
123
+
124
+ ## Where It Helps
125
+
126
+ Any agent that repeats a similar task type and sees execution feedback beats its prompt frozen on day one:
127
+
128
+ - **Customer support ticket classification** — a change that helps one category can't degrade another.
129
+ - **Code review / PR analysis** — false positives on docs-only PRs are learned and fixed.
130
+ - **Data extraction / entity parsing** — PDF-with-tables extraction doesn't regress plain-text extraction.
131
+ - **Content moderation** — false-positive / false-negative tradeoffs are measured, not guessed.
132
+ - **Sales outreach personalization** — winning variants are proven, not copy-pasted.
133
+ - **Documentation generation** — output length and tone adapt from feedback.
134
+
135
+ ## Roadmap
136
+
137
+ | Version | Focus |
138
+ |---|---|
139
+ | **v0.1.0** | Prove the loop — core loop, statistical gate, CLI, guardrails, Docker, field test (in progress — M10) |
140
+ | **v0.2.0** | Trust + visibility — web dashboard, drift detection, near-miss feedback, REST API, shadow mode |
141
+ | **v0.3.0** | Scale + adapters — framework adapters, multi-failure clustering, adaptive sample floors, evals integration |
142
+ | **v0.4.0** | Fleet — fleet-wide shared-rules learning, cost-aware improvement, promotion analytics |
143
+ | **v1.0.0** | General availability — stable API, production deployment guide |
144
+
145
+ ## Status
146
+
147
+ 🚧 **Pre-release v0.1.0.** Core loop complete: trace ingestion, feedback analyzer, A/B test engine, promotion gate, prompt registry, CLI (10 commands), Docker support, diff visualization, rollback, guardrails. **434 hermetic tests + 9 Docker tests pass.** Docker full-loop integration test runs against OMLX real LLM (9/9 tests pass in 112s). Field test in progress (M10): 3-model comparison (4B/9B/cloud) completed, 10-iteration improvement run pending.
148
+
149
+ ## Field Test Status
150
+
151
+ | Component | Status |
152
+ |-----------|--------|
153
+ | F-01 Trace ingestion | ✅ works |
154
+ | F-02 Feedback analyzer | ✅ works (proposes edits against OMLX) |
155
+ | F-03 A/B test engine | ✅ works (2 distinct prompts, real statistics) |
156
+ | F-04 Promotion gate | ✅ works (6 checks, deterministic) |
157
+ | F-05 Prompt registry | ✅ works (versioned, lineage, rollback) |
158
+ | F-09 CLI | ✅ works (10 commands) |
159
+ | F-14 Docker support | ✅ works (9/9 tests, full loop against OMLX) |
160
+ | M10 Field test | ⬜ 10-iteration improvement run pending (#100) |
161
+
162
+ See [mini field test report](docs/field-test/v0.1.0/mini-field-test-report.md) for 3-model (4B, 9B, cloud) comparison results.
163
+
164
+ ## License
165
+
166
+ MIT — see [LICENSE](LICENSE)
@@ -0,0 +1,143 @@
1
+ # AgentSelfEdit
2
+
3
+ **An agent that rewrites its own system prompt from execution feedback — proposing edits, A/B testing them against a held-out task set, and promoting only statistically-proven winners under deterministic guardrails.**
4
+
5
+ The agentic ecosystem raced ahead on orchestration and retrieval, but skipped the capability that would make agents feel alive: the ability to get measurably better at their own job over time. AgentSelfEdit turns prompt optimization into a self-sustaining, evidence-driven loop with provenance, rollback, and guardrails.
6
+
7
+ ## Why
8
+
9
+ Most production agents are prompt-tuned once by hand — usually by the human who wrote them, usually once, then never again. The prompt freezes the moment it ships. Every recurring failure is silently absorbed until a human manually tunes again. And the agent that sees the most failure data is the least able to use it.
10
+
11
+ Two common answers are not enough:
12
+ - **"Reflection" is not learning.** Appending a paragraph of prose to context makes prompts longer, not better. The prompt itself never changes, so the same failure repeats tomorrow.
13
+ - **Sharing the raw prompt optimizer** with an LLM breaks everything. Unmanaged, LLM-judged edits poison the baseline within a few iterations.
14
+
15
+ AgentSelfEdit turns prompt optimization into a **self-sustaining, evidence-driven loop** with provenance, rollback, and guardrails — and it is designed as a **sidecar**. It does not modify the agent's runtime. It observes execution traces and proposes prompt edits.
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Install
21
+ pip install agent-self-edit
22
+
23
+ # Scaffold a project
24
+ agent-self-edit init
25
+
26
+ # Run the self-improvement loop
27
+ agent-self-edit run --once
28
+
29
+ # Or in Docker (requires local OMLX or OpenRouter key)
30
+ docker build -t agent-self-edit .
31
+ docker run --rm --network=host agent-self-edit run --once
32
+ ```
33
+
34
+ ## How It Works
35
+
36
+ ```
37
+ Agent executes task ──▶ Execution trace stored (SQLite)
38
+
39
+
40
+ Feedback Analyzer (LLM)
41
+ reviews traces, proposes concrete edits,
42
+ each with a written hypothesis
43
+
44
+
45
+ ───────────────────── A/B Test Engine ─────────────────────
46
+ candidate edit vs current prompt on a held-out task set:
47
+ win rate, bootstrap confidence interval, effect size,
48
+ permutation p-value, per-task breakdown
49
+ ────────────────────────────────────────────────────────────
50
+
51
+
52
+ Promotion Gate (deterministic checks)
53
+ 1. Sample floor 4. Frozen sections
54
+ 2. Effect size 5. Edit-distance limit
55
+ 3. Confidence p-val 6. Drift detection
56
+
57
+ ┌─────────────────┼─────────────────┐
58
+ ▼ ▼ ▼
59
+ Promoted Near-miss Rejected
60
+ prompt updated in logged for archived with
61
+ versioned Registry human review full reasoning
62
+ ```
63
+
64
+ 1. **Analyze** — After each task, an LLM reviews the execution trace and identifies what went wrong: the specific instruction that was missing, ambiguous, or wrong.
65
+ 2. **Propose** — It proposes one or more concrete, minimal prompt edits, each with a stated hypothesis about why it should improve outcomes.
66
+ 3. **Test** — Each candidate edit is A/B tested against the current prompt on a held-out task set, with confidence intervals, effect-size thresholds, and a minimum sample floor before any promotion decision.
67
+ 4. **Promote or Archive** — The statistically-proven winner becomes the new baseline. The loser is archived with its full reasoning.
68
+ 5. **Guard** — Frozen core sections, edit-distance limits, and drift detection keep the agent from rewriting itself into a worse version over hundreds of iterations.
69
+
70
+ ## Core Components
71
+
72
+ | Component | What it does |
73
+ |---|---|
74
+ | **Feedback Analyzer** | An LLM that reviews execution traces and produces structured failure diagnoses plus concrete prompt-edit proposals, each with a written hypothesis. **It has no authority** — it only proposes; every proposal goes through A/B test + gate. |
75
+ | **A/B Test Engine** | Compares a candidate prompt against the current one on a held-out task set. Reports win rate, bootstrap confidence intervals, effect size, permutation p-value, and per-task breakdown. |
76
+ | **Promotion Gate** | The safety-critical component. Six deterministic checks in fail-fast order: sample floor, effect size, confidence interval, frozen sections, edit-distance, drift. Outcomes: **promote**, **reject**, or **near-miss** (logged for human review). The gate is **code, not prompts** — verifiable, testable, non-negotiable. |
77
+ | **Prompt Registry** | File-based versioned store of every prompt with full lineage: diff from previous version, the analyzer's hypothesis, A/B test results, guardrail results, timestamp, model version, trigger trace IDs. Supports `diff`, `rollback`, `lineage`. SHA-256 integrity per version. |
78
+ | **Guardrail Module** | Frozen section annotations, edit-distance calculation, and TF-IDF drift (embedding drift in v0.2.0). |
79
+ | **Diff Visualization** | Side-by-side or inline diff showing exactly what changed between prompt versions, what stayed the same (frozen core), and why (guardrail evidence). |
80
+ | **CLI** | `agent-self-edit` with `init`, `run`, `status`, `diff`, `rollback`, `guardrails`, `lineage`, `propose`, `ingest`, `validate`. Shortest path from `pip install` to a working loop is under 5 minutes. |
81
+
82
+ ## Guardrails
83
+
84
+ The promotion gate is deterministic — never LLM-judged — and runs six checks before any edit is promoted:
85
+
86
+ 1. **Sample floor** — minimum number of A/B trials completed
87
+ 2. **Effect size** — improvement exceeds a configurable minimum threshold
88
+ 3. **Confidence interval** — p-value below the confidence threshold
89
+ 4. **Frozen core sections** — user-annotated sections the analyzer cannot modify
90
+ 5. **Edit-distance limit** — maximum lines changed per cycle (configurable)
91
+ 6. **Drift detection** — semantic similarity to the original prompt, alerts on divergence
92
+
93
+ Design target: < 1% of good edits rejected (false positives), < 0.1% of bad edits promoted (false negatives), 100% rollback success.
94
+
95
+ ## Trigger Modes
96
+
97
+ - **Batch** — analyze after N tasks (default: 50)
98
+ - **Time-based** — analyze every N hours
99
+ - **Manual** — analyze on demand
100
+
101
+ ## Where It Helps
102
+
103
+ Any agent that repeats a similar task type and sees execution feedback beats its prompt frozen on day one:
104
+
105
+ - **Customer support ticket classification** — a change that helps one category can't degrade another.
106
+ - **Code review / PR analysis** — false positives on docs-only PRs are learned and fixed.
107
+ - **Data extraction / entity parsing** — PDF-with-tables extraction doesn't regress plain-text extraction.
108
+ - **Content moderation** — false-positive / false-negative tradeoffs are measured, not guessed.
109
+ - **Sales outreach personalization** — winning variants are proven, not copy-pasted.
110
+ - **Documentation generation** — output length and tone adapt from feedback.
111
+
112
+ ## Roadmap
113
+
114
+ | Version | Focus |
115
+ |---|---|
116
+ | **v0.1.0** | Prove the loop — core loop, statistical gate, CLI, guardrails, Docker, field test (in progress — M10) |
117
+ | **v0.2.0** | Trust + visibility — web dashboard, drift detection, near-miss feedback, REST API, shadow mode |
118
+ | **v0.3.0** | Scale + adapters — framework adapters, multi-failure clustering, adaptive sample floors, evals integration |
119
+ | **v0.4.0** | Fleet — fleet-wide shared-rules learning, cost-aware improvement, promotion analytics |
120
+ | **v1.0.0** | General availability — stable API, production deployment guide |
121
+
122
+ ## Status
123
+
124
+ 🚧 **Pre-release v0.1.0.** Core loop complete: trace ingestion, feedback analyzer, A/B test engine, promotion gate, prompt registry, CLI (10 commands), Docker support, diff visualization, rollback, guardrails. **434 hermetic tests + 9 Docker tests pass.** Docker full-loop integration test runs against OMLX real LLM (9/9 tests pass in 112s). Field test in progress (M10): 3-model comparison (4B/9B/cloud) completed, 10-iteration improvement run pending.
125
+
126
+ ## Field Test Status
127
+
128
+ | Component | Status |
129
+ |-----------|--------|
130
+ | F-01 Trace ingestion | ✅ works |
131
+ | F-02 Feedback analyzer | ✅ works (proposes edits against OMLX) |
132
+ | F-03 A/B test engine | ✅ works (2 distinct prompts, real statistics) |
133
+ | F-04 Promotion gate | ✅ works (6 checks, deterministic) |
134
+ | F-05 Prompt registry | ✅ works (versioned, lineage, rollback) |
135
+ | F-09 CLI | ✅ works (10 commands) |
136
+ | F-14 Docker support | ✅ works (9/9 tests, full loop against OMLX) |
137
+ | M10 Field test | ⬜ 10-iteration improvement run pending (#100) |
138
+
139
+ See [mini field test report](docs/field-test/v0.1.0/mini-field-test-report.md) for 3-model (4B, 9B, cloud) comparison results.
140
+
141
+ ## License
142
+
143
+ MIT — see [LICENSE](LICENSE)
@@ -0,0 +1,62 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "agent-self-edit"
7
+ version = "0.1.0"
8
+ description = "An agent that rewrites its own system prompt from execution feedback"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [{name = "Debashish Ghosal"}]
12
+ requires-python = ">=3.10"
13
+ dependencies = [
14
+ "click>=8.1",
15
+ "pyyaml>=6.0",
16
+ "numpy>=1.24",
17
+ "scipy>=1.10",
18
+ "tomli>=2.0; python_version < '3.11'",
19
+ ]
20
+
21
+ [project.optional-dependencies]
22
+ dev = [
23
+ "pytest>=7.4",
24
+ "pytest-cov>=4.1",
25
+ "ruff>=0.1",
26
+ "mypy>=1.7",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/deghosal-2026/agent-self-edit"
31
+ Repository = "https://github.com/deghosal-2026/agent-self-edit.git"
32
+
33
+ [project.scripts]
34
+ agent-self-edit = "agent_self_edit.cli:main"
35
+
36
+ [tool.setuptools.packages.find]
37
+ where = ["src"]
38
+
39
+ [tool.ruff]
40
+ line-length = 100
41
+ target-version = "py310"
42
+
43
+ [tool.ruff.lint.per-file-ignores]
44
+ "field-test/**" = ["E501"]
45
+ "tests/**" = ["E501"]
46
+
47
+ [tool.ruff.lint]
48
+ select = ["E", "F", "I", "N", "W"]
49
+
50
+ [tool.mypy]
51
+ strict = true
52
+ python_version = "3.10"
53
+ ignore_missing_imports = true
54
+ disallow_untyped_defs = true
55
+ disallow_any_unimported = false
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
59
+ addopts = "--cov=agent_self_edit --cov-report=term-missing"
60
+ markers = [
61
+ "docker: marks tests that require a Docker daemon and optionally OMLX",
62
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """AgentSelfEdit — An agent that rewrites its own system prompt from execution feedback."""