bd-6xd: Standardize on issues.jsonl as canonical filename
- Change default JSONL filename from beads.jsonl to issues.jsonl - Add bd doctor check and fix to auto-migrate legacy beads.jsonl configs - Update FindJSONLPath to prefer issues.jsonl over beads.jsonl - Add CheckLegacyJSONLConfig and CheckLegacyJSONLFilename checks - Add LegacyJSONLConfig fix to rename files and update config - Update .gitattributes to reference issues.jsonl - Fix tests to expect new canonical filename - Add bd-6xd to v0.25.1 release notes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,56 +1,56 @@
|
||||
{"id":"bd-44e","title":"Ensure deletions.jsonl is tracked in git","description":"Parent: bd-imj\n\nEnsure deletions.jsonl is tracked in git (not ignored).\n\nUpdate bd init and gitignore upgrade logic to:\n1. NOT add deletions.jsonl to .gitignore\n2. Ensure it is committed alongside beads.jsonl\n\nThe file must be in git for cross-clone propagation to work.\n\nAcceptance criteria:\n- bd init does not ignore deletions.jsonl\n- Existing .gitignore files are not broken\n- File appears in git status when modified","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.663196-08:00","updated_at":"2025-11-25T16:56:18.772769-08:00","closed_at":"2025-11-25T14:55:43.225883-08:00"}
|
||||
{"id":"bd-81a","title":"Add programmatic tip injection API","description":"Allow tips to be programmatically injected at runtime based on detected conditions. This enables dynamic tips (not just pre-defined ones) to be shown with custom priority and frequency.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:46.645583-08:00","updated_at":"2025-11-26T08:48:08.4517698-07:00","closed_at":"2025-11-25T17:52:35.096882-08:00","dependencies":[{"issue_id":"bd-81a","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:46.646327-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-c4rq","title":"Refactor: Move staleness check inside daemon branch","description":"## Problem\n\nCurrently ensureDatabaseFresh() is called before the daemon mode check, but it checks daemonClient != nil internally and returns early. This is redundant.\n\n**Location:** All read commands (list.go:196, show.go:27, ready.go:102, status.go:80, etc.)\n\n## Current Pattern\n\nCall happens before daemon check, function checks daemonClient internally.\n\n## Better Pattern\n\nMove staleness check to direct mode branch only, after daemon check.\n\n## Impact\nLow - minor performance improvement (avoids one function call per command in daemon mode)\n\n## Effort\nMedium - requires refactoring 8 command files\n\n## Priority\nLow - can defer to future cleanup PR","status":"open","priority":3,"issue_type":"chore","created_at":"2025-11-20T20:17:45.119583-05:00","updated_at":"2025-11-20T20:17:45.119583-05:00"}
|
||||
{"id":"bd-f0n","title":"Git history fallback missing timeout - could hang on large repos","description":"## Problem\n\nThe git commands in `checkGitHistoryForDeletions` have no timeout. On large repos with extensive history, `git log --all -S` or `git log --all -G` can take a very long time (minutes).\n\n## Location\n`internal/importer/importer.go:899` and `:930`\n\n## Impact\n- Import could hang indefinitely\n- User has no feedback that git search is running\n- No way to cancel except killing the process\n\n## Fix\nAdd context with timeout to git commands:\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\ndefer cancel()\ncmd := exec.CommandContext(ctx, \"git\", ...)\n```\n\nAlso consider adding a `--since` flag to bound the git history search.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:24.388639-08:00","updated_at":"2025-11-25T16:56:18.774748-08:00","closed_at":"2025-11-25T15:04:53.669714-08:00"}
|
||||
{"id":"bd-tys","title":"Git history fallback has incorrect logic for detecting deletions","description":"## Problem\n\nThe `wasInGitHistory` function in `internal/importer/importer.go:891` returns true if the ID is found **anywhere** in git history. But finding an ID in history doesn't necessarily mean it was deleted - it could mean:\n\n1. The issue was added (appears in a commit adding it)\n2. The issue was modified (appears in commits updating it)\n3. The issue was deleted (appears in a commit removing it)\n\nThe current logic incorrectly treats all three cases as 'deleted'.\n\n## Correct Logic\n\n`git log -S` with `--oneline` shows commits where the string was added OR removed. To detect deletion specifically:\n\n1. ID appears in git history (was once in JSONL)\n2. ID is NOT currently in JSONL\n\nThe second condition is already checked by the caller (`purgeDeletedIssues`), so technically the logic is correct in context. But the function name and doc comment are misleading.\n\n## Fix Options\n\n1. **Rename function** to `wasEverInJSONL` and update doc comment to clarify\n2. **Add explicit check** for current JSONL state in the function itself\n\nOption 1 is simpler and correct since caller already filters.","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:46:16.073661-08:00","updated_at":"2025-11-26T08:48:08.4581913-07:00","closed_at":"2025-11-25T15:11:54.426093-08:00"}
|
||||
{"id":"bd-pbj","title":"bd doctor --fix should run bd sync to commit untracked deletions.jsonl","description":"After running bd cleanup -f, the deletions.jsonl file is created but left untracked. bd doctor --fix should notice this and run bd sync to commit it.\n\nCurrent behavior:\n- bd cleanup -f creates/updates deletions.jsonl\n- git status shows deletions.jsonl as untracked\n- bd doctor --fix does not notice or fix this\n\nExpected behavior:\n- bd doctor --fix should detect untracked .beads/*.jsonl files\n- Should offer to run bd sync to commit them\n\nRelated: The git hooks were also missing deletions.jsonl from their staging loops - that's been fixed in this session.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:29:33.901199-08:00","updated_at":"2025-11-26T20:33:03.296592-08:00","closed_at":"2025-11-26T20:33:03.296592-08:00"}
|
||||
{"id":"bd-v29","title":"Deletions pruning doesn't include results in JSON output","description":"## Problem\n\nWhen `bd compact --json` runs with deletions pruning, the prune results are silently discarded:\n\n```go\n// Only report if there were deletions to prune\nif result.PrunedCount \u003e 0 {\n if jsonOutput {\n // JSON output will be included in the main response\n return // \u003c-- BUG: results are NOT included anywhere\n }\n ...\n}\n```\n\n## Location\n`cmd/bd/compact.go:925-929`\n\n## Impact\n- JSON consumers don't know deletions were pruned\n- No way to audit pruning via automation\n\n## Fix\nReturn prune results and include in JSON output structure:\n\n```json\n{\n \"success\": true,\n \"compacted\": {...},\n \"deletions_pruned\": {\n \"count\": 5,\n \"retention_days\": 7\n }\n}\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:59.730979-08:00","updated_at":"2025-11-26T08:48:08.4590125-07:00","closed_at":"2025-11-25T15:11:54.363653-08:00"}
|
||||
{"id":"bd-b8h","title":"Refactor check-health DB access to avoid repeated path resolution","description":"The runCheckHealth lightweight checks (hintsDisabled, checkVersionMismatch, checkSyncBranchQuick) each have duplicated database path resolution logic. Extract a helper function to DRY this up.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:35.075929-08:00","updated_at":"2025-11-25T20:56:48.605799-08:00","closed_at":"2025-11-25T19:50:21.272961-08:00"}
|
||||
{"id":"bd-tru","title":"Update documentation for bd prime and Claude integration","description":"Update AGENTS.md, README.md, and QUICKSTART.md to document the new `bd prime` command, `bd setup claude` command, and tip system.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:30:22.77349-08:00","updated_at":"2025-11-26T08:48:08.4576789-07:00","closed_at":"2025-11-25T17:47:30.807069-08:00"}
|
||||
{"id":"bd-d4i","title":"Create tip system infrastructure for contextual hints","description":"Implement a tip/hint system that shows helpful contextual messages after successful commands. This is different from the existing error-path \"Hint:\" messages - tips appear on success paths to educate users about features they might not know about.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:15.693956-08:00","updated_at":"2025-11-26T08:48:08.453814-07:00","closed_at":"2025-11-25T17:47:30.747566-08:00"}
|
||||
{"id":"bd-hdt","title":"Implement auto-merge functionality in duplicates command","description":"The duplicates.go file has a TODO at line 95 to implement the performMerge function for automatic duplicate merging. Currently it just prints a warning message. This would automate the merge process instead of just suggesting commands.","status":"open","priority":2,"issue_type":"feature","created_at":"2025-11-21T18:55:02.828619-05:00","updated_at":"2025-11-21T18:55:02.828619-05:00"}
|
||||
{"id":"bd-gqo","title":"Implement health checks in daemon event loop","description":"Add health checks to checkDaemonHealth() function in daemon_event_loop.go:170:\n- Database integrity check\n- Disk space check\n- Memory usage check\n\nCurrently it's just a no-op placeholder.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-21T18:55:07.534304-05:00","updated_at":"2025-11-21T18:55:07.534304-05:00"}
|
||||
{"id":"bd-ge7","title":"Improve Beads test coverage from 46% to 80%","status":"open","priority":1,"issue_type":"epic","created_at":"2025-11-20T21:21:03.700271-05:00","updated_at":"2025-11-20T21:21:03.700271-05:00","dependencies":[{"issue_id":"bd-ge7","depends_on_id":"bd-4h3","type":"blocks","created_at":"2025-11-22T11:13:20.340458-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-e92","type":"blocks","created_at":"2025-11-22T11:13:20.407609-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-m0w","type":"blocks","created_at":"2025-11-22T11:13:20.476188-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-t3b","type":"blocks","created_at":"2025-11-22T11:13:20.546335-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-j3zt","title":"Fix mypy errors in beads-mcp","description":"Running `mypy .` in `integrations/beads-mcp` reports 287 errors. These should be addressed to improve type safety and code quality.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-20T18:53:28.557708-05:00","updated_at":"2025-11-26T21:09:25.947233-08:00","closed_at":"2025-11-26T21:09:25.947233-08:00"}
|
||||
{"id":"bd-39o","title":"Rename last_import_hash metadata key to jsonl_content_hash","description":"The metadata key 'last_import_hash' is misleading because it's updated on both import AND export (sync.go:614, import.go:320).\n\nBetter names:\n- jsonl_content_hash (more accurate)\n- last_sync_hash (clearer intent)\n\nThis is a breaking change requiring migration of existing metadata values.","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:31:07.568739-05:00","updated_at":"2025-11-20T21:31:07.568739-05:00"}
|
||||
{"id":"bd-wmo","title":"PruneDeletions iterates map non-deterministically","description":"## Problem\n\n`PruneDeletions` iterates over `loadResult.Records` which is a map. Go maps iterate in random order, so:\n\n1. `result.PrunedIDs` order is non-deterministic\n2. `kept` slice order is non-deterministic → `WriteDeletions` output order varies\n\n## Location\n`internal/deletions/deletions.go:213`\n\n## Impact\n- Git diffs are noisy (file changes order on each prune)\n- Tests could be flaky if they depend on order\n- Harder to debug/audit\n\n## Fix\nSort by ID or timestamp before iterating:\n\n```go\n// Convert map to slice and sort\nvar records []DeletionRecord\nfor _, r := range loadResult.Records {\n records = append(records, r)\n}\nsort.Slice(records, func(i, j int) bool {\n return records[i].ID \u003c records[j].ID\n})\n```","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:49:11.290916-08:00","updated_at":"2025-11-26T08:48:08.4595251-07:00","closed_at":"2025-11-25T15:15:21.903649-08:00"}
|
||||
{"id":"bd-4aao","title":"Fix failing integration tests in beads-mcp","description":"The `beads-mcp` test suite has failures in `tests/test_bd_client_integration.py` (assertion error in `test_init_creates_beads_directory`) and errors in `tests/test_worktree_separate_dbs.py` (setup failures finding database). These need to be investigated and fixed to ensure a reliable CI baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T18:53:28.4803-05:00","updated_at":"2025-11-26T14:42:45.914861-08:00","closed_at":"2025-11-25T21:39:20.967106-08:00"}
|
||||
{"id":"bd-4h3","title":"Add test coverage for internal/git package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:23.497486-05:00","updated_at":"2025-11-20T21:21:23.497486-05:00","dependencies":[{"issue_id":"bd-4h3","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.277639-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-bgs","title":"Git history fallback doesn't escape regex special chars in IDs","description":"## Problem\n\nIn `batchCheckGitHistory`, IDs are directly interpolated into a regex pattern:\n\n```go\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, id))\nsearchPattern := strings.Join(patterns, \"|\")\ncmd := exec.Command(\"git\", \"log\", \"--all\", \"-G\", searchPattern, ...)\n```\n\nIf an ID contains regex special characters (e.g., `bd-foo.bar` or `bd-test+1`), the pattern will be malformed or match unintended strings.\n\n## Location\n`internal/importer/importer.go:923-926`\n\n## Impact\n- False positives: IDs with `.` could match any character\n- Regex errors: IDs with `[` or `(` could cause git to fail\n- Security: potential for regex injection (low risk since IDs are validated)\n\n## Fix\nEscape regex special characters:\n\n```go\nimport \"regexp\"\n\nescapedID := regexp.QuoteMeta(id)\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, escapedID))\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:50:30.132232-08:00","updated_at":"2025-11-25T16:56:18.773249-08:00","closed_at":"2025-11-25T15:04:06.217695-08:00"}
|
||||
{"id":"bd-b2b","title":"CI test timeout: cmd/bd tests take 600s (10 min timeout)","description":"The cmd/bd test suite is hitting the 10 minute Go test timeout on both Linux and Windows CI. A database/sql connection opener goroutine remains stuck for 9+ minutes, suggesting a test is not properly closing a database connection. This causes CI failures even when all individual tests pass.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:58:30.117739-08:00","updated_at":"2025-11-26T20:58:30.117739-08:00"}
|
||||
{"id":"bd-m7ge","title":"Add .beads/README.md during 'bd init' for project documentation and promotion","description":"When 'bd init' is run, automatically generate a .beads/README.md file that:\n\n1. Briefly explains what Beads is (AI-native issue tracking that lives in your repo)\n2. Links to the main repository: https://github.com/steveyegge/beads\n3. Provides a quick reference of essential commands:\n - bd create: Create new issues\n - bd list: View all issues\n - bd update: Modify issue status/details\n - bd show: View issue details\n - bd sync: Sync with git remote\n4. Highlights key benefits for AI coding agents and developers\n5. Encourages developers to try it out\n\nThe README should be enthusiastic and compelling to get open source contributors excited about using Beads for their AI-assisted development workflows.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-16T22:32:50.478681-08:00","updated_at":"2025-11-26T08:48:08.4554967-07:00","closed_at":"2025-11-25T17:49:42.558381-08:00"}
|
||||
{"id":"bd-bhd","title":"Git history fallback assumes .beads is direct child of repo root","description":"## Problem\n\n`checkGitHistoryForDeletions` assumes the repo structure:\n\n```go\nrepoRoot := filepath.Dir(beadsDir) // Assumes .beads is in repo root\njsonlPath := filepath.Join(\".beads\", \"beads.jsonl\")\n```\n\nBut `.beads` could be in a subdirectory (monorepo, nested project), and the actual JSONL filename could be different (configured via `metadata.json`).\n\n## Location\n`internal/importer/importer.go:865-869`\n\n## Impact\n- Git search will fail silently for repos with non-standard structure\n- Monorepo users won't get deletion propagation\n\n## Fix\n1. Use `git rev-parse --show-toplevel` to find actual repo root\n2. Compute relative path from repo root to JSONL\n3. Or use `git -C \u003cdir\u003e` to run from beadsDir directly","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:51:03.46856-08:00","updated_at":"2025-11-25T16:56:18.775568-08:00","closed_at":"2025-11-25T15:05:40.754716-08:00"}
|
||||
{"id":"bd-1pj6","title":"Proposal: Custom status states via config","description":"Proposal to add 'custom status states' via `bd config`.\nUsers could define an optional issue status enum (e.g., awaiting_review, review_in_progress) in the config.\nThis would enable multi-step pipelines to process issues where each step correlates to a specific status.\n\nExamples:\n- awaiting_verification\n- awaiting_docs\n- awaiting_testing\n","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-20T18:55:48.670499-05:00","updated_at":"2025-11-20T18:55:48.670499-05:00"}
|
||||
{"id":"bd-b2b","title":"CI test timeout: cmd/bd tests take 600s (10 min timeout)","description":"The cmd/bd test suite is hitting the 10 minute Go test timeout on both Linux and Windows CI. A database/sql connection opener goroutine remains stuck for 9+ minutes, suggesting a test is not properly closing a database connection. This causes CI failures even when all individual tests pass.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:58:30.117739-08:00","updated_at":"2025-11-26T20:58:30.117739-08:00"}
|
||||
{"id":"bd-l7u","title":"Duplicate DefaultRetentionDays constants","description":"## Problem\n\nThere are now two constants for the same value:\n\n1. `deletions.DefaultRetentionDays = 7` in `internal/deletions/deletions.go:184`\n2. `configfile.DefaultDeletionsRetentionDays = 7` in `internal/configfile/configfile.go:102`\n\n## Impact\n- DRY violation\n- Risk of values getting out of sync\n- Confusing which one to use\n\n## Fix\nRemove the constant from `deletions` package and have it import from `configfile`, or create a shared constants package.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-25T12:49:38.356211-08:00","updated_at":"2025-11-26T08:48:08.4548901-07:00","closed_at":"2025-11-25T15:15:21.964842-08:00"}
|
||||
{"id":"bd-nq41","title":"Fix Homebrew warning about Ruby file location","description":"Homebrew warning: Found Ruby file outside steveyegge/beads tap formula directory.\nWarning points to: /opt/homebrew/Library/Taps/steveyegge/homebrew-beads/bd.rb\nIt should likely be inside a Formula/ directory or similar structure expected by Homebrew taps.\n","status":"closed","priority":2,"issue_type":"chore","created_at":"2025-11-20T18:56:21.226579-05:00","updated_at":"2025-11-26T21:09:31.039592-08:00","closed_at":"2025-11-26T21:01:53.07918-08:00"}
|
||||
{"id":"bd-2em","title":"Expand checkHooksQuick to verify all hook versions","description":"Currently checkHooksQuick only checks post-merge hook version. Should also check pre-commit, pre-push, and post-checkout for completeness. Keep it lightweight but catch more outdated hooks.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:47.432243-08:00","updated_at":"2025-11-25T20:56:48.60513-08:00","closed_at":"2025-11-25T19:50:21.378464-08:00"}
|
||||
{"id":"bd-6xd","title":"Standardize on issues.jsonl as canonical filename","description":"## Background\n\nThe codebase has confused and contradictory references to both `issues.jsonl` and `beads.jsonl`. This arose from a misconception that `issues.jsonl` was polluted with 100k test issues, but analysis shows:\n\n- issues.jsonl git history: 253 blobs, 54 MB total (max blob 2.1 MB)\n- beads.jsonl git history: 1140 blobs, 353 MB total (6.5x larger!)\n\nThe 'pollution' was never as big as remembered. Meanwhile, 99% of user installs use `issues.jsonl`.\n\n## The Problem\n\nCode has contradictory comments:\n```go\n// cmd/bd/autoimport.go:88\n// Try canonical JSONL filenames in precedence order (issues.jsonl is canonical)\n\n// internal/configfile/configfile.go:24\nJSONLExport: \"beads.jsonl\", // Default to canonical name (was issues.jsonl)\n```\n\n## Current State\n\n### Code References (excluding tests)\n- `beads.jsonl`: 51 references in Go code\n- `issues.jsonl`: 84 references in Go code\n\n### Documentation References\n- `beads.jsonl`: 59 references\n- `issues.jsonl`: 62 references\n\n## Proposed Solution\n\n1. Make `issues.jsonl` the **only** canonical name\n2. Support `beads.jsonl` only as legacy (auto-migrate to issues.jsonl)\n3. Switch beads repo itself back to using issues.jsonl\n4. Update all code and docs for consistency\n\n## Files Requiring Changes\n\n### High Priority (logic changes)\n- `internal/configfile/configfile.go` - Change default from beads.jsonl to issues.jsonl\n- `internal/beads/beads.go` - Reverse preference order, prefer issues.jsonl\n- `cmd/bd/version_tracking.go` - Reverse preference order\n- `cmd/bd/doctor/fix/database_config.go` - Reverse preference order\n- `cmd/bd/autoimport.go` - Already prefers issues.jsonl (correct)\n- `cmd/bd/init.go` - Update gitattributes setup, comments\n\n### Medium Priority (user-facing messages)\n- `cmd/bd/import.go` - Update example paths in error messages\n- `cmd/bd/sync.go` - Update diff display path\n- `cmd/bd/status.go` - Update git log path\n- `cmd/bd/staleness.go` - Update help message\n- `cmd/bd/init_contributor.go` - Update output messages\n- `cmd/bd/clean.go` - Update help text\n- `cmd/bd/cleanup.go` - Update help text\n\n### Lower Priority (internal/comments)\n- `internal/importer/importer.go` - Update comments and paths\n- `cmd/bd/merge.go` - Update comment\n- `cmd/bd/doctor.go` - Multiple references\n- `cmd/bd/doctor/fix/sync.go` - Variable naming\n- `cmd/bd/doctor/fix/deletions.go` - Path reference\n\n### Documentation\n- README.md - ~8 references to update\n- docs/DELETIONS.md\n- docs/CLI_REFERENCE.md\n- docs/ARCHITECTURE.md\n- docs/TROUBLESHOOTING.md\n- docs/PROTECTED_BRANCHES.md\n- docs/GIT_INTEGRATION.md\n- docs/MULTI_REPO_AGENTS.md\n- docs/MULTI_REPO_MIGRATION.md\n- docs/TESTING.md (acknowledges the inconsistency)\n\n## Migration Strategy\n\n1. Add migration in `bd init`: if beads.jsonl exists and issues.jsonl doesn't, rename it\n2. Update `bd doctor` to detect and offer to fix the naming\n3. Keep reading beads.jsonl as fallback for one version cycle\n4. Remove beads.jsonl fallback in future version\n\n## For Beads Repo Itself\n\n1. `git mv .beads/beads.jsonl .beads/issues.jsonl`\n2. Update .gitattributes if present\n3. Commit with clear message","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-26T19:33:34.169595-08:00","updated_at":"2025-11-26T19:33:34.169595-08:00"}
|
||||
{"id":"bd-03r","title":"Document deletions manifest in AGENTS.md and README","description":"Parent: bd-imj\n\n## Task\nAdd documentation about the deletions manifest feature.\n\n## Locations to Update\n\n### AGENTS.md\n- Explain that deletions.jsonl is tracked in git\n- Document that `bd delete` records to the manifest\n- Explain cross-clone propagation mechanism\n\n### README.md \n- Brief mention in .beads directory structure section\n- Link to detailed docs if needed\n\n### docs/deletions.md (new file)\n- Full technical documentation\n- Format specification\n- Pruning policy\n- Git history fallback\n- Troubleshooting\n\n## Acceptance Criteria\n- AGENTS.md updated with deletion workflow\n- README.md mentions deletions.jsonl purpose\n- New docs/deletions.md with complete reference","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:49.13027-08:00","updated_at":"2025-11-26T08:48:08.4481359-07:00","closed_at":"2025-11-25T15:17:23.145944-08:00"}
|
||||
{"id":"bd-736d","title":"Refactor path canonicalization into helper function","description":"The path canonicalization logic (filepath.Abs + EvalSymlinks) is duplicated in 3 places:\n- beads.go:131-137 (BEADS_DIR handling)\n- cmd/bd/main.go:446-451 (--no-db cleanup)\n- cmd/bd/nodb.go:26-31 (--no-db initialization)\n\nRefactoring suggestion:\nExtract to a helper function like:\n func canonicalizePath(path string) string\n\nThis would:\n- Reduce code duplication\n- Make the logic easier to maintain\n- Ensure consistent behavior across all path handling\n\nRelated to bd-e16b implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:33:47.727443-08:00","updated_at":"2025-11-26T14:42:45.915853-08:00","closed_at":"2025-11-25T22:27:33.738672-08:00"}
|
||||
{"id":"bd-tne","title":"Add Claude setup tip with dynamic priority","description":"Add a predefined tip that suggests running `bd setup claude` when Claude Code is detected but not configured. This tip should have higher priority (shown more frequently) until the setup is complete.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:29:29.871324-08:00","updated_at":"2025-11-26T08:48:08.4571675-07:00","closed_at":"2025-11-25T17:52:35.044989-08:00","dependencies":[{"issue_id":"bd-tne","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:29.872081-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-x2i","title":"Add bd deleted command for audit trail","description":"Parent: bd-imj\n\nAdd command to view deletion history.\n\nUsage:\n bd deleted # Show recent deletions (last 7 days)\n bd deleted --since=30d # Show deletions in last 30 days\n bd deleted --all # Show all tracked deletions\n bd deleted bd-xxx # Show deletion details for specific issue\n\nOutput format:\n bd-xxx 2025-11-25 10:00 stevey duplicate of bd-yyy\n bd-yyy 2025-11-25 10:05 claude cleanup\n\nAcceptance criteria:\n- List deletions with timestamp, actor, reason\n- Filter by time range\n- Lookup specific issue ID\n- JSON output option for scripting","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.113861-08:00","updated_at":"2025-11-26T08:48:08.460049-07:00","closed_at":"2025-11-25T15:13:53.781519-08:00"}
|
||||
{"id":"bd-3gc","title":"Audit remaining cmd/bd files for error handling consistency","description":"Extend ERROR_HANDLING_AUDIT.md to cover: daemon_sync.go, update.go, list.go, show.go, close.go, reopen.go, dep.go, label.go, comments.go, delete.go, compact.go, config.go, validate.go and other high-usage command files","status":"open","priority":3,"issue_type":"task","created_at":"2025-11-24T00:28:55.890991-08:00","updated_at":"2025-11-24T00:28:55.890991-08:00"}
|
||||
{"id":"bd-red","title":"bd sync should only commit .beads/ files, not all staged changes","description":"Currently bd sync commits ALL staged files, not just .beads/*.jsonl. This can lead to:\n- Unintended commits of work-in-progress code\n- Surprise for users/agents who staged files but weren't ready to commit\n- Mixing beads sync commits with actual code changes\n\nExpected behavior: bd sync should only stage and commit .beads/ files, leaving other staged changes alone.\n\nOptions:\n1. Stash other staged changes, commit only .beads/, restore stash\n2. Use git add .beads/ \u0026\u0026 git commit -m '...' -- .beads/ to only commit beads files\n3. Warn if non-beads files are staged and require --force to proceed","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:35:40.212006-08:00","updated_at":"2025-11-26T20:46:26.106545-08:00","closed_at":"2025-11-26T20:46:26.106545-08:00"}
|
||||
{"id":"bd-wcl","title":"Document CLI + hooks as recommended approach over MCP","description":"Update documentation to position CLI + bd prime hooks as the primary recommended approach over MCP server, explaining why minimizing context matters even with large context windows (compute cost, energy, environment, latency).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-12T00:15:25.923025-08:00","updated_at":"2025-11-26T20:23:54.673705-08:00","closed_at":"2025-11-26T18:06:51.020351-08:00"}
|
||||
{"id":"bd-mdw","title":"Add integration test for cross-clone deletion propagation","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:38.997009-08:00","updated_at":"2025-11-26T08:48:08.4561434-07:00","closed_at":"2025-11-25T16:35:59.052914-08:00"}
|
||||
{"id":"bd-p6vp","title":"Clarify .beads/.gitattributes handling in Protected Branches docs","description":"Protected Branches docs quick start leaves untracked `.beads` directory and `.gitattributes`.\nQuestion: Are these changes meant to be checked into the protected branch?\nNeed to clarify if these should be ignored or committed, or if the instructions are missing a step.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:25.79407-05:00","updated_at":"2025-11-26T21:09:31.040035-08:00","closed_at":"2025-11-26T21:05:25.38864-08:00"}
|
||||
{"id":"bd-ybv5","title":"Refactor AGENTS.md to use external references","description":"Suggestion to use external references (e.g., \"ALWAYS REFER TO ./beads/prompt.md\") instead of including all instructions directly within AGENTS.md.\nReasons:\n1. Agents can follow external references.\n2. Prevents context pollution/stuffing in AGENTS.md as more tools append instructions.\n","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-20T18:55:53.259144-05:00","updated_at":"2025-11-26T21:09:31.040412-08:00","closed_at":"2025-11-26T21:05:26.887516-08:00"}
|
||||
{"id":"bd-c362","title":"Extract database search logic into helper function","description":"The logic for finding a database in a beads directory is duplicated:\n- FindDatabasePath() BEADS_DIR section (beads.go:141-169)\n- findDatabaseInTree() (beads.go:248-280)\n\nBoth implement the same search order:\n1. Check config.json first (single source of truth)\n2. Fall back to canonical beads.db\n3. Search for *.db files, filtering backups and vc.db\n\nRefactoring suggestion:\nExtract to a helper function like:\n func findDatabaseInBeadsDir(beadsDir string) string\n\nBenefits:\n- Single source of truth for database search logic\n- Easier to maintain and update search order\n- Reduces code duplication\n\nRelated to [deleted:bd-e16b] implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:34:02.831543-08:00","updated_at":"2025-11-26T14:42:45.916835-08:00","closed_at":"2025-11-25T22:27:33.794656-08:00"}
|
||||
{"id":"bd-s0z","title":"Consider extracting error handling helpers","description":"Evaluate creating FatalError() and WarnError() helpers as suggested in ERROR_HANDLING.md to reduce boilerplate and enforce consistency. Prototype in a few files first to validate the approach.","status":"open","priority":4,"issue_type":"task","created_at":"2025-11-24T00:28:57.248959-08:00","updated_at":"2025-11-24T00:28:57.248959-08:00"}
|
||||
{"id":"bd-xyc","title":"Consolidate check-health DB opens into single connection","description":"The --check-health flag opens the database 3 separate times (once per quick check). Consolidate into a single DB open for better performance, especially on slower filesystems.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:42.034178-08:00","updated_at":"2025-11-25T20:56:48.606205-08:00","closed_at":"2025-11-25T19:50:21.32375-08:00"}
|
||||
{"id":"bd-9li4","title":"Create Docker image for Agent Mail","description":"Containerize Agent Mail server for easy deployment.\n\nAcceptance Criteria:\n- Dockerfile with Python 3.14\n- Health check endpoint\n- Volume mount for storage\n- Environment variable configuration\n- Multi-arch builds (amd64, arm64)\n\nFile: deployment/agent-mail/Dockerfile","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-07T22:43:43.231964-08:00","updated_at":"2025-11-26T08:48:08.4522812-07:00","closed_at":"2025-11-25T17:47:30.777486-08:00"}
|
||||
{"id":"bd-bt6y","title":"Improve compact/daemon/merge documentation and UX","description":"Multiple documentation and UX issues encountered:\n1. \"bd compact --analyze\" fails with misleading \"requires SQLite storage\" error when daemon is running. Needs --no-daemon or better error.\n2. \"bd merge\" help text is outdated (refers to 3-way merge instead of issue merging).\n3. Daemon mode purpose isn't clear to local-only users.\n4. Compact/cleanup commands are hard to discover.\n\nProposed fixes:\n- Fix compact+daemon interaction or error message.\n- Update \"bd merge\" help text.\n- Add \"when to use daemon\" section to docs.\n- Add maintenance section to quickstart.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:55:43.637047-05:00","updated_at":"2025-11-20T18:55:43.637047-05:00"}
|
||||
{"id":"bd-l954","title":"Performance Testing Framework","description":"Add comprehensive performance testing for beads focusing on optimization guidance and validating 10K+ database scale. Uses standard Go tooling, follows existing patterns, minimal complexity.\n\nComponents:\n- Benchmark suite for critical operations at 10K-20K scale\n- Fixture generator for realistic test data (epic hierarchies, cross-links)\n- User diagnostics via bd doctor --perf\n- Always-on profiling integration\n\nGoals:\n- Identify bottlenecks for optimization work\n- Validate performance at 10K+ issue scale\n- Enable users to collect diagnostics for bug reports\n- Support both SQLite and JSONL import paths","status":"open","priority":2,"issue_type":"epic","created_at":"2025-11-13T22:22:11.203467-08:00","updated_at":"2025-11-13T22:22:11.203467-08:00"}
|
||||
{"id":"bd-imj","title":"Deletion propagation via deletions manifest","description":"## Problem\n\nWhen `bd cleanup -f` or `bd delete` removes issues in one clone, those deletions don't propagate to other clones. The import logic only creates/updates, never deletes. This causes \"resurrection\" where deleted issues reappear.\n\n## Root Cause\n\nImport sees DB issues not in JSONL and assumes they're \"local unpushed work\" rather than \"intentionally deleted upstream.\"\n\n## Solution: Deletions Manifest\n\nAdd `.beads/deletions.jsonl` - an append-only log of deleted issue IDs with metadata.\n\n### Format\n```jsonl\n{\"id\":\"bd-xxx\",\"ts\":\"2025-11-25T10:00:00Z\",\"by\":\"stevey\"}\n{\"id\":\"bd-yyy\",\"ts\":\"2025-11-25T10:05:00Z\",\"by\":\"claude\",\"reason\":\"duplicate of bd-zzz\"}\n```\n\n### Fields\n- `id`: Issue ID (required)\n- `ts`: ISO 8601 UTC timestamp (required)\n- `by`: Actor who deleted (required)\n- `reason`: Optional context (\"cleanup\", \"duplicate of X\", etc.)\n\n### Import Logic\n```\nFor each DB issue not in JSONL:\n 1. Check deletions manifest → if found, delete from DB\n 2. Fallback: check git history → if found, delete + backfill manifest\n 3. Neither → keep (local unpushed work)\n```\n\n### Conflict Resolution\nSimultaneous deletions from multiple clones are handled naturally:\n- Append-only design means both clones append their deletion records\n- On merge, file contains duplicate entries (same ID, different timestamps)\n- `LoadDeletions` deduplicates by ID (keeps any/first entry)\n- Result: deletion propagates correctly, duplicates are harmless\n\n### Pruning Policy\n- Default retention: 7 days (configurable via `deletions.retention_days`)\n- Auto-compact during `bd sync` is **opt-in** (disabled by default)\n- Hard cap: `deletions.max_entries` (default 50000)\n- Git fallback handles pruned entries (self-healing)\n\n### Self-Healing\nWhen git fallback catches a resurrection (pruned entry), it backfills the manifest. One-time git scan cost, then fast again.\n\n### Size Estimates\n- ~80 bytes/entry\n- 7-day retention with 100 deletions/day = ~56KB\n- Git compressed: ~10KB\n\n## Benefits\n- ✅ Deletions propagate across clones\n- ✅ O(1) lookup (no git scan in normal case)\n- ✅ Works in shallow clones\n- ✅ Survives history rewrite\n- ✅ Audit trail (who deleted what when)\n- ✅ Self-healing via git fallback\n- ✅ Bounded size via time-based pruning\n\n## References\n- Investigation session: 2025-11-25\n- Related: bd-2q6d (stale database warnings)","status":"closed","issue_type":"epic","created_at":"2025-11-25T09:56:01.98027-08:00","updated_at":"2025-11-26T08:48:08.454377-07:00","closed_at":"2025-11-25T16:36:27.965168-08:00","dependencies":[{"issue_id":"bd-imj","depends_on_id":"bd-qsm","type":"blocks","created_at":"2025-11-25T09:57:42.821911-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-x2i","type":"blocks","created_at":"2025-11-25T09:57:42.851712-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-44e","type":"blocks","created_at":"2025-11-25T09:57:42.88154-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bhd","type":"blocks","created_at":"2025-11-25T14:56:23.675787-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bgs","type":"blocks","created_at":"2025-11-25T14:56:23.744648-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-f0n","type":"blocks","created_at":"2025-11-25T14:56:23.80649-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-v29","type":"blocks","created_at":"2025-11-25T14:56:23.864569-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-mdw","type":"blocks","created_at":"2025-11-25T14:56:48.592492-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-03r","type":"blocks","created_at":"2025-11-25T14:56:54.295851-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-qsm","title":"Auto-compact deletions during bd sync","description":"Parent: bd-imj\n\n## Task\nOptionally prune deletions manifest during sync when threshold exceeded.\n\n**Note: Opt-in feature** - disabled by default to avoid sync latency.\n\n## Implementation\n\nIn `bd sync`:\n```go\nfunc (s *Syncer) Sync() error {\n // ... existing sync logic ...\n \n // Auto-compact only if enabled\n if s.config.GetBool(\"deletions.auto_compact\", false) {\n deletionCount := deletions.Count(\".beads/deletions.jsonl\")\n threshold := s.config.GetInt(\"deletions.auto_compact_threshold\", 1000)\n \n if deletionCount \u003e threshold {\n retentionDays := s.config.GetInt(\"deletions.retention_days\", 7)\n if err := s.compactor.PruneDeletions(retentionDays); err != nil {\n log.Warnf(\"Failed to auto-compact deletions: %v\", err)\n // Non-fatal, continue sync\n }\n }\n }\n \n // ... rest of sync ...\n}\n```\n\n## Configuration\n```yaml\ndeletions:\n retention_days: 7\n auto_compact: false # Opt-in, disabled by default\n auto_compact_threshold: 1000 # Trigger when \u003e N entries (if enabled)\n```\n\n## Acceptance Criteria\n- [ ] Auto-compact disabled by default\n- [ ] Enabled via config `deletions.auto_compact: true`\n- [ ] Sync checks deletion count only when enabled\n- [ ] Auto-prunes when threshold exceeded\n- [ ] Failure is non-fatal (logged warning)\n- [ ] Test: no compaction when disabled\n- [ ] Test: compaction triggers when enabled and threshold exceeded","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-25T09:57:04.522795-08:00","updated_at":"2025-11-25T16:56:18.772078-08:00","closed_at":"2025-11-25T15:03:01.469629-08:00"}
|
||||
{"id":"bd-055","title":"Fix hyphenated prefix parsing in ExtractIssuePrefix (GH #395)","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T15:22:22.395177-08:00","updated_at":"2025-11-26T16:46:57.8927-08:00","closed_at":"2025-11-26T16:46:57.8927-08:00"}
|
||||
{"id":"bd-zj8e","title":"Performance Testing Documentation","description":"Create docs/performance-testing.md documenting the performance testing framework.\n\nSections:\n1. Overview - What the framework does, goals\n2. Running Benchmarks\n - make bench command\n - Running specific benchmarks\n - Interpreting output (ns/op, allocs/op)\n3. Profiling and Analysis\n - Viewing CPU profiles with pprof\n - Reading flamegraphs\n - Memory profiling\n - Finding hotspots\n4. User Diagnostics\n - bd doctor --perf usage\n - Sharing profiles with bug reports\n - Understanding the report output\n5. Comparing Performance\n - Using benchstat for before/after comparisons\n - Detecting regressions\n6. Tips for Optimization\n - Common patterns\n - When to profile vs benchmark\n\nStyle:\n- Concise, practical examples\n- Screenshots/examples of pprof output\n- Clear command-line examples\n- Focus on workflow, not theory","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-13T22:23:38.99897-08:00","updated_at":"2025-11-13T22:23:38.99897-08:00"}
|
||||
{"id":"bd-mnap","title":"Investigate performance issues in VS Code Copilot (Windows)","description":"Beads unusable in Windows 11 VS Code Copilot chat with Sonnet 4.5.\nSummary event happens every 3-4 turns, taking 3 minutes.\nCopilot summarizes after ~125k tokens despite model supporting 1M.\nLarge context size of beads might be triggering aggressive summarization.\nNeed workaround or optimization for context size.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:30.124918-05:00","updated_at":"2025-11-20T18:56:30.124918-05:00"}
|
||||
{"id":"bd-m0w","title":"Add test coverage for internal/validation package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:24.129559-05:00","updated_at":"2025-11-20T21:21:24.129559-05:00","dependencies":[{"issue_id":"bd-m0w","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.350477-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-9e23","title":"Optimize Memory backend GetIssueByExternalRef with index","description":"Currently GetIssueByExternalRef in Memory storage uses O(n) linear search through all issues.\n\nCurrent code (memory.go:282-308):\nfor _, issue := range m.issues {\n if issue.ExternalRef != nil \u0026\u0026 *issue.ExternalRef == externalRef {\n return \u0026issueCopy, nil\n }\n}\n\nProposed optimization:\n- Add externalRefToID map[string]string to MemoryStorage\n- Maintain it in CreateIssue, UpdateIssue, DeleteIssue\n- Achieve O(1) lookup like SQLite's index\n\nImpact: Low (--no-db mode typically has smaller datasets)\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:30.242357-08:00","updated_at":"2025-11-26T14:42:45.916316-08:00","closed_at":"2025-11-26T11:14:49.172418-08:00"}
|
||||
{"id":"bd-ye0d","title":"troubleshoot GH#278 daemon exits every few secs","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-13T06:27:23.39509215-07:00","updated_at":"2025-11-26T08:48:08.4609494-07:00","closed_at":"2025-11-25T17:48:43.62418-08:00"}
|
||||
{"id":"bd-e166","title":"Improve timestamp comparison readability in import","description":"The timestamp comparison logic uses double-negative which can be confusing:\n\nCurrent code:\nif !incoming.UpdatedAt.After(existing.UpdatedAt) {\n // skip update\n}\n\nMore readable:\nif incoming.UpdatedAt.After(existing.UpdatedAt) {\n // perform update\n} else {\n // skip (local is newer)\n}\n\nThis is a minor refactor for code clarity.\n\nRelated: bd-1022\nFiles: internal/importer/importer.go:411, 488","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:12.27108-08:00","updated_at":"2025-11-26T21:09:31.038863-08:00","closed_at":"2025-11-26T21:02:13.080437-08:00"}
|
||||
{"id":"bd-e92","title":"Add test coverage for internal/autoimport package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.338577-05:00","updated_at":"2025-11-20T21:21:22.338577-05:00","dependencies":[{"issue_id":"bd-e92","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.128625-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-t3b","title":"Add test coverage for internal/config package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.91657-05:00","updated_at":"2025-11-20T21:21:22.91657-05:00","dependencies":[{"issue_id":"bd-t3b","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.201036-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-k4b","title":"Enhance dep tree to show full dependency graph","description":"When running `bd dep tree \u003cissue-id\u003e`, the current output only shows the issue itself without its dependency relationships.\n\n## Current Behavior\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\n→ gt-0iqq: Implement Boss (global overseer) [P2] (open)\n```\n\nThis doesn't show any of the dependency structure.\n\n## Desired Behavior\n\nShow the full dependency DAG rooted at the given issue. For example:\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\ngt-0iqq: Implement Boss (global overseer) [P2] (open)\n├── gt-0xh4: Boss session management [P2] (open) [READY]\n│ ├── gt-le7c: Boss mail identity [P2] (open)\n│ │ ├── gt-r8fe: Boss human escalation queue [P2] (open)\n│ │ └── gt-vdak: Boss dispatch loop [P2] (open)\n│ │ └── gt-kgy6: Boss resource management [P2] (open)\n│ │ └── gt-93iv: Boss wake daemon [P2] (open)\n│ └── gt-vdak: (shown above)\n```\n\n## Suggested Options\n\n- `--direction=down|up|both` - Show dependents (what this blocks), dependencies (what blocks this), or both\n- `--status=open` - Filter to only show issues with a given status\n- `--depth=N` - Limit tree depth\n- Handle DAG cycles gracefully (show \"(shown above)\" or similar for already-displayed nodes)\n\n## Use Case\n\nWhen reorganizing a set of related issues (like I just did with the Boss implementation), being able to visualize the full dependency graph helps verify the structure is correct before syncing.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-25T19:18:18.750649-08:00","updated_at":"2025-11-25T19:50:46.863319-08:00","closed_at":"2025-11-25T19:31:55.312314-08:00"}
|
||||
{"id":"bd-v29","title":"Deletions pruning doesn't include results in JSON output","description":"## Problem\n\nWhen `bd compact --json` runs with deletions pruning, the prune results are silently discarded:\n\n```go\n// Only report if there were deletions to prune\nif result.PrunedCount \u003e 0 {\n if jsonOutput {\n // JSON output will be included in the main response\n return // \u003c-- BUG: results are NOT included anywhere\n }\n ...\n}\n```\n\n## Location\n`cmd/bd/compact.go:925-929`\n\n## Impact\n- JSON consumers don't know deletions were pruned\n- No way to audit pruning via automation\n\n## Fix\nReturn prune results and include in JSON output structure:\n\n```json\n{\n \"success\": true,\n \"compacted\": {...},\n \"deletions_pruned\": {\n \"count\": 5,\n \"retention_days\": 7\n }\n}\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:59.730979-08:00","updated_at":"2025-11-26T08:48:08.4590125-07:00","closed_at":"2025-11-25T15:11:54.363653-08:00"}
|
||||
{"id":"bd-f0n","title":"Git history fallback missing timeout - could hang on large repos","description":"## Problem\n\nThe git commands in `checkGitHistoryForDeletions` have no timeout. On large repos with extensive history, `git log --all -S` or `git log --all -G` can take a very long time (minutes).\n\n## Location\n`internal/importer/importer.go:899` and `:930`\n\n## Impact\n- Import could hang indefinitely\n- User has no feedback that git search is running\n- No way to cancel except killing the process\n\n## Fix\nAdd context with timeout to git commands:\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\ndefer cancel()\ncmd := exec.CommandContext(ctx, \"git\", ...)\n```\n\nAlso consider adding a `--since` flag to bound the git history search.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:24.388639-08:00","updated_at":"2025-11-25T16:56:18.774748-08:00","closed_at":"2025-11-25T15:04:53.669714-08:00"}
|
||||
{"id":"bd-4l5","title":"bd prime: Detect ephemeral branches and adjust workflow output","description":"When 'bd prime' runs on a branch with no upstream (ephemeral branch), it should output a different SESSION CLOSE PROTOCOL.\n\n**Current output (wrong for ephemeral branches):**\n```\n[ ] 1. git status\n[ ] 2. git add \u003cfiles\u003e\n[ ] 3. bd sync\n[ ] 4. git commit -m \"...\"\n[ ] 5. bd sync\n[ ] 6. git push\n```\n\n**Needed output for ephemeral branches:**\n```\n[ ] 1. git status\n[ ] 2. git add \u003cfiles\u003e\n[ ] 3. bd sync --from-main (pull updates from main)\n[ ] 4. git commit -m \"...\"\n[ ] 5. (no push - branch is ephemeral)\n```\n\n**Detection:** `git rev-parse --abbrev-ref --symbolic-full-name @{u}` returns error code 128 if no upstream.\n\nAlso update Sync \u0026 Collaboration section to mention `bd sync --from-main` for ephemeral branches.\n\n**Use case:** Gastown polecats work on ephemeral local branches that are never pushed. Their code gets merged to main via local merge, and beads changes stay local (communicated via gm mail to Overseer).","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-25T16:55:24.984104-08:00","updated_at":"2025-11-25T17:12:46.604978-08:00","closed_at":"2025-11-25T17:12:46.604978-08:00"}
|
||||
{"id":"bd-c362","title":"Extract database search logic into helper function","description":"The logic for finding a database in a beads directory is duplicated:\n- FindDatabasePath() BEADS_DIR section (beads.go:141-169)\n- findDatabaseInTree() (beads.go:248-280)\n\nBoth implement the same search order:\n1. Check config.json first (single source of truth)\n2. Fall back to canonical beads.db\n3. Search for *.db files, filtering backups and vc.db\n\nRefactoring suggestion:\nExtract to a helper function like:\n func findDatabaseInBeadsDir(beadsDir string) string\n\nBenefits:\n- Single source of truth for database search logic\n- Easier to maintain and update search order\n- Reduces code duplication\n\nRelated to [deleted:bd-e16b] implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:34:02.831543-08:00","updated_at":"2025-11-26T14:42:45.916835-08:00","closed_at":"2025-11-25T22:27:33.794656-08:00"}
|
||||
{"id":"bd-wcl","title":"Document CLI + hooks as recommended approach over MCP","description":"Update documentation to position CLI + bd prime hooks as the primary recommended approach over MCP server, explaining why minimizing context matters even with large context windows (compute cost, energy, environment, latency).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-12T00:15:25.923025-08:00","updated_at":"2025-11-26T20:23:54.673705-08:00","closed_at":"2025-11-26T18:06:51.020351-08:00"}
|
||||
{"id":"bd-e92","title":"Add test coverage for internal/autoimport package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.338577-05:00","updated_at":"2025-11-20T21:21:22.338577-05:00","dependencies":[{"issue_id":"bd-e92","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.128625-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-1pj6","title":"Proposal: Custom status states via config","description":"Proposal to add 'custom status states' via `bd config`.\nUsers could define an optional issue status enum (e.g., awaiting_review, review_in_progress) in the config.\nThis would enable multi-step pipelines to process issues where each step correlates to a specific status.\n\nExamples:\n- awaiting_verification\n- awaiting_docs\n- awaiting_testing\n","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-20T18:55:48.670499-05:00","updated_at":"2025-11-20T18:55:48.670499-05:00"}
|
||||
{"id":"bd-tys","title":"Git history fallback has incorrect logic for detecting deletions","description":"## Problem\n\nThe `wasInGitHistory` function in `internal/importer/importer.go:891` returns true if the ID is found **anywhere** in git history. But finding an ID in history doesn't necessarily mean it was deleted - it could mean:\n\n1. The issue was added (appears in a commit adding it)\n2. The issue was modified (appears in commits updating it)\n3. The issue was deleted (appears in a commit removing it)\n\nThe current logic incorrectly treats all three cases as 'deleted'.\n\n## Correct Logic\n\n`git log -S` with `--oneline` shows commits where the string was added OR removed. To detect deletion specifically:\n\n1. ID appears in git history (was once in JSONL)\n2. ID is NOT currently in JSONL\n\nThe second condition is already checked by the caller (`purgeDeletedIssues`), so technically the logic is correct in context. But the function name and doc comment are misleading.\n\n## Fix Options\n\n1. **Rename function** to `wasEverInJSONL` and update doc comment to clarify\n2. **Add explicit check** for current JSONL state in the function itself\n\nOption 1 is simpler and correct since caller already filters.","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:46:16.073661-08:00","updated_at":"2025-11-26T08:48:08.4581913-07:00","closed_at":"2025-11-25T15:11:54.426093-08:00"}
|
||||
{"id":"bd-e166","title":"Improve timestamp comparison readability in import","description":"The timestamp comparison logic uses double-negative which can be confusing:\n\nCurrent code:\nif !incoming.UpdatedAt.After(existing.UpdatedAt) {\n // skip update\n}\n\nMore readable:\nif incoming.UpdatedAt.After(existing.UpdatedAt) {\n // perform update\n} else {\n // skip (local is newer)\n}\n\nThis is a minor refactor for code clarity.\n\nRelated: bd-1022\nFiles: internal/importer/importer.go:411, 488","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:12.27108-08:00","updated_at":"2025-11-26T21:09:31.038863-08:00","closed_at":"2025-11-26T21:02:13.080437-08:00"}
|
||||
{"id":"bd-ybv5","title":"Refactor AGENTS.md to use external references","description":"Suggestion to use external references (e.g., \"ALWAYS REFER TO ./beads/prompt.md\") instead of including all instructions directly within AGENTS.md.\nReasons:\n1. Agents can follow external references.\n2. Prevents context pollution/stuffing in AGENTS.md as more tools append instructions.\n","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-20T18:55:53.259144-05:00","updated_at":"2025-11-26T21:09:31.040412-08:00","closed_at":"2025-11-26T21:05:26.887516-08:00"}
|
||||
{"id":"bd-9e23","title":"Optimize Memory backend GetIssueByExternalRef with index","description":"Currently GetIssueByExternalRef in Memory storage uses O(n) linear search through all issues.\n\nCurrent code (memory.go:282-308):\nfor _, issue := range m.issues {\n if issue.ExternalRef != nil \u0026\u0026 *issue.ExternalRef == externalRef {\n return \u0026issueCopy, nil\n }\n}\n\nProposed optimization:\n- Add externalRefToID map[string]string to MemoryStorage\n- Maintain it in CreateIssue, UpdateIssue, DeleteIssue\n- Achieve O(1) lookup like SQLite's index\n\nImpact: Low (--no-db mode typically has smaller datasets)\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:30.242357-08:00","updated_at":"2025-11-26T14:42:45.916316-08:00","closed_at":"2025-11-26T11:14:49.172418-08:00"}
|
||||
{"id":"bd-c4rq","title":"Refactor: Move staleness check inside daemon branch","description":"## Problem\n\nCurrently ensureDatabaseFresh() is called before the daemon mode check, but it checks daemonClient != nil internally and returns early. This is redundant.\n\n**Location:** All read commands (list.go:196, show.go:27, ready.go:102, status.go:80, etc.)\n\n## Current Pattern\n\nCall happens before daemon check, function checks daemonClient internally.\n\n## Better Pattern\n\nMove staleness check to direct mode branch only, after daemon check.\n\n## Impact\nLow - minor performance improvement (avoids one function call per command in daemon mode)\n\n## Effort\nMedium - requires refactoring 8 command files\n\n## Priority\nLow - can defer to future cleanup PR","status":"open","priority":3,"issue_type":"chore","created_at":"2025-11-20T20:17:45.119583-05:00","updated_at":"2025-11-20T20:17:45.119583-05:00"}
|
||||
{"id":"bd-4h3","title":"Add test coverage for internal/git package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:23.497486-05:00","updated_at":"2025-11-20T21:21:23.497486-05:00","dependencies":[{"issue_id":"bd-4h3","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.277639-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-xyc","title":"Consolidate check-health DB opens into single connection","description":"The --check-health flag opens the database 3 separate times (once per quick check). Consolidate into a single DB open for better performance, especially on slower filesystems.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:42.034178-08:00","updated_at":"2025-11-25T20:56:48.606205-08:00","closed_at":"2025-11-25T19:50:21.32375-08:00"}
|
||||
{"id":"bd-gqo","title":"Implement health checks in daemon event loop","description":"Add health checks to checkDaemonHealth() function in daemon_event_loop.go:170:\n- Database integrity check\n- Disk space check\n- Memory usage check\n\nCurrently it's just a no-op placeholder.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-21T18:55:07.534304-05:00","updated_at":"2025-11-21T18:55:07.534304-05:00"}
|
||||
{"id":"bd-44e","title":"Ensure deletions.jsonl is tracked in git","description":"Parent: bd-imj\n\nEnsure deletions.jsonl is tracked in git (not ignored).\n\nUpdate bd init and gitignore upgrade logic to:\n1. NOT add deletions.jsonl to .gitignore\n2. Ensure it is committed alongside beads.jsonl\n\nThe file must be in git for cross-clone propagation to work.\n\nAcceptance criteria:\n- bd init does not ignore deletions.jsonl\n- Existing .gitignore files are not broken\n- File appears in git status when modified","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.663196-08:00","updated_at":"2025-11-25T16:56:18.772769-08:00","closed_at":"2025-11-25T14:55:43.225883-08:00"}
|
||||
{"id":"bd-mdw","title":"Add integration test for cross-clone deletion propagation","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:38.997009-08:00","updated_at":"2025-11-26T08:48:08.4561434-07:00","closed_at":"2025-11-25T16:35:59.052914-08:00"}
|
||||
{"id":"bd-81a","title":"Add programmatic tip injection API","description":"Allow tips to be programmatically injected at runtime based on detected conditions. This enables dynamic tips (not just pre-defined ones) to be shown with custom priority and frequency.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:46.645583-08:00","updated_at":"2025-11-26T08:48:08.4517698-07:00","closed_at":"2025-11-25T17:52:35.096882-08:00","dependencies":[{"issue_id":"bd-81a","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:46.646327-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-bt6y","title":"Improve compact/daemon/merge documentation and UX","description":"Multiple documentation and UX issues encountered:\n1. \"bd compact --analyze\" fails with misleading \"requires SQLite storage\" error when daemon is running. Needs --no-daemon or better error.\n2. \"bd merge\" help text is outdated (refers to 3-way merge instead of issue merging).\n3. Daemon mode purpose isn't clear to local-only users.\n4. Compact/cleanup commands are hard to discover.\n\nProposed fixes:\n- Fix compact+daemon interaction or error message.\n- Update \"bd merge\" help text.\n- Add \"when to use daemon\" section to docs.\n- Add maintenance section to quickstart.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:55:43.637047-05:00","updated_at":"2025-11-20T18:55:43.637047-05:00"}
|
||||
{"id":"bd-nq41","title":"Fix Homebrew warning about Ruby file location","description":"Homebrew warning: Found Ruby file outside steveyegge/beads tap formula directory.\nWarning points to: /opt/homebrew/Library/Taps/steveyegge/homebrew-beads/bd.rb\nIt should likely be inside a Formula/ directory or similar structure expected by Homebrew taps.\n","status":"closed","priority":2,"issue_type":"chore","created_at":"2025-11-20T18:56:21.226579-05:00","updated_at":"2025-11-26T21:09:31.039592-08:00","closed_at":"2025-11-26T21:01:53.07918-08:00"}
|
||||
{"id":"bd-39o","title":"Rename last_import_hash metadata key to jsonl_content_hash","description":"The metadata key 'last_import_hash' is misleading because it's updated on both import AND export (sync.go:614, import.go:320).\n\nBetter names:\n- jsonl_content_hash (more accurate)\n- last_sync_hash (clearer intent)\n\nThis is a breaking change requiring migration of existing metadata values.","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:31:07.568739-05:00","updated_at":"2025-11-20T21:31:07.568739-05:00"}
|
||||
{"id":"bd-mnap","title":"Investigate performance issues in VS Code Copilot (Windows)","description":"Beads unusable in Windows 11 VS Code Copilot chat with Sonnet 4.5.\nSummary event happens every 3-4 turns, taking 3 minutes.\nCopilot summarizes after ~125k tokens despite model supporting 1M.\nLarge context size of beads might be triggering aggressive summarization.\nNeed workaround or optimization for context size.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:30.124918-05:00","updated_at":"2025-11-20T18:56:30.124918-05:00"}
|
||||
{"id":"bd-d4i","title":"Create tip system infrastructure for contextual hints","description":"Implement a tip/hint system that shows helpful contextual messages after successful commands. This is different from the existing error-path \"Hint:\" messages - tips appear on success paths to educate users about features they might not know about.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:15.693956-08:00","updated_at":"2025-11-26T08:48:08.453814-07:00","closed_at":"2025-11-25T17:47:30.747566-08:00"}
|
||||
{"id":"bd-03r","title":"Document deletions manifest in AGENTS.md and README","description":"Parent: bd-imj\n\n## Task\nAdd documentation about the deletions manifest feature.\n\n## Locations to Update\n\n### AGENTS.md\n- Explain that deletions.jsonl is tracked in git\n- Document that `bd delete` records to the manifest\n- Explain cross-clone propagation mechanism\n\n### README.md \n- Brief mention in .beads directory structure section\n- Link to detailed docs if needed\n\n### docs/deletions.md (new file)\n- Full technical documentation\n- Format specification\n- Pruning policy\n- Git history fallback\n- Troubleshooting\n\n## Acceptance Criteria\n- AGENTS.md updated with deletion workflow\n- README.md mentions deletions.jsonl purpose\n- New docs/deletions.md with complete reference","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:49.13027-08:00","updated_at":"2025-11-26T08:48:08.4481359-07:00","closed_at":"2025-11-25T15:17:23.145944-08:00"}
|
||||
{"id":"bd-tru","title":"Update documentation for bd prime and Claude integration","description":"Update AGENTS.md, README.md, and QUICKSTART.md to document the new `bd prime` command, `bd setup claude` command, and tip system.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:30:22.77349-08:00","updated_at":"2025-11-26T08:48:08.4576789-07:00","closed_at":"2025-11-25T17:47:30.807069-08:00"}
|
||||
{"id":"bd-j3zt","title":"Fix mypy errors in beads-mcp","description":"Running `mypy .` in `integrations/beads-mcp` reports 287 errors. These should be addressed to improve type safety and code quality.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-20T18:53:28.557708-05:00","updated_at":"2025-11-26T21:09:25.947233-08:00","closed_at":"2025-11-26T21:09:25.947233-08:00"}
|
||||
{"id":"bd-3gc","title":"Audit remaining cmd/bd files for error handling consistency","description":"Extend ERROR_HANDLING_AUDIT.md to cover: daemon_sync.go, update.go, list.go, show.go, close.go, reopen.go, dep.go, label.go, comments.go, delete.go, compact.go, config.go, validate.go and other high-usage command files","status":"open","priority":3,"issue_type":"task","created_at":"2025-11-24T00:28:55.890991-08:00","updated_at":"2025-11-24T00:28:55.890991-08:00"}
|
||||
{"id":"bd-p6vp","title":"Clarify .beads/.gitattributes handling in Protected Branches docs","description":"Protected Branches docs quick start leaves untracked `.beads` directory and `.gitattributes`.\nQuestion: Are these changes meant to be checked into the protected branch?\nNeed to clarify if these should be ignored or committed, or if the instructions are missing a step.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:25.79407-05:00","updated_at":"2025-11-26T21:09:31.040035-08:00","closed_at":"2025-11-26T21:05:25.38864-08:00"}
|
||||
{"id":"bd-b8h","title":"Refactor check-health DB access to avoid repeated path resolution","description":"The runCheckHealth lightweight checks (hintsDisabled, checkVersionMismatch, checkSyncBranchQuick) each have duplicated database path resolution logic. Extract a helper function to DRY this up.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:35.075929-08:00","updated_at":"2025-11-25T20:56:48.605799-08:00","closed_at":"2025-11-25T19:50:21.272961-08:00"}
|
||||
{"id":"bd-9li4","title":"Create Docker image for Agent Mail","description":"Containerize Agent Mail server for easy deployment.\n\nAcceptance Criteria:\n- Dockerfile with Python 3.14\n- Health check endpoint\n- Volume mount for storage\n- Environment variable configuration\n- Multi-arch builds (amd64, arm64)\n\nFile: deployment/agent-mail/Dockerfile","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-07T22:43:43.231964-08:00","updated_at":"2025-11-26T08:48:08.4522812-07:00","closed_at":"2025-11-25T17:47:30.777486-08:00"}
|
||||
{"id":"bd-red","title":"bd sync should only commit .beads/ files, not all staged changes","description":"Currently bd sync commits ALL staged files, not just .beads/*.jsonl. This can lead to:\n- Unintended commits of work-in-progress code\n- Surprise for users/agents who staged files but weren't ready to commit\n- Mixing beads sync commits with actual code changes\n\nExpected behavior: bd sync should only stage and commit .beads/ files, leaving other staged changes alone.\n\nOptions:\n1. Stash other staged changes, commit only .beads/, restore stash\n2. Use git add .beads/ \u0026\u0026 git commit -m '...' -- .beads/ to only commit beads files\n3. Warn if non-beads files are staged and require --force to proceed","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:35:40.212006-08:00","updated_at":"2025-11-26T20:46:26.106545-08:00","closed_at":"2025-11-26T20:46:26.106545-08:00"}
|
||||
{"id":"bd-2em","title":"Expand checkHooksQuick to verify all hook versions","description":"Currently checkHooksQuick only checks post-merge hook version. Should also check pre-commit, pre-push, and post-checkout for completeness. Keep it lightweight but catch more outdated hooks.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:47.432243-08:00","updated_at":"2025-11-25T20:56:48.60513-08:00","closed_at":"2025-11-25T19:50:21.378464-08:00"}
|
||||
{"id":"bd-055","title":"Fix hyphenated prefix parsing in ExtractIssuePrefix (GH #395)","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T15:22:22.395177-08:00","updated_at":"2025-11-26T16:46:57.8927-08:00","closed_at":"2025-11-26T16:46:57.8927-08:00"}
|
||||
{"id":"bd-ye0d","title":"troubleshoot GH#278 daemon exits every few secs","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-13T06:27:23.39509215-07:00","updated_at":"2025-11-26T08:48:08.4609494-07:00","closed_at":"2025-11-25T17:48:43.62418-08:00"}
|
||||
{"id":"bd-4aao","title":"Fix failing integration tests in beads-mcp","description":"The `beads-mcp` test suite has failures in `tests/test_bd_client_integration.py` (assertion error in `test_init_creates_beads_directory`) and errors in `tests/test_worktree_separate_dbs.py` (setup failures finding database). These need to be investigated and fixed to ensure a reliable CI baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T18:53:28.4803-05:00","updated_at":"2025-11-26T14:42:45.914861-08:00","closed_at":"2025-11-25T21:39:20.967106-08:00"}
|
||||
{"id":"bd-wmo","title":"PruneDeletions iterates map non-deterministically","description":"## Problem\n\n`PruneDeletions` iterates over `loadResult.Records` which is a map. Go maps iterate in random order, so:\n\n1. `result.PrunedIDs` order is non-deterministic\n2. `kept` slice order is non-deterministic → `WriteDeletions` output order varies\n\n## Location\n`internal/deletions/deletions.go:213`\n\n## Impact\n- Git diffs are noisy (file changes order on each prune)\n- Tests could be flaky if they depend on order\n- Harder to debug/audit\n\n## Fix\nSort by ID or timestamp before iterating:\n\n```go\n// Convert map to slice and sort\nvar records []DeletionRecord\nfor _, r := range loadResult.Records {\n records = append(records, r)\n}\nsort.Slice(records, func(i, j int) bool {\n return records[i].ID \u003c records[j].ID\n})\n```","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:49:11.290916-08:00","updated_at":"2025-11-26T08:48:08.4595251-07:00","closed_at":"2025-11-25T15:15:21.903649-08:00"}
|
||||
{"id":"bd-l954","title":"Performance Testing Framework","description":"Add comprehensive performance testing for beads focusing on optimization guidance and validating 10K+ database scale. Uses standard Go tooling, follows existing patterns, minimal complexity.\n\nComponents:\n- Benchmark suite for critical operations at 10K-20K scale\n- Fixture generator for realistic test data (epic hierarchies, cross-links)\n- User diagnostics via bd doctor --perf\n- Always-on profiling integration\n\nGoals:\n- Identify bottlenecks for optimization work\n- Validate performance at 10K+ issue scale\n- Enable users to collect diagnostics for bug reports\n- Support both SQLite and JSONL import paths","status":"open","priority":2,"issue_type":"epic","created_at":"2025-11-13T22:22:11.203467-08:00","updated_at":"2025-11-13T22:22:11.203467-08:00"}
|
||||
{"id":"bd-bhd","title":"Git history fallback assumes .beads is direct child of repo root","description":"## Problem\n\n`checkGitHistoryForDeletions` assumes the repo structure:\n\n```go\nrepoRoot := filepath.Dir(beadsDir) // Assumes .beads is in repo root\njsonlPath := filepath.Join(\".beads\", \"beads.jsonl\")\n```\n\nBut `.beads` could be in a subdirectory (monorepo, nested project), and the actual JSONL filename could be different (configured via `metadata.json`).\n\n## Location\n`internal/importer/importer.go:865-869`\n\n## Impact\n- Git search will fail silently for repos with non-standard structure\n- Monorepo users won't get deletion propagation\n\n## Fix\n1. Use `git rev-parse --show-toplevel` to find actual repo root\n2. Compute relative path from repo root to JSONL\n3. Or use `git -C \u003cdir\u003e` to run from beadsDir directly","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:51:03.46856-08:00","updated_at":"2025-11-25T16:56:18.775568-08:00","closed_at":"2025-11-25T15:05:40.754716-08:00"}
|
||||
{"id":"bd-6xd","title":"Standardize on issues.jsonl as canonical filename","description":"## Background\n\nThe codebase has confused and contradictory references to both `issues.jsonl` and `beads.jsonl`. This arose from a misconception that `issues.jsonl` was polluted with 100k test issues, but analysis shows:\n\n- issues.jsonl git history: 253 blobs, 54 MB total (max blob 2.1 MB)\n- beads.jsonl git history: 1140 blobs, 353 MB total (6.5x larger!)\n\nThe 'pollution' was never as big as remembered. Meanwhile, 99% of user installs use `issues.jsonl`.\n\n## The Problem\n\nCode has contradictory comments:\n```go\n// cmd/bd/autoimport.go:88\n// Try canonical JSONL filenames in precedence order (issues.jsonl is canonical)\n\n// internal/configfile/configfile.go:24\nJSONLExport: \"beads.jsonl\", // Default to canonical name (was issues.jsonl)\n```\n\n## Current State\n\n### Code References (excluding tests)\n- `beads.jsonl`: 51 references in Go code\n- `issues.jsonl`: 84 references in Go code\n\n### Documentation References\n- `beads.jsonl`: 59 references\n- `issues.jsonl`: 62 references\n\n## Proposed Solution\n\n1. Make `issues.jsonl` the **only** canonical name\n2. Support `beads.jsonl` only as legacy (auto-migrate to issues.jsonl)\n3. Switch beads repo itself back to using issues.jsonl\n4. Update all code and docs for consistency\n\n## Files Requiring Changes\n\n### High Priority (logic changes)\n- `internal/configfile/configfile.go` - Change default from beads.jsonl to issues.jsonl\n- `internal/beads/beads.go` - Reverse preference order, prefer issues.jsonl\n- `cmd/bd/version_tracking.go` - Reverse preference order\n- `cmd/bd/doctor/fix/database_config.go` - Reverse preference order\n- `cmd/bd/autoimport.go` - Already prefers issues.jsonl (correct)\n- `cmd/bd/init.go` - Update gitattributes setup, comments\n\n### Medium Priority (user-facing messages)\n- `cmd/bd/import.go` - Update example paths in error messages\n- `cmd/bd/sync.go` - Update diff display path\n- `cmd/bd/status.go` - Update git log path\n- `cmd/bd/staleness.go` - Update help message\n- `cmd/bd/init_contributor.go` - Update output messages\n- `cmd/bd/clean.go` - Update help text\n- `cmd/bd/cleanup.go` - Update help text\n\n### Lower Priority (internal/comments)\n- `internal/importer/importer.go` - Update comments and paths\n- `cmd/bd/merge.go` - Update comment\n- `cmd/bd/doctor.go` - Multiple references\n- `cmd/bd/doctor/fix/sync.go` - Variable naming\n- `cmd/bd/doctor/fix/deletions.go` - Path reference\n\n### Documentation\n- README.md - ~8 references to update\n- docs/DELETIONS.md\n- docs/CLI_REFERENCE.md\n- docs/ARCHITECTURE.md\n- docs/TROUBLESHOOTING.md\n- docs/PROTECTED_BRANCHES.md\n- docs/GIT_INTEGRATION.md\n- docs/MULTI_REPO_AGENTS.md\n- docs/MULTI_REPO_MIGRATION.md\n- docs/TESTING.md (acknowledges the inconsistency)\n\n## Migration Strategy\n\n1. Add migration in `bd init`: if beads.jsonl exists and issues.jsonl doesn't, rename it\n2. Update `bd doctor` to detect and offer to fix the naming\n3. Keep reading beads.jsonl as fallback for one version cycle\n4. Remove beads.jsonl fallback in future version\n\n## For Beads Repo Itself\n\n1. `git mv .beads/beads.jsonl .beads/issues.jsonl`\n2. Update .gitattributes if present\n3. Commit with clear message","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-26T19:33:34.169595-08:00","updated_at":"2025-11-26T21:00:34.038454-08:00","closed_at":"2025-11-26T21:00:34.038454-08:00"}
|
||||
{"id":"bd-zj8e","title":"Performance Testing Documentation","description":"Create docs/performance-testing.md documenting the performance testing framework.\n\nSections:\n1. Overview - What the framework does, goals\n2. Running Benchmarks\n - make bench command\n - Running specific benchmarks\n - Interpreting output (ns/op, allocs/op)\n3. Profiling and Analysis\n - Viewing CPU profiles with pprof\n - Reading flamegraphs\n - Memory profiling\n - Finding hotspots\n4. User Diagnostics\n - bd doctor --perf usage\n - Sharing profiles with bug reports\n - Understanding the report output\n5. Comparing Performance\n - Using benchstat for before/after comparisons\n - Detecting regressions\n6. Tips for Optimization\n - Common patterns\n - When to profile vs benchmark\n\nStyle:\n- Concise, practical examples\n- Screenshots/examples of pprof output\n- Clear command-line examples\n- Focus on workflow, not theory","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-13T22:23:38.99897-08:00","updated_at":"2025-11-13T22:23:38.99897-08:00"}
|
||||
{"id":"bd-bgs","title":"Git history fallback doesn't escape regex special chars in IDs","description":"## Problem\n\nIn `batchCheckGitHistory`, IDs are directly interpolated into a regex pattern:\n\n```go\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, id))\nsearchPattern := strings.Join(patterns, \"|\")\ncmd := exec.Command(\"git\", \"log\", \"--all\", \"-G\", searchPattern, ...)\n```\n\nIf an ID contains regex special characters (e.g., `bd-foo.bar` or `bd-test+1`), the pattern will be malformed or match unintended strings.\n\n## Location\n`internal/importer/importer.go:923-926`\n\n## Impact\n- False positives: IDs with `.` could match any character\n- Regex errors: IDs with `[` or `(` could cause git to fail\n- Security: potential for regex injection (low risk since IDs are validated)\n\n## Fix\nEscape regex special characters:\n\n```go\nimport \"regexp\"\n\nescapedID := regexp.QuoteMeta(id)\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, escapedID))\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:50:30.132232-08:00","updated_at":"2025-11-25T16:56:18.773249-08:00","closed_at":"2025-11-25T15:04:06.217695-08:00"}
|
||||
{"id":"bd-hdt","title":"Implement auto-merge functionality in duplicates command","description":"The duplicates.go file has a TODO at line 95 to implement the performMerge function for automatic duplicate merging. Currently it just prints a warning message. This would automate the merge process instead of just suggesting commands.","status":"open","priority":2,"issue_type":"feature","created_at":"2025-11-21T18:55:02.828619-05:00","updated_at":"2025-11-21T18:55:02.828619-05:00"}
|
||||
{"id":"bd-qsm","title":"Auto-compact deletions during bd sync","description":"Parent: bd-imj\n\n## Task\nOptionally prune deletions manifest during sync when threshold exceeded.\n\n**Note: Opt-in feature** - disabled by default to avoid sync latency.\n\n## Implementation\n\nIn `bd sync`:\n```go\nfunc (s *Syncer) Sync() error {\n // ... existing sync logic ...\n \n // Auto-compact only if enabled\n if s.config.GetBool(\"deletions.auto_compact\", false) {\n deletionCount := deletions.Count(\".beads/deletions.jsonl\")\n threshold := s.config.GetInt(\"deletions.auto_compact_threshold\", 1000)\n \n if deletionCount \u003e threshold {\n retentionDays := s.config.GetInt(\"deletions.retention_days\", 7)\n if err := s.compactor.PruneDeletions(retentionDays); err != nil {\n log.Warnf(\"Failed to auto-compact deletions: %v\", err)\n // Non-fatal, continue sync\n }\n }\n }\n \n // ... rest of sync ...\n}\n```\n\n## Configuration\n```yaml\ndeletions:\n retention_days: 7\n auto_compact: false # Opt-in, disabled by default\n auto_compact_threshold: 1000 # Trigger when \u003e N entries (if enabled)\n```\n\n## Acceptance Criteria\n- [ ] Auto-compact disabled by default\n- [ ] Enabled via config `deletions.auto_compact: true`\n- [ ] Sync checks deletion count only when enabled\n- [ ] Auto-prunes when threshold exceeded\n- [ ] Failure is non-fatal (logged warning)\n- [ ] Test: no compaction when disabled\n- [ ] Test: compaction triggers when enabled and threshold exceeded","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-25T09:57:04.522795-08:00","updated_at":"2025-11-25T16:56:18.772078-08:00","closed_at":"2025-11-25T15:03:01.469629-08:00"}
|
||||
{"id":"bd-x2i","title":"Add bd deleted command for audit trail","description":"Parent: bd-imj\n\nAdd command to view deletion history.\n\nUsage:\n bd deleted # Show recent deletions (last 7 days)\n bd deleted --since=30d # Show deletions in last 30 days\n bd deleted --all # Show all tracked deletions\n bd deleted bd-xxx # Show deletion details for specific issue\n\nOutput format:\n bd-xxx 2025-11-25 10:00 stevey duplicate of bd-yyy\n bd-yyy 2025-11-25 10:05 claude cleanup\n\nAcceptance criteria:\n- List deletions with timestamp, actor, reason\n- Filter by time range\n- Lookup specific issue ID\n- JSON output option for scripting","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.113861-08:00","updated_at":"2025-11-26T08:48:08.460049-07:00","closed_at":"2025-11-25T15:13:53.781519-08:00"}
|
||||
{"id":"bd-k4b","title":"Enhance dep tree to show full dependency graph","description":"When running `bd dep tree \u003cissue-id\u003e`, the current output only shows the issue itself without its dependency relationships.\n\n## Current Behavior\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\n→ gt-0iqq: Implement Boss (global overseer) [P2] (open)\n```\n\nThis doesn't show any of the dependency structure.\n\n## Desired Behavior\n\nShow the full dependency DAG rooted at the given issue. For example:\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\ngt-0iqq: Implement Boss (global overseer) [P2] (open)\n├── gt-0xh4: Boss session management [P2] (open) [READY]\n│ ├── gt-le7c: Boss mail identity [P2] (open)\n│ │ ├── gt-r8fe: Boss human escalation queue [P2] (open)\n│ │ └── gt-vdak: Boss dispatch loop [P2] (open)\n│ │ └── gt-kgy6: Boss resource management [P2] (open)\n│ │ └── gt-93iv: Boss wake daemon [P2] (open)\n│ └── gt-vdak: (shown above)\n```\n\n## Suggested Options\n\n- `--direction=down|up|both` - Show dependents (what this blocks), dependencies (what blocks this), or both\n- `--status=open` - Filter to only show issues with a given status\n- `--depth=N` - Limit tree depth\n- Handle DAG cycles gracefully (show \"(shown above)\" or similar for already-displayed nodes)\n\n## Use Case\n\nWhen reorganizing a set of related issues (like I just did with the Boss implementation), being able to visualize the full dependency graph helps verify the structure is correct before syncing.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-25T19:18:18.750649-08:00","updated_at":"2025-11-25T19:50:46.863319-08:00","closed_at":"2025-11-25T19:31:55.312314-08:00"}
|
||||
{"id":"bd-s0z","title":"Consider extracting error handling helpers","description":"Evaluate creating FatalError() and WarnError() helpers as suggested in ERROR_HANDLING.md to reduce boilerplate and enforce consistency. Prototype in a few files first to validate the approach.","status":"open","priority":4,"issue_type":"task","created_at":"2025-11-24T00:28:57.248959-08:00","updated_at":"2025-11-24T00:28:57.248959-08:00"}
|
||||
{"id":"bd-m0w","title":"Add test coverage for internal/validation package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:24.129559-05:00","updated_at":"2025-11-20T21:21:24.129559-05:00","dependencies":[{"issue_id":"bd-m0w","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.350477-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-t3b","title":"Add test coverage for internal/config package","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.91657-05:00","updated_at":"2025-11-20T21:21:22.91657-05:00","dependencies":[{"issue_id":"bd-t3b","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.201036-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-pbj","title":"bd doctor --fix should run bd sync to commit untracked deletions.jsonl","description":"After running bd cleanup -f, the deletions.jsonl file is created but left untracked. bd doctor --fix should notice this and run bd sync to commit it.\n\nCurrent behavior:\n- bd cleanup -f creates/updates deletions.jsonl\n- git status shows deletions.jsonl as untracked\n- bd doctor --fix does not notice or fix this\n\nExpected behavior:\n- bd doctor --fix should detect untracked .beads/*.jsonl files\n- Should offer to run bd sync to commit them\n\nRelated: The git hooks were also missing deletions.jsonl from their staging loops - that's been fixed in this session.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:29:33.901199-08:00","updated_at":"2025-11-26T20:33:03.296592-08:00","closed_at":"2025-11-26T20:33:03.296592-08:00"}
|
||||
{"id":"bd-736d","title":"Refactor path canonicalization into helper function","description":"The path canonicalization logic (filepath.Abs + EvalSymlinks) is duplicated in 3 places:\n- beads.go:131-137 (BEADS_DIR handling)\n- cmd/bd/main.go:446-451 (--no-db cleanup)\n- cmd/bd/nodb.go:26-31 (--no-db initialization)\n\nRefactoring suggestion:\nExtract to a helper function like:\n func canonicalizePath(path string) string\n\nThis would:\n- Reduce code duplication\n- Make the logic easier to maintain\n- Ensure consistent behavior across all path handling\n\nRelated to bd-e16b implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:33:47.727443-08:00","updated_at":"2025-11-26T14:42:45.915853-08:00","closed_at":"2025-11-25T22:27:33.738672-08:00"}
|
||||
{"id":"bd-ge7","title":"Improve Beads test coverage from 46% to 80%","status":"open","priority":1,"issue_type":"epic","created_at":"2025-11-20T21:21:03.700271-05:00","updated_at":"2025-11-20T21:21:03.700271-05:00","dependencies":[{"issue_id":"bd-ge7","depends_on_id":"bd-4h3","type":"blocks","created_at":"2025-11-22T11:13:20.340458-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-e92","type":"blocks","created_at":"2025-11-22T11:13:20.407609-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-m0w","type":"blocks","created_at":"2025-11-22T11:13:20.476188-08:00","created_by":"daemon"},{"issue_id":"bd-ge7","depends_on_id":"bd-t3b","type":"blocks","created_at":"2025-11-22T11:13:20.546335-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-tne","title":"Add Claude setup tip with dynamic priority","description":"Add a predefined tip that suggests running `bd setup claude` when Claude Code is detected but not configured. This tip should have higher priority (shown more frequently) until the setup is complete.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:29:29.871324-08:00","updated_at":"2025-11-26T08:48:08.4571675-07:00","closed_at":"2025-11-25T17:52:35.044989-08:00","dependencies":[{"issue_id":"bd-tne","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:29.872081-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-imj","title":"Deletion propagation via deletions manifest","description":"## Problem\n\nWhen `bd cleanup -f` or `bd delete` removes issues in one clone, those deletions don't propagate to other clones. The import logic only creates/updates, never deletes. This causes \"resurrection\" where deleted issues reappear.\n\n## Root Cause\n\nImport sees DB issues not in JSONL and assumes they're \"local unpushed work\" rather than \"intentionally deleted upstream.\"\n\n## Solution: Deletions Manifest\n\nAdd `.beads/deletions.jsonl` - an append-only log of deleted issue IDs with metadata.\n\n### Format\n```jsonl\n{\"id\":\"bd-xxx\",\"ts\":\"2025-11-25T10:00:00Z\",\"by\":\"stevey\"}\n{\"id\":\"bd-yyy\",\"ts\":\"2025-11-25T10:05:00Z\",\"by\":\"claude\",\"reason\":\"duplicate of bd-zzz\"}\n```\n\n### Fields\n- `id`: Issue ID (required)\n- `ts`: ISO 8601 UTC timestamp (required)\n- `by`: Actor who deleted (required)\n- `reason`: Optional context (\"cleanup\", \"duplicate of X\", etc.)\n\n### Import Logic\n```\nFor each DB issue not in JSONL:\n 1. Check deletions manifest → if found, delete from DB\n 2. Fallback: check git history → if found, delete + backfill manifest\n 3. Neither → keep (local unpushed work)\n```\n\n### Conflict Resolution\nSimultaneous deletions from multiple clones are handled naturally:\n- Append-only design means both clones append their deletion records\n- On merge, file contains duplicate entries (same ID, different timestamps)\n- `LoadDeletions` deduplicates by ID (keeps any/first entry)\n- Result: deletion propagates correctly, duplicates are harmless\n\n### Pruning Policy\n- Default retention: 7 days (configurable via `deletions.retention_days`)\n- Auto-compact during `bd sync` is **opt-in** (disabled by default)\n- Hard cap: `deletions.max_entries` (default 50000)\n- Git fallback handles pruned entries (self-healing)\n\n### Self-Healing\nWhen git fallback catches a resurrection (pruned entry), it backfills the manifest. One-time git scan cost, then fast again.\n\n### Size Estimates\n- ~80 bytes/entry\n- 7-day retention with 100 deletions/day = ~56KB\n- Git compressed: ~10KB\n\n## Benefits\n- ✅ Deletions propagate across clones\n- ✅ O(1) lookup (no git scan in normal case)\n- ✅ Works in shallow clones\n- ✅ Survives history rewrite\n- ✅ Audit trail (who deleted what when)\n- ✅ Self-healing via git fallback\n- ✅ Bounded size via time-based pruning\n\n## References\n- Investigation session: 2025-11-25\n- Related: bd-2q6d (stale database warnings)","status":"closed","issue_type":"epic","created_at":"2025-11-25T09:56:01.98027-08:00","updated_at":"2025-11-26T08:48:08.454377-07:00","closed_at":"2025-11-25T16:36:27.965168-08:00","dependencies":[{"issue_id":"bd-imj","depends_on_id":"bd-qsm","type":"blocks","created_at":"2025-11-25T09:57:42.821911-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-x2i","type":"blocks","created_at":"2025-11-25T09:57:42.851712-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-44e","type":"blocks","created_at":"2025-11-25T09:57:42.88154-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bhd","type":"blocks","created_at":"2025-11-25T14:56:23.675787-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bgs","type":"blocks","created_at":"2025-11-25T14:56:23.744648-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-f0n","type":"blocks","created_at":"2025-11-25T14:56:23.80649-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-v29","type":"blocks","created_at":"2025-11-25T14:56:23.864569-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-mdw","type":"blocks","created_at":"2025-11-25T14:56:48.592492-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-03r","type":"blocks","created_at":"2025-11-25T14:56:54.295851-08:00","created_by":"daemon"}]}
|
||||
|
||||
@@ -49,3 +49,4 @@
|
||||
{"id":"bd-z3s3","ts":"2025-11-25T22:40:41.19109Z","by":"stevey","reason":"cleanup"}
|
||||
{"id":"bd-5a90","ts":"2025-11-25T22:40:41.19621Z","by":"stevey","reason":"cleanup"}
|
||||
{"id":"bd-5b6e","ts":"2025-11-25T22:40:41.201204Z","by":"stevey","reason":"cleanup"}
|
||||
{"id":"bd-98c4e1fa.1","ts":"2025-11-27T04:17:14.657783Z","by":"git-history-backfill","reason":"recovered from git history (pruned from manifest)"}
|
||||
|
||||
55
.beads/issues.jsonl
Normal file
55
.beads/issues.jsonl
Normal file
@@ -0,0 +1,55 @@
|
||||
{"id":"bd-03r","title":"Document deletions manifest in AGENTS.md and README","description":"Parent: bd-imj\n\n## Task\nAdd documentation about the deletions manifest feature.\n\n## Locations to Update\n\n### AGENTS.md\n- Explain that deletions.jsonl is tracked in git\n- Document that `bd delete` records to the manifest\n- Explain cross-clone propagation mechanism\n\n### README.md \n- Brief mention in .beads directory structure section\n- Link to detailed docs if needed\n\n### docs/deletions.md (new file)\n- Full technical documentation\n- Format specification\n- Pruning policy\n- Git history fallback\n- Troubleshooting\n\n## Acceptance Criteria\n- AGENTS.md updated with deletion workflow\n- README.md mentions deletions.jsonl purpose\n- New docs/deletions.md with complete reference","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:49.13027-08:00","updated_at":"2025-11-25T15:17:23.145944-08:00","closed_at":"2025-11-25T15:17:23.145944-08:00"}
|
||||
{"id":"bd-055","title":"Fix hyphenated prefix parsing in ExtractIssuePrefix (GH #395)","description":"","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T15:22:22.395177-08:00","updated_at":"2025-11-26T16:46:57.8927-08:00","closed_at":"2025-11-26T16:46:57.8927-08:00"}
|
||||
{"id":"bd-1pj6","title":"Proposal: Custom status states via config","description":"Proposal to add 'custom status states' via `bd config`.\nUsers could define an optional issue status enum (e.g., awaiting_review, review_in_progress) in the config.\nThis would enable multi-step pipelines to process issues where each step correlates to a specific status.\n\nExamples:\n- awaiting_verification\n- awaiting_docs\n- awaiting_testing\n","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-20T18:55:48.670499-05:00","updated_at":"2025-11-20T18:55:48.670499-05:00"}
|
||||
{"id":"bd-2em","title":"Expand checkHooksQuick to verify all hook versions","description":"Currently checkHooksQuick only checks post-merge hook version. Should also check pre-commit, pre-push, and post-checkout for completeness. Keep it lightweight but catch more outdated hooks.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:47.432243-08:00","updated_at":"2025-11-25T19:50:21.378464-08:00","closed_at":"2025-11-25T19:50:21.378464-08:00"}
|
||||
{"id":"bd-39o","title":"Rename last_import_hash metadata key to jsonl_content_hash","description":"The metadata key 'last_import_hash' is misleading because it's updated on both import AND export (sync.go:614, import.go:320).\n\nBetter names:\n- jsonl_content_hash (more accurate)\n- last_sync_hash (clearer intent)\n\nThis is a breaking change requiring migration of existing metadata values.","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:31:07.568739-05:00","updated_at":"2025-11-20T21:31:07.568739-05:00"}
|
||||
{"id":"bd-3gc","title":"Audit remaining cmd/bd files for error handling consistency","description":"Extend ERROR_HANDLING_AUDIT.md to cover: daemon_sync.go, update.go, list.go, show.go, close.go, reopen.go, dep.go, label.go, comments.go, delete.go, compact.go, config.go, validate.go and other high-usage command files","status":"open","priority":3,"issue_type":"task","created_at":"2025-11-24T00:28:55.890991-08:00","updated_at":"2025-11-24T00:28:55.890991-08:00"}
|
||||
{"id":"bd-44e","title":"Ensure deletions.jsonl is tracked in git","description":"Parent: bd-imj\n\nEnsure deletions.jsonl is tracked in git (not ignored).\n\nUpdate bd init and gitignore upgrade logic to:\n1. NOT add deletions.jsonl to .gitignore\n2. Ensure it is committed alongside beads.jsonl\n\nThe file must be in git for cross-clone propagation to work.\n\nAcceptance criteria:\n- bd init does not ignore deletions.jsonl\n- Existing .gitignore files are not broken\n- File appears in git status when modified","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.663196-08:00","updated_at":"2025-11-25T14:55:43.225883-08:00","closed_at":"2025-11-25T14:55:43.225883-08:00"}
|
||||
{"id":"bd-4aao","title":"Fix failing integration tests in beads-mcp","description":"The `beads-mcp` test suite has failures in `tests/test_bd_client_integration.py` (assertion error in `test_init_creates_beads_directory`) and errors in `tests/test_worktree_separate_dbs.py` (setup failures finding database). These need to be investigated and fixed to ensure a reliable CI baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T18:53:28.4803-05:00","updated_at":"2025-11-25T21:39:20.967106-08:00","closed_at":"2025-11-25T21:39:20.967106-08:00"}
|
||||
{"id":"bd-4h3","title":"Add test coverage for internal/git package","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:23.497486-05:00","updated_at":"2025-11-20T21:21:23.497486-05:00","dependencies":[{"issue_id":"bd-4h3","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.277639-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-4l5","title":"bd prime: Detect ephemeral branches and adjust workflow output","description":"When 'bd prime' runs on a branch with no upstream (ephemeral branch), it should output a different SESSION CLOSE PROTOCOL.\n\n**Current output (wrong for ephemeral branches):**\n```\n[ ] 1. git status\n[ ] 2. git add \u003cfiles\u003e\n[ ] 3. bd sync\n[ ] 4. git commit -m \"...\"\n[ ] 5. bd sync\n[ ] 6. git push\n```\n\n**Needed output for ephemeral branches:**\n```\n[ ] 1. git status\n[ ] 2. git add \u003cfiles\u003e\n[ ] 3. bd sync --from-main (pull updates from main)\n[ ] 4. git commit -m \"...\"\n[ ] 5. (no push - branch is ephemeral)\n```\n\n**Detection:** `git rev-parse --abbrev-ref --symbolic-full-name @{u}` returns error code 128 if no upstream.\n\nAlso update Sync \u0026 Collaboration section to mention `bd sync --from-main` for ephemeral branches.\n\n**Use case:** Gastown polecats work on ephemeral local branches that are never pushed. Their code gets merged to main via local merge, and beads changes stay local (communicated via gm mail to Overseer).","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-25T16:55:24.984104-08:00","updated_at":"2025-11-25T17:12:46.604978-08:00","closed_at":"2025-11-25T17:12:46.604978-08:00"}
|
||||
{"id":"bd-6xd","title":"Standardize on issues.jsonl as canonical filename","description":"## Background\n\nThe codebase has confused and contradictory references to both `issues.jsonl` and `beads.jsonl`. This arose from a misconception that `issues.jsonl` was polluted with 100k test issues, but analysis shows:\n\n- issues.jsonl git history: 253 blobs, 54 MB total (max blob 2.1 MB)\n- beads.jsonl git history: 1140 blobs, 353 MB total (6.5x larger!)\n\nThe 'pollution' was never as big as remembered. Meanwhile, 99% of user installs use `issues.jsonl`.\n\n## The Problem\n\nCode has contradictory comments:\n```go\n// cmd/bd/autoimport.go:88\n// Try canonical JSONL filenames in precedence order (issues.jsonl is canonical)\n\n// internal/configfile/configfile.go:24\nJSONLExport: \"beads.jsonl\", // Default to canonical name (was issues.jsonl)\n```\n\n## Current State\n\n### Code References (excluding tests)\n- `beads.jsonl`: 51 references in Go code\n- `issues.jsonl`: 84 references in Go code\n\n### Documentation References\n- `beads.jsonl`: 59 references\n- `issues.jsonl`: 62 references\n\n## Proposed Solution\n\n1. Make `issues.jsonl` the **only** canonical name\n2. Support `beads.jsonl` only as legacy (auto-migrate to issues.jsonl)\n3. Switch beads repo itself back to using issues.jsonl\n4. Update all code and docs for consistency\n\n## Files Requiring Changes\n\n### High Priority (logic changes)\n- `internal/configfile/configfile.go` - Change default from beads.jsonl to issues.jsonl\n- `internal/beads/beads.go` - Reverse preference order, prefer issues.jsonl\n- `cmd/bd/version_tracking.go` - Reverse preference order\n- `cmd/bd/doctor/fix/database_config.go` - Reverse preference order\n- `cmd/bd/autoimport.go` - Already prefers issues.jsonl (correct)\n- `cmd/bd/init.go` - Update gitattributes setup, comments\n\n### Medium Priority (user-facing messages)\n- `cmd/bd/import.go` - Update example paths in error messages\n- `cmd/bd/sync.go` - Update diff display path\n- `cmd/bd/status.go` - Update git log path\n- `cmd/bd/staleness.go` - Update help message\n- `cmd/bd/init_contributor.go` - Update output messages\n- `cmd/bd/clean.go` - Update help text\n- `cmd/bd/cleanup.go` - Update help text\n\n### Lower Priority (internal/comments)\n- `internal/importer/importer.go` - Update comments and paths\n- `cmd/bd/merge.go` - Update comment\n- `cmd/bd/doctor.go` - Multiple references\n- `cmd/bd/doctor/fix/sync.go` - Variable naming\n- `cmd/bd/doctor/fix/deletions.go` - Path reference\n\n### Documentation\n- README.md - ~8 references to update\n- docs/DELETIONS.md\n- docs/CLI_REFERENCE.md\n- docs/ARCHITECTURE.md\n- docs/TROUBLESHOOTING.md\n- docs/PROTECTED_BRANCHES.md\n- docs/GIT_INTEGRATION.md\n- docs/MULTI_REPO_AGENTS.md\n- docs/MULTI_REPO_MIGRATION.md\n- docs/TESTING.md (acknowledges the inconsistency)\n\n## Migration Strategy\n\n1. Add migration in `bd init`: if beads.jsonl exists and issues.jsonl doesn't, rename it\n2. Update `bd doctor` to detect and offer to fix the naming\n3. Keep reading beads.jsonl as fallback for one version cycle\n4. Remove beads.jsonl fallback in future version\n\n## For Beads Repo Itself\n\n1. `git mv .beads/beads.jsonl .beads/issues.jsonl`\n2. Update .gitattributes if present\n3. Commit with clear message","status":"in_progress","priority":2,"issue_type":"task","created_at":"2025-11-26T19:33:34.169595-08:00","updated_at":"2025-11-26T20:56:18.181866-08:00"}
|
||||
{"id":"bd-736d","title":"Refactor path canonicalization into helper function","description":"The path canonicalization logic (filepath.Abs + EvalSymlinks) is duplicated in 3 places:\n- beads.go:131-137 (BEADS_DIR handling)\n- cmd/bd/main.go:446-451 (--no-db cleanup)\n- cmd/bd/nodb.go:26-31 (--no-db initialization)\n\nRefactoring suggestion:\nExtract to a helper function like:\n func canonicalizePath(path string) string\n\nThis would:\n- Reduce code duplication\n- Make the logic easier to maintain\n- Ensure consistent behavior across all path handling\n\nRelated to bd-e16b implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:33:47.727443-08:00","updated_at":"2025-11-25T22:27:33.738672-08:00","closed_at":"2025-11-25T22:27:33.738672-08:00"}
|
||||
{"id":"bd-81a","title":"Add programmatic tip injection API","description":"Allow tips to be programmatically injected at runtime based on detected conditions. This enables dynamic tips (not just pre-defined ones) to be shown with custom priority and frequency.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:46.645583-08:00","updated_at":"2025-11-25T17:52:35.096882-08:00","closed_at":"2025-11-25T17:52:35.096882-08:00","dependencies":[{"issue_id":"bd-81a","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:46.646327-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-9e23","title":"Optimize Memory backend GetIssueByExternalRef with index","description":"Currently GetIssueByExternalRef in Memory storage uses O(n) linear search through all issues.\n\nCurrent code (memory.go:282-308):\nfor _, issue := range m.issues {\n if issue.ExternalRef != nil \u0026\u0026 *issue.ExternalRef == externalRef {\n return \u0026issueCopy, nil\n }\n}\n\nProposed optimization:\n- Add externalRefToID map[string]string to MemoryStorage\n- Maintain it in CreateIssue, UpdateIssue, DeleteIssue\n- Achieve O(1) lookup like SQLite's index\n\nImpact: Low (--no-db mode typically has smaller datasets)\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:30.242357-08:00","updated_at":"2025-11-26T11:14:49.172418-08:00","closed_at":"2025-11-26T11:14:49.172418-08:00"}
|
||||
{"id":"bd-9li4","title":"Create Docker image for Agent Mail","description":"Containerize Agent Mail server for easy deployment.\n\nAcceptance Criteria:\n- Dockerfile with Python 3.14\n- Health check endpoint\n- Volume mount for storage\n- Environment variable configuration\n- Multi-arch builds (amd64, arm64)\n\nFile: deployment/agent-mail/Dockerfile","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-07T22:43:43.231964-08:00","updated_at":"2025-11-25T17:47:30.777486-08:00","closed_at":"2025-11-25T17:47:30.777486-08:00"}
|
||||
{"id":"bd-b8h","title":"Refactor check-health DB access to avoid repeated path resolution","description":"The runCheckHealth lightweight checks (hintsDisabled, checkVersionMismatch, checkSyncBranchQuick) each have duplicated database path resolution logic. Extract a helper function to DRY this up.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:35.075929-08:00","updated_at":"2025-11-25T19:50:21.272961-08:00","closed_at":"2025-11-25T19:50:21.272961-08:00"}
|
||||
{"id":"bd-bgs","title":"Git history fallback doesn't escape regex special chars in IDs","description":"## Problem\n\nIn `batchCheckGitHistory`, IDs are directly interpolated into a regex pattern:\n\n```go\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, id))\nsearchPattern := strings.Join(patterns, \"|\")\ncmd := exec.Command(\"git\", \"log\", \"--all\", \"-G\", searchPattern, ...)\n```\n\nIf an ID contains regex special characters (e.g., `bd-foo.bar` or `bd-test+1`), the pattern will be malformed or match unintended strings.\n\n## Location\n`internal/importer/importer.go:923-926`\n\n## Impact\n- False positives: IDs with `.` could match any character\n- Regex errors: IDs with `[` or `(` could cause git to fail\n- Security: potential for regex injection (low risk since IDs are validated)\n\n## Fix\nEscape regex special characters:\n\n```go\nimport \"regexp\"\n\nescapedID := regexp.QuoteMeta(id)\npatterns = append(patterns, fmt.Sprintf(\\`\"id\":\"%s\"\\`, escapedID))\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:50:30.132232-08:00","updated_at":"2025-11-25T15:04:06.217695-08:00","closed_at":"2025-11-25T15:04:06.217695-08:00"}
|
||||
{"id":"bd-bhd","title":"Git history fallback assumes .beads is direct child of repo root","description":"## Problem\n\n`checkGitHistoryForDeletions` assumes the repo structure:\n\n```go\nrepoRoot := filepath.Dir(beadsDir) // Assumes .beads is in repo root\njsonlPath := filepath.Join(\".beads\", \"beads.jsonl\")\n```\n\nBut `.beads` could be in a subdirectory (monorepo, nested project), and the actual JSONL filename could be different (configured via `metadata.json`).\n\n## Location\n`internal/importer/importer.go:865-869`\n\n## Impact\n- Git search will fail silently for repos with non-standard structure\n- Monorepo users won't get deletion propagation\n\n## Fix\n1. Use `git rev-parse --show-toplevel` to find actual repo root\n2. Compute relative path from repo root to JSONL\n3. Or use `git -C \u003cdir\u003e` to run from beadsDir directly","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:51:03.46856-08:00","updated_at":"2025-11-25T15:05:40.754716-08:00","closed_at":"2025-11-25T15:05:40.754716-08:00"}
|
||||
{"id":"bd-bt6y","title":"Improve compact/daemon/merge documentation and UX","description":"Multiple documentation and UX issues encountered:\n1. \"bd compact --analyze\" fails with misleading \"requires SQLite storage\" error when daemon is running. Needs --no-daemon or better error.\n2. \"bd merge\" help text is outdated (refers to 3-way merge instead of issue merging).\n3. Daemon mode purpose isn't clear to local-only users.\n4. Compact/cleanup commands are hard to discover.\n\nProposed fixes:\n- Fix compact+daemon interaction or error message.\n- Update \"bd merge\" help text.\n- Add \"when to use daemon\" section to docs.\n- Add maintenance section to quickstart.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:55:43.637047-05:00","updated_at":"2025-11-20T18:55:43.637047-05:00"}
|
||||
{"id":"bd-c362","title":"Extract database search logic into helper function","description":"The logic for finding a database in a beads directory is duplicated:\n- FindDatabasePath() BEADS_DIR section (beads.go:141-169)\n- findDatabaseInTree() (beads.go:248-280)\n\nBoth implement the same search order:\n1. Check config.json first (single source of truth)\n2. Fall back to canonical beads.db\n3. Search for *.db files, filtering backups and vc.db\n\nRefactoring suggestion:\nExtract to a helper function like:\n func findDatabaseInBeadsDir(beadsDir string) string\n\nBenefits:\n- Single source of truth for database search logic\n- Easier to maintain and update search order\n- Reduces code duplication\n\nRelated to [deleted:bd-e16b] implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:34:02.831543-08:00","updated_at":"2025-11-25T22:27:33.794656-08:00","closed_at":"2025-11-25T22:27:33.794656-08:00"}
|
||||
{"id":"bd-c4rq","title":"Refactor: Move staleness check inside daemon branch","description":"## Problem\n\nCurrently ensureDatabaseFresh() is called before the daemon mode check, but it checks daemonClient != nil internally and returns early. This is redundant.\n\n**Location:** All read commands (list.go:196, show.go:27, ready.go:102, status.go:80, etc.)\n\n## Current Pattern\n\nCall happens before daemon check, function checks daemonClient internally.\n\n## Better Pattern\n\nMove staleness check to direct mode branch only, after daemon check.\n\n## Impact\nLow - minor performance improvement (avoids one function call per command in daemon mode)\n\n## Effort\nMedium - requires refactoring 8 command files\n\n## Priority\nLow - can defer to future cleanup PR","status":"open","priority":3,"issue_type":"chore","created_at":"2025-11-20T20:17:45.119583-05:00","updated_at":"2025-11-20T20:17:45.119583-05:00"}
|
||||
{"id":"bd-d4i","title":"Create tip system infrastructure for contextual hints","description":"Implement a tip/hint system that shows helpful contextual messages after successful commands. This is different from the existing error-path \"Hint:\" messages - tips appear on success paths to educate users about features they might not know about.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:15.693956-08:00","updated_at":"2025-11-25T17:47:30.747566-08:00","closed_at":"2025-11-25T17:47:30.747566-08:00"}
|
||||
{"id":"bd-e166","title":"Improve timestamp comparison readability in import","description":"The timestamp comparison logic uses double-negative which can be confusing:\n\nCurrent code:\nif !incoming.UpdatedAt.After(existing.UpdatedAt) {\n // skip update\n}\n\nMore readable:\nif incoming.UpdatedAt.After(existing.UpdatedAt) {\n // perform update\n} else {\n // skip (local is newer)\n}\n\nThis is a minor refactor for code clarity.\n\nRelated: bd-1022\nFiles: internal/importer/importer.go:411, 488","status":"open","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:12.27108-08:00","updated_at":"2025-11-02T15:32:12.27108-08:00"}
|
||||
{"id":"bd-e92","title":"Add test coverage for internal/autoimport package","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.338577-05:00","updated_at":"2025-11-20T21:21:22.338577-05:00","dependencies":[{"issue_id":"bd-e92","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.128625-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-f0n","title":"Git history fallback missing timeout - could hang on large repos","description":"## Problem\n\nThe git commands in `checkGitHistoryForDeletions` have no timeout. On large repos with extensive history, `git log --all -S` or `git log --all -G` can take a very long time (minutes).\n\n## Location\n`internal/importer/importer.go:899` and `:930`\n\n## Impact\n- Import could hang indefinitely\n- User has no feedback that git search is running\n- No way to cancel except killing the process\n\n## Fix\nAdd context with timeout to git commands:\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\ndefer cancel()\ncmd := exec.CommandContext(ctx, \"git\", ...)\n```\n\nAlso consider adding a `--since` flag to bound the git history search.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:24.388639-08:00","updated_at":"2025-11-25T15:04:53.669714-08:00","closed_at":"2025-11-25T15:04:53.669714-08:00"}
|
||||
{"id":"bd-ge7","title":"Improve Beads test coverage from 46% to 80%","description":"","status":"open","priority":1,"issue_type":"epic","created_at":"2025-11-20T21:21:03.700271-05:00","updated_at":"2025-11-20T21:21:03.700271-05:00"}
|
||||
{"id":"bd-gqo","title":"Implement health checks in daemon event loop","description":"Add health checks to checkDaemonHealth() function in daemon_event_loop.go:170:\n- Database integrity check\n- Disk space check\n- Memory usage check\n\nCurrently it's just a no-op placeholder.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-11-21T18:55:07.534304-05:00","updated_at":"2025-11-21T18:55:07.534304-05:00"}
|
||||
{"id":"bd-hdt","title":"Implement auto-merge functionality in duplicates command","description":"The duplicates.go file has a TODO at line 95 to implement the performMerge function for automatic duplicate merging. Currently it just prints a warning message. This would automate the merge process instead of just suggesting commands.","status":"open","priority":2,"issue_type":"feature","created_at":"2025-11-21T18:55:02.828619-05:00","updated_at":"2025-11-21T18:55:02.828619-05:00"}
|
||||
{"id":"bd-imj","title":"Deletion propagation via deletions manifest","description":"## Problem\n\nWhen `bd cleanup -f` or `bd delete` removes issues in one clone, those deletions don't propagate to other clones. The import logic only creates/updates, never deletes. This causes \"resurrection\" where deleted issues reappear.\n\n## Root Cause\n\nImport sees DB issues not in JSONL and assumes they're \"local unpushed work\" rather than \"intentionally deleted upstream.\"\n\n## Solution: Deletions Manifest\n\nAdd `.beads/deletions.jsonl` - an append-only log of deleted issue IDs with metadata.\n\n### Format\n```jsonl\n{\"id\":\"bd-xxx\",\"ts\":\"2025-11-25T10:00:00Z\",\"by\":\"stevey\"}\n{\"id\":\"bd-yyy\",\"ts\":\"2025-11-25T10:05:00Z\",\"by\":\"claude\",\"reason\":\"duplicate of bd-zzz\"}\n```\n\n### Fields\n- `id`: Issue ID (required)\n- `ts`: ISO 8601 UTC timestamp (required)\n- `by`: Actor who deleted (required)\n- `reason`: Optional context (\"cleanup\", \"duplicate of X\", etc.)\n\n### Import Logic\n```\nFor each DB issue not in JSONL:\n 1. Check deletions manifest → if found, delete from DB\n 2. Fallback: check git history → if found, delete + backfill manifest\n 3. Neither → keep (local unpushed work)\n```\n\n### Conflict Resolution\nSimultaneous deletions from multiple clones are handled naturally:\n- Append-only design means both clones append their deletion records\n- On merge, file contains duplicate entries (same ID, different timestamps)\n- `LoadDeletions` deduplicates by ID (keeps any/first entry)\n- Result: deletion propagates correctly, duplicates are harmless\n\n### Pruning Policy\n- Default retention: 7 days (configurable via `deletions.retention_days`)\n- Auto-compact during `bd sync` is **opt-in** (disabled by default)\n- Hard cap: `deletions.max_entries` (default 50000)\n- Git fallback handles pruned entries (self-healing)\n\n### Self-Healing\nWhen git fallback catches a resurrection (pruned entry), it backfills the manifest. One-time git scan cost, then fast again.\n\n### Size Estimates\n- ~80 bytes/entry\n- 7-day retention with 100 deletions/day = ~56KB\n- Git compressed: ~10KB\n\n## Benefits\n- ✅ Deletions propagate across clones\n- ✅ O(1) lookup (no git scan in normal case)\n- ✅ Works in shallow clones\n- ✅ Survives history rewrite\n- ✅ Audit trail (who deleted what when)\n- ✅ Self-healing via git fallback\n- ✅ Bounded size via time-based pruning\n\n## References\n- Investigation session: 2025-11-25\n- Related: bd-2q6d (stale database warnings)","status":"closed","priority":0,"issue_type":"epic","created_at":"2025-11-25T09:56:01.98027-08:00","updated_at":"2025-11-25T16:36:27.965168-08:00","closed_at":"2025-11-25T16:36:27.965168-08:00","dependencies":[{"issue_id":"bd-imj","depends_on_id":"bd-qsm","type":"blocks","created_at":"2025-11-25T09:57:42.821911-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-x2i","type":"blocks","created_at":"2025-11-25T09:57:42.851712-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-44e","type":"blocks","created_at":"2025-11-25T09:57:42.88154-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bhd","type":"blocks","created_at":"2025-11-25T14:56:23.675787-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-bgs","type":"blocks","created_at":"2025-11-25T14:56:23.744648-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-f0n","type":"blocks","created_at":"2025-11-25T14:56:23.80649-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-v29","type":"blocks","created_at":"2025-11-25T14:56:23.864569-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-mdw","type":"blocks","created_at":"2025-11-25T14:56:48.592492-08:00","created_by":"daemon"},{"issue_id":"bd-imj","depends_on_id":"bd-03r","type":"blocks","created_at":"2025-11-25T14:56:54.295851-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-j3zt","title":"Fix mypy errors in beads-mcp","description":"Running `mypy .` in `integrations/beads-mcp` reports 287 errors. These should be addressed to improve type safety and code quality.","status":"open","priority":3,"issue_type":"task","created_at":"2025-11-20T18:53:28.557708-05:00","updated_at":"2025-11-20T18:53:28.557708-05:00"}
|
||||
{"id":"bd-k4b","title":"Enhance dep tree to show full dependency graph","description":"When running `bd dep tree \u003cissue-id\u003e`, the current output only shows the issue itself without its dependency relationships.\n\n## Current Behavior\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\n→ gt-0iqq: Implement Boss (global overseer) [P2] (open)\n```\n\nThis doesn't show any of the dependency structure.\n\n## Desired Behavior\n\nShow the full dependency DAG rooted at the given issue. For example:\n\n```\n$ bd dep tree gt-0iqq\n🌲 Dependency tree for gt-0iqq:\n\ngt-0iqq: Implement Boss (global overseer) [P2] (open)\n├── gt-0xh4: Boss session management [P2] (open) [READY]\n│ ├── gt-le7c: Boss mail identity [P2] (open)\n│ │ ├── gt-r8fe: Boss human escalation queue [P2] (open)\n│ │ └── gt-vdak: Boss dispatch loop [P2] (open)\n│ │ └── gt-kgy6: Boss resource management [P2] (open)\n│ │ └── gt-93iv: Boss wake daemon [P2] (open)\n│ └── gt-vdak: (shown above)\n```\n\n## Suggested Options\n\n- `--direction=down|up|both` - Show dependents (what this blocks), dependencies (what blocks this), or both\n- `--status=open` - Filter to only show issues with a given status\n- `--depth=N` - Limit tree depth\n- Handle DAG cycles gracefully (show \"(shown above)\" or similar for already-displayed nodes)\n\n## Use Case\n\nWhen reorganizing a set of related issues (like I just did with the Boss implementation), being able to visualize the full dependency graph helps verify the structure is correct before syncing.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-25T19:18:18.750649-08:00","updated_at":"2025-11-25T19:50:46.863319-08:00","closed_at":"2025-11-25T19:31:55.312314-08:00"}
|
||||
{"id":"bd-l7u","title":"Duplicate DefaultRetentionDays constants","description":"## Problem\n\nThere are now two constants for the same value:\n\n1. `deletions.DefaultRetentionDays = 7` in `internal/deletions/deletions.go:184`\n2. `configfile.DefaultDeletionsRetentionDays = 7` in `internal/configfile/configfile.go:102`\n\n## Impact\n- DRY violation\n- Risk of values getting out of sync\n- Confusing which one to use\n\n## Fix\nRemove the constant from `deletions` package and have it import from `configfile`, or create a shared constants package.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-25T12:49:38.356211-08:00","updated_at":"2025-11-25T15:15:21.964842-08:00","closed_at":"2025-11-25T15:15:21.964842-08:00"}
|
||||
{"id":"bd-l954","title":"Performance Testing Framework","description":"Add comprehensive performance testing for beads focusing on optimization guidance and validating 10K+ database scale. Uses standard Go tooling, follows existing patterns, minimal complexity.\n\nComponents:\n- Benchmark suite for critical operations at 10K-20K scale\n- Fixture generator for realistic test data (epic hierarchies, cross-links)\n- User diagnostics via bd doctor --perf\n- Always-on profiling integration\n\nGoals:\n- Identify bottlenecks for optimization work\n- Validate performance at 10K+ issue scale\n- Enable users to collect diagnostics for bug reports\n- Support both SQLite and JSONL import paths","status":"open","priority":2,"issue_type":"epic","created_at":"2025-11-13T22:22:11.203467-08:00","updated_at":"2025-11-13T22:22:11.203467-08:00"}
|
||||
{"id":"bd-m0w","title":"Add test coverage for internal/validation package","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:24.129559-05:00","updated_at":"2025-11-20T21:21:24.129559-05:00","dependencies":[{"issue_id":"bd-m0w","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.350477-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-m7ge","title":"Add .beads/README.md during 'bd init' for project documentation and promotion","description":"When 'bd init' is run, automatically generate a .beads/README.md file that:\n\n1. Briefly explains what Beads is (AI-native issue tracking that lives in your repo)\n2. Links to the main repository: https://github.com/steveyegge/beads\n3. Provides a quick reference of essential commands:\n - bd create: Create new issues\n - bd list: View all issues\n - bd update: Modify issue status/details\n - bd show: View issue details\n - bd sync: Sync with git remote\n4. Highlights key benefits for AI coding agents and developers\n5. Encourages developers to try it out\n\nThe README should be enthusiastic and compelling to get open source contributors excited about using Beads for their AI-assisted development workflows.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-16T22:32:50.478681-08:00","updated_at":"2025-11-25T17:49:42.558381-08:00","closed_at":"2025-11-25T17:49:42.558381-08:00"}
|
||||
{"id":"bd-mdw","title":"Add integration test for cross-clone deletion propagation","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T14:56:38.997009-08:00","updated_at":"2025-11-25T16:35:59.052914-08:00","closed_at":"2025-11-25T16:35:59.052914-08:00"}
|
||||
{"id":"bd-mnap","title":"Investigate performance issues in VS Code Copilot (Windows)","description":"Beads unusable in Windows 11 VS Code Copilot chat with Sonnet 4.5.\nSummary event happens every 3-4 turns, taking 3 minutes.\nCopilot summarizes after ~125k tokens despite model supporting 1M.\nLarge context size of beads might be triggering aggressive summarization.\nNeed workaround or optimization for context size.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:30.124918-05:00","updated_at":"2025-11-20T18:56:30.124918-05:00"}
|
||||
{"id":"bd-nq41","title":"Fix Homebrew warning about Ruby file location","description":"Homebrew warning: Found Ruby file outside steveyegge/beads tap formula directory.\nWarning points to: /opt/homebrew/Library/Taps/steveyegge/homebrew-beads/bd.rb\nIt should likely be inside a Formula/ directory or similar structure expected by Homebrew taps.\n","status":"open","priority":2,"issue_type":"chore","created_at":"2025-11-20T18:56:21.226579-05:00","updated_at":"2025-11-20T18:56:21.226579-05:00"}
|
||||
{"id":"bd-p6vp","title":"Clarify .beads/.gitattributes handling in Protected Branches docs","description":"Protected Branches docs quick start leaves untracked `.beads` directory and `.gitattributes`.\nQuestion: Are these changes meant to be checked into the protected branch?\nNeed to clarify if these should be ignored or committed, or if the instructions are missing a step.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T18:56:25.79407-05:00","updated_at":"2025-11-20T18:56:25.79407-05:00"}
|
||||
{"id":"bd-pbj","title":"bd doctor --fix should run bd sync to commit untracked deletions.jsonl","description":"After running bd cleanup -f, the deletions.jsonl file is created but left untracked. bd doctor --fix should notice this and run bd sync to commit it.\n\nCurrent behavior:\n- bd cleanup -f creates/updates deletions.jsonl\n- git status shows deletions.jsonl as untracked\n- bd doctor --fix does not notice or fix this\n\nExpected behavior:\n- bd doctor --fix should detect untracked .beads/*.jsonl files\n- Should offer to run bd sync to commit them\n\nRelated: The git hooks were also missing deletions.jsonl from their staging loops - that's been fixed in this session.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:29:33.901199-08:00","updated_at":"2025-11-26T20:33:03.296592-08:00","closed_at":"2025-11-26T20:33:03.296592-08:00"}
|
||||
{"id":"bd-qsm","title":"Auto-compact deletions during bd sync","description":"Parent: bd-imj\n\n## Task\nOptionally prune deletions manifest during sync when threshold exceeded.\n\n**Note: Opt-in feature** - disabled by default to avoid sync latency.\n\n## Implementation\n\nIn `bd sync`:\n```go\nfunc (s *Syncer) Sync() error {\n // ... existing sync logic ...\n \n // Auto-compact only if enabled\n if s.config.GetBool(\"deletions.auto_compact\", false) {\n deletionCount := deletions.Count(\".beads/deletions.jsonl\")\n threshold := s.config.GetInt(\"deletions.auto_compact_threshold\", 1000)\n \n if deletionCount \u003e threshold {\n retentionDays := s.config.GetInt(\"deletions.retention_days\", 7)\n if err := s.compactor.PruneDeletions(retentionDays); err != nil {\n log.Warnf(\"Failed to auto-compact deletions: %v\", err)\n // Non-fatal, continue sync\n }\n }\n }\n \n // ... rest of sync ...\n}\n```\n\n## Configuration\n```yaml\ndeletions:\n retention_days: 7\n auto_compact: false # Opt-in, disabled by default\n auto_compact_threshold: 1000 # Trigger when \u003e N entries (if enabled)\n```\n\n## Acceptance Criteria\n- [ ] Auto-compact disabled by default\n- [ ] Enabled via config `deletions.auto_compact: true`\n- [ ] Sync checks deletion count only when enabled\n- [ ] Auto-prunes when threshold exceeded\n- [ ] Failure is non-fatal (logged warning)\n- [ ] Test: no compaction when disabled\n- [ ] Test: compaction triggers when enabled and threshold exceeded","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-25T09:57:04.522795-08:00","updated_at":"2025-11-25T15:03:01.469629-08:00","closed_at":"2025-11-25T15:03:01.469629-08:00"}
|
||||
{"id":"bd-red","title":"bd sync should only commit .beads/ files, not all staged changes","description":"Currently bd sync commits ALL staged files, not just .beads/*.jsonl. This can lead to:\n- Unintended commits of work-in-progress code\n- Surprise for users/agents who staged files but weren't ready to commit\n- Mixing beads sync commits with actual code changes\n\nExpected behavior: bd sync should only stage and commit .beads/ files, leaving other staged changes alone.\n\nOptions:\n1. Stash other staged changes, commit only .beads/, restore stash\n2. Use git add .beads/ \u0026\u0026 git commit -m '...' -- .beads/ to only commit beads files\n3. Warn if non-beads files are staged and require --force to proceed","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T20:35:40.212006-08:00","updated_at":"2025-11-26T20:46:26.106545-08:00","closed_at":"2025-11-26T20:46:26.106545-08:00"}
|
||||
{"id":"bd-s0z","title":"Consider extracting error handling helpers","description":"Evaluate creating FatalError() and WarnError() helpers as suggested in ERROR_HANDLING.md to reduce boilerplate and enforce consistency. Prototype in a few files first to validate the approach.","status":"open","priority":4,"issue_type":"task","created_at":"2025-11-24T00:28:57.248959-08:00","updated_at":"2025-11-24T00:28:57.248959-08:00"}
|
||||
{"id":"bd-t3b","title":"Add test coverage for internal/config package","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-20T21:21:22.91657-05:00","updated_at":"2025-11-20T21:21:22.91657-05:00","dependencies":[{"issue_id":"bd-t3b","depends_on_id":"bd-ge7","type":"blocks","created_at":"2025-11-20T21:21:31.201036-05:00","created_by":"daemon"}]}
|
||||
{"id":"bd-tne","title":"Add Claude setup tip with dynamic priority","description":"Add a predefined tip that suggests running `bd setup claude` when Claude Code is detected but not configured. This tip should have higher priority (shown more frequently) until the setup is complete.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:29:29.871324-08:00","updated_at":"2025-11-25T17:52:35.044989-08:00","closed_at":"2025-11-25T17:52:35.044989-08:00","dependencies":[{"issue_id":"bd-tne","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:29.872081-08:00","created_by":"daemon"}]}
|
||||
{"id":"bd-tru","title":"Update documentation for bd prime and Claude integration","description":"Update AGENTS.md, README.md, and QUICKSTART.md to document the new `bd prime` command, `bd setup claude` command, and tip system.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-11T23:30:22.77349-08:00","updated_at":"2025-11-25T17:47:30.807069-08:00","closed_at":"2025-11-25T17:47:30.807069-08:00"}
|
||||
{"id":"bd-tys","title":"Git history fallback has incorrect logic for detecting deletions","description":"## Problem\n\nThe `wasInGitHistory` function in `internal/importer/importer.go:891` returns true if the ID is found **anywhere** in git history. But finding an ID in history doesn't necessarily mean it was deleted - it could mean:\n\n1. The issue was added (appears in a commit adding it)\n2. The issue was modified (appears in commits updating it)\n3. The issue was deleted (appears in a commit removing it)\n\nThe current logic incorrectly treats all three cases as 'deleted'.\n\n## Correct Logic\n\n`git log -S` with `--oneline` shows commits where the string was added OR removed. To detect deletion specifically:\n\n1. ID appears in git history (was once in JSONL)\n2. ID is NOT currently in JSONL\n\nThe second condition is already checked by the caller (`purgeDeletedIssues`), so technically the logic is correct in context. But the function name and doc comment are misleading.\n\n## Fix Options\n\n1. **Rename function** to `wasEverInJSONL` and update doc comment to clarify\n2. **Add explicit check** for current JSONL state in the function itself\n\nOption 1 is simpler and correct since caller already filters.","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:46:16.073661-08:00","updated_at":"2025-11-25T15:11:54.426093-08:00","closed_at":"2025-11-25T15:11:54.426093-08:00"}
|
||||
{"id":"bd-v29","title":"Deletions pruning doesn't include results in JSON output","description":"## Problem\n\nWhen `bd compact --json` runs with deletions pruning, the prune results are silently discarded:\n\n```go\n// Only report if there were deletions to prune\nif result.PrunedCount \u003e 0 {\n if jsonOutput {\n // JSON output will be included in the main response\n return // \u003c-- BUG: results are NOT included anywhere\n }\n ...\n}\n```\n\n## Location\n`cmd/bd/compact.go:925-929`\n\n## Impact\n- JSON consumers don't know deletions were pruned\n- No way to audit pruning via automation\n\n## Fix\nReturn prune results and include in JSON output structure:\n\n```json\n{\n \"success\": true,\n \"compacted\": {...},\n \"deletions_pruned\": {\n \"count\": 5,\n \"retention_days\": 7\n }\n}\n```","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:59.730979-08:00","updated_at":"2025-11-25T15:11:54.363653-08:00","closed_at":"2025-11-25T15:11:54.363653-08:00"}
|
||||
{"id":"bd-wcl","title":"Document CLI + hooks as recommended approach over MCP","description":"Update documentation to position CLI + bd prime hooks as the primary recommended approach over MCP server, explaining why minimizing context matters even with large context windows (compute cost, energy, environment, latency).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-12T00:15:25.923025-08:00","updated_at":"2025-11-26T20:13:52.891053-08:00","closed_at":"2025-11-26T18:06:51.020351-08:00"}
|
||||
{"id":"bd-wmo","title":"PruneDeletions iterates map non-deterministically","description":"## Problem\n\n`PruneDeletions` iterates over `loadResult.Records` which is a map. Go maps iterate in random order, so:\n\n1. `result.PrunedIDs` order is non-deterministic\n2. `kept` slice order is non-deterministic → `WriteDeletions` output order varies\n\n## Location\n`internal/deletions/deletions.go:213`\n\n## Impact\n- Git diffs are noisy (file changes order on each prune)\n- Tests could be flaky if they depend on order\n- Harder to debug/audit\n\n## Fix\nSort by ID or timestamp before iterating:\n\n```go\n// Convert map to slice and sort\nvar records []DeletionRecord\nfor _, r := range loadResult.Records {\n records = append(records, r)\n}\nsort.Slice(records, func(i, j int) bool {\n return records[i].ID \u003c records[j].ID\n})\n```","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-11-25T12:49:11.290916-08:00","updated_at":"2025-11-25T15:15:21.903649-08:00","closed_at":"2025-11-25T15:15:21.903649-08:00"}
|
||||
{"id":"bd-x2i","title":"Add bd deleted command for audit trail","description":"Parent: bd-imj\n\nAdd command to view deletion history.\n\nUsage:\n bd deleted # Show recent deletions (last 7 days)\n bd deleted --since=30d # Show deletions in last 30 days\n bd deleted --all # Show all tracked deletions\n bd deleted bd-xxx # Show deletion details for specific issue\n\nOutput format:\n bd-xxx 2025-11-25 10:00 stevey duplicate of bd-yyy\n bd-yyy 2025-11-25 10:05 claude cleanup\n\nAcceptance criteria:\n- List deletions with timestamp, actor, reason\n- Filter by time range\n- Lookup specific issue ID\n- JSON output option for scripting","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T09:57:21.113861-08:00","updated_at":"2025-11-25T15:13:53.781519-08:00","closed_at":"2025-11-25T15:13:53.781519-08:00"}
|
||||
{"id":"bd-xyc","title":"Consolidate check-health DB opens into single connection","description":"The --check-health flag opens the database 3 separate times (once per quick check). Consolidate into a single DB open for better performance, especially on slower filesystems.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:42.034178-08:00","updated_at":"2025-11-25T19:50:21.32375-08:00","closed_at":"2025-11-25T19:50:21.32375-08:00"}
|
||||
{"id":"bd-ybv5","title":"Refactor AGENTS.md to use external references","description":"Suggestion to use external references (e.g., \"ALWAYS REFER TO ./beads/prompt.md\") instead of including all instructions directly within AGENTS.md.\nReasons:\n1. Agents can follow external references.\n2. Prevents context pollution/stuffing in AGENTS.md as more tools append instructions.\n","status":"open","priority":3,"issue_type":"task","created_at":"2025-11-20T18:55:53.259144-05:00","updated_at":"2025-11-20T18:55:53.259144-05:00"}
|
||||
{"id":"bd-ye0d","title":"troubleshoot GH#278 daemon exits every few secs","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-13T06:27:23.39509215-07:00","updated_at":"2025-11-25T17:48:43.62418-08:00","closed_at":"2025-11-25T17:48:43.62418-08:00"}
|
||||
{"id":"bd-zj8e","title":"Performance Testing Documentation","description":"Create docs/performance-testing.md documenting the performance testing framework.\n\nSections:\n1. Overview - What the framework does, goals\n2. Running Benchmarks\n - make bench command\n - Running specific benchmarks\n - Interpreting output (ns/op, allocs/op)\n3. Profiling and Analysis\n - Viewing CPU profiles with pprof\n - Reading flamegraphs\n - Memory profiling\n - Finding hotspots\n4. User Diagnostics\n - bd doctor --perf usage\n - Sharing profiles with bug reports\n - Understanding the report output\n5. Comparing Performance\n - Using benchstat for before/after comparisons\n - Detecting regressions\n6. Tips for Optimization\n - Common patterns\n - When to profile vs benchmark\n\nStyle:\n- Concise, practical examples\n- Screenshots/examples of pprof output\n- Clear command-line examples\n- Focus on workflow, not theory","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-13T22:23:38.99897-08:00","updated_at":"2025-11-13T22:23:38.99897-08:00"}
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1 +1 @@
|
||||
.beads/beads.jsonl merge=beads
|
||||
.beads/issues.jsonl merge=beads
|
||||
|
||||
@@ -49,7 +49,8 @@ func TestFindJSONLPath(t *testing.T) {
|
||||
}
|
||||
|
||||
jsonlPath := beads.FindJSONLPath(dbPath)
|
||||
expectedPath := filepath.Join(tmpDir, ".beads", "beads.jsonl")
|
||||
// bd-6xd: Default is now issues.jsonl (canonical name)
|
||||
expectedPath := filepath.Join(tmpDir, ".beads", "issues.jsonl")
|
||||
|
||||
if jsonlPath != expectedPath {
|
||||
t.Errorf("FindJSONLPath returned %s, expected %s", jsonlPath, expectedPath)
|
||||
|
||||
@@ -25,7 +25,7 @@ Files removed:
|
||||
- Git merge driver temp files (*.json[0-9], *.jsonl[0-9])
|
||||
|
||||
Files preserved:
|
||||
- beads.jsonl (source of truth)
|
||||
- issues.jsonl (source of truth)
|
||||
- beads.db (SQLite database)
|
||||
- metadata.json
|
||||
- config.yaml
|
||||
|
||||
@@ -16,7 +16,7 @@ var cleanupCmd = &cobra.Command{
|
||||
Short: "Delete closed issues from database to free up space",
|
||||
Long: `Delete closed issues from the database to reduce database size.
|
||||
|
||||
This command permanently removes closed issues from beads.db and beads.jsonl.
|
||||
This command permanently removes closed issues from beads.db and issues.jsonl.
|
||||
It does NOT remove temporary files - use 'bd clean' for that.
|
||||
|
||||
By default, deletes ALL closed issues. Use --older-than to only delete
|
||||
|
||||
@@ -210,6 +210,8 @@ func applyFixes(result doctorResult) {
|
||||
err = fix.SyncBranchConfig(result.Path)
|
||||
case "Database Config":
|
||||
err = fix.DatabaseConfig(result.Path)
|
||||
case "JSONL Config":
|
||||
err = fix.LegacyJSONLConfig(result.Path)
|
||||
case "Deletions Manifest":
|
||||
err = fix.HydrateDeletionsManifest(result.Path)
|
||||
case "Untracked Files":
|
||||
@@ -484,6 +486,11 @@ func runDiagnostics(path string) doctorResult {
|
||||
result.OverallOK = false
|
||||
}
|
||||
|
||||
// Check 6a: Legacy JSONL config (bd-6xd: migrate beads.jsonl to issues.jsonl)
|
||||
legacyConfigCheck := convertDoctorCheck(doctor.CheckLegacyJSONLConfig(path))
|
||||
result.Checks = append(result.Checks, legacyConfigCheck)
|
||||
// Don't fail overall check for legacy config, just warn
|
||||
|
||||
// Check 7: Database/JSONL configuration mismatch
|
||||
configCheck := convertDoctorCheck(doctor.CheckDatabaseConfig(path))
|
||||
result.Checks = append(result.Checks, configCheck)
|
||||
@@ -625,20 +632,20 @@ func checkDatabaseVersion(path string) doctorCheck {
|
||||
// Check if database file exists
|
||||
if _, err := os.Stat(dbPath); os.IsNotExist(err) {
|
||||
// Check if JSONL exists (--no-db mode)
|
||||
// Check both canonical (beads.jsonl) and legacy (issues.jsonl) names
|
||||
beadsJSONL := filepath.Join(beadsDir, "beads.jsonl")
|
||||
// Check canonical (issues.jsonl) first, then legacy (beads.jsonl)
|
||||
issuesJSONL := filepath.Join(beadsDir, "issues.jsonl")
|
||||
beadsJSONL := filepath.Join(beadsDir, "beads.jsonl")
|
||||
|
||||
if _, err := os.Stat(beadsJSONL); err == nil {
|
||||
if _, err := os.Stat(issuesJSONL); err == nil {
|
||||
return doctorCheck{
|
||||
Name: "Database",
|
||||
Status: statusOK,
|
||||
Message: "JSONL-only mode",
|
||||
Detail: "Using beads.jsonl (no SQLite database)",
|
||||
Detail: "Using issues.jsonl (no SQLite database)",
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := os.Stat(issuesJSONL); err == nil {
|
||||
if _, err := os.Stat(beadsJSONL); err == nil {
|
||||
return doctorCheck{
|
||||
Name: "Database",
|
||||
Status: statusOK,
|
||||
@@ -2095,9 +2102,10 @@ func checkDeletionsManifest(path string) doctorCheck {
|
||||
|
||||
// deletions.jsonl doesn't exist or is empty
|
||||
// Check if there's git history that might have deletions
|
||||
jsonlPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
// bd-6xd: Check canonical issues.jsonl first, then legacy beads.jsonl
|
||||
jsonlPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
if _, err := os.Stat(jsonlPath); os.IsNotExist(err) {
|
||||
jsonlPath = filepath.Join(beadsDir, "issues.jsonl")
|
||||
jsonlPath = filepath.Join(beadsDir, "beads.jsonl")
|
||||
if _, err := os.Stat(jsonlPath); os.IsNotExist(err) {
|
||||
return doctorCheck{
|
||||
Name: "Deletions Manifest",
|
||||
|
||||
@@ -73,7 +73,8 @@ func DatabaseConfig(path string) error {
|
||||
}
|
||||
|
||||
// findActualJSONLFile scans .beads/ for the actual JSONL file in use.
|
||||
// Prefers beads.jsonl over issues.jsonl, skips backups and merge artifacts.
|
||||
// Prefers issues.jsonl over beads.jsonl (canonical name), skips backups and merge artifacts.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func findActualJSONLFile(beadsDir string) string {
|
||||
entries, err := os.ReadDir(beadsDir)
|
||||
if err != nil {
|
||||
@@ -109,17 +110,87 @@ func findActualJSONLFile(beadsDir string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Prefer beads.jsonl over issues.jsonl (canonical name)
|
||||
// bd-6xd: Prefer issues.jsonl over beads.jsonl (canonical name)
|
||||
for _, name := range candidates {
|
||||
if name == "beads.jsonl" {
|
||||
if name == "issues.jsonl" {
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to first candidate
|
||||
// Fall back to first candidate (including beads.jsonl as legacy)
|
||||
return candidates[0]
|
||||
}
|
||||
|
||||
// LegacyJSONLConfig migrates from legacy beads.jsonl to canonical issues.jsonl.
|
||||
// This renames the file, updates metadata.json, and updates .gitattributes if present.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func LegacyJSONLConfig(path string) error {
|
||||
if err := validateBeadsWorkspace(path); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
beadsDir := filepath.Join(path, ".beads")
|
||||
|
||||
// Load existing config
|
||||
cfg, err := configfile.Load(beadsDir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to load config: %w", err)
|
||||
}
|
||||
if cfg == nil {
|
||||
return fmt.Errorf("no metadata.json found")
|
||||
}
|
||||
|
||||
legacyPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
canonicalPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
|
||||
legacyExists := false
|
||||
if _, err := os.Stat(legacyPath); err == nil {
|
||||
legacyExists = true
|
||||
}
|
||||
|
||||
canonicalExists := false
|
||||
if _, err := os.Stat(canonicalPath); err == nil {
|
||||
canonicalExists = true
|
||||
}
|
||||
|
||||
// Case 1: Config says beads.jsonl, file exists, issues.jsonl doesn't exist -> rename
|
||||
if cfg.JSONLExport == "beads.jsonl" && legacyExists && !canonicalExists {
|
||||
fmt.Printf(" Renaming beads.jsonl → issues.jsonl\n")
|
||||
if err := os.Rename(legacyPath, canonicalPath); err != nil {
|
||||
return fmt.Errorf("failed to rename file: %w", err)
|
||||
}
|
||||
cfg.JSONLExport = "issues.jsonl"
|
||||
|
||||
// Update .gitattributes if it references beads.jsonl
|
||||
gitattrsPath := filepath.Join(path, ".gitattributes")
|
||||
if content, err := os.ReadFile(gitattrsPath); err == nil {
|
||||
if strings.Contains(string(content), ".beads/beads.jsonl") {
|
||||
newContent := strings.ReplaceAll(string(content), ".beads/beads.jsonl", ".beads/issues.jsonl")
|
||||
// #nosec G306 -- .gitattributes should be world-readable
|
||||
if err := os.WriteFile(gitattrsPath, []byte(newContent), 0644); err != nil {
|
||||
fmt.Printf(" Warning: failed to update .gitattributes: %v\n", err)
|
||||
} else {
|
||||
fmt.Printf(" Updated .gitattributes\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Case 2: Config says beads.jsonl but issues.jsonl exists -> just update config
|
||||
if cfg.JSONLExport == "beads.jsonl" && canonicalExists {
|
||||
fmt.Printf(" Updating config: beads.jsonl → issues.jsonl\n")
|
||||
cfg.JSONLExport = "issues.jsonl"
|
||||
}
|
||||
|
||||
// Save updated config
|
||||
if err := cfg.Save(beadsDir); err != nil {
|
||||
return fmt.Errorf("failed to save config: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf(" Updated metadata.json\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
// findActualDBFile scans .beads/ for the actual database file in use.
|
||||
// Prefers beads.db (canonical name), skips backups and vc.db.
|
||||
func findActualDBFile(beadsDir string) string {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// TestDatabaseConfigFix_JSONLMismatch tests that DatabaseConfig fixes JSONL mismatches.
|
||||
// bd-afd: Verify auto-fix for metadata.json jsonl_export mismatch
|
||||
// bd-6xd: Verify auto-fix for metadata.json jsonl_export mismatch
|
||||
func TestDatabaseConfigFix_JSONLMismatch(t *testing.T) {
|
||||
// Create temporary directory
|
||||
tmpDir := t.TempDir()
|
||||
@@ -18,16 +18,16 @@ func TestDatabaseConfigFix_JSONLMismatch(t *testing.T) {
|
||||
t.Fatalf("Failed to create .beads dir: %v", err)
|
||||
}
|
||||
|
||||
// Create beads.jsonl file (actual JSONL)
|
||||
jsonlPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
// Create issues.jsonl file (actual JSONL - canonical name)
|
||||
jsonlPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
if err := os.WriteFile(jsonlPath, []byte(`{"id":"test-123"}`), 0644); err != nil {
|
||||
t.Fatalf("Failed to create beads.jsonl: %v", err)
|
||||
t.Fatalf("Failed to create issues.jsonl: %v", err)
|
||||
}
|
||||
|
||||
// Create metadata.json with wrong JSONL filename (issues.jsonl)
|
||||
// Create metadata.json with wrong JSONL filename (beads.jsonl)
|
||||
cfg := &configfile.Config{
|
||||
Database: "beads.db",
|
||||
JSONLExport: "issues.jsonl", // Wrong - should be beads.jsonl
|
||||
JSONLExport: "beads.jsonl", // Wrong - should be issues.jsonl
|
||||
}
|
||||
if err := cfg.Save(beadsDir); err != nil {
|
||||
t.Fatalf("Failed to save config: %v", err)
|
||||
@@ -44,13 +44,14 @@ func TestDatabaseConfigFix_JSONLMismatch(t *testing.T) {
|
||||
t.Fatalf("Failed to load updated config: %v", err)
|
||||
}
|
||||
|
||||
if updatedCfg.JSONLExport != "beads.jsonl" {
|
||||
t.Errorf("Expected JSONLExport to be 'beads.jsonl', got %q", updatedCfg.JSONLExport)
|
||||
if updatedCfg.JSONLExport != "issues.jsonl" {
|
||||
t.Errorf("Expected JSONLExport to be 'issues.jsonl', got %q", updatedCfg.JSONLExport)
|
||||
}
|
||||
}
|
||||
|
||||
// TestDatabaseConfigFix_PrefersBeadsJSONL tests that DatabaseConfig prefers beads.jsonl over issues.jsonl.
|
||||
func TestDatabaseConfigFix_PrefersBeadsJSONL(t *testing.T) {
|
||||
// TestDatabaseConfigFix_PrefersIssuesJSONL tests that DatabaseConfig prefers issues.jsonl over beads.jsonl.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func TestDatabaseConfigFix_PrefersIssuesJSONL(t *testing.T) {
|
||||
// Create temporary directory
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
@@ -72,7 +73,7 @@ func TestDatabaseConfigFix_PrefersBeadsJSONL(t *testing.T) {
|
||||
// Create metadata.json with wrong JSONL filename (old.jsonl)
|
||||
cfg := &configfile.Config{
|
||||
Database: "beads.db",
|
||||
JSONLExport: "old.jsonl", // Wrong - should prefer beads.jsonl
|
||||
JSONLExport: "old.jsonl", // Wrong - should prefer issues.jsonl
|
||||
}
|
||||
if err := cfg.Save(beadsDir); err != nil {
|
||||
t.Fatalf("Failed to save config: %v", err)
|
||||
@@ -83,30 +84,31 @@ func TestDatabaseConfigFix_PrefersBeadsJSONL(t *testing.T) {
|
||||
t.Fatalf("DatabaseConfig failed: %v", err)
|
||||
}
|
||||
|
||||
// Verify the config was updated to beads.jsonl (not issues.jsonl)
|
||||
// Verify the config was updated to issues.jsonl (canonical name)
|
||||
updatedCfg, err := configfile.Load(beadsDir)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to load updated config: %v", err)
|
||||
}
|
||||
|
||||
if updatedCfg.JSONLExport != "beads.jsonl" {
|
||||
t.Errorf("Expected JSONLExport to be 'beads.jsonl', got %q", updatedCfg.JSONLExport)
|
||||
if updatedCfg.JSONLExport != "issues.jsonl" {
|
||||
t.Errorf("Expected JSONLExport to be 'issues.jsonl', got %q", updatedCfg.JSONLExport)
|
||||
}
|
||||
}
|
||||
|
||||
// TestFindActualJSONLFile_SkipsBackups tests that backup files are skipped.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func TestFindActualJSONLFile_SkipsBackups(t *testing.T) {
|
||||
// Create temporary directory
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
// Create beads.jsonl and various backup files
|
||||
// Create issues.jsonl and various backup files
|
||||
files := []string{
|
||||
"beads.jsonl",
|
||||
"beads.jsonl.backup",
|
||||
"backup_beads.jsonl",
|
||||
"beads.jsonl.orig",
|
||||
"beads.jsonl.bak",
|
||||
"beads.jsonl~",
|
||||
"issues.jsonl",
|
||||
"issues.jsonl.backup",
|
||||
"backup_issues.jsonl",
|
||||
"issues.jsonl.orig",
|
||||
"issues.jsonl.bak",
|
||||
"issues.jsonl~",
|
||||
}
|
||||
|
||||
for _, name := range files {
|
||||
@@ -116,9 +118,105 @@ func TestFindActualJSONLFile_SkipsBackups(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// findActualJSONLFile should return beads.jsonl (not backups)
|
||||
// findActualJSONLFile should return issues.jsonl (not backups)
|
||||
result := findActualJSONLFile(tmpDir)
|
||||
if result != "beads.jsonl" {
|
||||
t.Errorf("Expected 'beads.jsonl', got %q", result)
|
||||
if result != "issues.jsonl" {
|
||||
t.Errorf("Expected 'issues.jsonl', got %q", result)
|
||||
}
|
||||
}
|
||||
|
||||
// TestLegacyJSONLConfig_MigratesBeadsToIssues tests migration from beads.jsonl to issues.jsonl.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func TestLegacyJSONLConfig_MigratesBeadsToIssues(t *testing.T) {
|
||||
// Create temporary directory
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
if err := os.Mkdir(beadsDir, 0755); err != nil {
|
||||
t.Fatalf("Failed to create .beads dir: %v", err)
|
||||
}
|
||||
|
||||
// Create beads.jsonl file (legacy name)
|
||||
legacyPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
if err := os.WriteFile(legacyPath, []byte(`{"id":"test-123"}`), 0644); err != nil {
|
||||
t.Fatalf("Failed to create beads.jsonl: %v", err)
|
||||
}
|
||||
|
||||
// Create metadata.json with legacy filename
|
||||
cfg := &configfile.Config{
|
||||
Database: "beads.db",
|
||||
JSONLExport: "beads.jsonl",
|
||||
}
|
||||
if err := cfg.Save(beadsDir); err != nil {
|
||||
t.Fatalf("Failed to save config: %v", err)
|
||||
}
|
||||
|
||||
// Run the fix
|
||||
if err := LegacyJSONLConfig(tmpDir); err != nil {
|
||||
t.Fatalf("LegacyJSONLConfig failed: %v", err)
|
||||
}
|
||||
|
||||
// Verify the file was renamed
|
||||
canonicalPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
if _, err := os.Stat(canonicalPath); os.IsNotExist(err) {
|
||||
t.Error("Expected issues.jsonl to exist after migration")
|
||||
}
|
||||
if _, err := os.Stat(legacyPath); err == nil {
|
||||
t.Error("Expected beads.jsonl to be removed after migration")
|
||||
}
|
||||
|
||||
// Verify the config was updated
|
||||
updatedCfg, err := configfile.Load(beadsDir)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to load updated config: %v", err)
|
||||
}
|
||||
|
||||
if updatedCfg.JSONLExport != "issues.jsonl" {
|
||||
t.Errorf("Expected JSONLExport to be 'issues.jsonl', got %q", updatedCfg.JSONLExport)
|
||||
}
|
||||
}
|
||||
|
||||
// TestLegacyJSONLConfig_UpdatesGitattributes tests that .gitattributes is updated during migration.
|
||||
func TestLegacyJSONLConfig_UpdatesGitattributes(t *testing.T) {
|
||||
// Create temporary directory
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
if err := os.Mkdir(beadsDir, 0755); err != nil {
|
||||
t.Fatalf("Failed to create .beads dir: %v", err)
|
||||
}
|
||||
|
||||
// Create beads.jsonl file (legacy name)
|
||||
legacyPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
if err := os.WriteFile(legacyPath, []byte(`{"id":"test-123"}`), 0644); err != nil {
|
||||
t.Fatalf("Failed to create beads.jsonl: %v", err)
|
||||
}
|
||||
|
||||
// Create .gitattributes with legacy reference
|
||||
gitattrsPath := filepath.Join(tmpDir, ".gitattributes")
|
||||
if err := os.WriteFile(gitattrsPath, []byte(".beads/beads.jsonl merge=beads\n"), 0644); err != nil {
|
||||
t.Fatalf("Failed to create .gitattributes: %v", err)
|
||||
}
|
||||
|
||||
// Create metadata.json with legacy filename
|
||||
cfg := &configfile.Config{
|
||||
Database: "beads.db",
|
||||
JSONLExport: "beads.jsonl",
|
||||
}
|
||||
if err := cfg.Save(beadsDir); err != nil {
|
||||
t.Fatalf("Failed to save config: %v", err)
|
||||
}
|
||||
|
||||
// Run the fix
|
||||
if err := LegacyJSONLConfig(tmpDir); err != nil {
|
||||
t.Fatalf("LegacyJSONLConfig failed: %v", err)
|
||||
}
|
||||
|
||||
// Verify .gitattributes was updated
|
||||
content, err := os.ReadFile(gitattrsPath)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to read .gitattributes: %v", err)
|
||||
}
|
||||
|
||||
if string(content) != ".beads/issues.jsonl merge=beads\n" {
|
||||
t.Errorf("Expected .gitattributes to reference issues.jsonl, got: %q", string(content))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@ func HydrateDeletionsManifest(path string) error {
|
||||
}
|
||||
|
||||
beadsDir := filepath.Join(path, ".beads")
|
||||
jsonlPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
jsonlPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
|
||||
// Also check for legacy issues.jsonl
|
||||
// Also check for legacy beads.jsonl
|
||||
if _, err := os.Stat(jsonlPath); os.IsNotExist(err) {
|
||||
legacyPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
legacyPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
if _, err := os.Stat(legacyPath); err == nil {
|
||||
jsonlPath = legacyPath
|
||||
} else {
|
||||
|
||||
@@ -177,6 +177,73 @@ func CheckLegacyJSONLFilename(repoPath string) DoctorCheck {
|
||||
}
|
||||
}
|
||||
|
||||
// CheckLegacyJSONLConfig detects if metadata.json is configured to use the legacy
|
||||
// beads.jsonl filename and recommends migrating to the canonical issues.jsonl.
|
||||
// bd-6xd: issues.jsonl is the canonical filename
|
||||
func CheckLegacyJSONLConfig(repoPath string) DoctorCheck {
|
||||
beadsDir := filepath.Join(repoPath, ".beads")
|
||||
|
||||
// Load config
|
||||
cfg, err := configfile.Load(beadsDir)
|
||||
if err != nil || cfg == nil {
|
||||
// No config - using defaults, which are now issues.jsonl
|
||||
return DoctorCheck{
|
||||
Name: "JSONL Config",
|
||||
Status: "ok",
|
||||
Message: "Using default configuration (issues.jsonl)",
|
||||
}
|
||||
}
|
||||
|
||||
// Check if using legacy beads.jsonl
|
||||
if cfg.JSONLExport == "beads.jsonl" {
|
||||
// Check if beads.jsonl actually exists
|
||||
legacyPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
canonicalPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
|
||||
legacyExists := false
|
||||
if _, err := os.Stat(legacyPath); err == nil {
|
||||
legacyExists = true
|
||||
}
|
||||
|
||||
canonicalExists := false
|
||||
if _, err := os.Stat(canonicalPath); err == nil {
|
||||
canonicalExists = true
|
||||
}
|
||||
|
||||
if legacyExists && !canonicalExists {
|
||||
return DoctorCheck{
|
||||
Name: "JSONL Config",
|
||||
Status: "warning",
|
||||
Message: "Using legacy beads.jsonl filename",
|
||||
Detail: "The canonical filename is now issues.jsonl (bd-6xd).\n" +
|
||||
" Legacy beads.jsonl is still supported but should be migrated.",
|
||||
Fix: "Run 'bd doctor --fix' to auto-migrate, or manually:\n" +
|
||||
" 1. git mv .beads/beads.jsonl .beads/issues.jsonl\n" +
|
||||
" 2. Update metadata.json: jsonl_export: \"issues.jsonl\"\n" +
|
||||
" 3. Update .gitattributes if present",
|
||||
}
|
||||
}
|
||||
|
||||
if !legacyExists && canonicalExists {
|
||||
// Config says beads.jsonl but issues.jsonl exists - just update config
|
||||
return DoctorCheck{
|
||||
Name: "JSONL Config",
|
||||
Status: "warning",
|
||||
Message: "Config references beads.jsonl but issues.jsonl exists",
|
||||
Detail: "metadata.json says beads.jsonl but the actual file is issues.jsonl",
|
||||
Fix: "Run 'bd doctor --fix' to update the configuration",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Using issues.jsonl or custom name - all good
|
||||
return DoctorCheck{
|
||||
Name: "JSONL Config",
|
||||
Status: "ok",
|
||||
Message: fmt.Sprintf("Using %s", cfg.JSONLExport),
|
||||
}
|
||||
}
|
||||
|
||||
// CheckDatabaseConfig verifies that the configured database and JSONL paths
|
||||
// match what actually exists on disk.
|
||||
func CheckDatabaseConfig(repoPath string) DoctorCheck {
|
||||
|
||||
@@ -261,3 +261,86 @@ func TestCheckLegacyJSONLFilename(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckLegacyJSONLConfig(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
configJSONL string // what metadata.json says
|
||||
existingFiles []string // which files actually exist
|
||||
expectedStatus string
|
||||
expectWarning bool
|
||||
}{
|
||||
{
|
||||
name: "no config (defaults)",
|
||||
configJSONL: "",
|
||||
existingFiles: []string{},
|
||||
expectedStatus: "ok",
|
||||
expectWarning: false,
|
||||
},
|
||||
{
|
||||
name: "using canonical issues.jsonl",
|
||||
configJSONL: "issues.jsonl",
|
||||
existingFiles: []string{"issues.jsonl"},
|
||||
expectedStatus: "ok",
|
||||
expectWarning: false,
|
||||
},
|
||||
{
|
||||
name: "using custom name",
|
||||
configJSONL: "my-project.jsonl",
|
||||
existingFiles: []string{"my-project.jsonl"},
|
||||
expectedStatus: "ok",
|
||||
expectWarning: false,
|
||||
},
|
||||
{
|
||||
name: "using legacy beads.jsonl",
|
||||
configJSONL: "beads.jsonl",
|
||||
existingFiles: []string{"beads.jsonl"},
|
||||
expectedStatus: "warning",
|
||||
expectWarning: true,
|
||||
},
|
||||
{
|
||||
name: "config says beads.jsonl but issues.jsonl exists",
|
||||
configJSONL: "beads.jsonl",
|
||||
existingFiles: []string{"issues.jsonl"},
|
||||
expectedStatus: "warning",
|
||||
expectWarning: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
if err := os.Mkdir(beadsDir, 0750); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Create test files
|
||||
for _, file := range tt.existingFiles {
|
||||
filePath := filepath.Join(beadsDir, file)
|
||||
if err := os.WriteFile(filePath, []byte(`{"id":"test"}`), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Create metadata.json if configJSONL is set
|
||||
if tt.configJSONL != "" {
|
||||
metadataPath := filepath.Join(beadsDir, "metadata.json")
|
||||
content := `{"database":"beads.db","jsonl_export":"` + tt.configJSONL + `"}`
|
||||
if err := os.WriteFile(metadataPath, []byte(content), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
check := CheckLegacyJSONLConfig(tmpDir)
|
||||
|
||||
if check.Status != tt.expectedStatus {
|
||||
t.Errorf("Expected status %s, got %s (message: %s)", tt.expectedStatus, check.Status, check.Message)
|
||||
}
|
||||
|
||||
if tt.expectWarning && check.Fix == "" {
|
||||
t.Error("Expected fix message for warning, got empty string")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ NOTE: Import requires direct database access and does not work with daemon mode.
|
||||
fmt.Fprintf(os.Stderr, "Did you mean: bd import -i %s\n\n", args[0])
|
||||
fmt.Fprintf(os.Stderr, "The import command does not accept positional arguments.\n")
|
||||
fmt.Fprintf(os.Stderr, "Use the -i flag to specify an input file:\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/beads.jsonl\n\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/issues.jsonl\n\n")
|
||||
fmt.Fprintf(os.Stderr, "Or pipe data via stdin:\n")
|
||||
fmt.Fprintf(os.Stderr, " cat data.jsonl | bd import\n")
|
||||
os.Exit(1)
|
||||
@@ -89,8 +89,8 @@ NOTE: Import requires direct database access and does not work with daemon mode.
|
||||
if input == "" && term.IsTerminal(int(os.Stdin.Fd())) {
|
||||
fmt.Fprintf(os.Stderr, "Error: No input specified.\n\n")
|
||||
fmt.Fprintf(os.Stderr, "Usage:\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/beads.jsonl # Import from file\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/beads.jsonl --dry-run # Preview changes\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/issues.jsonl # Import from file\n")
|
||||
fmt.Fprintf(os.Stderr, " bd import -i .beads/issues.jsonl --dry-run # Preview changes\n")
|
||||
fmt.Fprintf(os.Stderr, " cat data.jsonl | bd import # Import from pipe\n")
|
||||
fmt.Fprintf(os.Stderr, " bd sync --import-only # Import latest JSONL\n\n")
|
||||
fmt.Fprintf(os.Stderr, "For more information, run: bd import --help\n")
|
||||
@@ -144,8 +144,8 @@ NOTE: Import requires direct database access and does not work with daemon mode.
|
||||
if err := attemptAutoMerge(input); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: Automatic merge failed: %v\n\n", err)
|
||||
fmt.Fprintf(os.Stderr, "To resolve manually:\n")
|
||||
fmt.Fprintf(os.Stderr, " git checkout --ours .beads/beads.jsonl && bd import -i .beads/beads.jsonl\n")
|
||||
fmt.Fprintf(os.Stderr, " git checkout --theirs .beads/beads.jsonl && bd import -i .beads/beads.jsonl\n\n")
|
||||
fmt.Fprintf(os.Stderr, " git checkout --ours .beads/issues.jsonl && bd import -i .beads/issues.jsonl\n")
|
||||
fmt.Fprintf(os.Stderr, " git checkout --theirs .beads/issues.jsonl && bd import -i .beads/issues.jsonl\n\n")
|
||||
fmt.Fprintf(os.Stderr, "For advanced field-level merging, see: https://github.com/neongreen/mono/tree/main/beads-merge\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ func runContributorWizard(ctx context.Context, store storage.Storage) error {
|
||||
return fmt.Errorf("failed to create .beads in planning repo: %w", err)
|
||||
}
|
||||
|
||||
// Create issues.jsonl
|
||||
jsonlPath := filepath.Join(beadsDir, "beads.jsonl")
|
||||
// Create issues.jsonl (canonical name, bd-6xd)
|
||||
jsonlPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
// #nosec G306 -- planning repo JSONL must be shareable across collaborators
|
||||
if err := os.WriteFile(jsonlPath, []byte{}, 0644); err != nil {
|
||||
return fmt.Errorf("failed to create issues.jsonl: %w", err)
|
||||
@@ -183,8 +183,8 @@ Created by: bd init --contributor
|
||||
fmt.Printf("\n%s %s\n\n", green("✓"), bold("Contributor setup complete!"))
|
||||
|
||||
fmt.Println("Configuration:")
|
||||
fmt.Printf(" Current repo issues: %s\n", cyan(".beads/beads.jsonl"))
|
||||
fmt.Printf(" Planning repo issues: %s\n", cyan(filepath.Join(planningPath, ".beads/beads.jsonl")))
|
||||
fmt.Printf(" Current repo issues: %s\n", cyan(".beads/issues.jsonl"))
|
||||
fmt.Printf(" Planning repo issues: %s\n", cyan(filepath.Join(planningPath, ".beads/issues.jsonl")))
|
||||
fmt.Println()
|
||||
fmt.Println("How it works:")
|
||||
fmt.Println(" • Issues you create will route to the planning repo")
|
||||
|
||||
@@ -177,8 +177,8 @@ func TestAutoFlushJSONLContent(t *testing.T) {
|
||||
|
||||
dbPath = filepath.Join(tmpDir, "test.db")
|
||||
// The actual JSONL path - findJSONLPath() will determine this
|
||||
// but in tests it appears to be issues.jsonl in the same directory as the db
|
||||
expectedJSONLPath := filepath.Join(tmpDir, "beads.jsonl")
|
||||
// bd-6xd: Default is now issues.jsonl (canonical name)
|
||||
expectedJSONLPath := filepath.Join(tmpDir, "issues.jsonl")
|
||||
|
||||
// Create store
|
||||
testStore := newTestStore(t, dbPath)
|
||||
|
||||
@@ -93,7 +93,7 @@ Vendored into bd with permission.`,
|
||||
|
||||
func cleanupMergeArtifacts(outputPath string, debug bool) {
|
||||
// Determine the .beads directory from the output path
|
||||
// outputPath is typically .beads/beads.jsonl
|
||||
// outputPath is typically .beads/issues.jsonl
|
||||
beadsDir := filepath.Dir(outputPath)
|
||||
|
||||
if debug {
|
||||
|
||||
@@ -50,7 +50,7 @@ func ensureDatabaseFresh(ctx context.Context) error {
|
||||
"hasn't been imported yet. This would cause you to see stale/incomplete data.\n\n"+
|
||||
"To fix:\n"+
|
||||
" bd sync --import-only # Import JSONL updates to database\n"+
|
||||
" bd import -i .beads/beads.jsonl # Alternative: specify file explicitly\n\n"+
|
||||
" bd import -i .beads/issues.jsonl # Alternative: specify file explicitly\n\n"+
|
||||
"If in a sandboxed environment (e.g., Codex) where daemon can't be stopped:\n"+
|
||||
" bd --sandbox ready # Use direct mode (no daemon)\n"+
|
||||
" bd ready --allow-stale # Skip staleness check (use with caution)\n\n"+
|
||||
|
||||
@@ -169,7 +169,7 @@ Examples:
|
||||
},
|
||||
}
|
||||
|
||||
// getGitActivity calculates activity stats from git log of beads.jsonl
|
||||
// getGitActivity calculates activity stats from git log of issues.jsonl
|
||||
func getGitActivity(hours int) *RecentActivitySummary {
|
||||
activity := &RecentActivitySummary{
|
||||
HoursTracked: hours,
|
||||
@@ -177,7 +177,7 @@ func getGitActivity(hours int) *RecentActivitySummary {
|
||||
|
||||
// Run git log to get patches for the last N hours
|
||||
since := fmt.Sprintf("%d hours ago", hours)
|
||||
cmd := exec.Command("git", "log", "--since="+since, "--numstat", "--pretty=format:%H", ".beads/beads.jsonl") // #nosec G204 -- bounded arguments for local git history inspection
|
||||
cmd := exec.Command("git", "log", "--since="+since, "--numstat", "--pretty=format:%H", ".beads/issues.jsonl") // #nosec G204 -- bounded arguments for local git history inspection
|
||||
|
||||
output, err := cmd.Output()
|
||||
if err != nil {
|
||||
@@ -213,7 +213,7 @@ func getGitActivity(hours int) *RecentActivitySummary {
|
||||
}
|
||||
|
||||
// Get detailed diff to analyze changes
|
||||
cmd = exec.Command("git", "log", "--since="+since, "-p", ".beads/beads.jsonl") // #nosec G204 -- bounded arguments for local git history inspection
|
||||
cmd = exec.Command("git", "log", "--since="+since, "-p", ".beads/issues.jsonl") // #nosec G204 -- bounded arguments for local git history inspection
|
||||
output, err = cmd.Output()
|
||||
if err != nil {
|
||||
return nil
|
||||
|
||||
@@ -1045,9 +1045,9 @@ func showSyncStatus(ctx context.Context) error {
|
||||
fmt.Print(string(logOutput))
|
||||
}
|
||||
|
||||
// Show file diff for .beads/beads.jsonl
|
||||
fmt.Println("\nFile differences in .beads/beads.jsonl:")
|
||||
diffCmd := exec.CommandContext(ctx, "git", "diff", currentBranch+"..."+syncBranch, "--", ".beads/beads.jsonl")
|
||||
// Show file diff for .beads/issues.jsonl
|
||||
fmt.Println("\nFile differences in .beads/issues.jsonl:")
|
||||
diffCmd := exec.CommandContext(ctx, "git", "diff", currentBranch+"..."+syncBranch, "--", ".beads/issues.jsonl")
|
||||
diffOutput, err := diffCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
// diff returns non-zero when there are differences, which is fine
|
||||
|
||||
@@ -186,10 +186,10 @@ func findSubstring(haystack, needle string) int {
|
||||
}
|
||||
|
||||
// findActualJSONLFile scans .beads/ for the actual JSONL file in use.
|
||||
// Prefers beads.jsonl over issues.jsonl, skips backups and merge artifacts.
|
||||
// Prefers issues.jsonl over beads.jsonl (canonical name), skips backups and merge artifacts.
|
||||
// Returns empty string if no JSONL file is found.
|
||||
//
|
||||
// bd-afd: Auto-detect JSONL file to prevent metadata.json mismatches
|
||||
// bd-6xd: Auto-detect JSONL file to prevent metadata.json mismatches
|
||||
func findActualJSONLFile(beadsDir string) string {
|
||||
entries, err := os.ReadDir(beadsDir)
|
||||
if err != nil {
|
||||
@@ -225,14 +225,14 @@ func findActualJSONLFile(beadsDir string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Prefer beads.jsonl over issues.jsonl (canonical name)
|
||||
// bd-6xd: Prefer issues.jsonl over beads.jsonl (canonical name)
|
||||
for _, name := range candidates {
|
||||
if name == "beads.jsonl" {
|
||||
if name == "issues.jsonl" {
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to first candidate (including issues.jsonl if present)
|
||||
// Fall back to first candidate (including beads.jsonl as legacy)
|
||||
return candidates[0]
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ func FindBeadsDir() string {
|
||||
|
||||
// FindJSONLPath returns the expected JSONL file path for the given database path.
|
||||
// It searches for existing *.jsonl files in the database directory and returns
|
||||
// the first one found, preferring beads.jsonl over issues.jsonl (bd-afd).
|
||||
// the first one found, preferring issues.jsonl over beads.jsonl (bd-6xd).
|
||||
//
|
||||
// This function does not create directories or files - it only discovers paths.
|
||||
// Use this when you need to know where bd stores its JSONL export.
|
||||
@@ -275,18 +275,18 @@ func FindJSONLPath(dbPath string) string {
|
||||
pattern := filepath.Join(dbDir, "*.jsonl")
|
||||
matches, err := filepath.Glob(pattern)
|
||||
if err == nil && len(matches) > 0 {
|
||||
// bd-afd: Prefer beads.jsonl over issues.jsonl (canonical name)
|
||||
// bd-6xd: Prefer issues.jsonl over beads.jsonl (canonical name)
|
||||
for _, match := range matches {
|
||||
if filepath.Base(match) == "beads.jsonl" {
|
||||
if filepath.Base(match) == "issues.jsonl" {
|
||||
return match
|
||||
}
|
||||
}
|
||||
// Return the first .jsonl file found if beads.jsonl not present
|
||||
// Return the first .jsonl file found if issues.jsonl not present
|
||||
return matches[0]
|
||||
}
|
||||
|
||||
// bd-afd: Default to beads.jsonl (was issues.jsonl)
|
||||
return filepath.Join(dbDir, "beads.jsonl")
|
||||
// bd-6xd: Default to issues.jsonl (canonical name)
|
||||
return filepath.Join(dbDir, "issues.jsonl")
|
||||
}
|
||||
|
||||
// DatabaseInfo contains information about a discovered beads database
|
||||
|
||||
@@ -168,9 +168,9 @@ func TestFindJSONLPathDefault(t *testing.T) {
|
||||
// Create a fake database path (no .jsonl files exist)
|
||||
dbPath := filepath.Join(tmpDir, "test.db")
|
||||
|
||||
// Should return default beads.jsonl
|
||||
// bd-6xd: Should return default issues.jsonl (canonical name)
|
||||
result := FindJSONLPath(dbPath)
|
||||
expected := filepath.Join(tmpDir, "beads.jsonl")
|
||||
expected := filepath.Join(tmpDir, "issues.jsonl")
|
||||
if result != expected {
|
||||
t.Errorf("Expected '%s', got '%s'", expected, result)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type Config struct {
|
||||
func DefaultConfig() *Config {
|
||||
return &Config{
|
||||
Database: "beads.db",
|
||||
JSONLExport: "beads.jsonl", // Default to canonical name (was issues.jsonl)
|
||||
JSONLExport: "issues.jsonl", // Canonical name (bd-6xd)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ func TestDefaultConfig(t *testing.T) {
|
||||
t.Errorf("Database = %q, want beads.db", cfg.Database)
|
||||
}
|
||||
|
||||
// bd-afd: Default changed from issues.jsonl to beads.jsonl (canonical name)
|
||||
if cfg.JSONLExport != "beads.jsonl" {
|
||||
t.Errorf("JSONLExport = %q, want beads.jsonl", cfg.JSONLExport)
|
||||
// bd-6xd: issues.jsonl is the canonical name
|
||||
if cfg.JSONLExport != "issues.jsonl" {
|
||||
t.Errorf("JSONLExport = %q, want issues.jsonl", cfg.JSONLExport)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -877,7 +877,7 @@ func checkGitHistoryForDeletions(beadsDir string, ids []string) []string {
|
||||
}
|
||||
repoRoot := strings.TrimSpace(string(output))
|
||||
|
||||
// Compute relative path from repo root to beads.jsonl
|
||||
// Compute relative path from repo root to issues.jsonl
|
||||
// beadsDir is absolute, compute its path relative to repoRoot
|
||||
absBeadsDir, err := filepath.Abs(beadsDir)
|
||||
if err != nil {
|
||||
@@ -889,8 +889,8 @@ func checkGitHistoryForDeletions(beadsDir string, ids []string) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build JSONL path relative to repo root
|
||||
jsonlPath := filepath.Join(relBeadsDir, "beads.jsonl")
|
||||
// Build JSONL path relative to repo root (bd-6xd: issues.jsonl is canonical)
|
||||
jsonlPath := filepath.Join(relBeadsDir, "issues.jsonl")
|
||||
|
||||
var deleted []string
|
||||
|
||||
@@ -921,7 +921,7 @@ const gitHistoryTimeout = 30 * time.Second
|
||||
// The caller is responsible for confirming the ID is NOT currently in JSONL
|
||||
// to determine that it was deleted (vs still present).
|
||||
func wasEverInJSONL(repoRoot, jsonlPath, id string) bool {
|
||||
// git log --all -S "\"id\":\"bd-xxx\"" --oneline -- .beads/beads.jsonl
|
||||
// git log --all -S "\"id\":\"bd-xxx\"" --oneline -- .beads/issues.jsonl
|
||||
// This searches for commits that added or removed the ID string
|
||||
// Note: -S uses literal string matching, not regex, so no escaping needed
|
||||
searchPattern := fmt.Sprintf(`"id":"%s"`, id)
|
||||
|
||||
Reference in New Issue
Block a user