beads/internal/config
matt wilkie 64e504d541
fix: enable auto-export by default and add init prompt (GH#2973) (#3204)
* fix: enable auto-export by default with canonical issues.jsonl name (GH#2973)

Users expected JSONL export to refresh automatically but export.auto
defaulted to false, requiring explicit opt-in. Also the default filename
(export.jsonl) didn't match the canonical issues.jsonl used in docs and
git hooks. Change defaults: export.auto=true, export.path=issues.jsonl,
export.git-add=true so viewers (bv) and git workflows see fresh data
without extra configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(init): add auto-export prompt and document export.* config (GH#2973)

Interactive bd init now asks whether to enable auto-export (default: yes).
Users can opt out during setup instead of discovering the setting later.

Also documents the export.* config namespace in bd config --help with
all four keys (export.auto, export.path, export.interval, export.git-add)
and adds export examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: document export.* auto-export config keys (GH#2973)

Document the export.auto/path/interval/git-add keys in docs/CONFIG.md
and note the default-on switch in CHANGELOG.md [Unreleased].

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(export): don't prime throttle on empty init and skip git-add without git (GH#2973)

Review feedback on #3204 surfaced two regressions in the default-on
auto-export path:

1. bd init's PersistentPostRun fired maybeAutoExport with zero issues,
   writing an empty .beads/issues.jsonl and saving export-state.json with
   the current dolt commit + timestamp. The next `bd create` was then
   throttled for up to export.interval (default 60s) because the
   timestamp check in maybeAutoExport returned before considering the new
   commit, leaving issues.jsonl stale on fresh repos.

   Skip saving state and remove the empty file when the export produced
   no issues and no memories. The next write runs a real export
   immediately.

2. export.git-add defaulting to true emitted
   `Warning: auto-export: git add failed: exit status 128` on every
   write in the supported standalone BEADS_DIR flow where init
   intentionally skips `git init`. Gate the git add call on isGitRepo()
   so standalone users get silent, working auto-export.

Adds a scripttest regression guard for the init -> immediate create
path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(memory): disable auto-export in concurrent test (GH#2973)

TestEmbeddedMemoryConcurrent started failing on this branch after
auto-export became the default: every concurrent 'bd remember'/'bd
forget' call now fires maybeAutoExport, which reads store state after
the write. Under 8-worker contention this intermittently leaves a
forgotten key visible to 'bd memories'.

The test exercises memory concurrency, not export behavior; opt it
out of auto-export so the signal stays focused. Followup: investigate
the race between write commit and post-write auto-export read in
embedded Dolt concurrent paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:02:58 -07:00
..
agents_file_test.go feat(init): add --agents-file flag to customize agent instructions filename 2026-03-22 11:17:43 -07:00
config.go fix: enable auto-export by default and add init prompt (GH#2973) (#3204) 2026-04-13 16:02:58 -07:00
config_test.go refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8) 2026-03-20 18:39:50 -07:00
permissions.go Enforce .beads/ directory permissions at runtime 2026-03-30 09:15:49 -07:00
permissions_test.go Enforce .beads/ directory permissions at runtime 2026-03-30 09:15:49 -07:00
permissions_windows.go Enforce .beads/ directory permissions at runtime 2026-03-30 09:15:49 -07:00
repos.go chore: add explanatory comments to silently ignored errors across codebase 2026-02-14 17:16:43 -08:00
repos_test.go fix: bd repo commands write to YAML and cleanup on remove (#683) 2025-12-22 01:26:45 -08:00
sync.go refactor: remove dead sync mode scaffolding (GH#2485) 2026-03-10 11:48:11 -07:00
sync_test.go refactor: remove dead sync mode scaffolding (GH#2485) 2026-03-10 11:48:11 -07:00
testmain_test.go refactor: clean up residual sync.mode references (PR #2661) 2026-03-18 12:07:13 -07:00
yaml_config.go feat(telemetry): add pool metrics for shared-server diagnosis (GH#3140) (#3172) 2026-04-10 20:31:54 -07:00
yaml_config_test.go fix: show diverged-history guidance on auto-push failure (#3138) 2026-04-08 15:55:37 -07:00