beads/internal
CI Bot 37d3f6b98b fix(bd): commit-ordered gapless journal seq + structural coverage guards + delete/doc fixes
The mutations journal was durable and coverage-symmetric, but several
correctness/robustness gaps remained. This addresses them.

seq is no longer AUTO_INCREMENT. AUTO_INCREMENT assigns at INSERT, not at
commit, so under concurrent transactions (the shared SQL server) commit-
visibility order can invert seq order and a consumer tailing WHERE seq > cursor
permanently skips a lower seq that commits after a higher one is visible;
rolled-back transactions also burn seqs. seq is now drawn from a single-row
counter table (bd_mutations_seq) incremented inside the mutation's own
transaction, at the ONE shared seam (issueops.insertMutationRow) both write
plumbings funnel through. The shared counter row makes concurrent allocators
conflict, so exactly one commit order survives; surviving seqs are gapless and
commit-ordered, and a rolled-back allocator burns no seq. The counter table is
dolt_ignore'd (same working-set locality as the journal) and seeded past the
journal high-water mark, so seq never resets across prune or restart.

Empirically verified in bd's actual deferred-commit model on BOTH concurrency
models: the Dolt SQL server resolves overlapping counter writers optimistically
and aborts the loser with a serialization error (retried by the write paths),
while the embedded engine serializes writers on the counter row. Two overlapping
transactions yield seq order == commit-visibility order with no gaps and no
duplicates; the guarantee holds even on dolt_ignore'd tables. The safety
property is unconditional: a committed seq=N implies its transaction read
counter=N-1, which required seq=N-1's transaction to have already committed.

Completeness guards are now STRUCTURAL, not name-based. They detect a mutator by
the DML it executes against a work-bead table (literal or templated table name),
not by a verb regex or a broad "Insert" coverage token, so a mutator named off-
pattern can no longer ship un-journaled. Shared static-analysis primitives live
in internal/storage/journalscan. Comment writes (a work-bead mutation) now
journal as an update on both seams, and the guards cover the comment receiver.

Phantom deletes fixed: the bulk delete paths (issueops.DeleteIssuesInTx and the
uow DeleteByIDs) journaled a delete for every requested id even when the id
removed no row (only the batch total was checked). They now journal a delete
only for ids that actually removed a row, matched by an in-transaction existence
read.

Docs: ts is documented as insert time stamped inside the committing transaction
(it always was); seq as counter-assigned/gapless/commit-ordered. The CLI help
now states that raw `bd sql` DML is not journaled, that the journal is per-branch
working-set state, and that prune retain floors are time/rows based rather than a
consumer watermark (a lagging consumer can be pruned past). The prune-floor
orchestration is consolidated into one helper (issueops.ComputeMutationsPruneWhere)
used by both the DBTX and proxied raw-SQL prune paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 17:22:38 +00:00
..
ado fix(ado): preserve unmanaged links on push instead of clobbering them (#4523) 2026-07-05 10:53:05 -07:00
atomicfile /internal/atomicfile/atomicfile.go: use io.Copy 2026-05-01 17:03:30 -07:00
audit fix(audit): make JSONL sidecar opt-in (#4688) 2026-07-11 00:09:17 -07:00
beads test: reconcile the sqlite-era tests the reapply left asserting live support 2026-07-18 02:43:57 +00:00
compact fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
config bd: transactional mutations journal + hooks on both write plumbings 2026-07-20 04:20:15 +00:00
configfile refactor(storage)!: remove the SQLite backend and dialect 2026-07-18 02:43:56 +00:00
creds fix(backends): address red-team review findings before merge 2026-07-10 18:58:00 +00:00
debug feat(verbosity): wire --quiet into create/close/update (bd-au0.10) (#4058) 2026-07-06 22:35:42 -07:00
doltremote fix(doltremote): fold host case, strip creds, recognize user-less SCP in CanonicalForComparison (#4576) 2026-07-07 12:59:18 -07:00
doltserver /{cmd,internal}: migration commands for server to proxied server 2026-07-13 13:23:47 -07:00
formula feat(formula): make primitives discoverable to coding agents (GH#3621) (#3781) 2026-07-06 22:26:41 -07:00
git fix: anchor jj-secondary role resolution at repoPath, not cwd 2026-06-04 15:00:30 -07:00
github fix(github) bd github sync (GitHub issues integration) (#3929) 2026-05-15 08:47:39 -07:00
gitlab feat(gitlab): sync issue dependency links on push (#4294) 2026-07-08 08:00:41 -07:00
hooks test: port Windows hardening fixes (#4600) 2026-07-07 12:59:50 -07:00
idgen fix(idgen): correct test vectors in hash_test.go 2025-12-19 18:13:56 -08:00
jira feat(unclaim): add --if-assignee conditional release (CAS inverse of claim) (#4727) 2026-07-18 03:23:13 -07:00
linear fix(linear): arm rate-limit breaker after successful calls (#4778) 2026-07-14 13:13:52 -07:00
lockfile Triage and clean up an unreviewed automated commit stream on main (#4418) 2026-06-15 20:24:57 -07:00
metrics fix(metrics): maintainer adoption fixes for usage-metrics + RunE refactor 2026-06-22 20:44:48 +00:00
molecules fix: materialize local table schemas for branch tests (#4014) 2026-05-19 09:22:35 -07:00
notion fix(notion): drop in_trash from data-source query body (Notion 400) (#4543) 2026-07-05 10:53:01 -07:00
query fix(query): lex digit-led identifier-shaped tokens as identifiers (#4403) 2026-07-05 11:15:15 -07:00
recipes docs: fix integration-page fact errors; restore three lost source edits 2026-07-12 10:37:18 -07:00
remotecache fix: pass remote auth user during clone (#4484) 2026-07-05 11:28:24 -07:00
routing fix: anchor jj-secondary role resolution at repoPath, not cwd 2026-06-04 15:00:30 -07:00
storage fix(bd): commit-ordered gapless journal seq + structural coverage guards + delete/doc fixes 2026-07-20 17:22:38 +00:00
telemetry feat(unclaim): add --if-assignee conditional release (CAS inverse of claim) (#4727) 2026-07-18 03:23:13 -07:00
templates fix(cli): printed doc paths point at the new docs locations 2026-07-12 10:37:17 -07:00
testutil /{.github,docs,engdocs,go,internal,scripts}: bump dolt 2026-07-15 13:14:34 -07:00
timeparsing chore: unexport 14 dead symbols across 8 packages 2026-02-07 09:24:22 -08:00
tracker fix(tracker): gate externalRefChangedAfter on capability, not DB() presence (#4549) (#4734) 2026-07-12 14:12:54 -07:00
types feat(leases): move leases to ephemeral dolt_ignored leases table (bd-lrgn1) 2026-07-17 01:02:29 -07:00
ui test(cli): cover --no-color flag handling and ui.DisableColors 2026-07-07 23:32:22 -04:00
uimd fix(cli): render markdown with terminal capability gates (#3881) 2026-06-25 13:55:28 -07:00
utils Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
validation feat(lint): accept Acceptance Criteria heading for epics (#3834) 2026-07-07 23:00:30 -04:00