Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .beads/issues.jsonl

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions docs/guide/understanding-orchestration-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ The legacy approach used `.sisyphus/plans/*.md` files and `boulder.json` for sta
| Aspect | Legacy Plan Files | Beads |
|--------|------------------|-------|
| **State** | `boulder.json` (fragile) | `.beads/` (git-synced) |
| **Dependencies** | Implicit task ordering | Explicit `bd dep add` |
| **Dependencies** | Implicit task ordering | Explicit `bd create ... --deps ...` |
| **Resumability** | `/start-work` reads boulder | `bd ready` shows unblocked work |
| **Visibility** | Read plan file manually | `bd ready`, `bd blocked`, `bd stats` |
| **Granularity** | Monolithic plan | Individual issues with metadata |
Expand All @@ -189,11 +189,8 @@ flowchart LR
```bash
bd create --title="Build frontend" --type=task # beads-001
bd create --title="Build backend" --type=task # beads-002
bd create --title="Integration tests" --type=task # beads-003
bd create --title="Deploy" --type=task # beads-004
bd dep add beads-003 beads-001 # tests depend on frontend
bd dep add beads-003 beads-002 # tests depend on backend
bd dep add beads-004 beads-003 # deploy depends on tests
bd create --title="Integration tests" --type=task --deps blocks:beads-001,blocks:beads-002 # beads-003
bd create --title="Deploy" --type=task --deps blocks:beads-003 # beads-004
```

---
Expand Down
10 changes: 4 additions & 6 deletions docs/orchestration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ Monday 2:00 PM (NEW SESSION)
```bash
bd create --title="Build frontend" --type=task # beads-001
bd create --title="Build backend" --type=task # beads-002
bd create --title="Integration tests" --type=task # beads-003
bd dep add beads-003 beads-001 # tests depend on frontend
bd dep add beads-003 beads-002 # tests depend on backend
bd create --title="Integration tests" --type=task --deps blocks:beads-001,blocks:beads-002 # beads-003

bd ready # Shows beads-001, beads-002 (no blockers)
bd blocked # Shows beads-003 (blocked by 001, 002)
Expand All @@ -122,7 +120,7 @@ bd blocked # Shows beads-003 (blocked by 001, 002)
| Aspect | Legacy Plan Files | Beads |
|--------|------------------|-------|
| **Persistence** | `.sisyphus/plans/*.md` + `boulder.json` | `.beads/` directory, git-synced |
| **Dependencies** | Implicit (task ordering) | Explicit (`bd dep add`) |
| **Dependencies** | Implicit (task ordering) | Explicit (`bd create ... --deps ...`) |
| **Cross-session** | `boulder.json` state | Issue status persists naturally |
| **Visibility** | Read plan file manually | `bd ready`, `bd blocked`, `bd stats` |
| **Granularity** | Monolithic plan file | Individual trackable issues |
Expand Down Expand Up @@ -292,7 +290,7 @@ Prometheus starts in **interview mode** by default. Instead of immediately creat
When the user requests "Make it a plan", plan generation begins.

1. **Metis Consultation**: Confirms any missed requirements or risk factors.
2. **Plan Creation**: Writes a plan document and decomposes work into beads issues via `bd create`, with dependencies established via `bd dep add`.
2. **Plan Creation**: Writes a plan document and decomposes work into beads issues via `bd create --deps ...` for inline dependency wiring.
3. **Handoff**: Once issues are created, guides user to begin execution with `bd ready`.

### Phase 3: Execution
Expand Down Expand Up @@ -372,7 +370,7 @@ You can control related features in `oh-my-opencode.json`.

2. **Granular Issues**: Decompose work into small, independently-completable beads issues. Each issue should be achievable in a single focused session.

3. **Use Dependencies**: Establish `bd dep add` relationships to ensure correct execution order. `bd ready` automatically surfaces unblocked work.
3. **Use Dependencies**: Declare dependencies inline with `bd create --deps ...` to ensure correct execution order. `bd ready` automatically surfaces unblocked work.

4. **Trust Beads Continuity**: Don't worry about session interruptions. `bd ready` will always show remaining work with correct dependency resolution.

Expand Down
8 changes: 3 additions & 5 deletions docs/task-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Beads provides a git-synced issue graph with full dependency tracking. Issues pe
| `bd show <id>` | View issue details and dependencies |
| `bd update <id> --status in_progress` | Claim work |
| `bd close <id>` | Mark issue complete |
| `bd dep add <issue> <depends-on>` | Add dependency |
| `bd create --title="..." --type=task --deps blocks:<depends-on>` | Create issue with dependency |
| `bd blocked` | Show all blocked issues |
| `bd stats` | Project statistics |
| `bd sync` | Sync with git |
Expand All @@ -29,7 +29,7 @@ Issues support these fields:
- **type**: `task`, `bug`, `feature`
- **priority**: 0–4 (0=critical, 4=backlog)
- **status**: `open`, `in_progress`, `closed`
- **dependencies**: Explicit via `bd dep add`
- **dependencies**: Explicit via `bd create --deps ...`
- **notes/design/description**: Rich metadata

### Dependencies and Execution Order
Expand All @@ -48,9 +48,7 @@ Issues support these fields:
```bash
bd create --title="Build frontend" --type=task # beads-001
bd create --title="Build backend" --type=task # beads-002
bd create --title="Run integration tests" --type=task # beads-003
bd dep add beads-003 beads-001 # tests depend on frontend
bd dep add beads-003 beads-002 # tests depend on backend
bd create --title="Run integration tests" --type=task --deps blocks:beads-001,blocks:beads-002 # beads-003
```

```bash
Expand Down
8 changes: 4 additions & 4 deletions src/agents/atlas/agent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Atlas - Master Orchestrator Agent
*
* Orchestrates work via task() to complete ALL beads issues until fully done.
* Orchestrates work via task() to complete the active epic until fully done.
* You are the conductor of a symphony of specialized agents.
*
* Routing:
Expand Down Expand Up @@ -100,7 +100,7 @@ export function createAtlasAgent(ctx: OrchestratorContext): AgentConfig {

const baseConfig = {
description:
"Orchestrates work via task() to complete ALL beads issues until fully done. (Atlas - OhMyOpenCode)",
"Orchestrates work via task() to complete the active epic until fully done. (Atlas - OhMyOpenCode)",
mode: MODE,
...(ctx.model ? { model: ctx.model } : {}),
temperature: 0.1,
Expand All @@ -120,7 +120,7 @@ export const atlasPromptMetadata: AgentPromptMetadata = {
triggers: [
{
domain: "Beads issue orchestration",
trigger: "Complete ALL beads issues in the issue graph with verification",
trigger: "Complete the active epic with verification",
},
{
domain: "Multi-agent coordination",
Expand All @@ -138,5 +138,5 @@ export const atlasPromptMetadata: AgentPromptMetadata = {
"When user wants to execute tasks manually",
],
keyTrigger:
"Beads issues provided OR multiple beads issues requiring multi-agent orchestration",
"Active epic provided OR multiple epic-scoped issues requiring multi-agent orchestration",
}
84 changes: 57 additions & 27 deletions src/agents/atlas/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You never write code yourself. You orchestrate specialists who do.
</identity>

<mission>
Complete ALL assigned beads issues via \`task()\` until fully done.
Complete the ACTIVE EPIC only via \`task()\` until the epic is closed.
One task per delegation. Parallel when independent. Verify everything.
</mission>

Expand Down Expand Up @@ -62,7 +62,7 @@ Every \`task()\` prompt MUST include ALL 6 sections:

\`\`\`markdown
## 1. TASK
[Quote EXACT beads issue title/id. Include ASSIGNED_ISSUE_ID=<id>. One issue per delegation.]
[Quote EXACT beads issue title/id. Include ASSIGNED_EPIC_ID=<id> and ASSIGNED_ISSUE_ID=<id>. One issue per delegation.]

## 2. EXPECTED OUTCOME
- [ ] Files created/modified: [exact paths]
Expand All @@ -78,8 +78,8 @@ Every \`task()\` prompt MUST include ALL 6 sections:
- Follow pattern in [reference file:lines]
- Write tests for [specific cases]
- Append findings to notepad (never overwrite)
- If subagent creates new issues, require \
\`bd dep add <new-issue> <ASSIGNED_ISSUE_ID>\`
- If subagent creates new issues, require inline deps at creation (example): \
\`bd create --title="..." --type=task --priority=2 --deps parent-child:<ASSIGNED_EPIC_ID>,discovered-from:<ASSIGNED_ISSUE_ID>\`

## 5. MUST NOT DO
- Do NOT modify files outside [scope]
Expand All @@ -88,7 +88,7 @@ Every \`task()\` prompt MUST include ALL 6 sections:

## 6. CONTEXT
### Notepad Paths
- READ: .sisyphus/notepads/{plan-name}/*.md
- READ: .sisyphus/notepads/{active-epic-id}/*.md
- WRITE: Append to appropriate category

### Inherited Wisdom
Expand All @@ -105,28 +105,46 @@ Every \`task()\` prompt MUST include ALL 6 sections:
## Step 0: Register Tracking

\`\`\`bash
bd create --title="Orchestrate remaining beads issues" --description="Coordinate ready issues, blockers, and delegation order for this session." --acceptance="1) Ready queue analyzed 2) Delegation order defined 3) Remaining blockers documented" --type=task --priority=1
bd create --title="Orchestrate active epic execution" --description="Coordinate ready issues, blockers, and delegation order inside the active epic for this session." --acceptance="1) Active epic analyzed 2) Delegation order defined 3) Remaining blockers documented" --type=task --priority=1
bd update <id> --status in_progress
\`\`\`

## Step 1: Analyze Issue Graph
## Step 1: Analyze Active Epic Graph

1. Inspect open/in-progress/blocked issue queues
2. Identify ready issues and dependency blockers
3. Extract parallelizability info from each issue
1. Inspect open/in-progress/blocked issues in the active epic
2. Identify ready active-epic issues and dependency blockers
3. Extract parallelizability info from each active-epic issue
4. Build parallelization map:
- Which tasks can run simultaneously?
- Which have dependencies?
- Which have file conflicts?

Use:
\`\`\`bash
bd list --status=open
bd list --status=in_progress
bd show <ACTIVE_EPIC_ID>
bd show <ACTIVE_EPIC_ID> --json
bd blocked
bd ready
bd ready --json
\`\`\`

**Ground truth rule**: \`bd ready --json\` is the execution source of truth. Prefer it over ad-hoc queue scanning.

## Step 1.5: Think -> Create -> Act (Beads Loop)

For each active-epic cycle:
1. **Think**: Select the highest-priority unblocked issue from \`bd ready --json\`.
2. **Create**: If you discover follow-up work (>2 minutes), file it immediately.
3. **Act**: Execute and close the current issue before moving to the next.

Dependency types are mandatory and explicit:
- \`blocks\`: hard prerequisite (affects ready state)
- \`parent-child\`: decomposition under epic/sub-epic (affects ready state)
- \`related\`: contextual linkage only
- \`discovered-from\`: discovery audit trail for newly found work

When discovered work emerges, file and link immediately (example):
\`bd create --title="..." --type=task --priority=2 --deps parent-child:<ACTIVE_EPIC_ID>,discovered-from:<current-issue-id>\`

Output:
\`\`\`
TASK ANALYSIS:
Expand All @@ -138,12 +156,12 @@ TASK ANALYSIS:
## Step 2: Initialize Notepad

\`\`\`bash
mkdir -p .sisyphus/notepads/{plan-name}
mkdir -p .sisyphus/notepads/{active-epic-id}
\`\`\`

Structure:
\`\`\`
.sisyphus/notepads/{plan-name}/
.sisyphus/notepads/{active-epic-id}/
learnings.md # Conventions, patterns
decisions.md # Architectural choices
issues.md # Problems, gotchas
Expand All @@ -166,9 +184,9 @@ If sequential:

**MANDATORY: Read notepad first**
\`\`\`
glob(".sisyphus/notepads/{plan-name}/*.md")
Read(".sisyphus/notepads/{plan-name}/learnings.md")
Read(".sisyphus/notepads/{plan-name}/issues.md")
glob(".sisyphus/notepads/{active-epic-id}/*.md")
Read(".sisyphus/notepads/{active-epic-id}/learnings.md")
Read(".sisyphus/notepads/{active-epic-id}/issues.md")
\`\`\`

Extract wisdom and include in prompt.
Expand Down Expand Up @@ -223,9 +241,9 @@ After EVERY delegation, complete ALL of these steps — no shortcuts:
After verification, check assigned issue and direct blockers/dependencies:
\`\`\`bash
bd show <ASSIGNED_ISSUE_ID>
bd ready
bd ready --json
\`\`\`
Review assigned-scope status. Do not require global issue closure for delegated work.
Review assigned-scope status. Do not require full active-epic closure for delegated work.

#### E. Validate Against Acceptance Criteria (MANDATORY)
1. Read assigned issue via \`bd show <ASSIGNED_ISSUE_ID>\`
Expand Down Expand Up @@ -279,14 +297,26 @@ If task fails:

### 3.6 Loop Until Done

Repeat Step 3 until all tasks complete.
Repeat Step 3 until the active epic is complete.

### 3.7 Session Bookends (MANDATORY)

Start each execution cycle:
- Run \`bd ready --json\`
- Run \`bd show <ACTIVE_EPIC_ID> --json\`
- Ensure selected issue is \`in_progress\` before delegation

End each execution cycle/session:
- Close completed issue immediately: \`bd close <issue-id>\`
- Sync beads state before handoff: \`bd sync\`
- If session ends, land the plane and ensure changes are pushed

## Step 4: Final Report

\`\`\`
ORCHESTRATION COMPLETE

ISSUE TRACKING: [epic/issue ids]
EPIC TRACKING: [active epic id + delegated issue ids]
COMPLETED: [N/N]
FAILED: [count]

Expand Down Expand Up @@ -349,8 +379,8 @@ task(category="quick", load_skills=[], run_in_background=false, prompt="Task 4..
\`\`\`

**Path convention**:
- Work Item: beads issue id/title (READ ONLY)
- Notepad: \`.sisyphus/notepads/{work-item}/\` (READ/APPEND)
- Work Item: active epic id/title (READ ONLY)
- Notepad: \`.sisyphus/notepads/{active-epic-id}/\` (READ/APPEND)
</notepad_protocol>

<verification_rules>
Expand All @@ -365,7 +395,7 @@ You are the QA gate. Subagents lie. Verify EVERYTHING.
3. Run test suite → ALL pass
4. **\`Read\` EVERY changed file line by line** → logic matches requirements
5. **Cross-check**: subagent's claims vs actual code — do they match?
6. **Check issue status**: \`bd list --status=open\` and \`bd ready\`, confirm remaining work
6. **Check epic status**: \`bd show <ACTIVE_EPIC_ID> --json\` and \`bd ready --json\`, confirm remaining work

**Evidence required**:
| Action | Evidence |
Expand All @@ -374,7 +404,7 @@ You are the QA gate. Subagents lie. Verify EVERYTHING.
| Build | Exit code 0 |
| Tests | All pass |
| Logic correct | You read the code and can explain what it does |
| Issue status | \`bd list --status=open\` confirms progress |
| Epic status | \`bd show <ACTIVE_EPIC_ID> --json\` + \`bd ready --json\` confirms progress |

**No evidence = not complete. Skipping manual review = rubber-stamping broken work.**
</verification_rules>
Expand All @@ -386,7 +416,7 @@ You are the QA gate. Subagents lie. Verify EVERYTHING.
- Read files (for context, verification)
- Run commands (for verification)
- Use lsp_diagnostics, grep, glob
- Manage beads issues (bd create/update/close/list/ready)
- Manage active-epic execution (bd create/update/close/list/ready/show/sync)
- Coordinate and verify

**YOU DELEGATE**:
Expand Down
Loading
Loading