oficina / docs Public

Live push slice 1a: rule 1 is per handle, not per document (#174 delta 3)

When an entry leaves the map while held, a new POST makes a new entry, so
two POSTs to one document can run on separate handles; rule 3's MAX(seq)
check inside the transaction is what keeps that correct. The comment said
one POST at a time per document.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev b9bae9d3ef855e5aa1f9e682d0a47346531c91ba parent 42f0b91
1 file changed, +6 −2
  • internal/docs/warm.go +6 −2
diff --git a/internal/docs/warm.go b/internal/docs/warm.go
index 6635568..15269fb 100644
--- a/internal/docs/warm.go
+++ b/internal/docs/warm.go
@@ -12,9 +12,13 @@ package docs
//
// The rules, each of which some test in warm_test.go holds:
//
-// 1. One POST at a time per document: the entry's mutex is held from the
+// 1. One POST at a time per handle: the entry's mutex is held from the
// Apply to the commit. POSTs to one document already serialise on the
-// single SQLite writer, so this costs nothing.
+// single SQLite writer, so this costs nothing. It is per handle, not per
+// document: when an entry leaves the map while held (a drop, an
+// eviction), a new POST makes a new entry, so two POSTs to one document
+// can run on separate handles. Rule 3's MAX(seq) check inside the
+// transaction is what keeps that correct; the one that loses is dropped.
// 2. Applied before the transaction, as the replayed handle always was.
// Any error from Apply drops the handle. A rejection answers 400 as
// before; it is not clean, since a refused update can leave its earlier