Skip to content

Commit 3c00a0c

Browse files
fix(repo): unify Drive paths, align docs with v2 architecture
- Remove duplicate SwarmDriveManager from drive.py; route get_default_drive and create_scoped_pool through swarm_manager (shared swarms/<id>/drive/) - Fix __init__.py imports; dreaming defaults use get_default_drive_path() - Rewrite SWARM.md, ARCHITECTURE.md, funnel docs, rules-and-patterns for Growth Merge + Memory Bank + framework skills - Repair docs.json nav to existing pages; fix broken pool.* import examples - Add create_scoped_pool regression test; ruff-clean scripts/examples
1 parent f8239a2 commit 3c00a0c

34 files changed

Lines changed: 1097 additions & 673 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ All notable changes to this project are documented here. The product is
66

77
## Unreleased
88

9+
### Fixed — Repo-wide consistency audit (2026-06-18)
10+
11+
- **Drive path unification (P0)** — removed duplicate `SwarmDriveManager` from `drive.py`; `get_default_drive()` and `create_scoped_pool()` now use `swarm_manager.get_or_create_pool()` → shared `swarms/<id>/drive/` (aligns MCP, memory bank, Experience Graph).
12+
- **`__init__.py`**`SwarmDriveManager` / `get_swarm_drive_manager` imported from `swarm_manager` only.
13+
- **Dreaming defaults**`ingestion.py` / `dilation.py` use `get_default_drive_path()` / `get_genomes_dir()` instead of legacy `~/.agentdrive/pool/`.
14+
- **Docs**`ARCHITECTURE.md`, `CAPABILITY_FUNNEL.md`, `SWARM.md`, `FOR_AI_MODELS.md`, `rules-and-patterns.md`, `SETTINGS.md`, `ASSESSMENT.md`, `DEVELOPERS.md`, `HELP.md` updated for v2 shared Drive + full capability funnel.
15+
- **`docs/docs.json`** — navigation trimmed to existing pages; added Memory Bank, Capability Funnel, Skills Library groups.
16+
- **Tests**`test_create_scoped_pool_uses_shared_swarm_drive` in `test_shared_swarm_drive.py`.
17+
- **Examples/scripts** — ruff clean across `scripts/` and `examples/`.
18+
919
### Fixed — CI ruff lint + format (2026-06-18)
1020

1121
- **ruff check** — removed unused imports (`json`, `list_projects`, `ingest_from_operation`, `ingest_observation_mirror`, `PathTraversalError`); fixed import ordering across cognition, memory, learning, and test modules.

DEVELOPERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DEVELOPERS — One-Command Bring-Up
22

3-
This is the contributor's quick-start. For high-level orientation read [`VISION.md`](VISION.md), then [`ARCHITECTURE.md`](ARCHITECTURE.md). For the project's public framing read [`README.md`](README.md).
3+
This is the contributor's quick-start. For high-level orientation read [`VISION.md`](VISION.md), then [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) and [`docs/CAPABILITY_FUNNEL.md`](docs/CAPABILITY_FUNNEL.md). For the project's public framing read [`README.md`](README.md).
44

55
## Prerequisites
66

HELP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ These are production optional advanced extensions. Core AgentDrive (three drives
514514

515515
**Deep reference & mental models**:
516516
- `CONCEPTS.md` (the single best deep, agent-and-human-friendly explanation of the three-tier model, genomes, living loops, quarantine, reconciliation, and the new Lineage-enhanced components)
517-
- `ARCHITECTURE.md`
517+
- `docs/ARCHITECTURE.md`
518518
- `GENOME-SPEC.md`
519519
- `docs/AGENTDRIVE-V2-INHERITANCE.md`
520520
- `docs/SETTINGS.md`

docs/ARCHITECTURE.md

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,47 @@
22

33
**AgentDrive** is a local-first platform that gives AI agents structural, compounding memory — not just retrieval.
44

5-
For the single capability funnel (Observe → Graph → Skills → Genomes), see **`docs/CAPABILITY_FUNNEL.md`**.
5+
For the capability funnel, see **`docs/CAPABILITY_FUNNEL.md`**.
66

77
For model onboarding rules, see **`docs/FOR_AI_MODELS.md`**.
88

99
---
1010

11-
## Core subsystems (what stays)
11+
## Core subsystems
1212

1313
| Layer | Location | Purpose |
1414
|-------|----------|---------|
1515
| **Drive engine** | `src/agentdrive/drive/` | Swarm-scoped persistence, ingest, query |
1616
| **Operations registry** | `src/agentdrive/operations/registry.py` | Canonical MCP/CLI surface + auto-learning |
1717
| **Experience Graph** | `src/agentdrive/evolution/experience_graph.py` | TypedEdges, cycles, fabric reasoning |
18+
| **Growth merge** | `src/agentdrive/learning/growth_merge.py` | Cross-surface pattern compounding |
19+
| **Memory Bank** | `src/agentdrive/memory/` | Deep AI databank (`memories.jsonl`, relations) |
20+
| **Framework skills** | `src/agentdrive/learning/framework_skills.py` | Route learned/fused playbooks per task |
1821
| **Multiverse cognition** | `src/agentdrive/cognition/` | Parallel timelines → governed collapse |
19-
| **Memory Bank** | `src/agentdrive/memory/` | Deep AI databank + graph memory triage |
20-
| **Skills + learning** | `src/agentdrive/skills/`, `learning/auto_absorb.py` | Distillation, inheritance, auto-absorb, fusion |
22+
| **Skills + learning** | `src/agentdrive/skills/`, `learning/auto_absorb.py` | Distillation, inheritance, fusion |
2123
| **Codebase mirrors** | `src/agentdrive/codebase/` | Pattern recognition + mimicry |
2224
| **Golden path** | `golden_path.py` | Install → doctor → MCP → verify |
23-
| **Event bus + sessions** | `events.py`, `session_events.py` | TUI/CLI observability |
2425
| **MCP adapter** | `adapters/mcp_server.py` | Any-model tool surface |
2526

26-
Historical module names (`pool/`, `AgentDrivePool`) remain in code; product docs use **Drive**.
27+
**Naming:** Product surface is **Drive** (`AgentDrive`, `get_swarm_drive_path`). The YAML config key `pool:` and some method names (`get_pool_stats`) are historical — they refer to the same engine under `src/agentdrive/drive/`.
28+
29+
---
30+
31+
## Capability funnel
32+
33+
```
34+
Observe / Decide
35+
36+
Experience Graph
37+
38+
Growth Merge
39+
40+
Memory Bank
41+
42+
Skills (learned + fused)
43+
44+
Genomes / DNA
45+
```
2746

2847
---
2948

@@ -32,15 +51,22 @@ Historical module names (`pool/`, `AgentDrivePool`) remain in code; product docs
3251
```
3352
~/.agentdrive/
3453
├── config.yaml
35-
├── genomes/ # Global genome registry
36-
├── swarms/<swarm_id>/
37-
│ ├── drive/ # Graph + multiverse + meta_evolution
38-
│ │ └── memory_bank/ # Deep AI memory databank (memories.jsonl)
39-
│ └── <subagent_id>/pool/ # Isolated sub-agent DNA (optional)
40-
├── codebase-patterns/<project>/ # Mirror-neuron observations
41-
└── agents/<agent>/sessions/ # Chat session event logs
54+
├── genomes/ # Global genome registry
55+
├── skills/ # User + inherited learned skills
56+
├── codebase-patterns/<project>/ # Mirror-neuron observations
57+
├── learnings/ # Operational JSONL logs
58+
└── swarms/<swarm_id>/
59+
└── drive/ # Shared per-swarm Drive (v2)
60+
├── ingest.jsonl
61+
├── genomes/
62+
├── memory_bank/ # memories.jsonl + relations.sqlite3
63+
└── meta_evolution/ # Experience Graph + multiverse sessions
4264
```
4365

66+
**Swarm model (v2 / Milestone 2a):** All sub-agents in a swarm share one Drive at `swarms/<swarm_id>/drive/`. Sub-agents namespace writes via Genome author tagging (`sub:<id>`), not separate directories. MCP `create_scoped_pool()` and `SwarmDriveManager` use the same path.
67+
68+
Legacy v1 trees (`swarms/<id>/<subagent>/pool/`) may exist on disk from older sessions; new provisioning always uses the shared `drive/` layout.
69+
4470
---
4571

4672
## Integration surfaces
@@ -50,23 +76,14 @@ Historical module names (`pool/`, `AgentDrivePool`) remain in code; product docs
5076
- **TUI** — default operator shell when no `--cli`
5177
- **Harness** — in-process outcome capture for adapters
5278

53-
See `docs/MCP.md`, `docs/INTEGRATION.md`, `docs/GOLDEN_PATH.md`.
79+
See `docs/MCP.md`, `docs/INTEGRATION.md`, `docs/GOLDEN_PATH.md`, `docs/MEMORY_BANK.md`.
5480

5581
---
5682

5783
## Archived / legacy (do not extend)
5884

5985
- `archive/ui-webpage-legacy-*` — superseded web templates
60-
- `archive/development-history/` — stabilization sprint reports, stale `BUILD_STATUS.md` / `MISSION_PLAN.md`
86+
- `archive/development-history/` — stabilization sprint reports
6187
- `src/agentdrive/backup/` — still referenced by tests; migrate before removal
6288

63-
---
64-
65-
## Consolidation direction
66-
67-
1. One capability funnel (documented in `CAPABILITY_FUNNEL.md`)
68-
2. Pool → Drive naming in user-facing docs (code rename is incremental)
69-
3. Split `cli.py` / `mcp_server.py` into focused modules
70-
4. Expand multiverse + graph test coverage
71-
72-
See `CHANGELOG.md` Unreleased for recent work.
89+
See `CHANGELOG.md` for recent work.

docs/ASSESSMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Executive summary
99

10-
AgentDrive crossed a meaningful product threshold: **a new operator can install, wire MCP, run the memory loop, and use a terminal that feels alive while the agent works.** The UX-PROPOSAL’s five patterns are all shipped at v1. The codebase is in strong shape — **618 tests collected, full suite green** — with multiverse, auto-learning, and codebase-mirror coverage added since the June 8 snapshot.
10+
AgentDrive crossed a meaningful product threshold: **a new operator can install, wire MCP, run the memory loop, and use a terminal that feels alive while the agent works.** The UX-PROPOSAL’s five patterns are all shipped at v1. The codebase is in strong shape — **655+ tests collected, full suite green** — with multiverse, auto-learning, and codebase-mirror coverage added since the June 8 snapshot.
1111

1212
What you have now is not a demo shell. It is a **local-first agent memory platform** with a coherent operator surface (CLI + TUI + MCP), observable sessions, and a credible first-run story. The main gap is no longer “does the terminal feel broken?” but “which surface do we deepen next — terminal v2, web, or external adapters?”
1313

@@ -67,7 +67,7 @@ Every chat session writes `~/.agentdrive/agents/<agent>/sessions/<id>/events.jso
6767

6868
1. Coherent operator story — golden path + TUI gate + MCP + verify
6969
2. Event-bus architecture — lanes compose; session recording is automatic
70-
3. Test discipline — 618 tests, per-lane + multiverse + auto-learning suites
70+
3. Test discipline — 655+ tests, per-lane + multiverse + auto-learning + memory bank suites
7171
4. Unified dispatch — CLI, REPL, slash, skills share handlers
7272
5. Low TODO debt — ~3 TODOs across ~22k LOC
7373

docs/CAPABILITY_FUNNEL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Single mental model for how intelligence compounds in AgentDrive.**
44

5-
Public product: **AgentDrive**. Internal engine modules still use historical names (`pool/`, `AgentDrivePool`) — treat **Drive** as the product-facing term and **Pool** as the persistence/query engine behind it.
5+
Public product: **AgentDrive**. Python module is `agentdrive.drive` (`AgentDrive` class). Some config keys and method names still say `pool` (e.g. YAML `pool:`, `get_pool_stats()`) — treat **Drive** as the product term.
66

77
---
88

@@ -124,10 +124,11 @@ Each swarm gets isolated storage:
124124

125125
```
126126
~/.agentdrive/swarms/<swarm_id>/
127-
├── drive/ # Experience Graph + meta_evolution + multiverse sessions
128-
└── <subagent_id>/pool/ # Per-sub-agent DNA (when isolation_level=subagent)
127+
└── drive/ # Shared swarm Drive: graph, memory_bank, ingest, genomes
129128
```
130129

130+
Sub-agents share this Drive; writes are attributed via Genome author field (`sub:<id>`). Truly air-gapped children need an explicit custom `drive_path`.
131+
131132
The funnel runs **per swarm**. Cross-swarm sharing is policy-gated (`docs/SETTINGS.md`).
132133

133134
---

docs/FOR_AI_MODELS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ These rules turn stateless tool-calling into compounding intelligence.
4141

4242
## Capability funnel (how work compounds)
4343

44-
All serious work flows one direction: **Observe/Decide → Experience Graph → Skills → Genomes/DNA**. Retrieval can jump levels; writes should land at the right tier. Full routing table: **`docs/CAPABILITY_FUNNEL.md`**. Architecture overview: **`docs/ARCHITECTURE.md`**.
44+
All serious work flows one direction:
45+
46+
**Observe/Decide → Experience Graph → Growth Merge → Memory Bank → Skills → Genomes/DNA**
47+
48+
Retrieval can jump levels; writes should land at the right tier. Full routing table: **`docs/CAPABILITY_FUNNEL.md`**. Architecture overview: **`docs/ARCHITECTURE.md`**.
4549

4650
---
4751

docs/SETTINGS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ agentdrive config edit
8686
### Via Python API (agents or scripts)
8787

8888
```python
89-
from agentdrive.pool.settings import (
89+
from agentdrive.drive.settings import (
9090
get_pool_settings_manager,
9191
PoolSettings,
9292
get_effective_pool_settings,
@@ -187,7 +187,7 @@ pool:
187187
## Viewing Effective Policy at Runtime
188188
189189
```python
190-
from agentdrive.pool.settings import get_effective_pool_settings
190+
from agentdrive.drive.settings import get_effective_drive_settings
191191
print(get_effective_pool_settings("my-swarm").to_dict())
192192
```
193193

0 commit comments

Comments
 (0)