Carry forward the useful CLI dependency parsing fix from gastownhall/beads PR #3560 while excluding unrelated governance/template and Dolt subsystem changes.
blocked-by:<id> and depends-on:<id> now store a blocks dependency from the new issue to the target, while explicit blocks:<id> continues to invert direction so the target depends on the new issue.
Also reject unknown create --deps dependency types using the centralized well-known dependency type policy.
Co-authored-by: kev <kglynn@pryoninc.com>
Two fixes for the contributor mode "no database selected" bug:
1. store_factory.go: Default to "beads" when metadata.json is missing
(same fix as the standalone PR for the unit-level regression).
2. create.go (ensureBeadsDirForPath): Write metadata.json after creating
the target store so that newDoltStoreFromConfig can find the correct
database name on subsequent opens. Also sanitize the prefix for SQL
database names (hyphens → underscores), matching bd init behavior.
Adds embedded Dolt contributor mode tests that exercise the full
init --contributor → create → show flow, covering:
- Issue routing to planning repo (the #2988 regression scenario)
- Issue isolation (not in project store)
- bd show reads routed issues
- Multiple sequential creates
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: move hook firing into storage layer via decorator
Add HookFiringStore decorator that wraps DoltStorage and automatically
fires on_create/on_update/on_close hooks after successful mutations.
This replaces manual hookRunner.Run() calls scattered across 8+ CLI
command files, ensuring ALL mutations fire hooks — including future
commands that haven't been written yet.
Key features:
- Decorator pattern: storage layer stays clean (no hooks dependency)
- Transaction support: hookTrackingTransaction accumulates pending
hooks during RunInTransaction, fires them only after successful
commit. Rollback = no hooks.
- Covers all mutation methods: CreateIssue(s), UpdateIssue, CloseIssue,
ReopenIssue, UpdateIssueType, Add/RemoveDependency, Add/RemoveLabel,
AddIssueComment
- DeleteIssue intentionally skipped (destructive, no issue to pass)
- Nil runner safe (passthrough only, no panics)
Removed hookRunner.Run() from: create.go, update.go, close.go,
note.go, assign.go, tag.go, priority.go.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add BD_NO_HOOKS env var to disable all hook firing
Allows opting out of the HookFiringStore decorator entirely via
BD_NO_HOOKS=1. Useful for bulk imports, migrations, or environments
where eventing should not run.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove the "Creating issue without description" warning that fires on
the default happy path. Descriptions are optional; the quickstart guide
tells users to run `bd create "My first issue"` without one. Teams that
want mandatory descriptions can use create.require-description config.
- Only show "Creating test issue in production database" warning when the
database already has ≥5 issues. A brand-new repo with zero issues is
not a "production database" and the warning confuses new users.
Closes#2897Closes#2898
Amp-Thread-ID: https://ampcode.com/threads/T-019d3afe-92cc-74bc-a917-f8e92e21060f
Co-authored-by: Amp <amp@ampcode.com>
* fix: anchor routed town root to active beads dir (bd-e3q)
* fix: fail closed for authoritative routed contexts (bd-e3q)
---------
Co-authored-by: obsidian <thalia.geraghty@fiserv.com>
Replace standalone `bd graph-apply` subcommand with `bd create --graph
<plan-file>` flag, consistent with the existing `bd create -f` (markdown)
pattern. The graph plan format and transactional execution are unchanged.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* /{cmd,internal}: add remote URL support to multi-repo hydration
Multi-repo hydration (`bd repo sync`) reads issues.jsonl from local
filesystem paths, predating beads' dolt remote support. This adds
remote URL support so hydration, `--repo`, and `bd repo add` can
accept dolt remote URLs (dolthub://, https://, s3://, etc.) alongside
local paths.
New internal/remotecache package manages cached dolt clones at
~/.cache/beads/remotes/<hash>/ with clone/pull/push lifecycle and
file-based locking for concurrent access.
Closes#2826
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review issues in remote hydration PR
- Fix gosec G306: tighten meta file permissions from 0644 to 0600
- Make lock polling context-aware (respects Ctrl+C / ctx cancellation)
- Replace defer cache.Push with explicit call (FatalError calls os.Exit,
which skips deferred functions — silent data loss on remote creates)
- Log remoteStore.Close() errors as warnings instead of discarding
- Quantify CacheKey birthday-bound collision risk in comment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(remotecache): address code review findings from #2827
- Fix lock file race: remove os.Remove in releaseLock to prevent TOCTOU
race where another process's lock gets deleted; stale lock cleanup in
acquireLock handles orphaned files
- Add debug.Logf to writeMeta for error visibility
- Rename cacheErr to idiomatic err in repo sync remote block
- Escalate remote push failure to FatalError in create (silent warning
meant the remote never received the issue)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(remotecache): defer store close, add Push test, add freshness TTL
- Replace defer-in-loop with eager close in repo sync (defer inside a
for loop leaks connections until function return)
- Add FreshFor TTL to Cache (default 30s) — Ensure() skips pull when
last pull is within the window, FreshFor=0 preserves always-pull
- Add TestPush: full round-trip integration test (clone → insert → push
→ re-clone → verify data)
- Add TestEnsureFreshFor: validates TTL skip and FreshFor=0 bypass
- Add concurrency doc comment to OpenStore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace gastown-specific references with generic alternatives throughout
the codebase:
- Rename --gastown flag to --orchestrator in bd doctor
- Rename gastownMode/gastownThreshold params to orchestratorMode/orchestratorThreshold
- Rename isGasTownTownRoot() to isOrchestratorRoot()
- Replace "gastown" in CLI examples with generic rig names (my-project, other-project)
- Update comments replacing "Gas Town" with "orchestrator" or "multi-agent workspace"
- Update active docs (DOLT.md, CONFIG.md, ADVANCED.md, etc.)
- Update test data to use generic names instead of "gastown"
- Update role templates (deacon, witness, refinery) to use generic language
Preserved as historical (not changed):
- CHANGELOG.md entries (historical record)
- ARTICLES.md (links to real published articles)
- info.go version notes (historical release notes)
- gastown/ file path references in dolt-concurrency.md (point to actual repo)
Remove the entire agent-as-bead subsystem which treated agents as beads
with GT-specific state management. This is pure Gas Town infrastructure
that belongs in GT, not in the beads issue tracker.
Deleted files:
- cmd/bd/agent.go (state, heartbeat, show, backfill-labels commands)
- cmd/bd/slot.go (hook/role slot management)
- cmd/bd/merge_slot.go (merge queue slot primitives)
- All associated test files
Removed from types.Issue:
- AgentState, HookBead, RoleBead, LastActivity, RoleType, Rig, Holder
- AgentState type definition and constants
Removed from storage layer:
- 6 agent columns from DB schema (hook_bead, role_bead, agent_state,
last_activity, role_type, rig)
- Agent field scanning, insertion, and update allowlisting
Cleaned up references in:
- show_format.go (agent identity and slot display sections)
- create.go (--agent-rig flag and agent label auto-add)
- move.go, refile.go (RoleType/Rig field copying)
- doctor/deep.go (agent bead integrity check)
- config.go (agent role configuration functions)
Three fixes for validation consistency:
1. bd create --validate now uses LintIssue() instead of ValidateTemplate(),
bringing it to parity with bd lint. A non-empty --acceptance field now
satisfies the "Acceptance Criteria" requirement without needing the
heading in --description. (GH#2468 parity)
2. --dry-run no longer bypasses --validate. Validation now runs before the
dry-run exit, so users get feedback on template issues during preview.
3. New validation.on-close config option (none|warn|error, default: none).
When enabled, warns on terse close reasons (<20 chars) or default
"Closed" reasons. Mirrors existing validation.on-create pattern.
Co-Authored-By: seanmartinsmith <114885497+seanmartinsmith@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Separates two concerns bundled by --ephemeral: skipping Dolt commit
history and GC eligibility. NoHistory beads route to wisps table
(no DOLT_COMMIT) but remain non-GC-eligible. Fixes agent identity
beads being incorrectly garbage collected.
Also adds --exclude-type to wisp gc, --type filter to wisp list,
and fixes ExcludeTypes self-join subquery.
Closes#2619
PR: https://github.com/steveyegge/beads/pull/2622
Author: mmlac
Separates "no git history" from "garbage-collectible" for beads stored in the
wisps table. Previously --ephemeral bundled both behaviors, causing agent identity
beads to be incorrectly GC'd.
Changes:
- Add NoHistory field to types.Issue and wisps/issues schema (migration 011)
- Route NoHistory issues to wisps table, skip DOLT_COMMIT, but leave ephemeral=0
- Wire --no-history flag in bd create and bd update (with --history to undo)
- Add --exclude-type flag to bd mol wisp gc
- Add --type filter flag to bd mol wisp list
- Include type and labels in wisp list JSON output
- Move ephemeral/no-history mutual exclusion to validation layer
- Migrate issues between tables when --no-history/--ephemeral set on update
- Fix ExcludeTypes filter self-join subquery inefficiency
- Ensure JSONL export/import roundtrip preserves no_history
- Remove dead AllEphemeral function (superseded by AllWisps)
- Comprehensive test coverage for all new flags and edge cases
Resolves: steveyegge/beads#2619
Refs: steveyegge/gastown#2768
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds support for reading design content from files or stdin, making it easier to manage longer design notes.
The new `--design-file` flag is mutually exclusive with the inline `--design` flag. Includes comprehensive tests for all code paths.
In shared-server mode, the DB issue_prefix belongs to whichever project
initialized first. This caused all projects sharing a server to use the
wrong prefix for issue creation, ID generation, and imports.
Fix: YAML config.yaml issue-prefix now takes precedence over the DB value
in create.go, github.go, gitlab.go, linear.go, orphans.go, and merge_slot.go
(which already had the correct pattern).
Also: EnsureRunning() now calls KillStaleServers() before starting a new
server, cleaning up orphaned dolt sql-server processes that accumulate when
parent processes crash without graceful shutdown (GH#2372).
Also: add cross-project data isolation tests (5 tests covering read isolation,
port collision, same-prefix isolation, concurrent writes, and concurrent
read-write mix). Based on tests by @PabloLION (PR #2472).
Co-Authored-By: PabloLION <dev@pablolion.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all BEADS_NO_DAEMON env var handling from test files (dead code
since daemon removal in v0.50.0), delete stopRepoDaemon() and daemon
file guards from test setup, remove no-daemon config key from tests,
and update daemon→server wording in docs and comments.
37 files changed, -193 lines net.
Co-Authored-By: davetashner <davetashner@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ensureBeadsDirForPath checked for beads.db (SQLite artifact) to detect
existing databases. With Dolt, storage is under .beads/dolt/, so the
check always failed, causing unnecessary re-initialization attempts.
- Check for metadata.json instead of beads.db as the canonical marker
- Use dolt.NewFromConfigWithOptions instead of dolt.New with stale path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jade
Rig: beads
Role: polecats
bd unconditionally ran CREATE DATABASE IF NOT EXISTS on every connection.
When connecting to the wrong server (auto-started from .beads/dolt/ or
Homebrew default), this created an empty shadow database hiding real data.
Changes:
- Add CreateIfMissing field to Config — only bd init sets it true
- SHOW DATABASES LIKE check before CREATE (with underscore escaping)
- Network error handling for SHOW DATABASES failure
- Suppress auto-start when metadata.json has explicit dolt_server_port
- Fix backup git push across .beads/redirect (findGitRoot)
- Fix macOS CanonicalizePath case resolution (walk dirs, not realpath)
- Add CreateIfMissing to all migration and create paths
- 10 regression tests covering guard, auto-start, ReadOnly, underscore
- CHANGELOG and TROUBLESHOOTING docs
Authored by: Aaron Lippold<lippold@gmail.com>
When --help or other flags bypass Cobra flag parsing (e.g., programmatic
invocation), they end up as positional title arguments, creating garbage
issues. Add a guard that rejects positional titles starting with - and
directs users to --title flag if intentional.
Executed-By: beads/polecats/onyx
Rig: beads
Role: polecats
Per-operation pushes to git remotes caused 22GB of git-remote-cache
bloat with dozens of agents creating wisps constantly. Push is now
only done by the daemon periodic task (every 15min) or explicitly
via `bd dolt push`. Cross-rig creates still commit pending changes
but skip the push. (hq-glw)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --metadata flag to bd create, matching the existing bd update --metadata interface.
Supports inline JSON and @file.json syntax. Wired through both direct and cross-rig paths.
Co-Authored-By: Joseph Turian <turian@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Batch N+1 query patterns in GetBlockedIssues, GetEpicsEligibleForClosure,
GetMoleculeProgress, and GetStatistics with IN-clause batch operations.
Add per-invocation caching for custom statuses, custom types, and blocked
IDs (invalidated on writes). Introduce storage.ErrNotFound sentinel error
replacing the (nil, nil) not-found pattern across all callers.
Comprehensive unit tests for queries.go and compact.go (2209 new lines).
PR: https://github.com/steveyegge/beads/pull/1874
Author: Steven Syrek <sjsyrek@users.noreply.github.com>
Reviewed-by: beads/crew/jane
Co-Authored-By: Steven Syrek <sjsyrek@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update comments and user-facing messages across 17 production files to
reflect the current Dolt-native architecture (no daemon):
- Gitignore template: reorganized, daemon/SQLite entries moved to legacy section
- Doctor fix messages: removed references to non-existent bd daemon commands
- Doctor federation: updated fix suggestions to use gt dolt start / server mode
- Doctor integrity: removed "daemon won't start" messaging
- Code comments: replaced daemon mode references with current architecture terms
- Lock handling: marked daemon.lock as legacy cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Phase 7 (a5da57e3) deleted internal/storage/factory/ and internal/storage/memory/
but left 30+ files still importing them. This commit fixes all broken references:
- Created internal/storage/dolt/open.go with NewFromConfig/NewFromConfigWithOptions
- Replaced all factory.New/NewFromConfig/NewWithOptions with dolt equivalents
- Broke import cycles in dolt/bootstrap.go (routing/utils/audit → local types)
- Removed dead storage.Config struct
- Converted all test files from memory.New() to dolt.New() test stores
- Removed tests that depended on deleted detectPrefix/LoadFromIssues/mockRemoteStore
46 files changed, 249 insertions(+), 851 deletions(-)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Strip out the multi-backend storage layer: factory pattern, memory/in-memory
provider, connection string parsing, local provider, and associated tests.
Inline Dolt as the sole storage backend. Part of Dolt-Native Beads v2 epic.
WIP - SQLite removal in progress, more cleanup phases to follow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Code health review found 30+ instances of error suppression using blank
identifier without explanation. Added comments to 82 files explaining WHY
each error is safely ignored (best-effort cleanup, advisory operations,
safe defaults, etc.) to improve code maintainability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats
When a user specifies --deps blocks:X, they mean "the new issue blocks X",
but the code was creating the dependency with the wrong direction (X blocks
the new issue). This swaps IssueID and DependsOnID when the user explicitly
uses the blocks: prefix so the semantics match intent.
Also adds "depends-on" as a recognized alias for the default dependency
direction.
Fixes#1369
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The help text for `bd create --type` and `bd update --type` listed
Gas Town types (molecule, gate, convoy, etc.) as valid options, but
they fail with 'invalid issue type' unless types.custom is configured.
Show only the six built-in types and note that custom types require
configuration.
Closes#1727
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cherry-picked UX improvements from maphew init workflow PR:
- Better test issue detection with shared isTestIssue() helper
- Non-interactive stdin detection in doctor fix/validate (prevents CI hangs)
- Initialize last_import_time and version tracking during bd init
- Set default beads.role when interactive prompt is skipped
- Warn about missing git upstream at init time
- Remove stale --no-daemon from doctor fix commands
- Context-aware Claude Plugin suggestion (only in Claude Code)
- Actionable error hints for database not initialized via FatalErrorWithHint
- Compile test-prefix regex once at package level instead of per-call
Dropped from original PR: auto-commit during init (needs opt-out flag),
daemon_deprecated.go stubs, accidentally restored deleted files (queries.go,
dirty.go from pre-Dolt transition branch base), release playbook docs.
Co-authored-by: maphew <maphew@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew