feat(close): Add --suggest-next flag to show newly unblocked issues (GH#679)

When closing an issue, the new --suggest-next flag returns a list of
issues that became unblocked (ready to work on) as a result of the close.

This helps agents and users quickly identify what work is now available
after completing a blocker.

Example:
  $ bd close bd-5 --suggest-next
  ✓ Closed bd-5: Completed

  Newly unblocked:
    • bd-7 "Implement feature X" (P1)
    • bd-8 "Write tests for X" (P2)

Implementation:
- Added GetNewlyUnblockedByClose to storage interface
- Implemented efficient single-query for SQLite using blocked_issues_cache
- Added SuggestNext field to CloseArgs in RPC protocol
- Added CloseResult type for structured response
- CLI handles both daemon and direct modes

Thanks to @kraitsura for the detailed feature request and design.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-25 20:05:04 -08:00
parent 35ab0d7a7f
commit f3a5e02a35
16 changed files with 306 additions and 140 deletions

View File

@@ -238,49 +238,18 @@ bd wisp gc # Garbage collect old wisps
For reference, here's how the layers stack:
```
Formulas (.formula.json) ← SOURCE: shareable workflow definitions
cook (ephemeral)
[Protos] ← TRANSIENT: compiled templates (auto-deleted)
pour/wisp
Molecules (bond, squash, burn) ← EXECUTION: workflow operations
Formulas (JSON compile-time macros) ← optional, for complex composition
Protos (template issues) ← optional, for reusable patterns
Molecules (bond, squash, burn) ← workflow operations
Epics (parent-child, dependencies) ← DATA PLANE (the core)
Issues (JSONL, git-backed) ← STORAGE
```
**Protos are ephemeral**: When you `bd pour formula-name` or `bd wisp create formula-name`, the formula is cooked into a temporary proto, used to spawn the mol/wisp, then automatically deleted. Protos are an implementation detail, not something users manage directly.
**Most users only need the bottom two layers.** Formulas are for sharing reusable patterns.
## Distillation: Extracting Patterns
The lifecycle is circular - you can extract formulas from completed work:
```
Formulas ──cook──→ Mols/Wisps ──distill──→ Formulas
```
**Use cases for distillation:**
- **Emergent patterns**: Manually structured an epic that worked well
- **Modified execution**: Poured a formula but added custom steps
- **Learning from success**: Extract what made a complex mol succeed
```bash
bd distill <mol-id> -o my-workflow.formula.json # Extract formula from mol
```
## Sharing: The Mol Mall
All workflow sharing happens via formulas:
```bash
bd mol publish my-workflow.formula.json # Share to GitHub repo
bd mol install github.com/org/mol-code-review # Install from GitHub
bd pour mol-code-review --var repo=myproject # Use installed formula
```
Formulas are clean source code: composable, versioned, parameterized. Mols contain execution-specific context and aren't shared directly.
**Most users only need the bottom two layers.** Protos and formulas are for reusable patterns and complex composition.
## Commands Quick Reference