Skip to content

Commit e4fa3c1

Browse files
authored
docs: refocus README on team outcomes and move deep details to docs/ (#60)
1 parent fc892c5 commit e4fa3c1

10 files changed

Lines changed: 512 additions & 194 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Add new test files to `bin/test.sh` — don't scatter test invocations across CI
150150
- Extensions are deployed from `pi/extensions/` → agent's `~/.pi/agent/extensions/`.
151151
- Skills are deployed from `pi/skills/` → agent's `~/.pi/agent/skills/`.
152152
- Agent commits operational learnings to its own skills dir (not back to source).
153-
- **When changing behavior, update all docs.** Check and update: `README.md`, `CONFIGURATION.md`, skill files (`pi/skills/*/SKILL.md`), and `AGENTS.md`. Inline code examples in docs must match the actual implementation.
153+
- **When changing behavior, update all docs.** Check and update: `README.md`, relevant pages in `docs/`, `CONFIGURATION.md`, skill files (`pi/skills/*/SKILL.md`), and `AGENTS.md`. Inline code examples in docs must match the actual implementation.
154154
- **No distro-specific commands.** Scripts must work on both Arch and Ubuntu (and any standard Linux). Use `grep -E` (not `grep -P`), POSIX-compatible tools, and avoid package manager calls (`pacman`, `apt`, etc.). If a package is needed, document it as a prerequisite rather than auto-installing it.
155155

156156
## Testing on Droplets

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ git clone https://github.com/modem-dev/baudbot.git ~/baudbot
77
npm install
88
```
99

10+
## Documentation map
11+
12+
- Product/team workflow overview: [README.md](README.md)
13+
- Deep architecture and operations docs: [`docs/`](docs)
14+
- Security model: [SECURITY.md](SECURITY.md)
15+
- Configuration reference: [CONFIGURATION.md](CONFIGURATION.md)
16+
1017
## Running Tests
1118

1219
```bash
13-
# All tests (8 suites)
20+
# All tests (10 suites)
1421
bin/test.sh
1522

1623
# JS/TS only

README.md

Lines changed: 71 additions & 192 deletions
Large diffs are not rendered by default.

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Security
22

3+
For product overview and team workflow context, start with [README.md](README.md). For architecture and operations docs, see [`docs/architecture.md`](docs/architecture.md) and [`docs/operations.md`](docs/operations.md).
4+
35
## Architecture: Source / Runtime Separation
46

57
```

docs/agents.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Agents
2+
3+
Baudbot uses a small multi-agent architecture: one persistent orchestrator and task-scoped workers. This keeps the team-facing interface stable while allowing parallel execution in the background.
4+
5+
## Role overview
6+
7+
| Agent | Lifecycle | Primary responsibility |
8+
|------|-----------|------------------------|
9+
| `control-agent` | Persistent | Intake, triage, delegation, user communication, orchestration |
10+
| `dev-agent` | Ephemeral per task | Code changes, tests, PRs, CI/review iteration |
11+
| `sentry-agent` | Persistent/on-demand | Sentry alert triage and investigation support |
12+
13+
## Control-agent
14+
15+
The control-agent is the team-facing coordinator.
16+
17+
Responsibilities:
18+
19+
- monitor inbound requests (Slack/email)
20+
- create and manage todos
21+
- select target repo(s)
22+
- spawn and supervise dev-agent sessions
23+
- relay progress/results to users
24+
- enforce operational guardrails (cleanup, escalation)
25+
26+
It should remain lightweight on coding itself and focus on orchestration quality.
27+
28+
## Dev-agent
29+
30+
The dev-agent is a coding worker launched in a dedicated git worktree for each task.
31+
32+
Responsibilities:
33+
34+
- read project guidance (`CODEX.md`, `AGENTS.md`, `CLAUDE.md` as available)
35+
- implement requested changes
36+
- run tests/build checks
37+
- open PR and monitor CI
38+
- fix failures and address review comments
39+
- report completion details back to control-agent
40+
41+
Each dev-agent is task-scoped and should exit when work is done.
42+
43+
## Sentry-agent
44+
45+
The sentry-agent handles incident-oriented analysis.
46+
47+
Responsibilities:
48+
49+
- investigate Sentry issues by issue ID
50+
- summarize likely impact and root cause
51+
- provide actionable recommendations for fixes
52+
- hand off coding tasks to dev-agent through control-agent
53+
54+
## Session model
55+
56+
- Control and sentry sessions are long-lived.
57+
- Dev sessions are ephemeral and tied to todos.
58+
- Session-control sockets allow inter-agent messaging (`send_to_session`).
59+
- Naming conventions encode role and task context (for observability and cleanup).
60+
61+
## Concurrency
62+
63+
Baudbot limits concurrent dev agents to keep resource usage predictable and avoid context thrash.
64+
65+
Use this model when scaling:
66+
67+
- keep a fixed max active dev-agent count
68+
- queue additional tasks
69+
- prioritize by urgency or user/channel policy
70+
71+
## Communication contract
72+
73+
- **Users talk to control-agent**
74+
- **Dev-agent reports to control-agent**
75+
- **Control-agent reports back to users**
76+
77+
This keeps the external interface stable while allowing internal execution strategies to evolve.
78+
79+
For flow details, see [team-workflow.md](team-workflow.md).

docs/architecture.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Architecture
2+
3+
Baudbot separates admin-owned source from agent-owned runtime to reduce blast radius while still enabling always-on autonomous execution.
4+
5+
## Source / release / runtime layout
6+
7+
```text
8+
admin user
9+
├── ~/baudbot/ # source repo (admin-owned)
10+
│ ├── bin/
11+
│ ├── pi/extensions/
12+
│ ├── pi/skills/
13+
│ └── slack-bridge/
14+
15+
root-managed releases
16+
├── /opt/baudbot/
17+
│ ├── releases/<sha>/ # immutable, git-free snapshots
18+
│ ├── current -> releases/<sha>
19+
│ └── previous -> releases/<sha>
20+
21+
baudbot_agent user
22+
├── ~/runtime/ # deployed runtime used by live agent
23+
├── ~/.pi/agent/ # skills/extensions/memory/manifests
24+
└── ~/workspace/ # project repos + task worktrees
25+
```
26+
27+
## Deployment flow
28+
29+
1. Admin updates source repo.
30+
2. Deploy/update scripts build a staged snapshot.
31+
3. Snapshot is published to `/opt/baudbot/releases/<sha>`.
32+
4. Runtime files are deployed for `baudbot_agent`.
33+
5. Symlink switch (`current`) is updated atomically on success.
34+
35+
This allows reproducible releases and fast rollback.
36+
37+
## Agent topology
38+
39+
```text
40+
control-agent (persistent)
41+
├── sentry-agent (persistent/on-demand)
42+
└── dev-agent-* (ephemeral task workers)
43+
```
44+
45+
Inter-session communication is handled over pi session-control sockets.
46+
47+
## Data path summary
48+
49+
```text
50+
Slack/Email → bridge + wrapping → control-agent
51+
→ todo + delegation → dev-agent worktree execution
52+
→ PR/CI outcomes → control-agent response in source thread
53+
```
54+
55+
## Why this architecture
56+
57+
- clear trust boundaries between admin and agent runtime
58+
- predictable operations for deploy/update/rollback
59+
- support for concurrent, task-scoped coding workers
60+
- safer enablement of high-privilege tools via layered controls
61+
62+
For security controls and known risks, see [../SECURITY.md](../SECURITY.md).

docs/linux-runtime.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Linux Runtime
2+
3+
Baudbot is designed to run as Linux-native infrastructure, not a browser-only assistant, so it can execute against your real stack instead of a simulated environment.
4+
5+
## Execution model
6+
7+
- runs as unprivileged `baudbot_agent` user
8+
- operates in real filesystem workspaces and git worktrees
9+
- executes shell commands, test suites, and build pipelines directly
10+
- supports container workflows via guarded Docker wrapper
11+
12+
## What this enables for teams
13+
14+
- run actual project commands (lint/test/build/migrate)
15+
- validate fixes against real local/runtime dependencies
16+
- automate browser tasks through cloud browser tooling
17+
- handle long-running operational loops in tmux/systemd
18+
19+
## Docker support
20+
21+
Agents must use:
22+
23+
```bash
24+
sudo /usr/local/bin/baudbot-docker
25+
```
26+
27+
This wrapper blocks common privilege-escalation patterns (for example, privileged mode and unsafe host mounts).
28+
29+
## Process and workspace model
30+
31+
```text
32+
/home/baudbot_agent/
33+
├── runtime/ # deployed runtime files
34+
├── .pi/agent/ # extensions, skills, memory, manifests
35+
└── workspace/ # repos + git worktrees used by dev agents
36+
```
37+
38+
Dev agents work inside `~/workspace/worktrees/<branch>` and should not commit directly from base repo checkouts.
39+
40+
## Platform support
41+
42+
Validated in CI against:
43+
44+
- Ubuntu 24.04
45+
- Arch Linux
46+
47+
Baudbot scripts aim to remain distro-agnostic across standard Linux environments.
48+
49+
## Operational boundaries
50+
51+
Linux-native does not mean unrestricted root access:
52+
53+
- no general sudo for agents
54+
- security-critical files are read-only at runtime
55+
- network controls can restrict outbound traffic
56+
- source/runtime separation limits self-tampering blast radius
57+
58+
See [SECURITY.md](../SECURITY.md) for threat model details.

docs/memory.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Persistent Memory
2+
3+
Baudbot uses file-based memory so context survives session restarts and knowledge compounds at the team level.
4+
5+
## Memory location
6+
7+
Memory files live in the deployed runtime under:
8+
9+
```text
10+
~/.pi/agent/memory/
11+
```
12+
13+
Typical files:
14+
15+
- `operational.md` — infra learnings and recurring fixes
16+
- `repos.md` — per-repo build/CI quirks and notes
17+
- `users.md` — collaboration preferences and communication style
18+
- `incidents.md` — prior incidents, root cause, and resolution
19+
20+
## Why it matters
21+
22+
Persistent memory lets the system improve over time:
23+
24+
- fewer repeated mistakes
25+
- faster triage for recurring failures
26+
- better continuity across restarts or model/session swaps
27+
28+
## Operating rules
29+
30+
- Read memory on startup before executing new work.
31+
- Append new learnings with dated entries.
32+
- Keep entries concrete and action-oriented.
33+
- Never store secrets, API keys, tokens, or private credentials.
34+
35+
## Entry format (example)
36+
37+
```markdown
38+
## 2026-02-18
39+
- Repo: myapp
40+
- Finding: integration tests fail unless REDIS_URL is set explicitly in CI.
41+
- Fix: export REDIS_URL=redis://127.0.0.1:6379 before running test:integration.
42+
```
43+
44+
## What belongs in memory vs git docs
45+
46+
Use memory for:
47+
48+
- runtime observations
49+
- team preferences
50+
- temporary but useful operational context
51+
52+
Use repository docs/commits for:
53+
54+
- canonical architecture
55+
- long-term implementation docs
56+
- user-facing product behavior changes
57+
58+
## Maintenance
59+
60+
- prune stale or duplicated notes periodically
61+
- keep headings consistent for scanability
62+
- consolidate repeated points into single authoritative entries
63+
64+
For role behavior around memory usage, see [agents.md](agents.md).

0 commit comments

Comments
 (0)