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>
bd list --deferred only matched issues with defer_until set, missing
issues with status=deferred but no defer_until timestamp. The filter
now uses (defer_until IS NOT NULL OR status = 'deferred') in both
issueops and dolt transaction paths.
* fix: promote gate to built-in type so formula pour works (GH#3213)
bd mol pour fails with 'invalid issue type: gate' when a formula step
has a gate field. The pour pipeline creates companion beads of type
"gate", but gate was removed from the built-in types list. Since bd
gate create/check/resolve commands already hardcode IssueType("gate"),
gate should be built-in like molecule and event.
Adds TypeGate constant and includes it in IsValid(). This is the same
pattern used to re-promote molecule for swarm coordination.
Fixes#3213
* fix: update TestEventTypeValidation for gate as built-in
The test asserted gate is NOT built-in, but we promoted it. Flip the
assertion to match the new behavior.
* fix: suppress gosec G304 false positive in hookWorkTreeRoot
The path is filepath.Join(os.Getenv("GIT_DIR"), "gitdir") — reading a
well-known git internal file from a trusted environment variable set by
git itself during hook execution. Not a user-controlled file inclusion.
This false positive causes the Lint CI check to fail on every PR in
the repo, masking real lint issues.
* fix: enable auto-export by default with canonical issues.jsonl name (GH#2973)
Users expected JSONL export to refresh automatically but export.auto
defaulted to false, requiring explicit opt-in. Also the default filename
(export.jsonl) didn't match the canonical issues.jsonl used in docs and
git hooks. Change defaults: export.auto=true, export.path=issues.jsonl,
export.git-add=true so viewers (bv) and git workflows see fresh data
without extra configuration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(init): add auto-export prompt and document export.* config (GH#2973)
Interactive bd init now asks whether to enable auto-export (default: yes).
Users can opt out during setup instead of discovering the setting later.
Also documents the export.* config namespace in bd config --help with
all four keys (export.auto, export.path, export.interval, export.git-add)
and adds export examples.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(issues): add started_at timestamp (GH#2796)
Adds a `started_at` field to issues that is auto-populated when an
issue transitions to in_progress status. Preserved across subsequent
status changes.
- Migration 0027 adds started_at column to issues and wisps tables
- ManageStartedAt() in issueops mirrors ManageClosedAt() pattern
- Query filter support: `started>2026-01-01`, `started<...`
- Displayed in `bd show` between Created and Updated
- Exposed in --json output via struct tag
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: gofmt alignment in update.go and types.go
Amp-Thread-ID: https://ampcode.com/threads/T-019d887d-4eb1-7648-96be-8d906797c382
Co-authored-by: Amp <amp@ampcode.com>
* fix(claim): set started_at when claiming via --claim (GH#2796)
ClaimIssueInTx had its own bespoke UPDATE that only wrote assignee, status,
and updated_at. Since `bd update --claim` is the canonical way agents transition
issues to in_progress, started_at was left NULL in the common case. Set it on
first transition, mirroring ManageStartedAt's guard (preserve existing value on
re-claim).
Also document the `started` field in `bd query --help`.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Amp <amp@ampcode.com>
* fix: backward-compatible JSONL import for all pre-v1.0 formats
Three breaking changes accumulated across versions that prevent
importing old JSONL data:
1. Comment.ID changed from int64 to string in v1.0 — old JSONL
with numeric comment IDs crashes the importer. Add custom
UnmarshalJSON that accepts both types.
2. "wisp" field renamed to "ephemeral" in v0.38 — JSONL from
v0.35–v0.37 silently loses the ephemeral flag. Map the old
field name during import.
3. BondRef.proto_id renamed to source_id — old JSONL silently
loses bond source references. Accept proto_id as alias.
Also improve auto-import error messaging: when upgrade recovery
fails, tell the user their data is safe and suggest bd init
--from-jsonl instead of silently swallowing the error.
* fix: use American English spelling for misspell linter
* test: add unit tests for backward-compatible UnmarshalJSON and legacy import
- TestCommentUnmarshalJSON: string IDs, numeric IDs (pre-v1.0),
zero, large numbers, missing ID, invalid JSON
- TestBondRefUnmarshalJSON: source_id, proto_id (legacy),
both fields (precedence), neither, invalid JSON
- TestImportFromLocalJSONL_LegacyFormats: numeric comment IDs
survive import, wisp→ephemeral mapping (true/false/absent)
Adds three new core work types:
- spike: timeboxed investigation to reduce uncertainty before committing to a story
- story: user story describing a feature from the user's perspective
- milestone: marks completion of a set of related issues (contains no work itself)
Previously these were workarounds (spike→task, story→feature). They are now
first-class types with IsValid() support, Normalize() aliases, RequiredSections()
(spike gets Goal/Findings; story shares Acceptance Criteria with task/feature),
and bd types output entries.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
bd ready --explain provides a comprehensive view of the dependency graph:
- Ready items with reasoning (resolved blockers, dependency counts)
- Blocked items with detailed blocker info (ID, title, status, priority)
- Cycle detection results
- Aggregate summary stats
Works in both JSON (--json) and human-readable text modes. JSON output
gives agents structured data for graph-aware work prioritization.
No storage layer changes — all data comes from existing GetReadyWork,
GetBlockedIssues, GetDependencyRecordsForIssues, and DetectCycles APIs.
New types: ReadyExplanation, ReadyItem, BlockedItem, BlockerInfo,
ExplainSummary (all in internal/types/types.go).
Fixes: bd-7zt
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add category-aware custom statuses that control behavior in bd ready
and bd list. New config format: bd config set status.custom
"in_review:active,qa_testing:wip,archived:done,on_hold:frozen".
Backward compatible with old flat format. New bd statuses command
lists all statuses with --json support.
Also fix TestKillStaleServersPreservesOtherRepoServers to clear
BEADS_DOLT_AUTO_START env var, since the new IsAutoStartDisabled guard
in killStaleServersForDir short-circuits when set.
PR: #2665
Co-Authored-By: Harry Miller <harry-miller-trimble@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Strip Gas Town GUPP (Gas Town Universal Propulsion Principle) references
from hooked status comments. The hooked status remains as a valid beads
concept for work actively claimed by a worker.
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)
Remove GT-specific HOP (Human-Oriented Programming) fields that were
only used by Gas Town agents, not by standalone beads:
- Remove Creator (*EntityRef), Validations ([]Validation),
QualityScore (*float32), Crystallizes (bool) from Issue struct
- Remove EntityRef, Validation types and ParseEntityURI function
- Drop quality_score and crystallizes DB columns via migration 012
- Remove from schema, scan, insert, and show display code
- Remove all related tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ExcludeTypes field to WorkFilter and wire it into GetReadyWork query.
Caller-supplied exclusions are appended to the existing hardcoded list
(merge-request, gate, molecule, etc.). When --type is set, --exclude-type
is ignored (explicit inclusion wins).
Supports comma-separated and repeatable flag forms with type alias
normalization (e.g., mr→merge-request).
Co-Authored-By: Julian Knutsen <julianknutsen@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
Replace BIGINT AUTO_INCREMENT with CHAR(36) UUID primary keys on 6 tables
(events, comments, issue_snapshots, compaction_snapshots, wisp_events,
wisp_comments) to eliminate duplicate PK collisions during Dolt federation.
- Change Event.ID and Comment.ID from int64 to string
- Change GetAllEventsSince to use time.Time instead of int64 high-water marks
- Add migration 010 to convert existing BIGINT PKs to UUID
- Remove resetAutoIncrements band-aid (no longer needed)
- Generate UUIDs in Go before INSERT for comments (ImportIssueComment)
- Schema version bumped from 6 to 7
Prevent closing epics with open children (use --force to override).
Re-parent children to merge target during duplicate merges to prevent
orphaning. Show epic progress (N/M complete) in bd show output.
Normalize related/relates-to dependency types and weight dependents 3×
in merge target selection.
From: https://github.com/steveyegge/beads/pull/2500
Co-Authored-By: matt wilkie <maphew@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Free-text ID-like queries (e.g. "BE-1521") now also match against
external_ref, so issues linked to Linear/Jira tickets can be found
without knowing their beads ID. Adds --external-contains flag for
explicit substring search.
Co-Authored-By: gregorycollins-usmobile <gregorycollins-usmobile@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove ExclusiveLock, ShouldSkipDatabase, and IsProcessAlive from
internal/types. This code was part of the old daemon sync architecture
where external tools could claim exclusive management of a beads
database via .exclusive-lock files. With the migration to Dolt server
mode, this infrastructure has no production callers — all references
are self-contained within the removed files and their tests.
The active lockfile package (internal/lockfile) and Dolt server
lifecycle code (internal/doltserver) are unaffected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/leeloo
Rig: beads
Role: crew
extractPrefix in dolt/dependencies.go and ExtractPrefix in
routing/routes.go were identical implementations. Move the
canonical definition to types.ExtractPrefix (importable by both
packages without cycles) and delegate from routing.ExtractPrefix.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old SQLite backend filtered issues with -mol- or -wisp- in their IDs
from GetReadyWork results. This was removed with the SQLite backend, but
the IncludeMolSteps field in WorkFilter and associated comments remained
as dead code. Clean up the stale field and add a regression test
confirming molecule steps correctly appear in bd ready.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a command to get the most recent activity timestamp for a molecule,
making it easy to detect stale/stuck molecules without parsing JSON output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Add --metadata-field key=value and --has-metadata-key filters to bd ready.
SQL-level JSON_EXTRACT/JSON_UNQUOTE for efficient filtering. Enables agents and
teams to claim work based on metadata tags.
Co-Authored-By: Joseph Turian <turian@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove FindJSONLPath, FindJSONLInDir, JSONLExport config field, JSONL
bootstrap detection, post-merge JSONL import hook, and findActualJSONLFile.
Update hasBeadsProjectFiles to check for dolt/ directory instead of JSONL
files. Simplify error messages and hook descriptions to remove JSONL
references. Update comments across types, storage, and doctor subsystem.
29 files changed, -882/+79 lines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Surgical removal of ~1050 lines of JSONL-related code from core Go files:
- Remove FindJSONLPath/FindJSONLInDir/findMoleculesJSONLInDir functions
- Remove JSONLExport config field and JSONLPath method
- Remove JSONL bootstrap detection and auto-bootstrap logic from main.go
- Remove noDb mode flag and related context plumbing
- Remove JSONL import from post-merge git hook
- Remove CheckIssuesTracking doctor check
- Remove .jsonl.lock and sync_base.jsonl from gitignore template
- Remove findActualJSONLFile version tracking helper
- Remove JSONL config validation from doctor checks
- Update hook descriptions to remove JSONL references
- Update JSONL-specific comments in types.go
- Update tests to match code removals
Compiles clean. All non-pre-existing tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SQL-level metadata filtering using Dolt's JSON_EXTRACT/JSON_UNQUOTE
with parameterized queries. New CLI flags: --metadata-field key=value
(repeatable, AND semantics) and --has-metadata-key key. Add metadata.<key>
support to bd query DSL. Strict key validation prevents JSON path injection.
Remove //go:build cgo tag from metadata_filter_test.go (CGO bifurcation
was removed in c4010c19).
bd list displayed parent-child dependencies as "(blocked by: <parent>)"
which is incorrect — parent-child is structural containment, not a
blocking relationship. This caused real harm: AI agents seeing
"blocked by" would attempt to remove the dependency or skip the issue
entirely, treating organisational hierarchy as a workflow blocker.
Two fixes in this commit:
1. Human-readable output now shows "(parent: X)" instead of
"(blocked by: X)" for parent-child deps. Mixed relationships
render correctly: "(parent: X, blocked by: Y, blocks: Z)".
2. JSON output (bd list --json) now includes a computed "parent"
field on each issue, matching bd show --json behaviour. Previously
consumers had to manually parse the dependencies array to find the
parent, requiring knowledge of the dep type convention.
Changes:
- GetBlockingInfoForIssues returns parentMap (childID→parentID) as a
new return value, routing parent-child deps separately from blockers
- formatDependencyInfo/formatIssueCompact/formatAgentIssue accept
parent parameter for distinct display
- IssueWithCounts gains Parent field computed from dependency records
This is the bd list counterpart to PR #1293 which fixed the same
conflation in bd show. Related upstream issues: #1155, #1122.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/leeloo
Rig: beads
Role: crew
EntityRef.URI() now returns hop://<platform>/<org>/<id> instead of the
legacy entity://hop/<platform>/<org>/<id> format, per GRAPH-ARCHITECTURE.md.
ParseEntityURI() accepts both schemes for backward compatibility.
Closes: bd-yi8
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/quartz
Rig: beads
Role: polecats
Update ~20 stale comments across the Dolt storage layer that still
referenced SQLite after the migration to Dolt-only storage. Rename
LargeSQLite/XLargeSQLite fixture functions to LargeDolt/XLargeDolt.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GetReadyWork hardcoded (ephemeral = 0 OR ephemeral IS NULL) which excluded
all ephemeral issues from bd ready results. This broke gastown refinery
merge queue since merge-request beads are created as ephemeral=true.
Add IncludeEphemeral field to WorkFilter and --include-ephemeral CLI flag
so callers can opt in to ephemeral results when needed.
Fixes: bd-i5k5x
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Add a --no-parent flag to the list command that filters out child issues,
showing only top-level (root) beads. This excludes any issue that has a
parent-child dependency relationship where it is the child.
Mutually exclusive with --parent flag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Run make fmt to fix all gofmt issues. Add nolint directives for:
- G204 (gosec) in cmd/bd/stubs.go: git args are internal, not user-supplied
- unparam in internal/syncbranch/worktree.go: error return kept for callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
Re-promote "message" from a custom Gas Town type back to a built-in core
type. The message type is needed for inter-agent communication and was
being rejected without explicit types.custom configuration.
Updates the IsValid() switch case and test expectations accordingly.
Fixes#1347
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Projects track what they're doing (issues) and what happened (events),
but not why they chose a particular approach. Decisions are a missing
first-class concept -- every project has them, they're distinct from
tasks, and they're the context hardest to recover after the fact.
Adds TypeDecision as a core work type alongside bug/feature/task/epic/chore.
Includes aliases (dec, adr), required sections template (Decision, Rationale,
Alternatives Considered), and a Claude plugin command for structured recording.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
migrate-issues used UnderlyingDB() type-assertion to SQLite and raw SQL
queries, which would fail on Dolt backend. Now uses the Storage interface:
- Add SourceRepo filter to IssueFilter (types, SQLite, Dolt SearchIssues)
- Add source_repo to allowed update fields (SQLite + Dolt)
- Replace raw SQL queries with SearchIssues, GetDependencyRecords,
GetDependents, GetAllDependencyRecords, GetDependencyRecordsForIssues
- Replace raw transaction with RunInTransaction + UpdateIssue
- Remove database/sql and sqlite package imports
Closes: dolt-test-ztzb
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>