Skip to content

Commit 71ec8c1

Browse files
bkataruclaude
andcommitted
chore(v0.2.2): wrap up — README, CHANGELOG, version, gitignore, CLAUDE.md
- README: full rewrite for v0.2.2 — supercar-themed lead paragraph, local LLM section with igllama usage, session summary example, tests badge (195/195), Showcase link in docs section, igllama in inspiration table - CHANGELOG: add [0.2.2] entry covering all changes in this release - build.zig.zon: bump version 0.2.1 → 0.2.2 - src/main.zig: bump VERSION constant and test 0.2.1 → 0.2.2 - .gitignore: add .powerglide/ (runtime session dir written by powerglide run) - CLAUDE.md: add igllama section, current version note, update roadmap to include items 8-10 (igllama, session summary, showcase) 195/195 tests passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0d98ae3 commit 71ec8c1

File tree

6 files changed

+109
-58
lines changed

6 files changed

+109
-58
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ revert_*.py
4343
test_*.zig
4444
test_env
4545
test_arraylist
46+
47+
# Runtime session data written by powerglide run/agent
48+
.powerglide/

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to the **powerglide** project will be documented in this file.
44

5+
## [0.2.2] - 2026-03-04
6+
7+
### Added
8+
- **Session summary output**`powerglide run` now emits a structured completion block showing steps taken, elapsed time, agent/model name, and `<POWERGLIDE_DONE>` or `<POWERGLIDE_ERROR>` terminal signal
9+
- **igllama port scanning**`powerglide doctor` scans `:8090–8099` instead of hardcoded `:8090`; reports all running igllama instances
10+
- **`json_mode` on `OpenAIClient`** — sets `response_format: {"type":"json_object"}` for constrained JSON generation on igllama and other local endpoints
11+
- **Showcase page**`website/content/showcase.smd` with 4 case studies: codebase exploration (0.8B), targeted query (4B), tool calling triage + json_mode, session summary output; performance table; dogfooding verdict
12+
- **Showcase nav link** — added to both `page.shtml` and `home.shtml` nav bars with amber highlight
13+
- **Tests badge** in README (195/195)
14+
15+
### Fixed
16+
- **`Loop step count increments` test** — now uses `/tmp/test_loop_step_count.json` instead of default `.powerglide/session.json`; previously picked up real session state from dogfooding runs and failed
17+
- **README** — updated to v0.2.2 with local LLM section, session summary example, igllama integration, Showcase link, and tests badge
18+
519
## [0.2.1] - 2026-03-04
620

721
### Added

CLAUDE.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,27 @@ cp -r zig-out/docs/. ../docs/
4141
- `src/mcp/tool_bridge.zig` — converts `McpTool``Tool`, prefixed `mcp_{server}_{tool}`
4242
- Config key: `mcp_servers` array in `~/.config/powerglide/config.json`
4343

44+
## igllama / Local LLM
45+
46+
- `local` agent → `Qwen3.5-0.8B-Q8_0.gguf` on `http://127.0.0.1:8090/v1`
47+
- `local4b` agent → `Qwen3.5-4B-Q8_0.gguf` on `http://127.0.0.1:8091/v1`
48+
- Start with: `igllama api <model.gguf> --port <N> --no-think`
49+
- `OpenAIClient.json_mode = true` → forces `response_format: {"type":"json_object"}` for constrained output
50+
- Doctor scans `:8090–8099` automatically
51+
52+
## Current Version
53+
54+
`0.2.2` — 195/195 tests passing, 0 leaks.
55+
4456
## Roadmap
4557

4658
1. ✅ Zig 0.15.2 compatibility
4759
2. ✅ Multi-agent swarm implementation
4860
3. ✅ Ralph Loop integration
49-
4. ✅ Technical overhaul of website & prose
61+
4. ✅ Technical overhaul of website & prose (supercar theme)
5062
5. ✅ Refactored velocity to multiplier model
5163
6. ✅ TUI implementation (vxfw multi-agent dashboard)
5264
7. ✅ MCP integration (`src/mcp/` — server, client, tool_bridge)
65+
8. ✅ igllama integration — local Qwen3.5 agents, json_mode, port scanning
66+
9. ✅ Session summary output on `powerglide run` completion
67+
10. ✅ Showcase page — dogfooding case studies with 0.8B and 4B models

README.md

Lines changed: 73 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
[![Zig](https://img.shields.io/badge/Zig-0.15.2-F7A41D?logo=zig&logoColor=white)](https://ziglang.org/)
88
[![Build](https://github.com/bkataru/powerglide/actions/workflows/ci.yml/badge.svg)](https://github.com/bkataru/powerglide/actions/workflows/ci.yml)
9+
[![Tests](https://img.shields.io/badge/tests-195%2F195-brightgreen)](https://github.com/bkataru/powerglide)
910
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
1011
[![GitHub Stars](https://img.shields.io/github/stars/bkataru/powerglide?style=social)](https://github.com/bkataru/powerglide)
1112

@@ -17,9 +18,9 @@
1718

1819
## What is powerglide?
1920

20-
**powerglide** is a high-performance CLI coding agent runtime built in [Zig 0.15.2](https://ziglang.org/). It provides a robust, fault-tolerant execution layer for LLM swarms, designed specifically for autonomous coding tasks that require high throughput and verifiable correctness.
21+
Like a finely tuned transmission at full throttle, **powerglide** swerves through your codebase with precision, force, and grace. It is the layer between you and a swarm of LLM-driven engineers working in parallel — written in [Zig 0.15.2](https://ziglang.org/), compiled to a single static binary with zero runtime dependencies, and built around one non-negotiable constraint: the agent loop must be reliable enough to run unattended.
2122

22-
Unlike open-ended agent loops that can drift or hang, powerglide is built around the **Ralph Loop** — an explicit 11-state machine that ensures every step is auditable, every tool call is isolated in its own PTY, and every session terminates with a clear protocol signal.
23+
The foundation is the **Ralph Loop** — an explicit 11-state machine that sequences every agent action from task intake through tool execution to verified completion. No implicit flow, no silent exits. Every session terminates with `<POWERGLIDE_DONE>` or `<POWERGLIDE_ERROR>`. The loop drives the model; the model does not drive the loop.
2324

2425
```bash
2526
$ powerglide run --agent hephaestus --velocity 2.0 "refactor the auth module to use the new session manager"
@@ -29,11 +30,13 @@ $ powerglide run --agent hephaestus --velocity 2.0 "refactor the auth module to
2930

3031
## Core Pillars
3132

32-
- **The Ralph Loop** 🔄 — An explicit state machine (`idle → load_tasks → pick_task → thinking → tool_call → executing → observing → verify → commit → done`) that sequences cognition and action. No silent failures, no implicit transitions.
33-
- **Velocity Control** 🚀 — Precision control over agent throughput. Velocity is a floating-point multiplier (f64) on a 1000ms base delay (`delay_ms = 1000 / velocity`). Default is `1.0` (1000ms). Speed up (`--velocity 2.0` = 500ms) or slow down (`--velocity 0.5` = 2000ms) as needed.
34-
- **Reliable PTYs** 💻 — Every tool execution happens in a real pseudoterminal. Exit codes are captured via `waitpid` with a `/proc` fallback, ensuring that `zig build` or `pytest` results are 100% reliable.
35-
- **Rogue Agent Prevention** 🛡️ — Defense in depth with step limits, heartbeat monitoring, circuit breakers for repeat tool calls, and budget tracking. Rogue agents are killed before they can damage your codebase.
36-
- **Multi-Model Routing** 🤖 — Native support for Anthropic (Claude), OpenAI, and any OpenAI-compatible endpoint. Automatic fallback chains ensure that rate limits don't stop your workflow.
33+
- **The Ralph Loop** 🔄 — Explicit 11-state machine: `idle → load_tasks → pick_task → thinking → tool_call → executing → observing → verify → commit → done`. Every step is auditable; every session ends with a deterministic terminal signal.
34+
- **Velocity Control** 🚀 — Precision control over agent throughput. `delay_ms = 1000 / velocity`. Speed up (`--velocity 2.0` = 500ms/step) or slow down (`--velocity 0.5` = 2000ms/step) without restarting the session. Agents can self-throttle mid-run.
35+
- **Reliable PTYs** 💻 — Every tool runs in a real pseudoterminal. Exit codes captured via `waitpid` with WNOHANG polling and a `/proc/<pid>/status` fallback — so `zig build`, `pytest`, and `bash` all deliver trustable results to the VERIFY state.
36+
- **Rogue Agent Prevention** 🛡️ — Step limits, heartbeat monitoring (30s), circuit breakers for repeated tool calls, and budget tracking. Stuck agents are killed before they accumulate diverged work.
37+
- **Multi-Model Routing** 🤖 — Anthropic (Claude), OpenAI, and any OpenAI-compatible endpoint (Ollama, [igllama](https://github.com/bkataru/igllama), NVIDIA NIM, Together AI). Fallback chains keep sessions alive through provider outages.
38+
- **MCP Integration** 🔌 — Run as an MCP server (`powerglide mcp`) or connect to external MCP servers as a client. External tools get prefixed names and become first-class tools in the registry.
39+
- **Local LLM Support** 🏠 — Pre-configured `local` and `local4b` agents route to igllama on `:8090`/`:8091`. No API keys required for exploration and triage workflows.
3740

3841
---
3942

@@ -47,136 +50,152 @@ $ powerglide run --agent hephaestus --velocity 2.0 "refactor the auth module to
4750

4851
![Swarm Architecture](docs/svg/swarm-arch.svg)
4952

53+
### The Ralph Loop
54+
55+
![Ralph Loop](docs/svg/ralph-loop.svg)
56+
5057
---
5158

5259
## Quick Start
5360

5461
### Prerequisites
5562

56-
- [Zig 0.15.2](https://ziglang.org/download/)`mise install zig@0.15.2` or from official binaries.
57-
- An API key for your provider (set `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`).
63+
- [Zig 0.15.2](https://ziglang.org/download/)`mise install zig@0.15.2` or official binaries
64+
- An API key for your provider (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`), **or** run [igllama](https://github.com/bkataru/igllama) locally for a fully offline stack
5865

5966
### Build
6067

6168
```bash
6269
git clone https://github.com/bkataru/powerglide
6370
cd powerglide
6471
zig build
72+
# Binary at ./zig-out/bin/powerglide
6573
```
6674

67-
The static binary is located at `./zig-out/bin/powerglide`.
68-
6975
### Run
7076

7177
```bash
72-
# Verify system health and API keys
78+
# Verify setup — scans :8090-8099 for local igllama instances
7379
./zig-out/bin/powerglide doctor
7480

75-
# Launch a new agent session
81+
# Run a session (cloud)
7682
./zig-out/bin/powerglide run "implement a binary search tree in Zig"
7783

84+
# Run fully locally with Qwen3.5-4B via igllama
85+
igllama api Qwen3.5-4B-Q8_0.gguf --port 8091 --no-think &
86+
./zig-out/bin/powerglide run --agent local4b "describe the orchestrator module"
87+
7888
# Run at double speed
7989
./zig-out/bin/powerglide run --velocity 2.0 "add comprehensive unit tests"
8090

81-
# Open the multi-agent TUI dashboard
91+
# Open multi-agent TUI dashboard
8292
./zig-out/bin/powerglide tui
8393
```
8494

95+
Every completed session emits a structured summary:
96+
97+
```
98+
─────────────────────────────────────────
99+
Session complete [done]
100+
Steps: 9
101+
Elapsed: 3.4s
102+
Agent: local4b (Qwen3.5-4B-Q8_0.gguf)
103+
Signal: <POWERGLIDE_DONE>
104+
─────────────────────────────────────────
105+
```
106+
85107
---
86108

87109
## CLI Reference
88110

89111
| Command | Purpose |
90112
|---------|---------|
91113
| `run` | Launch a coding agent session |
92-
| `session` | Manage sessions (list, resume, show, delete) |
93-
| `agent` | Manage agent configurations (hephaestus, artistry, deep) |
114+
| `session` | Manage sessions list, show, resume, delete, export |
115+
| `agent` | Manage agent configs — list, add, remove, show |
94116
| `swarm` | Orchestrate parallel worker swarms |
95117
| `config` | View and modify global configuration |
96-
| `tools` | List and test available MCP-style tools |
97-
| `tui` | Launch the multi-panel dashboard |
118+
| `tools` | List and test available tools |
119+
| `mcp` | Start powerglide as an MCP server |
120+
| `tui` | Launch the multi-panel vxfw dashboard |
98121
| `doctor` | Run system health checks |
122+
| `version` | Show version |
99123

100124
---
101125

102126
## MCP Integration
103127

104-
powerglide speaks [Model Context Protocol](https://modelcontextprotocol.io/) natively — both as a server and as a client.
128+
powerglide speaks [Model Context Protocol](https://modelcontextprotocol.io/) natively — as both server and client.
105129

106130
### As an MCP Server
107131

108-
Run powerglide as an MCP server to expose its tools to any MCP-compatible client (Claude Desktop, another powerglide instance, or any JSON-RPC 2.0 client over stdin/stdout):
109-
110132
```bash
111133
powerglide mcp
112134
```
113135

114-
The server advertises all registered tools via `tools/list` and handles `tools/call` requests. Protocol sequence:
115-
1. Client sends `initialize` — server responds with `protocolVersion: "2024-11-05"` and `capabilities.tools`
116-
2. Client sends `tools/list` — server returns the full tool registry as MCP tool descriptors
117-
3. Client sends `tools/call` — server executes the tool and returns `content: [{type: "text", text: "..."}]`
136+
Exposes all registered tools via JSON-RPC 2.0 over stdin/stdout. Any MCP-compatible client (Claude Desktop, another powerglide instance) can call powerglide tools.
118137

119138
### As an MCP Client
120139

121-
Connect powerglide to external MCP servers to bring their tools into its registry as first-class powerglide tools. Add `mcp_servers` to your config:
140+
Add `mcp_servers` to `~/.config/powerglide/config.json`:
122141

123142
```json
124143
{
125144
"mcp_servers": [
126145
{
127146
"name": "filesystem",
128147
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
129-
},
130-
{
131-
"name": "github",
132-
"command": ["npx", "-y", "@modelcontextprotocol/server-github"]
133148
}
134149
]
135150
}
136151
```
137152

138-
External tools are registered with prefixed names (`mcp_filesystem_read_file`, `mcp_github_search_repositories`) and become indistinguishable from built-in tools to the agent loop.
153+
External tools register as `mcp_filesystem_read_file` etc. and are indistinguishable from built-in tools to the agent loop.
139154

140155
---
141156

142-
## The Ralph Loop
157+
## Local LLM Dogfooding
143158

144-
Every powerglide agent session is driven by the **Ralph Loop** — an explicit state machine that enforces a strict sequence from task intake through tool execution to completion.
159+
powerglide ships with igllama integration for fully local inference. See the **[Showcase](https://bkataru.github.io/powerglide/showcase/)** for case studies with Qwen3.5 0.8B and 4B models — including tool calling triage, session summary analysis, and the honest performance table.
145160

146-
![Ralph Loop](docs/svg/ralph-loop.svg)
161+
```bash
162+
# Start igllama (Zig-based Ollama alternative)
163+
igllama api Qwen3.5-0.8B-Q8_0.gguf --port 8090 --no-think &
164+
igllama api Qwen3.5-4B-Q8_0.gguf --port 8091 --no-think &
165+
166+
# Doctor detects both automatically
167+
powerglide doctor
168+
# OK igllama: running on :8090 (local agent available)
169+
# OK igllama: running on :8091 (local agent available)
170+
```
147171

148172
---
149173

150174
## Inspiration
151175

152-
powerglide is inspired by the best ideas from the AI coding agent ecosystem:
176+
powerglide synthesizes the strongest ideas from the AI coding agent ecosystem:
153177

154-
| Project | Inspiration |
155-
|---------|------------|
156-
| [oh-my-pi](https://github.com/can1357/oh-my-pi) | Multi-agent harness patterns, agent orchestration |
157-
| [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) | Ralph Wiggum loop, autonomous agent control |
158-
| [ralph](https://github.com/snarktank/ralph) | Ralph loop state machine, explicit done signals |
159-
| [The Ralph Playbook](https://github.com/ghuntley/how-to-ralph-wiggum) | Ralph Wiggum methodology, autonomous loops |
160-
| [gastown](https://github.com/steveyegge/gastown) | Multi-agent workspace isolation, task queues |
178+
| Project | What We Took |
179+
|---------|--------------|
180+
| [oh-my-pi](https://github.com/can1357/oh-my-pi) | Multi-agent harness: N workers, one orchestrator, file-based coordination |
181+
| [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) | Autonomous coding agents as invocable CLI subprocesses |
182+
| [ralph](https://github.com/snarktank/ralph) | The Ralph Loop pattern: explicit states, explicit done signal |
183+
| [gastown](https://github.com/steveyegge/gastown) | Per-worker workspace isolation, no write conflicts |
184+
| [opencode](https://github.com/anomalyco/opencode) | CLI structure and multi-model routing with fallback chains |
161185
| [loki](https://github.com/Dark-Alex-17/loki) | Tool registry, provider abstraction, session persistence |
162186
| [plandex](https://github.com/plandex-ai/plandex) | Plan+execute pattern, diff-based application |
163-
| [opencode](https://github.com/anomalyco/opencode) | CLI UX, multi-model routing |
164-
| [aichat](https://github.com/sigoden/aichat) | SSE streaming, config schema |
165-
| [goose](https://github.com/block/goose) | Agent extensibility, MCP integration |
166-
| [crush](https://github.com/charmbracelet/crush) | Terminal UX, TUI design |
167-
| [mem0](https://github.com/mem0ai/mem0) | Persistent memory layer for AI agents |
168-
| [pi-mono](https://github.com/badlogic/pi-mono) | Multi-agent coordination patterns |
169-
| [forge code](https://forgecode.dev) | Agentic coding workflow design |
187+
| [goose](https://github.com/block/goose) | MCP integration, agent extensibility |
188+
| [crush](https://github.com/charmbracelet/crush) | Terminal UX sensibility, vxfw-based TUI |
189+
| [mem0](https://github.com/mem0ai/mem0) | Persistent memory layer design |
190+
| [igllama](https://github.com/bkataru/igllama) | Local GGUF inference, OpenAI-compatible API for Qwen3.5 |
170191

171192
---
172193

173-
## For AI Agents
174-
175-
Powerglide is designed to be wielded by other agents. See [AGENTS.md](AGENTS.md) for the protocol specification and integration guide.
176-
177194
## Documentation
178195

179-
Full documentation is available at [bkataru.github.io/powerglide](https://bkataru.github.io/powerglide).
196+
Full docs at **[bkataru.github.io/powerglide](https://bkataru.github.io/powerglide)** — including [Architecture](https://bkataru.github.io/powerglide/architecture/), [CLI Reference](https://bkataru.github.io/powerglide/cli-reference/), [Configuration](https://bkataru.github.io/powerglide/configuration/), and the [Showcase](https://bkataru.github.io/powerglide/showcase/).
197+
198+
For AI agents working with powerglide programmatically, see [AGENTS.md](AGENTS.md).
180199

181200
## License
182201

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.name = .powerglide,
1010
// This is a [Semantic Version](https://semver.org/).
1111
// In a future version of Zig it will be used for package deduplication.
12-
.version = "0.2.1",
12+
.version = "0.2.2",
1313
// Together with name, this represents a globally unique package
1414
// identifier. This field is generated by the Zig toolchain when the
1515
// package is first created, and then *never changes*. This allows

src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const clap = @import("clap");
55
const pg_lib = @import("powerglide");
66
const tui_app = pg_lib.tui;
77

8-
const VERSION = "0.2.1";
8+
const VERSION = "0.2.2";
99
const ConfigDir = ".config/powerglide";
1010

1111
/// Main entry point
@@ -1244,7 +1244,7 @@ fn checkConfigDir(writer: anytype) !void {
12441244
}
12451245

12461246
test "VERSION constant is defined" {
1247-
try std.testing.expectEqualStrings("0.2.1", VERSION);
1247+
try std.testing.expectEqualStrings("0.2.2", VERSION);
12481248
}
12491249

12501250
test "VERSION matches expected format" {

0 commit comments

Comments
 (0)