bd sync: 2025-11-26 22:46:36

This commit is contained in:
Steve Yegge
2025-11-26 22:46:36 -08:00
parent b5e58b0814
commit dfc68ed8f6

View File

@@ -14,7 +14,7 @@
{"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-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-8an","title":"bd import auto-detects wrong prefix from directory name instead of issue IDs","description":"When importing issues.jsonl into a fresh database, 'bd import' prints:\n\n ✓ Initialized database with prefix 'beads' (detected from issues)\n\nBut the issues all have prefix 'bd-' (e.g., bd-03r). It appears to be detecting the prefix from the directory name (.beads/) rather than from the actual issue IDs in the JSONL.\n\nThis causes import to fail with:\n validate ID prefix for bd-03r: issue ID 'bd-03r' does not match configured prefix 'beads'\n\nWorkaround: Run 'bd config set issue_prefix bd' before import, or use 'bd init --prefix bd'.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-11-26T22:28:01.582564-08:00","updated_at":"2025-11-26T22:28:01.582564-08:00"}
{"id":"bd-8an","title":"bd import auto-detects wrong prefix from directory name instead of issue IDs","description":"When importing issues.jsonl into a fresh database, 'bd import' prints:\n\n ✓ Initialized database with prefix 'beads' (detected from issues)\n\nBut the issues all have prefix 'bd-' (e.g., bd-03r). It appears to be detecting the prefix from the directory name (.beads/) rather than from the actual issue IDs in the JSONL.\n\nThis causes import to fail with:\n validate ID prefix for bd-03r: issue ID 'bd-03r' does not match configured prefix 'beads'\n\nWorkaround: Run 'bd config set issue_prefix bd' before import, or use 'bd init --prefix bd'.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T22:28:01.582564-08:00","updated_at":"2025-11-26T22:45:13.312594-08:00","closed_at":"2025-11-26T22:45:13.312594-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-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"}
@@ -56,5 +56,5 @@
{"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":"closed","priority":3,"issue_type":"task","created_at":"2025-11-20T18:55:53.259144-05:00","updated_at":"2025-11-26T22:25:57.772875-08:00","closed_at":"2025-11-26T22:25:57.772875-08: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-zai","title":"bd init resets metadata.json jsonl_export to beads.jsonl, ignoring existing issues.jsonl","description":"When running 'bd init --prefix bd' in a repo that already has .beads/issues.jsonl, the init command overwrites metadata.json and sets jsonl_export back to 'beads.jsonl' instead of detecting and respecting the existing issues.jsonl file.\n\nSteps to reproduce:\n1. Have a repo with .beads/issues.jsonl (canonical) and metadata.json pointing to issues.jsonl\n2. Delete beads.db and run 'bd init --prefix bd'\n3. Check metadata.json - it now says jsonl_export: beads.jsonl\n\nExpected: Init should detect existing issues.jsonl and use it.\n\nWorkaround: Manually edit metadata.json after init.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-11-26T22:27:41.653287-08:00","updated_at":"2025-11-26T22:27:41.653287-08:00"}
{"id":"bd-zai","title":"bd init resets metadata.json jsonl_export to beads.jsonl, ignoring existing issues.jsonl","description":"When running 'bd init --prefix bd' in a repo that already has .beads/issues.jsonl, the init command overwrites metadata.json and sets jsonl_export back to 'beads.jsonl' instead of detecting and respecting the existing issues.jsonl file.\n\nSteps to reproduce:\n1. Have a repo with .beads/issues.jsonl (canonical) and metadata.json pointing to issues.jsonl\n2. Delete beads.db and run 'bd init --prefix bd'\n3. Check metadata.json - it now says jsonl_export: beads.jsonl\n\nExpected: Init should detect existing issues.jsonl and use it.\n\nWorkaround: Manually edit metadata.json after init.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T22:27:41.653287-08:00","updated_at":"2025-11-26T22:44:57.25382-08:00","closed_at":"2025-11-26T22:44:57.25382-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"}