feat: add bd mol progress command for efficient molecule monitoring (bd-8xnf)

Adds a new `bd mol progress` command that shows molecule progress using
indexed queries instead of loading all steps into memory. This makes it
suitable for mega-molecules with millions of steps.

Features:
- Efficient SQL-based counting via idx_dependencies_depends_on_type index
- Progress display: completed / total (percentage)
- Current step identification
- Rate calculation from closure timestamps
- ETA estimation
- JSON output support

New storage interface method: GetMoleculeProgress(ctx, moleculeID)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/fang
2025-12-31 12:35:41 -08:00
committed by Steve Yegge
parent 3593ba8d66
commit 0a96b10bba
7 changed files with 1210 additions and 870 deletions

View File

@@ -677,6 +677,19 @@ type TreeNode struct {
Truncated bool `json:"truncated"`
}
// MoleculeProgressStats provides efficient progress info for large molecules.
// This uses indexed queries instead of loading all steps into memory.
type MoleculeProgressStats struct {
MoleculeID string `json:"molecule_id"`
MoleculeTitle string `json:"molecule_title"`
Total int `json:"total"` // Total steps (direct children)
Completed int `json:"completed"` // Closed steps
InProgress int `json:"in_progress"` // Steps currently in progress
CurrentStepID string `json:"current_step_id"` // First in_progress step ID (if any)
FirstClosed *time.Time `json:"first_closed,omitempty"`
LastClosed *time.Time `json:"last_closed,omitempty"`
}
// Statistics provides aggregate metrics
type Statistics struct {
TotalIssues int `json:"total_issues"`