beads/internal/storage
Steve Yegge 144876baab feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5)
Federation ask #3. Resolving a halted merge meant dropping into the raw dolt
CLI inside .beads/dolt/<db> — dolt conflicts cat issues, dolt conflicts resolve
--ours|--theirs issues, dolt add -A && dolt commit — dolt arcana whose flag
surface differs from git's just enough to bite. This wraps it in bd, presented
per issue FIELD rather than as raw conflict rows.

  bd conflicts list                     tables + conflicted issue IDs
  bd conflicts show [<id>]              base/ours/theirs per diverged field
  bd conflicts resolve <id> --ours      one issue, leaving the rest conflicted
  bd conflicts resolve --all --theirs   whole tables (dolt's own resolution)

Storage: storage.ConflictInspector is a new optional interface (GetConflictRows
/ ResolveConflictRows) implemented by both Dolt-backed stores over
versioncontrolops/conflicts.go, which folds dolt_conflicts_<table>'s
base_/our_/their_ columns into one row per conflict — generically, from the
result-set column names, so it does not rot on the next migration.

Per-row resolution follows dolt's manual-resolution protocol, the one
resolveIssuesLWWConflicts already proves: --ours deletes the conflict row (the
working set already holds our values), --theirs writes their values first and
then deletes it. It is restricted to modify/modify rows — when one side deleted
the row, "ours"/"theirs" do not describe what the operator wants, so it is
refused by name instead of guessed at.

Safety rails, several from the adversarial review of this diff:
- The CLI reaches the store through storage.UnwrapStore: store is always
  decorated (telemetry + hooks), and a decorator embedding the DoltStorage
  interface promotes only that interface's methods, so asserting on the wrapper
  would silently report "No merge conflicts" over a wedged merge.
- The merge is committed only when this invocation actually resolved something
  AND no conflict remains, via CommitMergeResolution (plain Commit excludes
  config, GH#2455/GH#2474). A partial resolution leaves the merge open.
- Server-mode resolution pins a connection and resets
  @@dolt_allow_commit_conflicts/@@dolt_force_transaction_commit before
  returning it to the pool, discarding the connection if the reset fails.
- A --theirs UPDATE that matches no row (concurrent delete on a shared server)
  aborts instead of clearing the conflict and dropping their side.
- Interpolated identifiers — table AND column — are validated; values are bound.

Follow-ups filed as wy-36ilm: a dolt-backed integration test (every test here
is a pure unit test, which is why the review's blocker was invisible to the
suite), a first-class way to conclude an already-resolved merge, and
schema-conflict/constraint-violation visibility in the commit gate.
2026-07-24 19:47:16 -07:00
..
conformance fix(lint): replace reclaim_scope eq closure with slices.Equal (gosec G602) (#5010) 2026-07-24 06:41:26 -07:00
contextinfo /{cmd,internal}: bd context proxied-server support 2026-06-24 13:04:48 -07:00
dberrors feat(engine): guarded write ops — atomic metadata merge, row-version CAS, typed dep errors + events, bd close delegation (#4911) 2026-07-21 18:13:03 -07:00
dbproxy Use Snappy output for Dolt garbage collection (#4986) 2026-07-23 08:55:29 -07:00
depid fix(deps): deterministic dependency primary keys for cross-clone merge-safety (#4259) 2026-06-07 14:47:58 -07:00
dolt feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5) 2026-07-24 19:47:16 -07:00
doltutil perf(dolt): eliminate 12s slow path on bd commands when .local_version is stale (#3710) 2026-07-24 00:53:06 -07:00
domain Merge pull request #4877 from anisoptera/feat/json-import-all-native-fields 2026-07-24 09:52:27 -07:00
embeddeddolt feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5) 2026-07-24 19:47:16 -07:00
fs /{cmd,internal}: refactoring 2026-05-19 15:37:37 -07:00
git /{cmd,internal}: refactoring 2026-05-19 15:37:37 -07:00
issueops Merge pull request #4877 from anisoptera/feat/json-import-all-native-fields 2026-07-24 09:52:27 -07:00
kvkeys fix(dolt): pre-pull commit must include config (kv.memory.* pull-wedge) (#4412) 2026-06-19 21:31:33 -07:00
rowid fix(schema): drop dormant DEFAULT (UUID()) from aux and wisp table ids (bd-2rd37) 2026-06-11 07:32:57 -04:00
schema Merge pull request #4877 from anisoptera/feat/json-import-all-native-fields 2026-07-24 09:52:27 -07:00
sqlbuild feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
uow feat: support compact/gc/ping/dolt clean-databases in proxied-server mode (#5003) 2026-07-23 22:42:02 -07:00
versioncontrolops feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5) 2026-07-24 19:47:16 -07:00
advanced_queries.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
annotation_queries.go Update internal/storage/annotation_queries.go 2026-03-06 15:40:56 -08:00
batch.go fix(import): equal-timestamp upsert keeps the local row; report what import changed (bd-hj85c) 2026-06-12 17:58:40 -04:00
bulk_issues.go feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
child_counter_reservation.go fix(create): commit labels during initial issue creation (#4149) 2026-05-24 19:23:46 -07:00
compaction.go fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
config_metadata.go feat: custom status categories (active/wip/done/frozen) 2026-03-21 12:35:03 -07:00
dependency_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
errors_unsupported.go Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
event_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
federation.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
history_viewer.go feat(storage): add ExternalRefHistoryQuerier capability for external-ref history (#4733) 2026-07-12 13:43:27 -07:00
hook_decorator.go feat(engine): guarded write ops — atomic metadata merge, row-version CAS, typed dep errors + events, bd close delegation (#4911) 2026-07-21 18:13:03 -07:00
hook_decorator_internal_test.go feat(engine): guarded write ops — atomic metadata merge, row-version CAS, typed dep errors + events, bd close delegation (#4911) 2026-07-21 18:13:03 -07:00
hook_decorator_test.go fix(telemetry): wire WrapStorage decorator into bd storage chain (#3858) 2026-07-06 22:27:32 -07:00
iter.go Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
merge_slot.go feat: add MergeSlot methods to Storage interface (fix-merge PR #2787) 2026-03-26 19:34:21 -07:00
metadata.go fix(query): make slash and mixed-case metadata keys queryable (#4896) 2026-07-24 17:52:22 -07:00
metadata_jsonpath_test.go fix(query): make slash and mixed-case metadata keys queryable (#4896) 2026-07-24 17:52:22 -07:00
metadata_schema_test.go feat: config-driven metadata schema enforcement (GH#1416 Phase 2) (#2027) 2026-02-24 22:24:56 -08:00
metadata_test.go feat: allow UpdateIssue metadata updates via json.RawMessage/[]byte (#1417) 2026-02-03 17:55:23 -08:00
remote.go feat: add --remote flag to bd dolt push/pull commands (#3211) 2026-04-20 18:02:33 -07:00
storage.go feat(update): conditional compare-and-set guards --if-assignee/--if-status (bd-wsqvw) (#5008) 2026-07-24 09:11:15 -07:00
sync.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
version_control.go feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5) 2026-07-24 19:47:16 -07:00
versioned.go feat(conflicts): bd conflicts list|show|resolve — issue-oriented merge conflicts (wy-jpd3.5) 2026-07-24 19:47:16 -07:00