* fix(defer): auto-wake expired dated defers on ready-front reads and claims (bd-i8qx8)
A dated defer (bd defer --until / bd update --defer) sets status=deferred
plus defer_until, but nothing ever flipped the status back — the ready
WHERE clause's defer_until predicate only helps rows already 'open', so an
expired defer stayed invisible to bd ready forever until a human ran bd
undefer. One deployment measured 241 issues (24 P1s in the first census)
silently dark this way, regenerating ~11/day from correct-looking
automation ('needs-design cooldown' call sites that defer +7d).
Fix: a lazy wake sweep (issueops.WakeExpiredDefersInTx, one shared DBTX
body serving both storage stacks, shaped after ReclaimExpiredLeasesInTx)
runs at the top of every ready-front read and claim:
- classic dolt server store: GetReadyWork/WithCounts/CountReadyWork and
readyClaimer.ClaimNext, via runIssueOperationTxWithMessage in a write tx
of its own (the read paths' withReadTx always rolls back)
- embedded store: same three seams plus its readyClaimer
- domain/uow stack (proxied CLI + bd serve): uow.WakeExpiredDefers in a
committing UOW before Reader.Ready, Reader.List(--ready), the proxied
CLI ready route, and uow readyClaimer.ClaimNext
Waking writes status=open, defer_until=NULL — byte-identical to bd
undefer, so a later dateless re-defer cannot inherit a stale past date —
and records a status_changed event (actor bd-defer-wake). A DATELESS
defer never auto-wakes: it is the indefinite icebox, and bd undefer stays
its only exit. The sweep is RowsAffected-gated (zero matches ⇒ no dolt
commit), advisory by contract (a ready listing never fails because the
sweep could not run; strict --readonly skips it), and covers wisps
(dolt_ignored, so wisp wakes mint no version commit by construction).
Tests: TestEmbeddedDeferAutoWake (wake/icebox/future/claimable) and
TestProxiedServerDeferAutoWake (parity subtest), green alongside the
existing defer/undefer/ready embedded and proxied suites.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: auto-regenerate CLI reference
Applied from the cli-docs-freshness-patch artifact of https://github.com/gastownhall/beads/actions/runs/31145176188
(generated with CI's canonical pinned build). See
scripts/check-cli-docs-drift.sh for how drift is attributed.
* fix(defer): persist wisp-only wakes in the uow stack; warn-once on access-denied (bd-i8qx8)
The uow sweep discarded wisp-only wakes: the repo returned only the
permanent-issue count, a wisp-only sweep produced commitMsg == "",
RunTxResult skipped Commit, and Close rolled the transaction back —
expired wisp defers stayed deferred forever in proxied/serve mode while
embedded mode woke them, and every ready read redid and re-discarded the
same writes. A wake commit message would not have fixed it: wisp tables
are dolt_ignored, so DOLT_COMMIT errors nothing-to-commit and the tx
still rolls back.
WakeExpiredDefers now reports (issues, wisps) through the repo and use
case; the uow sweep commits with the wake message when permanent issues
woke, and persists a wisp-only wake via uw.Commit(ctx, "") — the
ephemeral plain-COMMIT form RunTxEphemeral keeps for dolt_ignored state.
Wisp parity subtests added to both the embedded and proxied defer
auto-wake tests.
Also: dberrors.IsAccessDenied classifier + warn-once handling in both
defer-wake advisory handlers, so a read-only-privileged client gets one
warning per process instead of one per bd ready.
* ci: trigger runs for 0a94d44f4 (empty)
* test(defer): teach the ready-surface test fixtures about the wake sweep (bd-i8qx8)
Three fixtures pinned the pre-sweep ready path and broke against it:
- readerIssues and recordingIssues embed a nil domain.IssueUseCase and
stub only the read methods, so the sweep's promoted WakeExpiredDefers
call segfaulted (surfacing as a 500 on every httpapi ready-surface
test). Both now stub a no-op sweep.
- The reader-parity fixture's provider pool held one unit of work; the
ready arm now opens two (sweep, then read span), and past the pool the
mock provider hands out zero-valued units. The pool holds both.
- TestAReadRouteTimesTheUnitsOfWorkItsReaderOpens counted exactly one
unit of work; the count is now two, and both still land in uow_ms,
which is the property the test exists to pin.
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>