Skip to content

Conversation

@myleshenderson
Copy link

@myleshenderson myleshenderson commented Jan 24, 2026

Summary

  • Add GetAllEventsSince(ctx, sinceID) to the Storage interface with SQLite, Dolt, and Memory implementations
  • Create exportEventsToJSONL which appends new events as JSON lines using a high-water mark (events_last_exported_id metadata)
  • Hook into daemon_sync and autoflush, guarded by events.export config key (opt-in)
  • Add events.jsonl to git sync file list
  • Add --events and --events-reset flags to bd export command
  • Include test verifying all event table columns are returned

Configuration

Enable with events.export: true in .beads/config.yaml. The bd export --events flag works regardless of config.

Test plan

  • go build ./... passes
  • go test ./internal/storage/... passes (all backends)
  • TestGetAllEventsSinceReturnsAllColumns verifies all columns are returned
  • Manual: enable events.export: true, create/update issues, verify events.jsonl is populated
  • Manual: bd export --events works without config set
  • Manual: bd export --events-reset clears state and truncates file

Tickets: bd-w9f, bd-8fq, bd-w9w, bd-1ai, bd-2qd, bd-b22, bd-mmc, bd-3pc

🤖 Generated with Claude Code

Add GetAllEventsSince to the Storage interface and implement it in
SQLite, Dolt, and Memory backends. Create exportEventsToJSONL which
reads events_last_exported_id from metadata, fetches new events, appends
them as JSON lines, and updates the high-water mark.

Hook the events export into daemon_sync and autoflush, guarded by
config.GetBool("events.export") so it's opt-in. Add events.jsonl to
the sync file list in gitCommitBeadsDir. Add --events and --events-reset
flags to the export command (always available regardless of config).

Include a test verifying GetAllEventsSince returns all event columns.

Tickets: bd-w9f, bd-8fq, bd-w9w, bd-1ai, bd-2qd, bd-b22, bd-mmc, bd-3pc
The events.jsonl file uses 0644 permissions (matching issues.jsonl)
since it needs to be readable by other tools and git.

Ticket: bd-gdw
Satisfies gosec G302 lint check. Git normalizes permissions on
checkout anyway, so this only affects the local write.

Ticket: bd-gdw
Add commented-out example for the events.export option in both the
init template (for new projects) and the repo config.yaml.
Matches the doc comment style used in SQLite and Dolt implementations.
Viper uses "." as a nested key delimiter, so "events.export" would
look for nested YAML (events: { export: true }) instead of the flat
key. Use hyphenated "events-export" to match existing conventions
(no-auto-flush, no-auto-import, etc.).

Also registers the default in config.go.

Ticket: bd-v2x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant