~bigbes/sr-ht-spec: b217c7a7

refactor: move the reconciler's two deletes down to the layers that own them

The reconciler reached past its layer twice, because the primitives it
needed did not exist: a raw DELETE FROM proposal — the only SQL written
outside db/ — and a go-git RemoveReference under gitx's write lock. Both
move down, with no change in behaviour.

db.Store.DeleteOpenProposal keeps the guard in the statement, as
resolveProposal does, and distinguishes the two ways it can bite: a row
that is gone is ErrNotFound, a row that has been resolved is the new
ErrProposalNotOpen, which tells the reconciler "nothing to repair" apart
from "the repair no longer applies".

gitx.Repo.DeleteProposalBranch refuses anything outside proposals/* —
the only thing between a caller bug and a deleted approved branch — takes
the per-space write lock like every other write, and treats an
already-absent branch as success: the repair is a postcondition, and the
ref may legitimately vanish between the listing that found it and the
delete.

Eugene Blikh <bigbes@gmail.com> — 2026-07-22 11:15:28 UTC

Commit b217c7a76bcbba9b449218e310a2be76f99479caview raw patch

Parent(s): 0780b4cc

6 changed file(s)

FileStatus+
db/proposal.go M +49
db/proposal_test.go M +55
db/store.go M +7
gitx/write.go M +41
gitx/write_test.go M +46
service/reconcile.go M +8 -52