Add collaborative workflow diagram and clarify PostgreSQL status
- Added new diagram showing humans + AI agents + git workflow - Clarified that PostgreSQL is planned but not yet implemented - Updated system architecture diagram to distinguish implemented (SQLite) vs planned (PostgreSQL) backends - Added workflow steps and benefits explanation for collaborative work The architecture diagrams now accurately reflect current implementation status. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
118
DESIGN.md
118
DESIGN.md
@@ -27,36 +27,39 @@ graph TB
|
|||||||
end
|
end
|
||||||
|
|
||||||
subgraph "Storage Interface"
|
subgraph "Storage Interface"
|
||||||
Storage[Storage Interface]
|
Storage[Storage Interface<br/>Ready for multiple backends]
|
||||||
Factory[Backend Factory]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph "Backend Implementations"
|
subgraph "Current Implementation"
|
||||||
SQLite[SQLite Storage]
|
SQLite[SQLite Storage<br/>✅ Implemented]
|
||||||
Postgres[PostgreSQL Storage]
|
end
|
||||||
|
|
||||||
|
subgraph "Planned Future"
|
||||||
|
Postgres[PostgreSQL Storage<br/>📋 Planned Phase 3]
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph "Data Layer"
|
subgraph "Data Layer"
|
||||||
DB1[(SQLite DB<br/>~/.beads/beads.db)]
|
DB1[(SQLite DB<br/>~/.beads/beads.db)]
|
||||||
DB2[(PostgreSQL)]
|
DB2[(PostgreSQL<br/>Not yet implemented)]
|
||||||
end
|
end
|
||||||
|
|
||||||
CLI --> Cobra
|
CLI --> Cobra
|
||||||
Cobra --> Storage
|
Cobra --> Storage
|
||||||
Storage --> Factory
|
Storage --> SQLite
|
||||||
Factory --> SQLite
|
Storage -.future.-> Postgres
|
||||||
Factory --> Postgres
|
|
||||||
SQLite --> DB1
|
SQLite --> DB1
|
||||||
Postgres --> DB2
|
Postgres -.-> DB2
|
||||||
|
|
||||||
style CLI fill:#e1f5ff
|
style CLI fill:#e1f5ff
|
||||||
style Storage fill:#fff4e1
|
style Storage fill:#fff4e1
|
||||||
style SQLite fill:#e8f5e9
|
style SQLite fill:#4caf50,color:#fff
|
||||||
style Postgres fill:#e8f5e9
|
style Postgres fill:#bdbdbd,color:#fff
|
||||||
style DB1 fill:#f3e5f5
|
style DB1 fill:#e8f5e9
|
||||||
style DB2 fill:#f3e5f5
|
style DB2 fill:#f5f5f5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Current Status:** Only SQLite is implemented. PostgreSQL support is designed and planned for Phase 3 (see Implementation Roadmap below).
|
||||||
|
|
||||||
### Entity Relationship Diagram
|
### Entity Relationship Diagram
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
@@ -221,6 +224,93 @@ sequenceDiagram
|
|||||||
CLI-->>User: Display ready work
|
CLI-->>User: Display ready work
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Collaborative Workflow: Humans + AI Agents + Git
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TB
|
||||||
|
subgraph "Human Developer"
|
||||||
|
Human[👤 Human<br/>Developer]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "AI Worker Agents"
|
||||||
|
Agent1[🤖 Agent 1<br/>Feature Dev]
|
||||||
|
Agent2[🤖 Agent 2<br/>Bug Fixing]
|
||||||
|
Agent3[🤖 Agent 3<br/>Testing]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Shared Project Repository"
|
||||||
|
Git[(🗂️ Git Repository)]
|
||||||
|
BeadsDB[(.beads/issues.jsonl)]
|
||||||
|
Code[(Source Code)]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Local Workspaces"
|
||||||
|
HumanDB[(SQLite DB)]
|
||||||
|
Agent1DB[(SQLite DB)]
|
||||||
|
Agent2DB[(SQLite DB)]
|
||||||
|
end
|
||||||
|
|
||||||
|
Human -->|bd ready| HumanDB
|
||||||
|
Human -->|bd create/update| HumanDB
|
||||||
|
Human -->|bd export| BeadsDB
|
||||||
|
Human -->|git commit/push| Git
|
||||||
|
|
||||||
|
Agent1 -->|bd ready --json| Agent1DB
|
||||||
|
Agent1 -->|bd update status| Agent1DB
|
||||||
|
Agent1 -->|discovers bugs| Agent1DB
|
||||||
|
Agent1 -->|bd export| BeadsDB
|
||||||
|
|
||||||
|
Agent2 -->|bd ready --json| Agent2DB
|
||||||
|
Agent2 -->|bd close issue| Agent2DB
|
||||||
|
Agent2 -->|bd export| BeadsDB
|
||||||
|
|
||||||
|
Agent3 -->|bd create test task| Agent3DB
|
||||||
|
Agent3 -->|bd dep add| Agent3DB
|
||||||
|
Agent3 -->|bd export| BeadsDB
|
||||||
|
|
||||||
|
Git -->|git pull| Human
|
||||||
|
Git -->|git pull| Agent1
|
||||||
|
Git -->|git pull| Agent2
|
||||||
|
|
||||||
|
BeadsDB -->|bd import| HumanDB
|
||||||
|
BeadsDB -->|bd import| Agent1DB
|
||||||
|
BeadsDB -->|bd import| Agent2DB
|
||||||
|
|
||||||
|
Agent1 -->|git push| Git
|
||||||
|
Agent2 -->|git push| Git
|
||||||
|
Agent3 -->|git push| Git
|
||||||
|
|
||||||
|
Code -.lives alongside.-> BeadsDB
|
||||||
|
|
||||||
|
style Human fill:#64b5f6,color:#fff
|
||||||
|
style Agent1 fill:#81c784,color:#fff
|
||||||
|
style Agent2 fill:#81c784,color:#fff
|
||||||
|
style Agent3 fill:#81c784,color:#fff
|
||||||
|
style Git fill:#f06292,color:#fff
|
||||||
|
style BeadsDB fill:#ffd54f,color:#000
|
||||||
|
style HumanDB fill:#e0e0e0
|
||||||
|
style Agent1DB fill:#e0e0e0
|
||||||
|
style Agent2DB fill:#e0e0e0
|
||||||
|
```
|
||||||
|
|
||||||
|
**Workflow Steps:**
|
||||||
|
|
||||||
|
1. **Pull** - Everyone pulls latest code + `.beads/issues.jsonl` from git
|
||||||
|
2. **Import** - Run `bd import -i .beads/issues.jsonl` to sync local SQLite cache
|
||||||
|
3. **Query** - Run `bd ready` to find unblocked work
|
||||||
|
4. **Work** - Update issues as work progresses (`bd update`, `bd create`, `bd close`)
|
||||||
|
5. **Discover** - Agents create new issues when they find bugs/TODOs
|
||||||
|
6. **Export** - Run `bd export -o .beads/issues.jsonl` before committing
|
||||||
|
7. **Push** - Commit both code changes and `.beads/issues.jsonl` together
|
||||||
|
8. **Merge** - On conflicts, use `bd import --resolve-collisions` to auto-resolve
|
||||||
|
|
||||||
|
**Benefits:**
|
||||||
|
- Single source of truth (`.beads/issues.jsonl` in git)
|
||||||
|
- Fast local queries (SQLite cache)
|
||||||
|
- Offline work supported
|
||||||
|
- Automatic collision resolution on merge
|
||||||
|
- Full audit trail preserved
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Core Data Model
|
## Core Data Model
|
||||||
|
|||||||
Reference in New Issue
Block a user