Commit Graph

3401 Commits

Author SHA1 Message Date
Steve Yegge
7c8b69f5b3 Phase 4: Remove deprecated edge fields from Issue struct (Decision 004)
This is the final phase of the Edge Schema Consolidation. It removes
the deprecated edge fields (RepliesTo, RelatesTo, DuplicateOf, SupersededBy)
from the Issue struct and all related code.

Changes:
- Remove edge fields from types.Issue struct
- Remove edge field scanning from queries.go and transaction.go
- Update graph_links_test.go to use dependency API exclusively
- Update relate.go to use AddDependency/RemoveDependency
- Update show.go with helper functions for thread traversal via deps
- Update mail_test.go to verify thread links via dependencies
- Add migration 022 to drop columns from issues table
- Fix cycle detection to allow bidirectional relates-to links
- Fix migration 022 to disable foreign keys before table recreation

All edge relationships now use the dependencies table exclusively.
The old Issue fields are fully removed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:48:13 -08:00
Steve Yegge
3ec517cc1b Fix daemon/direct mode inconsistency in graph commands (bd-fu83)
Commands relate, unrelate, duplicate, and supersede now properly
use RPC Update when daemonClient is available, instead of always
calling store.UpdateIssue() directly and bypassing the daemon.

Added RelatesTo, DuplicateOf, and SupersededBy fields to UpdateArgs
in the RPC protocol, and updated server_issues_epics.go to handle them.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 01:34:14 -08:00
Steve Yegge
5d7187f29b Phase 3: Migrate existing edge fields to dependencies (Decision 004)
Add migration to convert existing issue fields to dependency edges:
- replies_to -> replies-to dependency with thread_id
- relates_to -> relates-to dependencies (JSON array)
- duplicate_of -> duplicates dependency
- superseded_by -> supersedes dependency

The migration is idempotent (INSERT OR IGNORE) so it does not duplicate
edges that were already created by Phase 2 dual-write.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 01:22:34 -08:00
Steve Yegge
1d40b8f970 Phase 2: Dual-write for edge schema consolidation (Decision 004)
When issue fields (replies_to, relates_to, duplicate_of, superseded_by)
are set during CreateIssue or UpdateIssue, we now ALSO create the
corresponding dependency edges. This enables gradual migration to
edge-based storage while maintaining backward compatibility.

Changes:
- createGraphEdgesFromIssueFields: handles CreateIssue dual-write
- createGraphEdgesFromUpdates: handles UpdateIssue dual-write
- Replies-to edges include thread_id for efficient thread queries
- Uses INSERT OR IGNORE to handle idempotency

The dual-write ensures both field and dependency stay in sync during
the migration period.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 01:21:15 -08:00
Steve Yegge
d390aa8834 Phase 1: Edge schema consolidation infrastructure (Decision 004)
Add metadata and thread_id columns to dependencies table to support:
- Edge metadata: JSON blob for type-specific data (similarity scores, etc.)
- Thread queries: O(1) conversation threading via thread_id

Changes:
- New migration 020_edge_consolidation.go
- Updated Dependency struct with Metadata and ThreadID fields
- Added new entity types: authored-by, assigned-to, approved-by
- Relaxed DependencyType validation (any non-empty string ≤50 chars)
- Added IsWellKnown() and AffectsReadyWork() methods
- Updated SQL queries to include new columns
- Updated tests for new behavior

This enables HOP knowledge graph requirements and Reddit-style threading.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 01:17:57 -08:00
Steve Yegge
b4a6ee4f5f fix: Include tombstones in DB count for stale check (bd-53c)
The countDBIssuesFast() fallback path used SearchIssues without
IncludeTombstones, returning only live issues (161). Meanwhile
countIssuesInJSONL counts all lines including tombstones (221).

This mismatch caused false "stale DB detected" warnings on every
sync, even when DB and JSONL were in sync.

Fix: Set IncludeTombstones: true in the fallback SearchIssues call.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 00:41:49 -08:00
Steve Yegge
6394033f72 chore: Bump version to 0.30.5
Updated all component versions:
- bd CLI: 0.30.4 → 0.30.5
- Plugin: 0.30.4 → 0.30.5
- MCP server: 0.30.4 → 0.30.5
- npm package: 0.30.4 → 0.30.5

Changes in 0.30.5:
- Removed YAML simple template system (--from-template flag)
- Removed embedded templates (bug.yaml, epic.yaml, feature.yaml)
- Templates are now purely Beads-based

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 00:27:59 -08:00
Steve Yegge
0d6b3d7e85 refactor: Remove YAML template system entirely
Removes the legacy YAML-based simple template system that provided
bug/epic/feature templates for --from-template flag on bd create.

Removed:
- cmd/bd/templates/bug.yaml, epic.yaml, feature.yaml
- Template struct and all YAML loading functions in template.go
- --from-template flag from bd create command
- template_security_test.go (tested removed functions)
- YAML template tests from template_test.go

The Beads template system remains (epics with "template" label,
instantiated via bd template instantiate with variable substitution).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 00:18:37 -08:00
Steve Yegge
0bfae2e0ab chore: Bump version to 0.30.4
Updated all component versions:
- bd CLI: 0.30.3 → 0.30.4
- Plugin: 0.30.3 → 0.30.4
- MCP server: 0.30.3 → 0.30.4
- npm package: 0.30.3 → 0.30.4

New features:
- bd template instantiate for YAML workflow templates
- --assignee flag for template instantiation
- Fixed mail inbox --identity filtering
- Fixed orphan detection false positives

Note: Graph link edges (relates_to, replies_to, etc.) and mail commands
are experimental and subject to breaking changes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 00:09:49 -08:00
Steve Yegge
a68c52a536 feat: Add --assignee flag to template instantiate, fix mail inbox --identity
- Add --assignee flag to `bd template instantiate` for work delegation
  - Assigns the root epic to specified agent/user
  - Child issues retain their template-defined assignees
  - Enables Gas Town orchestration: instantiate + assign in one step

- Add missing --identity flag to `bd mail inbox` for consistency
  - All mail subcommands now support --identity override

- Delete obsolete HANDOFF-template-redesign.md (work complete)

- Add test for assignee override behavior

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:38:19 -08:00
Steve Yegge
003a7d98db fix: Exclude closed issues from orphan detection warnings
No point warning about orphaned issues that are already closed or
tombstoned - they're dead either way.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:32:37 -08:00
Steve Yegge
1e97d9ccee fix: Exclude tombstones from orphan detection warnings
Orphan detection was reporting tombstoned issues (already deleted) as
orphans, causing repeated warnings during sync. Filter out status='tombstone'
from the orphan query.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:20:21 -08:00
Steve Yegge
83ae110508 refactor: Remove legacy MCP Agent Mail integration (bd-6gd)
Remove the external MCP Agent Mail server integration that required
running a separate HTTP server and configuring environment variables.

The native `bd mail` system (stored as git-synced issues) remains
unchanged and is the recommended approach for inter-agent messaging.

Files removed:
- cmd/bd/message.go - Legacy `bd message` command
- integrations/beads-mcp/src/beads_mcp/mail.py, mail_tools.py
- lib/beads_mail_adapter.py - Python adapter library
- examples/go-agent/ - Agent Mail-focused example
- examples/python-agent/agent_with_mail.py, AGENT_MAIL_EXAMPLE.md
- docs/AGENT_MAIL*.md, docs/adr/002-agent-mail-integration.md
- tests/integration/test_agent_race.py, test_mail_failures.py, etc.
- tests/benchmarks/ - Agent Mail benchmarks

Updated documentation to remove Agent Mail references while keeping
native `bd mail` documentation intact.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:14:23 -08:00
Steve Yegge
6920cd5224 feat: Add Beads template instantiation system (bd-r6a.2)
Implements native Beads templates as an alternative to YAML templates:

- Templates are epics with the "template" label and {{variable}} placeholders
- `bd template list` shows both YAML and Beads templates
- `bd template show <id>` displays template structure and variables
- `bd template instantiate <id> --var key=value` clones subgraph with substitution

Key implementation:
- loadTemplateSubgraph: Recursively loads epic and all descendants
- cloneSubgraph: Creates new issues with ID remapping in a transaction
- extractVariables/substituteVariables: {{name}} pattern handling

Closes bd-r6a.2, bd-r6a.4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:03:51 -08:00
Steve Yegge
71ff52deda bd sync: 2025-12-16 20:42:39 2025-12-17 22:56:23 -08:00
Steve Yegge
e1de6e8bb2 docs: Add template redesign handoff file (bd-r6a) 2025-12-17 22:51:59 -08:00
Steve Yegge
68bd0570c9 refactor: Remove YAML workflow system (bd-r6a.1)
Remove the entire YAML-based workflow system in preparation for
redesigning templates as native Beads.

Removed:
- cmd/bd/templates/workflows/*.yaml
- cmd/bd/workflow.go
- internal/types/workflow.go (WorkflowTemplate types)

The new design will use regular Beads with a template label,
and a clone-with-substitution operation for instantiation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 22:46:44 -08:00
Steve Yegge
6716395853 Revert "fix: Address workflow template issues from code review"
This reverts commit aae8407aa4.
2025-12-17 22:44:23 -08:00
Steve Yegge
aae8407aa4 fix: Address workflow template issues from code review
- Fix resolvePartialID stub to use utils.ResolvePartialID (bd-746)
- Add validation for empty wf.Tasks before accessing wf.Tasks[0] (bd-muw)
- Remove || echo fallback from update-hooks verification (bd-0w5)
- Implement ExpectExit/ExpectStdout verification fields (bd-dwh)
- Add warning when depends_on references unknown task ID (bd-aay)
- Add bd update --parent flag to change issue parent (bd-jvu)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 22:34:35 -08:00
Steve Yegge
23a14cc75f feat: Add --skip-preflight flag to workflow create
Allows bypassing preflight checks when needed (e.g., testing).
Use with caution - preflight checks exist for safety.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 21:19:50 -08:00
Steve Yegge
bc22d7deff feat: Add workflow template system for agent-executable checklists
Adds `bd workflow` command group that creates epics with dependent child tasks
from YAML templates. This enables structured multi-step workflows like version
bumps where agents can work through tasks with verification and dependencies.

Commands:
- `bd workflow list` - List available workflow templates
- `bd workflow show <name>` - Show template details and task graph
- `bd workflow create <name> --var key=value` - Instantiate workflow
- `bd workflow status <epic-id>` - Show workflow progress
- `bd workflow verify <task-id>` - Run verification command

Features:
- Variable substitution with {{var}} syntax
- Built-in variables: {{today}}, {{user}}
- Preflight checks before workflow creation
- Hierarchical task IDs under epic (bd-xxx.1, bd-xxx.2)
- Dependency graph between tasks
- Verification commands embedded in task descriptions

Includes built-in `version-bump` template with 21 tasks covering:
- All 10+ version files
- check-versions.sh verification
- Git commit, tag, push
- CI monitoring (goreleaser, npm, pypi, homebrew)
- Local machine upgrades
- Final verification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 21:17:59 -08:00
Steve Yegge
ede652dbb8 fix: Update remaining version files to 0.30.3
Files missed in manual version bump:
- .claude-plugin/plugin.json
- .claude-plugin/marketplace.json
- integrations/beads-mcp/pyproject.toml
- integrations/beads-mcp/__init__.py
- Hook templates

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:58:47 -08:00
Steve Yegge
b10d800e40 fix: Update npm publish to use OIDC trusted publishing
npm deprecated classic tokens and now requires either granular tokens
with 2FA or OIDC trusted publishing. This updates the workflow to use
the latter, which is npm recommended approach for CI/CD.

Requires configuring trusted publisher on npmjs.com:
- Organization: steveyegge
- Repository: beads
- Workflow: release.yml

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:51:10 -08:00
Steve Yegge
ad83d45f7e fix: Update npm package version to 0.30.3
The version was missed in the initial release commit.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:22:35 -08:00
Steve Yegge
488986c729 chore: Bump version to 0.30.3
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:16:12 -08:00
Steve Yegge
5869adadf2 fix: Remove unsafe ClearDirtyIssues() method (bd-b6xo)
Remove ClearDirtyIssues() which had a race condition that could lose
dirty issues if export failed partway through. All callers now use
ClearDirtyIssuesByID() which only clears specific exported issues.

- Remove from Storage interface
- Remove from SQLite and Memory implementations
- Update 6 test call sites to use ClearDirtyIssuesByID()

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:10:13 -08:00
Steve Yegge
a7bfb3a6cf feat: Add dependency direction guidance to onboard
Adds "Dependencies: Think Needs, Not Before" section with the
WRONG/RIGHT example pair to help agents avoid the temporal
language trap that inverts dependency direction.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 18:46:46 -08:00
Steve Yegge
125cfafe7f feat: Add self-contained issue writing guidance to onboard
Adds a "Writing Self-Contained Issues" section to the onboarding output
that instructs AI agents to create fully context-independent issues.
Includes required elements (summary, files, steps, examples) and shows
good vs bad examples.

Closes #618

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 18:34:23 -08:00
Steve Yegge
f270d90f12 fix: Resolve 3 P1 bugs and add --body-file flag to bd create
- bd-06px: Add --no-git-history flag to import command for sync subprocess compatibility
- bd-0zp7: Add missing hook calls (EventMessage in mail reply, EventClose in mail ack)
- bd-hy9p: Implement --body-file and --description-file flags for reading descriptions from files

Also closed stale issues that were already fixed:
- bd-0d5p: macOS test timeout (already fixed with SysProcAttr)
- bd-7yg: Merge driver placeholders (already using correct %A %O %A %B)
- bd-4ri: Test deadlock (test passes in 0.04s now)
- bd-b3og: TestImportBugIntegration (test no longer exists)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 17:29:33 -08:00
Steve Yegge
9073309b29 chore: Clean up old closed issues and tombstones
- Deleted 71 closed issues (converted to tombstones)
- Purged 697 tombstones older than 48 hours
- Cleaned 286 orphaned dependency records
- Kept 48 recent tombstones (< 48h) for resurrection protection

Before: 847 issues | After: 150 issues (102 open + 48 tombstones)
2025-12-17 16:13:43 -08:00
Steve Yegge
47a682acfb fix: Remove orphaned child issues permanently (bd-cb64c226.*, bd-cbed9619.*)
Root cause: Previous fix only cleaned beads-sync branch, not main.
During 3-way merge, orphans were re-introduced from main.

This export is from clean DB (0 orphaned issues).
Also force-resetting beads-sync to match.
2025-12-17 16:10:09 -08:00
Steve Yegge
93fdcc2b02 Merge pull request #601 from chapel/fix/gh-587-memory-stats-blocked-ready
Reviewed and approved - clean bug fix with good test coverage achieving parity between memory and SQLite storage implementations.
2025-12-17 15:30:05 -08:00
Steve Yegge
2e0f6e7ca2 Merge pull request #602 from SorraTheOrc/patch-1
Update link to EXTENDING.md in example extending README
2025-12-17 14:54:12 -08:00
Steve Yegge
b273652826 Merge pull request #603 from vgough/vgough/create-form
add visual create-form command
2025-12-17 14:19:16 -08:00
Steve Yegge
8f15dcfdae Merge pull request #606 from SorraTheOrc/fix/hooks-timeout-kill-descendants
hooks: kill descendant processes on timeout; add test and comment
2025-12-17 14:00:28 -08:00
Steve Yegge
56d2920bb3 docs: restore Community Tools section with beads.el
Adds back third-party tools removed in succinct README PR.
Includes beads.el Emacs package (closes #610).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 13:45:41 -08:00
Steve Yegge
9ddf69d700 fix: correct broken documentation links in README
The succinct README PR had Google search URLs instead of relative paths.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 13:43:05 -08:00
Steve Yegge
f3cd32d66e Merge pull request #612 from brycedrennan/patch-2
make README.md succinct
2025-12-17 13:42:11 -08:00
Bryce Drennan
57b1d90196 make README.md succinct 2025-12-17 10:44:51 -08:00
Steve Yegge
ff0ecb526e fix: daemon delete creates tombstones, export includes tombstones (bd-rp4o)
Three changes to fix deleted issues resurrecting during bd sync:

1. daemon handleDelete now uses CreateTombstone instead of DeleteIssue
   - internal/rpc/server_issues_epics.go

2. sync.go exportToJSONL now includes IncludeTombstones:true
   - cmd/bd/sync.go

3. server_export_import_auto.go handleExport and auto-export now include
   tombstones in SearchIssues filter
   - internal/rpc/server_export_import_auto.go

Also adds README.md documentation for sync.branch mode (bd-dsdh):
- Explains "always dirty" working tree behavior
- Shell alias tip: gs='git status -- ":!.beads/"'
- When to use bd sync --merge

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 01:15:40 -08:00
Steve Yegge
123e66f625 Merge beads-sync into main 2025-12-17 01:02:29 -08:00
Steve Yegge
bb750a96da bd sync: 2025-12-16 23:16:19 2025-12-16 23:16:19 -08:00
Steve Yegge
edb2186066 bd sync: 2025-12-16 23:09:57 2025-12-16 23:09:57 -08:00
Steve Yegge
4af0e1798e fix: allow bd sync --merge with uncommitted .beads/ changes (bd-7b7h)
The sync.branch workflow copies JSONL to main working dir without
committing, which blocked bd sync --merge (required clean working dir).

Changes:
- Exclude .beads/ from dirty check in mergeSyncBranch
- Restore .beads/ to HEAD before merge to prevent conflicts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 23:09:19 -08:00
Steve Yegge
88703ced1e bd sync: 2025-12-16 23:08:59 2025-12-16 23:08:59 -08:00
Steve Yegge
6ab8918177 bd sync: 2025-12-16 23:08:55 2025-12-16 23:08:55 -08:00
Steve Yegge
518b09ca4c bd sync: 2025-12-16 22:57:41 2025-12-16 22:57:41 -08:00
Ross Gardler
6b0d0901d0 hooks: harden timeout kill and add platform split
- Move runHook into build-tagged implementations (unix/windows) to keep unix syscalls off Windows builds.
- In unix implementation, guard nil Process, return wrapped kill errors except ESRCH, and document linkage to TestRunSync_KillsDescendants.
- On Windows, best-effort kill on timeout retains prior behavior.
- In tests, move testing.Short earlier and keep descendant-kill coverage on Linux.
2025-12-16 22:38:45 -08:00
Steve Yegge
a1604ddad1 bd sync: 2025-12-16 22:35:35 2025-12-16 22:35:35 -08:00
Steve Yegge
fcd29f5ea4 fix: add ID-based fallback matching to prevent ghost resurrection (bd-ncwo)
Root cause: The merge driver matched issues by IssueKey (ID+CreatedAt+CreatedBy).
When timestamp precision differed (e.g., with/without nanoseconds), the same
issue was treated as two different issues, causing both tombstone and closed
versions to appear in the merge result.

Fix: Added ID-based fallback matching in merge3WayWithTTL. When key-based
matching fails but the same ID exists in the other side, use that for merging.
Also track processed IDs to prevent duplicates.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 22:35:29 -08:00