adelie-ai 0.2.15 → 0.3.0
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.
- package/README.md +215 -135
- package/adelie/__init__.py +1 -1
- package/adelie/agents/coder_ai.py +10 -0
- package/adelie/agents/dynamic_agent.py +235 -0
- package/adelie/agents/expert_ai.py +56 -1
- package/adelie/agents/reviewer_ai.py +10 -0
- package/adelie/config.py +4 -0
- package/adelie/context_engine.py +15 -0
- package/adelie/dashboard.py +34 -0
- package/adelie/dashboard_html.py +281 -50
- package/adelie/harness_manager.py +817 -0
- package/adelie/hooks.py +3 -0
- package/adelie/interactive.py +216 -3
- package/adelie/kb/retriever.py +31 -10
- package/adelie/memory_harness.py +459 -0
- package/adelie/orchestrator.py +352 -60
- package/adelie/phases.py +105 -263
- package/adelie/policy_engine.py +561 -0
- package/adelie/production_bridge.py +778 -0
- package/adelie/prompts/expert.md +19 -1
- package/adelie/pyproject.toml +1 -1
- package/adelie/utils/ast_checker.py +216 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,22 +5,23 @@
|
|
|
5
5
|
<h1 align="center">Adelie</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>Autonomous AI Orchestration System</strong><br/>
|
|
9
|
-
<sub>13
|
|
8
|
+
<strong>Autonomous AI Orchestration System with Self-Configuring Harness</strong><br/>
|
|
9
|
+
<sub>13+ dynamic agents · adaptive pipeline · policy-enforced safety · production-aware</sub>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<a href="https://www.npmjs.com/package/adelie-ai"><img src="https://img.shields.io/npm/v/adelie-ai?style=flat-square&logo=npm&color=CB3837" alt="npm version" /></a>
|
|
14
14
|
<img src="https://img.shields.io/badge/python-3.10+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python" />
|
|
15
15
|
<img src="https://img.shields.io/badge/LLM-Gemini%20│%20Ollama-FF6F00?style=flat-square" alt="LLM" />
|
|
16
|
-
<img src="https://img.shields.io/badge/tests-
|
|
16
|
+
<img src="https://img.shields.io/badge/tests-748%20passing-2EA043?style=flat-square" alt="Tests" />
|
|
17
17
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a>
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
21
|
<a href="#quick-start">Quick Start</a> · 
|
|
22
|
-
<a href="#
|
|
22
|
+
<a href="#whats-new-in-v030">What's New</a> · 
|
|
23
23
|
<a href="#architecture">Architecture</a> · 
|
|
24
|
+
<a href="#harness-system">Harness</a> · 
|
|
24
25
|
<a href="#cli">CLI</a> · 
|
|
25
26
|
<a href="#dashboard">Dashboard</a> · 
|
|
26
27
|
<a href="https://ade1ie.github.io/adelie/">Docs</a> · 
|
|
@@ -34,39 +35,109 @@
|
|
|
34
35
|
Adelie is an autonomous AI orchestrator that plans, codes, reviews, tests, deploys, and evolves software projects through a coordinated multi-agent loop. It ships as a single CLI (`npm install -g adelie-ai`) and requires only an LLM provider — no cloud backend, no account.
|
|
35
36
|
|
|
36
37
|
```
|
|
37
|
-
(o_ Adelie v0.
|
|
38
|
-
//\ gemini · gemini-2.
|
|
39
|
-
V_/_ Phase:
|
|
38
|
+
(o_ Adelie v0.3.0
|
|
39
|
+
//\ gemini · gemini-2.5-pro
|
|
40
|
+
V_/_ Phase: mid_1 | 🛡️3 📡🟢 🧠12/5
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
Unlike simple code-generation tools, Adelie provides a **Harness** — a structural framework that constrains, monitors, and self-corrects the AI at every step:
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
6. **Checkpoint** snapshots the project before promotion
|
|
50
|
-
7. **Tester** runs tests and reports failures
|
|
51
|
-
8. **Runner** builds, installs, deploys
|
|
52
|
-
9. **Monitor** watches system health
|
|
53
|
-
10. **Analyst** evaluates trends and growth opportunities
|
|
54
|
-
11. **Inform** generates human-readable project status reports
|
|
55
|
-
12. **Phase gates** decide when to advance the project lifecycle
|
|
56
|
-
|
|
57
|
-
The loop runs continuously at a configurable interval (default 30 s), or once with `adelie run --once`.
|
|
45
|
+
- 🔧 **Dynamic Pipeline** — The AI reconfigures its own execution pipeline based on project needs
|
|
46
|
+
- 🛡️ **Policy Engine** — Declarative constraints block unsafe code before it reaches your project
|
|
47
|
+
- 🧠 **Selective Memory** — Phase-aware KB filtering prevents context derailment and hallucination
|
|
48
|
+
- 📡 **Production Bridge** — Live CI/CD and error monitoring feeds failures back into the AI loop
|
|
49
|
+
- ⛔ **Human Intercept** — Stop the AI instantly at any moment from CLI or Dashboard
|
|
58
50
|
|
|
59
51
|
---
|
|
60
52
|
|
|
61
|
-
## What's New in v0.
|
|
53
|
+
## What's New in v0.3.0
|
|
54
|
+
|
|
55
|
+
v0.3.0 is a major architectural evolution. The AI no longer just executes a fixed pipeline — it **understands, adapts, and self-corrects** its own operational structure.
|
|
56
|
+
|
|
57
|
+
### 🔧 Meta Harness — Dynamic Pipeline (v0.2.16)
|
|
58
|
+
|
|
59
|
+
The static 6-phase pipeline is now a **dynamic JSON state machine**. The Expert AI can analyze a project and restructure the execution flow at runtime.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Expert AI decides: "This project needs a security audit phase"
|
|
63
|
+
# → MODIFY_HARNESS action creates solidity_auditor agent + Security Audit phase
|
|
64
|
+
# → Pipeline automatically restructured: mid → security_audit → mid_1
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- **HarnessManager** — Loads/saves/validates JSON-based pipeline configurations
|
|
68
|
+
- **DynamicAgent** — Runtime-configurable agents with 3-tier permissions (observer → analyst → operator)
|
|
69
|
+
- **Snapshot Rollback** — Every modification creates a backup; failed changes auto-revert
|
|
70
|
+
|
|
71
|
+
### 🛡️ Policy Engine — Declarative Constraints (v0.2.17)
|
|
62
72
|
|
|
63
|
-
|
|
73
|
+
Define project-specific rules in `.adelie/constraints.yaml` that the AI **cannot violate**:
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
```yaml
|
|
76
|
+
rules:
|
|
77
|
+
- name: orm-only
|
|
78
|
+
type: ast
|
|
79
|
+
description: "DB queries must use ORM"
|
|
80
|
+
check: no_raw_sql
|
|
81
|
+
|
|
82
|
+
- name: timeout-required
|
|
83
|
+
type: pattern
|
|
84
|
+
pattern: 'requests\.(get|post|put|delete)\('
|
|
85
|
+
negative_pattern: 'timeout='
|
|
86
|
+
description: "HTTP calls must include timeout"
|
|
87
|
+
severity: block
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **AST Analysis** — Python AST checks for `eval()`, `exec()`, wildcard imports, missing docstrings
|
|
91
|
+
- **Pattern Matching** — Regex rules with negative pattern support for false positive suppression
|
|
92
|
+
- **PolicyGate** — Blocks staging → project promotion on violation; forces Coder retry
|
|
93
|
+
|
|
94
|
+
### 🧠 Memory Harness — Selective Forgetting (v0.2.18)
|
|
95
|
+
|
|
96
|
+
Prevents context derailment by controlling what the AI can and cannot see:
|
|
66
97
|
|
|
67
|
-
|
|
98
|
+
- **Phase Scope Filter** — KB files tagged with `phase_scope` are only visible during designated phases
|
|
99
|
+
- **Archive Manager** — Resolved errors and completed-phase docs auto-archived after 3 cycles
|
|
100
|
+
- **Summary Tree** — `archive/summaries.md` preserves 1-2 line summaries for historical awareness
|
|
101
|
+
- **Context Budget** — Only 5% of context window allocated to archived knowledge
|
|
68
102
|
|
|
69
|
-
|
|
103
|
+
### 📡 Production Bridge — CI/CD Feedback Loop (v0.2.19)
|
|
104
|
+
|
|
105
|
+
Connects the AI loop to external production monitoring:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
AI deploys code → GitHub Actions fails → Bridge detects CI failure
|
|
109
|
+
→ HealthVerdict: CRITICAL → Orchestrator: ERROR state
|
|
110
|
+
→ Coder generates hotfix → Deploy again → Bridge confirms: HEALTHY
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- **GitHub Actions Adapter** — Polls CI status via REST API or MCP
|
|
114
|
+
- **Sentry Adapter** — Monitors error spikes above threshold
|
|
115
|
+
- **Custom MCP Adapter** — Auto-discovers production monitoring tools
|
|
116
|
+
- **Graceful Degradation** — Missing tokens/config = adapter silently disabled
|
|
117
|
+
|
|
118
|
+
### ⛔ Human Intercept & Monitoring Overhaul (v0.2.20)
|
|
119
|
+
|
|
120
|
+
Complete CLI and Dashboard redesign for real-time visibility and control:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
> /intercept AI is going in wrong direction
|
|
124
|
+
⛔ INTERCEPTED
|
|
125
|
+
Cycle: #12
|
|
126
|
+
State: normal → error
|
|
127
|
+
Use /resume to continue with recovery flow.
|
|
128
|
+
|
|
129
|
+
> /status
|
|
130
|
+
Status: RUNNING
|
|
131
|
+
Phase: mid_1 | State: normal | Cycle: 5
|
|
132
|
+
🛡️ Policy Engine: 3 rules (2 pattern, 1 ast)
|
|
133
|
+
🧠 Memory Harness: 12 active / 5 archived / 3 scoped
|
|
134
|
+
📡 Production: HEALTHY (github_actions, sentry)
|
|
135
|
+
🔧 Pipeline: 6 phases, 13 agents
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**New CLI Commands:** `/intercept`, `/policy`, `/health`, `/memory`, `/harness`
|
|
139
|
+
|
|
140
|
+
**Dashboard Panels:** Intercept button, Production Health, Policy Engine, Memory Harness, Pipeline Visualizer
|
|
70
141
|
|
|
71
142
|
> See [CHANGELOG.md](./CHANGELOG.md) for complete release history.
|
|
72
143
|
|
|
@@ -181,33 +252,61 @@ The real-time **dashboard** opens automatically at **http://localhost:5042**.
|
|
|
181
252
|
| **Analyst** | Trend analysis, market insights, KB synthesis | Periodic |
|
|
182
253
|
| **Research** | Web search → KB for external knowledge | On demand |
|
|
183
254
|
| **Inform** | Human-readable project reports and status summaries | On demand |
|
|
255
|
+
| **Dynamic** | Runtime-created agents (security auditor, ML trainer, etc.) | On demand |
|
|
184
256
|
|
|
185
|
-
###
|
|
257
|
+
### Adaptive Lifecycle
|
|
186
258
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
259
|
+
```
|
|
260
|
+
initial → mid → mid_1 → mid_2 → late → evolve
|
|
261
|
+
↑
|
|
262
|
+
Expert AI can insert custom
|
|
263
|
+
phases here at runtime
|
|
264
|
+
```
|
|
192
265
|
|
|
193
|
-
|
|
266
|
+
Each phase transition is gated by quality metrics — KB file count, test pass rate, review scores, stability indicators. The Expert AI votes on phase transitions; the Harness enforces the gates.
|
|
194
267
|
|
|
195
|
-
|
|
268
|
+
### Harness System
|
|
196
269
|
|
|
197
|
-
|
|
198
|
-
- **Layer 1** — Connectors and integrations (depends on Layer 0)
|
|
199
|
-
- **Layer 2** — Infrastructure and configuration (depends on Layer 1)
|
|
270
|
+
The Harness is what makes Adelie different from a simple AI code generator. It's a **structural framework** that constrains and protects the AI:
|
|
200
271
|
|
|
201
|
-
|
|
272
|
+
```
|
|
273
|
+
┌─────────────────────────────────────────────────┐
|
|
274
|
+
│ HARNESS LAYER │
|
|
275
|
+
│ │
|
|
276
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
277
|
+
│ │ Policy │ │ Memory │ │Production│ │
|
|
278
|
+
│ │ Engine │ │ Harness │ │ Bridge │ │
|
|
279
|
+
│ │ │ │ │ │ │ │
|
|
280
|
+
│ │constraints│ │phase scope│ │CI/CD │ │
|
|
281
|
+
│ │AST check │ │archiving │ │Sentry │ │
|
|
282
|
+
│ │pattern │ │summaries │ │GitHub │ │
|
|
283
|
+
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
|
|
284
|
+
│ │ │ │ │
|
|
285
|
+
│ ┌────▼────────────▼────────────▼─────┐ │
|
|
286
|
+
│ │ ORCHESTRATOR │ │
|
|
287
|
+
│ │ cycle start → agents → promote │ │
|
|
288
|
+
│ └────────────────────────────────────┘ │
|
|
289
|
+
│ │
|
|
290
|
+
│ ┌──────────┐ ┌──────────┐ │
|
|
291
|
+
│ │ Harness │ │ Human │ │
|
|
292
|
+
│ │ Manager │ │ Intercept│ │
|
|
293
|
+
│ │ │ │ │ │
|
|
294
|
+
│ │dynamic │ │/intercept│ │
|
|
295
|
+
│ │pipeline │ │dashboard │ │
|
|
296
|
+
│ │rollback │ │⛔ button │ │
|
|
297
|
+
│ └──────────┘ └──────────┘ │
|
|
298
|
+
└─────────────────────────────────────────────────┘
|
|
299
|
+
```
|
|
202
300
|
|
|
203
301
|
### Security
|
|
204
302
|
|
|
205
303
|
Adelie enforces multiple security layers:
|
|
206
304
|
|
|
207
|
-
- **
|
|
208
|
-
- **
|
|
209
|
-
- **
|
|
210
|
-
- **
|
|
305
|
+
- **Policy Engine** — Declarative constraints block AST violations, forbidden patterns, and file limits
|
|
306
|
+
- **Shell injection prevention** — `BLOCKED_CHARS` filter blocks `&`, `>`, `|`, `;`, backticks
|
|
307
|
+
- **Path traversal protection** — `Path.resolve()` verification ensures files stay within staging
|
|
308
|
+
- **Staging isolation** — Code is written to `.adelie/staging/` first, verified, then promoted
|
|
309
|
+
- **Thread-safe operations** — `_usage_lock` and `_staging_lock` prevent race conditions
|
|
211
310
|
- **Whitelisted commands** — Runner and Tester only execute pre-approved command patterns
|
|
212
311
|
|
|
213
312
|
---
|
|
@@ -224,10 +323,14 @@ Adelie enforces multiple security layers:
|
|
|
224
323
|
|
|
225
324
|
Adelie serves a real-time monitoring UI at **`http://localhost:5042`** (auto-starts with `adelie run`).
|
|
226
325
|
|
|
227
|
-
- **Agent grid** — live status of all
|
|
326
|
+
- **Agent grid** — live status of all agents (idle / running / done / error)
|
|
327
|
+
- **⛔ Intercept button** — emergency stop from the browser
|
|
328
|
+
- **Production Health** — real-time verdict badge (🟢 HEALTHY / 🟡 DEGRADED / 🔴 CRITICAL)
|
|
329
|
+
- **Policy Engine** — active rule count and type breakdown
|
|
330
|
+
- **Memory Harness** — active/archived/scoped file counters
|
|
331
|
+
- **Pipeline Visualizer** — horizontal phase flow with active/completed highlighting
|
|
228
332
|
- **Log stream** — real-time SSE-powered log feed with category filtering
|
|
229
333
|
- **Cycle metrics** — tokens, LLM calls, files written, test results, review scores
|
|
230
|
-
- **Phase timeline** — visual progress through the 6-phase lifecycle
|
|
231
334
|
- **Cycle history chart** — last 30 cycles at a glance
|
|
232
335
|
|
|
233
336
|
Built with zero external dependencies — Python `http.server` + SSE + embedded HTML/JS.
|
|
@@ -264,6 +367,25 @@ adelie run --once --goal "…" # Single cycle
|
|
|
264
367
|
adelie run ws <N> # Resume workspace #N
|
|
265
368
|
```
|
|
266
369
|
|
|
370
|
+
### Interactive Commands (REPL)
|
|
371
|
+
|
|
372
|
+
| Command | Action |
|
|
373
|
+
|:--|:--|
|
|
374
|
+
| `/help` | Show all commands |
|
|
375
|
+
| `/status` | Full system status (all features) |
|
|
376
|
+
| `/pause` | Pause before next cycle |
|
|
377
|
+
| `/resume` | Resume from pause |
|
|
378
|
+
| `/intercept [reason]` | ⛔ Immediate stop + ERROR state |
|
|
379
|
+
| `/feedback <msg>` | Send feedback to AI |
|
|
380
|
+
| `/policy` | Policy Engine rules & status |
|
|
381
|
+
| `/health` | Production health & signals |
|
|
382
|
+
| `/memory` | Memory Harness statistics |
|
|
383
|
+
| `/harness` | Pipeline structure & agents |
|
|
384
|
+
| `/plan` | View pending plan (Plan Mode) |
|
|
385
|
+
| `/approve` | Approve pending plan |
|
|
386
|
+
| `/reject [reason]` | Reject pending plan |
|
|
387
|
+
| `/exit` | Stop and exit |
|
|
388
|
+
|
|
267
389
|
### Configuration
|
|
268
390
|
|
|
269
391
|
```bash
|
|
@@ -274,25 +396,12 @@ adelie config --api-key KEY # Set Gemini API key
|
|
|
274
396
|
adelie config --plan-mode true # Enable Plan Mode (human approval)
|
|
275
397
|
```
|
|
276
398
|
|
|
277
|
-
### Settings
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
adelie settings # View all settings
|
|
281
|
-
adelie settings --global # View global settings
|
|
282
|
-
adelie settings set <key> <val> # Change workspace setting
|
|
283
|
-
adelie settings set --global <key> <val> # Change global setting
|
|
284
|
-
adelie settings reset <key> # Reset to default
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Available settings: `dashboard`, `dashboard.port`, `loop.interval`, `plan.mode`, `sandbox`, `mcp`, `browser.search`, `browser.max_pages`, `fallback.models`, `fallback.cooldown`, `language`
|
|
288
|
-
|
|
289
399
|
### Monitoring
|
|
290
400
|
|
|
291
401
|
```bash
|
|
292
402
|
adelie status # System health & provider status
|
|
293
403
|
adelie inform # AI-generated project report
|
|
294
404
|
adelie phase # Show current phase
|
|
295
|
-
adelie phase set <phase> # Set phase manually
|
|
296
405
|
adelie metrics # Cycle metrics & history
|
|
297
406
|
adelie metrics --agents # Per-agent token usage
|
|
298
407
|
```
|
|
@@ -302,52 +411,13 @@ adelie metrics --agents # Per-agent token usage
|
|
|
302
411
|
```bash
|
|
303
412
|
adelie kb # KB file counts by category
|
|
304
413
|
adelie kb --clear-errors # Clear error files
|
|
305
|
-
adelie kb --reset # Reset entire KB
|
|
306
414
|
adelie goal # Show project goal
|
|
307
415
|
adelie goal set "…" # Set project goal
|
|
308
416
|
adelie feedback "message" # Inject feedback into AI loop
|
|
309
417
|
adelie research "topic" # Web search → KB
|
|
310
418
|
adelie spec load <file> # Load spec (MD/PDF/DOCX) into KB
|
|
311
|
-
adelie git # Git status & recent commits
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### Customization
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
adelie prompts # List agent system prompts
|
|
318
|
-
adelie prompts export # Export prompts for editing
|
|
319
|
-
adelie tools # List registered tools
|
|
320
|
-
adelie commands # List custom commands
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### Integrations
|
|
324
|
-
|
|
325
|
-
```bash
|
|
326
|
-
adelie telegram setup # Configure Telegram bot
|
|
327
|
-
adelie telegram start # Start Telegram bot
|
|
328
|
-
adelie ollama list # List Ollama models
|
|
329
|
-
adelie ollama pull <model> # Download model
|
|
330
|
-
adelie ollama run [model] # Interactive chat
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## Plan Mode
|
|
336
|
-
|
|
337
|
-
Enable Plan Mode for human-in-the-loop control:
|
|
338
|
-
|
|
339
|
-
```bash
|
|
340
|
-
adelie config --plan-mode true
|
|
341
419
|
```
|
|
342
420
|
|
|
343
|
-
When enabled, the Expert AI generates a **plan** before executing code changes. You can review, approve, or reject from the interactive REPL:
|
|
344
|
-
|
|
345
|
-
| Command | Action |
|
|
346
|
-
|:--|:--|
|
|
347
|
-
| `/plan` | View pending plan |
|
|
348
|
-
| `/approve` | Execute the plan |
|
|
349
|
-
| `/reject [reason]` | Reject and provide feedback |
|
|
350
|
-
|
|
351
421
|
---
|
|
352
422
|
|
|
353
423
|
## Configuration
|
|
@@ -361,49 +431,59 @@ When enabled, the Expert AI generates a **plan** before executing code changes.
|
|
|
361
431
|
| `GEMINI_MODEL` | `gemini-2.0-flash` | Gemini model name |
|
|
362
432
|
| `OLLAMA_BASE_URL` | `http://localhost:11434` | Ollama server URL |
|
|
363
433
|
| `OLLAMA_MODEL` | `llama3.2` | Ollama model name |
|
|
364
|
-
| `FALLBACK_MODELS` | — | Fallback chain (`gemini:flash,ollama:llama3.2`) |
|
|
365
434
|
| `LOOP_INTERVAL_SECONDS` | `30` | Cycle interval in seconds |
|
|
366
435
|
| `DASHBOARD_ENABLED` | `true` | Dashboard on/off |
|
|
367
436
|
| `DASHBOARD_PORT` | `5042` | Dashboard port |
|
|
368
437
|
| `PLAN_MODE` | `false` | Require approval before execution |
|
|
369
438
|
| `SANDBOX_MODE` | `none` | `none`, `seatbelt`, or `docker` |
|
|
439
|
+
| `PRODUCTION_BRIDGE_ENABLED` | `false` | Enable Production Bridge |
|
|
440
|
+
| `PRODUCTION_POLL_INTERVAL` | `60` | Bridge polling interval (seconds) |
|
|
370
441
|
|
|
371
|
-
###
|
|
442
|
+
### Policy Engine (`.adelie/constraints.yaml`)
|
|
372
443
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
444
|
+
```yaml
|
|
445
|
+
rules:
|
|
446
|
+
- name: no-eval
|
|
447
|
+
type: pattern
|
|
448
|
+
pattern: '\beval\s*\('
|
|
449
|
+
description: "Block eval() calls"
|
|
450
|
+
severity: block
|
|
451
|
+
|
|
452
|
+
- name: docstrings
|
|
453
|
+
type: ast
|
|
454
|
+
check: missing_docstring
|
|
455
|
+
description: "Public functions must have docstrings"
|
|
456
|
+
severity: warn
|
|
385
457
|
```
|
|
386
458
|
|
|
387
|
-
###
|
|
459
|
+
### Production Bridge
|
|
388
460
|
|
|
389
|
-
|
|
461
|
+
```bash
|
|
462
|
+
# .adelie/.env
|
|
463
|
+
PRODUCTION_BRIDGE_ENABLED=true
|
|
390
464
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
Use functional components with TypeScript props…
|
|
465
|
+
# GitHub Actions
|
|
466
|
+
GITHUB_TOKEN=ghp_xxxxx
|
|
467
|
+
|
|
468
|
+
# Sentry
|
|
469
|
+
SENTRY_AUTH_TOKEN=sntrys_xxxxx
|
|
470
|
+
SENTRY_ORG=my-org
|
|
471
|
+
SENTRY_PROJECT=my-project
|
|
399
472
|
```
|
|
400
473
|
|
|
474
|
+
Or add MCP servers to `.adelie/mcp.json` for MCP-based monitoring.
|
|
475
|
+
|
|
401
476
|
---
|
|
402
477
|
|
|
403
478
|
## Platform Features
|
|
404
479
|
|
|
405
480
|
| Feature | Description |
|
|
406
481
|
|:--|:--|
|
|
482
|
+
| 🔧 **Meta Harness** | Dynamic pipeline — AI reconfigures its own execution structure |
|
|
483
|
+
| 🛡️ **Policy Engine** | Declarative constraints block unsafe code at AST/pattern level |
|
|
484
|
+
| 🧠 **Memory Harness** | Phase-aware KB filtering prevents context derailment |
|
|
485
|
+
| 📡 **Production Bridge** | Live CI/CD + Sentry + MCP monitoring with auto-rollback |
|
|
486
|
+
| ⛔ **Human Intercept** | Instant mid-cycle stop from CLI (`/intercept`) or Dashboard |
|
|
407
487
|
| 💾 **Checkpoints** | Auto-snapshot before promotion, instant rollback |
|
|
408
488
|
| 🐳 **Docker Sandbox** | Configurable workspace isolation, network policy, resource limits |
|
|
409
489
|
| 🌐 **REST Gateway** | HTTP API — `/api/status`, `/api/tools`, `/api/control` |
|
|
@@ -411,7 +491,7 @@ Use functional components with TypeScript props…
|
|
|
411
491
|
| 📡 **Multichannel** | `ChannelProvider` ABC — Discord, Slack, custom channels |
|
|
412
492
|
| 🤝 **A2A Protocol** | Agent-to-Agent HTTP for external agent integration |
|
|
413
493
|
| 🔧 **MCP Support** | Model Context Protocol for external tool ecosystems |
|
|
414
|
-
| 📊 **Dashboard** | Real-time web UI with
|
|
494
|
+
| 📊 **Dashboard** | Real-time web UI with feature panels, intercept, and SSE streaming |
|
|
415
495
|
| 🔄 **Loop Detector** | 5 stuck-pattern types with escalating interventions |
|
|
416
496
|
| ⚡ **Scheduler** | Per-agent frequency control with cooldown/priority |
|
|
417
497
|
| 🔒 **Security** | Shell injection prevention, path traversal protection, staging isolation |
|
|
@@ -422,7 +502,7 @@ Use functional components with TypeScript props…
|
|
|
422
502
|
## Testing
|
|
423
503
|
|
|
424
504
|
```bash
|
|
425
|
-
python -m pytest tests/ -v #
|
|
505
|
+
python -m pytest tests/ -v # 748 tests
|
|
426
506
|
```
|
|
427
507
|
|
|
428
508
|
---
|
|
@@ -431,21 +511,19 @@ python -m pytest tests/ -v # 636 tests
|
|
|
431
511
|
|
|
432
512
|
```
|
|
433
513
|
adelie/
|
|
434
|
-
├── orchestrator.py # Main loop — state machine +
|
|
514
|
+
├── orchestrator.py # Main loop — state machine + harness integration
|
|
515
|
+
├── harness_manager.py # Dynamic pipeline configuration + rollback
|
|
516
|
+
├── policy_engine.py # Declarative constraint enforcement
|
|
517
|
+
├── memory_harness.py # Selective forgetting + phase-aware KB
|
|
518
|
+
├── production_bridge.py # CI/CD + monitoring feedback loop
|
|
435
519
|
├── commands/ # CLI command modules
|
|
436
|
-
│ ├── workspace.py # init, ws
|
|
437
|
-
│ ├── run.py # run, run once, run ws
|
|
438
|
-
│ ├── config.py # config, settings
|
|
439
|
-
│ ├── monitoring.py # status, phase, metrics, inform
|
|
440
|
-
│ ├── knowledge.py # kb, feedback, goal, research, spec, scan
|
|
441
|
-
│ └── integrations.py # ollama, telegram, git, tools, prompts
|
|
442
520
|
├── cli.py # CLI entry point + argparse routing
|
|
443
521
|
├── config.py # Configuration & env loading
|
|
444
522
|
├── llm_client.py # LLM abstraction (Gemini + Ollama + fallback)
|
|
445
|
-
├── interactive.py # REPL + dashboard
|
|
523
|
+
├── interactive.py # REPL + dashboard + intercept commands
|
|
446
524
|
├── dashboard.py # Real-time web server (HTTP + SSE)
|
|
447
525
|
├── dashboard_html.py # Embedded dashboard UI template
|
|
448
|
-
├── agents/ # 12 specialized AI agents
|
|
526
|
+
├── agents/ # 12+ specialized AI agents
|
|
449
527
|
│ ├── writer_ai.py # Knowledge Base curator
|
|
450
528
|
│ ├── expert_ai.py # Strategic decision maker
|
|
451
529
|
│ ├── coder_ai.py # Code generator
|
|
@@ -457,7 +535,10 @@ adelie/
|
|
|
457
535
|
│ ├── analyst_ai.py # Trend analyzer
|
|
458
536
|
│ ├── research_ai.py # Web researcher
|
|
459
537
|
│ ├── inform_ai.py # Status report generator
|
|
460
|
-
│
|
|
538
|
+
│ ├── scanner_ai.py # Initial codebase scanner
|
|
539
|
+
│ └── dynamic_agent.py # Runtime-created agents
|
|
540
|
+
├── utils/
|
|
541
|
+
│ └── ast_checker.py # AST-based static analysis
|
|
461
542
|
├── kb/ # Knowledge Base (retriever + embeddings)
|
|
462
543
|
├── channels/ # Multichannel providers (Discord, Slack)
|
|
463
544
|
├── a2a/ # Agent-to-Agent protocol
|
|
@@ -465,11 +546,10 @@ adelie/
|
|
|
465
546
|
├── sandbox.py # Docker/Seatbelt isolation
|
|
466
547
|
├── gateway.py # REST API gateway
|
|
467
548
|
├── skill_manager.py # Skill registry
|
|
468
|
-
├── env_strategy.py # Runtime environment detection
|
|
469
549
|
├── plan_mode.py # Plan Mode (human approval)
|
|
470
550
|
├── loop_detector.py # Stuck-pattern detection
|
|
471
551
|
├── scheduler.py # Per-agent scheduling
|
|
472
|
-
├── phases.py # Lifecycle phase definitions
|
|
552
|
+
├── phases.py # Lifecycle phase definitions (compat shim)
|
|
473
553
|
├── hooks.py # Event-driven plugin system
|
|
474
554
|
└── process_supervisor.py # Subprocess management
|
|
475
555
|
```
|
package/adelie/__init__.py
CHANGED
|
@@ -145,6 +145,15 @@ def run_coder(
|
|
|
145
145
|
except Exception:
|
|
146
146
|
project_tree = "(file tree unavailable)"
|
|
147
147
|
|
|
148
|
+
# Get active policy constraints (if any)
|
|
149
|
+
policy_section = ""
|
|
150
|
+
try:
|
|
151
|
+
from adelie.policy_engine import PolicyEngine
|
|
152
|
+
engine = PolicyEngine()
|
|
153
|
+
policy_section = engine.get_prompt_summary()
|
|
154
|
+
except Exception:
|
|
155
|
+
pass
|
|
156
|
+
|
|
148
157
|
user_prompt = (
|
|
149
158
|
f"## Task\n{task}\n\n"
|
|
150
159
|
f"## Layer\nThis is a Layer {layer} coder.\n"
|
|
@@ -155,6 +164,7 @@ def run_coder(
|
|
|
155
164
|
f"{get_context_prompt_section()}"
|
|
156
165
|
f"{get_rules_prompt_section()}"
|
|
157
166
|
f"{get_skills_prompt_section('coder')}"
|
|
167
|
+
f"{policy_section}"
|
|
158
168
|
f"## KB Context\n{context}\n\n"
|
|
159
169
|
f"## Existing Source Files\n{existing}\n\n"
|
|
160
170
|
f"## Lower Layer Coder Logs\n{lower_logs}\n\n"
|