Skip to content

Commit 16fe173

Browse files
author
StackMemory Bot (CLI)
committed
feat(conductor): self-improving conductor — v1.6.0
- Wire GEPA → `conductor learn --evolve`: auto-mutate prompt template from failure data using Claude as mutation engine - Generate default prompt-template.md on first `conductor start` - Extract `isProcessAlive()` to shared utility (7 call sites deduplicated) - Fix `conductor finalize` hardcoded origin/main — detect base branch dynamically via git symbolic-ref - Fix signal handler leaks in monitor + logs commands - Update CLAUDE.md with conductor learning loop docs
1 parent af3906e commit 16fe173

File tree

10 files changed

+390
-77
lines changed

10 files changed

+390
-77
lines changed

CLAUDE.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ docs/ # Documentation
2727
- Database: src/core/database/sqlite-adapter.ts
2828
- Snapshot: src/core/worktree/capture.ts
2929
- Preflight: src/core/worktree/preflight.ts
30-
- Conductor: src/cli/commands/orchestrator.ts
30+
- Conductor: src/cli/commands/orchestrator.ts (core) + orchestrate.ts (CLI)
31+
- Process Utils: src/utils/process-cleanup.ts
3132
- Shared Utils: src/core/utils/{git,text,fs}.ts
3233

3334
## Detailed Guides
@@ -62,7 +63,12 @@ stackmemory restore # Restore from captured state
6263
stackmemory snapshot save # Post-run context snapshot (alias: snap)
6364
stackmemory snapshot list # List recent snapshots
6465
stackmemory preflight # File overlap check for parallel tasks (alias: pf)
65-
stackmemory conductor start # Autonomous Linear→worktree→agent orchestrator
66+
stackmemory conductor start # Autonomous Linear→worktree→agent orchestrator
67+
stackmemory conductor learn # Analyze agent outcomes (success rate, failure phases, error patterns)
68+
stackmemory conductor learn --evolve # Auto-mutate prompt template from failure data (GEPA)
69+
stackmemory conductor status # Live agent status dashboard
70+
stackmemory conductor monitor # Real-time TUI with phase tracking
71+
stackmemory conductor finalize # Clean up dead/stale agents
6672
stackmemory loop "<cmd>" --until "<pattern>" # Poll until condition met (alias: watch)
6773
```
6874

@@ -145,6 +151,25 @@ railway up
145151
# Pre-publish checks require clean git status — stash GEPA files first
146152
```
147153

154+
## Conductor (Autonomous Agent Orchestration)
155+
156+
The conductor manages autonomous coding agents via Linear issues:
157+
158+
**Data files** (all under `~/.stackmemory/conductor/`):
159+
- `prompt-template.md` — Agent prompt template with `{{VARIABLE}}` substitution (auto-created on first `conductor start`)
160+
- `outcomes.jsonl` — JSONL log of agent outcomes (success/failure, phase, tokens, errors)
161+
- `evolution-log.jsonl` — History of `--evolve` mutations applied to the prompt template
162+
- `agents/<issue-id>/status.json` — Per-agent status files
163+
- `agents/<issue-id>/output.log` — Agent stdout/stderr
164+
165+
**Learning loop**:
166+
1. Agents run → outcomes logged to `outcomes.jsonl`
167+
2. `conductor learn` analyzes patterns (success rate, failure phases, error types)
168+
3. `conductor learn --evolve` calls Claude to mutate `prompt-template.md` based on failure data
169+
4. Next agent run uses the improved template → repeat
170+
171+
**Template variables**: `{{ISSUE_ID}}`, `{{TITLE}}`, `{{DESCRIPTION}}`, `{{LABELS}}`, `{{PRIORITY}}`, `{{ATTEMPT}}`, `{{PRIOR_CONTEXT}}`
172+
148173
## Task Delegation Model
149174

150175
Route effort by task complexity — not all code changes deserve equal scrutiny:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stackmemoryai/stackmemory",
3-
"version": "1.5.9",
3+
"version": "1.6.0",
44
"description": "Lossless, project-scoped memory for AI coding tools. Durable context across sessions with 56 MCP tools, FTS5 search, conductor orchestrator, loop/watch monitoring, snapshot capture, pre-flight overlap checks, Claude/Codex/OpenCode wrappers, Linear sync, and automatic hooks.",
55
"engines": {
66
"node": ">=20.0.0",

0 commit comments

Comments
 (0)