Commit Graph

4227 Commits

Author SHA1 Message Date
Steve Yegge
947b5ee1c6 feat: add bd agent state command for ZFC-compliant state reporting (bd-uxlb)
Add agent commands for self-reporting state:
- bd agent state <agent> <state>: Update agent state and last_activity
- bd agent heartbeat <agent>: Update last_activity timestamp only
- bd agent show <agent>: Display agent bead details

States: idle, spawning, running, working, stuck, done, stopped, dead

Also adds AgentState and LastActivity fields to UpdateArgs in RPC protocol.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 01:56:53 -08:00
Steve Yegge
dfc796589f feat: add pour warning for vapor-phase formulas, improve help text, add doctor check
- Add Phase field to Formula type to indicate recommended instantiation phase
- Add warning in 'bd mol pour' when formula has phase="vapor"
- Improve pour/wisp help text with clear comparison of when to use each
- Add CheckPersistentMolIssues doctor check to detect mol- issues in JSONL
- Update beads-release.formula.json with phase="vapor"

This helps prevent accidental persistence of ephemeral workflow issues.
2025-12-28 01:34:01 -08:00
Steve Yegge
b5ab4f2a3b fix: address code review issues in bd worktree command
- Add CheckReadonly calls to create/remove commands
- Add cleanup on partial failure (remove worktree if beads setup fails)
- Prevent removing main repository as worktree
- Fix gitignore entry to use relative path from repo root
- Remove misleading stash check (stashes are repo-wide, not per-worktree)
- Populate Name field in WorktreeInfo struct
- Add #nosec comments for exec.Command and file reads

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 01:07:38 -08:00
Steve Yegge
f631299a87 feat: add bd worktree command for parallel development
Adds user-facing worktree management commands:
- bd worktree create <name> - creates worktree with beads redirect
- bd worktree list - shows all worktrees and their beads state
- bd worktree remove <name> - removes worktree with safety checks
- bd worktree info - shows current worktree info

The create command automatically sets up .beads/redirect to point to
the main repos .beads directory, ensuring all worktrees share
the same issue database. This enables parallel development with
multiple agents or features.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 01:01:52 -08:00
Steve Yegge
ecff74e2af feat: add bd slot commands for agent bead slot management (gt-h5sza)
Add slot management commands:
- bd slot set <agent> <slot> <bead> - set slot (error if occupied)
- bd slot clear <agent> <slot> - clear slot
- bd slot show <agent> - show all slots

These enforce cardinality constraints for agent bead slots.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 00:11:22 -08:00
Steve Yegge
46cdf075d4 feat: add agent ID pattern validation for bd create --type=agent (gt-hlaaf)
- Update ParseIssueType to use canonical types.IsValid() (includes agent, role, gate, message)
- Add ValidateAgentID function to validate gt-<role>[-<rig>[-<name>]] pattern
- Wire up validation in create.go when --type=agent with explicit ID
- Update --type flag help text to include agent and role types
- Add comprehensive test coverage for agent ID validation
2025-12-28 00:07:04 -08:00
Steve Yegge
b5c695075a Add agent-specific fields to bead schema (gt-v2gkv)
Agent identity fields on Issue struct:
- HookBead: reference to current work (0..1 cardinality)
- RoleBead: reference to role definition bead
- AgentState: self-reported state (idle|spawning|running|working|stuck|done|stopped|dead)
- LastActivity: timestamp for heartbeat/timeout detection
- RoleType: agent type (polecat|crew|witness|refinery|mayor|deacon)
- Rig: rig name (empty for town-level agents)

Also adds:
- AgentState type with IsValid() method
- Validation for agent state in Issue.Validate()
- Agent fields included in content hash

This enables the agent-as-bead architecture where agents are tracked
as first-class beads with self-reported state.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:44:39 -08:00
Steve Yegge
927e8374ee Add type=agent and type=role to bead schema (gt-ikyo1, gt-gzp2y)
- Add TypeAgent and TypeRole to IssueType enum in types.go
- Update IsValid() to include new types
- Add UI styles with distinct colors (cyan for agent, green for role)
- Add RenderType cases for consistent display

This enables creating agent beads (identity) and role beads (behavior
definitions) as part of the agent-as-bead architecture.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:38:56 -08:00
Steve Yegge
d686f0e9b1 fix: add --allow-staged flag to bump-version.sh for pre-staged release notes (bd-n97g)
When running the release workflow, users often stage CHANGELOG.md and info.go
changes before running bump-version.sh. Previously, the script would error
on uncommitted changes with --commit.

Now:
- --allow-staged permits pre-staged CHANGELOG.md and cmd/bd/info.go
- Script detects these as expected release files and includes them in commit
- Provides helpful error message if other files are staged

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:36:43 -08:00
Steve Yegge
b1859f54c1 bd sync: 2025-12-27 23:24:32 2025-12-27 23:24:32 -08:00
Steve Yegge
9e7ccb3e03 fix: update jsonl_file_hash on import to prevent hash mismatch warnings (bd-0vtq)
The import command was only updating jsonl_content_hash, not jsonl_file_hash.
After sync imports JSONL but skips re-export (because DB matches JSONL),
the jsonl_file_hash remained stale, causing validateJSONLIntegrity() to
emit spurious "JSONL file hash mismatch" warnings on subsequent operations.

Now import also calls SetJSONLFileHash with the same hash value, keeping
both hashes in sync and eliminating the false warnings.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:22:18 -08:00
Steve Yegge
d08c877a33 chore: Bump version to 0.39.1 2025-12-27 22:33:05 -08:00
Steve Yegge
ab3feda007 fix: remove arbitrary 8-char prefix limit from rename-prefix (GH#770)
The limit wasn't enforced by init/create, so users could create issues
with longer prefixes but couldn't use rename-prefix to consolidate them.
Since the DB handles longer prefixes fine, just remove the limit.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:24:19 -08:00
Josh Thomas
aa4da74fd1 Add opencode-beads to Community Tools section of README (#771) 2025-12-27 22:21:27 -08:00
Steve Yegge
35f8e197ee feat: add --parent flag to bd update for reparenting issues (bd-cj2e)
Allows reparenting issues to a different epic/parent:
  bd update bd-xyz --parent=bd-epic

Implementation:
- Add Parent field to UpdateArgs in protocol.go
- Handle reparenting in RPC handler (server_issues_epics.go)
- Add --parent flag to updateCmd with both daemon and direct mode support
- Remove old parent-child dependency before adding new one
- Pass empty string to remove parent entirely

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:17:24 -08:00
Steve Yegge
05d44503de bd sync: 2025-12-27 22:17:12 2025-12-27 22:17:12 -08:00
Steve Yegge
cd618f4115 bd sync: 2025-12-27 22:17:10 2025-12-27 22:17:10 -08:00
Steve Yegge
92f2e1db8b docs: add Database Redirects section to ADVANCED.md (bd-8x43)
Documents the .beads/redirect feature for sharing databases across
multiple clones, and the new `bd where` command for debugging.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:04:25 -08:00
Steve Yegge
aa99235a59 refactor: consolidate git context into single cached struct (bd-qph3)
Replaced 3 separate caches (isWorktree, mainRepoRoot, repoRoot) with a
single gitContext struct populated by one git call. This reduces git
subprocess calls from up to 4 down to 1 and simplifies ResetCaches().

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:49:52 -08:00
Steve Yegge
59fa2d8d10 bd sync: 2025-12-27 21:49:38 2025-12-27 21:49:38 -08:00
Steve Yegge
e1de09513c bd sync: 2025-12-27 21:44:52 2025-12-27 21:44:52 -08:00
Steve Yegge
7cd4a96847 bd sync: 2025-12-27 21:33:54 2025-12-27 21:33:54 -08:00
Steve Yegge
e72eb41e6f bd sync: 2025-12-27 21:33:33 2025-12-27 21:33:33 -08:00
Steve Yegge
bcc611b0b3 bd sync: 2025-12-27 21:27:50 2025-12-27 21:33:15 -08:00
Steve Yegge
ba1c9d6b17 feat: show redirect info in bd prime output (bd-kblo)
When beads is redirected (e.g., in Gas Town crew clones), bd prime now
shows a notice about the redirect. This helps agents understand why
they share issues with other clones.

CLI mode shows:
> ⚠️ **Redirected**: Local .beads → /path/to/target/.beads
> You share issues with other clones using this redirect.

MCP mode shows:
**Note**: Beads redirected to /path/to/target/.beads (shared with other clones)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:33:01 -08:00
Steve Yegge
aa3c4cb3eb feat: add 'bd where' command to show active beads location (bd-8x43)
Adds a new command that shows the active .beads directory path,
including redirect information for debugging. Supports --json output.

Example:
  bd where
  → /Users/stevey/gt/beads/mayor/rig/.beads
    (via redirect from /Users/stevey/gt/beads/crew/emma/.beads)
    prefix: bd
    database: /Users/stevey/gt/beads/mayor/rig/.beads/beads.db

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:27:44 -08:00
Steve Yegge
a326df945d bd sync: 2025-12-27 20:42:09 2025-12-27 20:42:18 -08:00
Steve Yegge
a737223b3c fix: doctor checks follow redirect for Gas Town support (bd-tvus)
Extended bd-tvus fix to all doctor check functions that access .beads/
directory. In Gas Town multi-clone setups, crew/polecat clones use
.beads/redirect files to point to the shared mayor/rig beads directory.

Doctor checks now use resolveBeadsDir() to follow these redirects:
- daemon.go: CheckDaemonStatus
- git.go: CheckSyncBranchConfig, FindOrphanedIssues, CheckOrphanedIssues
- installation.go: CheckMultipleDatabases, CheckPermissions
- integrity.go: CheckIDFormat, CheckDependencyCycles, CheckTombstones,
  CheckDeletionsManifest, CheckRepoFingerprint
- jsonl_integrity.go: CheckJSONLIntegrity
- legacy.go: CheckFreshClone
- maintenance.go: CheckStaleClosedIssues, CheckExpiredTombstones,
  CheckCompactionCandidates
- perf.go: RunPerformanceDiagnostics, CollectPlatformInfo
- validation.go: CheckMergeArtifacts, CheckOrphanedDependencies,
  CheckDuplicateIssues, CheckTestPollution, CheckChildParentDependencies,
  CheckGitConflicts
- version.go: CheckMetadataVersionTracking

Intentionally NOT changed (check local files):
- CheckInstallation: checks local .beads/ exists
- CheckUntrackedBeadsFiles: checks git tracking of local files

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:41:57 -08:00
Steve Yegge
ac837bc22e bd sync: 2025-12-27 20:41:47 2025-12-27 20:41:47 -08:00
Steve Yegge
a1a36263a9 bd sync: 2025-12-27 20:19:21 2025-12-27 20:20:14 -08:00
Steve Yegge
fee0ce6ea1 bd sync: 2025-12-27 19:56:26 2025-12-27 20:20:14 -08:00
Steve Yegge
f9bbe8e8e0 fix(doctor): follow redirect when checking database (bd-tvus)
The bug was that doctor's database checks used the local .beads/beads.db
file directly, while import followed the redirect to the actual database.
This caused confusing output showing 0 issues when the actual database
had hundreds. Fixed by using resolveBeadsDir() in all database checks.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:20:06 -08:00
Steve Yegge
1db8379be6 chore: bump version to 0.39.0 2025-12-27 19:41:39 -08:00
Steve Yegge
a16447802c docs: prepare 0.39.0 changelog and version notes 2025-12-27 19:41:20 -08:00
Steve Yegge
a1b3552860 docs: make pinned status description more concise
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 19:21:21 -08:00
Steve Yegge
e23d7ddd78 docs: fix tombstone status description
Changed from "preserved for reference" to "suppresses resurrections"
which better reflects the actual purpose.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 19:21:02 -08:00
Steve Yegge
5e99aba587 bd sync: 2025-12-27 19:18:26 2025-12-27 19:18:26 -08:00
Steve Yegge
4a993d4a38 bd sync: 2025-12-27 19:14:17 2025-12-27 19:14:17 -08:00
Steve Yegge
2ad2dbbca1 docs: add Issue Statuses section to CLI_REFERENCE.md (bd-epww)
Document all 7 issue statuses:
- open, in_progress, blocked, deferred, closed, tombstone, pinned

The pinned status was previously undocumented but is used by Gas Town
for hook management and persistent work items.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 19:13:47 -08:00
Steve Yegge
f93068e1b0 docs: consolidate duplicate UI_PHILOSOPHY files (GH#745)
Kept the more comprehensive version (115 lines vs 58) and
renamed to match docs/ naming convention (SCREAMING_SNAKE_CASE).
2025-12-27 18:01:59 -08:00
matt wilkie
d3fe6b0f32 fix: lint errors and update Nix vendorHash
- Add nolint:unparam for readOnly param in sqlite_open.go
- Handle cmd.Help() error in wisp.go
- Handle rows.Close() error in migration 028
- Handle targetStore.Close() error in create.go
- Update Nix vendorHash for current dependencies

Cherry-picked from PR #769
2025-12-27 17:29:36 -08:00
matt wilkie
99f5e50a32 feat: Add 'bd orphans' command with DRY refactoring of orphan detection
Implements the 'bd orphans' command to identify issues referenced in commits
but still open in the database, and refactors to eliminate code duplication.

- Creates cmd/bd/orphans.go with Cobra command structure
- Identifies orphaned issues (referenced in git commits but still open/in_progress)
- Supports multiple output formats (human, JSON, detailed)
- Auto-close with --fix flag

DRY refactoring:
- Extracted FindOrphanedIssues() to cmd/bd/doctor/git.go as shared core logic
- Moved OrphanIssue type to cmd/bd/doctor/types.go
- Refactored CheckOrphanedIssues() to use FindOrphanedIssues()

Cherry-picked from PR #767

Co-authored-by: Amp <amp@ampcode.com>
2025-12-27 17:23:45 -08:00
Adam Spiers
d71601d98e docs: fix README and PLUGIN.md documentation issues (#763)
docs: fix README and PLUGIN.md documentation issues

- Clarify that bd ready shows issues ready to work on (#512)
- Update git hooks install command from deprecated script to bd hooks install (#513)
- Fix Claude Code plugin local install: use ./beads not ., clarify shell vs CC commands (#514)

Fixes #512, #513, #514
2025-12-27 17:20:00 -08:00
Steve Yegge
d0694e6171 docs: update documentation for CLI consolidation (bd-bxqv)
Update docs to reflect CLI command restructuring:
- migrate-tombstones → migrate tombstones
- bd quickstart is now hidden, point to docs/QUICKSTART.md
- Add CLI consolidation section to CHANGELOG.md
- Remove quickstart from command tables

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:21:08 -08:00
Steve Yegge
d77a697cee feat: add bd admin parent command for cleanup/compact/reset (bd-3u8m)
Move cleanup, compact, and reset commands under `bd admin` namespace.
Creates hidden aliases for backwards compatibility that show deprecation
notice when used.

- Create cmd/bd/admin.go with parent command
- Create cmd/bd/admin_aliases.go for hidden backwards-compat aliases
- Update cleanup.go, compact.go, reset.go to remove rootCmd.AddCommand
- Update all documentation to use `bd admin <cmd>` syntax

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:21:08 -08:00
Steve Yegge
2c82acd10b feat: integrate detect-pollution into bd doctor --check=pollution (bd-kff0)
- Add --check flag to doctor for specific check modes
- Add --check=pollution to run detailed pollution detection
- Add --clean flag to delete detected test issues
- Mark detect-pollution command as hidden (deprecated)
- Update fix messages to point to new doctor --check=pollution

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:20:12 -08:00
Steve Yegge
2810cf05cc refactor: relocate thanks command to bd info --thanks (bd-wb9g)
- Add --thanks flag to bd info command
- Make bd thanks a hidden command (deprecated but still works)
- Part of CLI consolidation effort (bd-9115)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:08:34 -08:00
Steve Yegge
1611f16751 refactor: remove unused bd pin/unpin/hook commands (bd-x0zl)
Analysis found these commands are dead code:
- gt never calls `bd pin` - uses `bd update --status=pinned` instead
- Beads.Pin() wrapper exists but is never called
- bd hook functionality duplicated by gt mol status
- Code comment says "pinned field is cosmetic for bd hook visibility"

Removed:
- cmd/bd/pin.go
- cmd/bd/unpin.go
- cmd/bd/hook.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:15 -08:00
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -08:00
Steve Yegge
87f535a65e bd sync: 2025-12-27 14:48:16 2025-12-27 14:48:49 -08:00