Fixes data-loss: exports now retain comment bodies. Import dedup now includes comment text to prevent same-second collision. Conflict in export.go resolved (allComments→commentsMap). Thanks to the contributor!
Co-authored-by: sms <223721492+s070681@users.noreply.github.com>
Separates two concerns bundled by --ephemeral: skipping Dolt commit
history and GC eligibility. NoHistory beads route to wisps table
(no DOLT_COMMIT) but remain non-GC-eligible. Fixes agent identity
beads being incorrectly garbage collected.
Also adds --exclude-type to wisp gc, --type filter to wisp list,
and fixes ExcludeTypes self-join subquery.
Closes#2619
PR: https://github.com/steveyegge/beads/pull/2622
Author: mmlac
Separates "no git history" from "garbage-collectible" for beads stored in the
wisps table. Previously --ephemeral bundled both behaviors, causing agent identity
beads to be incorrectly GC'd.
Changes:
- Add NoHistory field to types.Issue and wisps/issues schema (migration 011)
- Route NoHistory issues to wisps table, skip DOLT_COMMIT, but leave ephemeral=0
- Wire --no-history flag in bd create and bd update (with --history to undo)
- Add --exclude-type flag to bd mol wisp gc
- Add --type filter flag to bd mol wisp list
- Include type and labels in wisp list JSON output
- Move ephemeral/no-history mutual exclusion to validation layer
- Migrate issues between tables when --no-history/--ephemeral set on update
- Fix ExcludeTypes filter self-join subquery inefficiency
- Ensure JSONL export/import roundtrip preserves no_history
- Remove dead AllEphemeral function (superseded by AllWisps)
- Comprehensive test coverage for all new flags and edge cases
Resolves: steveyegge/beads#2619
Refs: steveyegge/gastown#2768
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follow-up to 1ce765ee (UUID primary keys for federation-safe events).
The core migration changed types and schema, but many files still
referenced the old AUTO_INCREMENT design. This commit makes the
codebase internally consistent:
- Update embedded Dolt schema SQL files to use CHAR(36) UUID PKs
- Fix backup restore: json.Number -> string for UUID event/comment IDs
(fixes TestBackupRestoreRoundTrip)
- Remove dead LastEventID field from backup state (never set)
- Update comments in issueops/create.go, import test, git_remote_test
- Update docs/audit-sync-mode-complexity.md (mark auto-increment resolved)
- Update version history in info.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PersistComments uses an auto-increment PK, so ON DUPLICATE KEY UPDATE
never fires — every re-import blindly creates duplicate comment rows.
Fix: check for existing identical comment (same issue_id, author,
created_at) before inserting. Skip if already present.
Adds regression test: re-import with comments must not duplicate them.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>