oficina / docs Public

Docs: AGENTS.md records the keepalive save and the SIGTERM drain

And names fixtures/build-bundles.mjs, which the gate runs, where it still
said build-editor.mjs (Claude Fable on #94).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev cc3589e17790e2859596f31f9dd4e9246461b30f parent ec6b7c7
1 file changed, +22 −1
  • AGENTS.md +22 −1
diff --git a/AGENTS.md b/AGENTS.md
index 5a72a7d..277ac95 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -264,7 +264,7 @@ convention, agreed 2026-08-31 between the three sessions then working in
this repo). `internal/docs/static/editor.<hash>.js` is a single
committed artifact whose name is the hash of its own contents, and
`assets.go` panics at init if it finds more or fewer than one. Two
-branches that both ran `fixtures/build-editor.mjs` therefore conflict
+branches that both ran `fixtures/build-bundles.mjs` therefore conflict
mechanically even when no source line overlaps. Whoever squash-merges
second discards their own bundle from the merge and re-runs the build on
top of `main`. Never reconcile the minified file by hand.
@@ -442,6 +442,27 @@ would have caught it.)
frozen into `static/` at scaffold time while the partials upgrade with the
module. `rastrillo doctor` will make this mechanical; until it lands it is
a manual step in the upgrade runbook.
+- **A save is a keepalive request, at most 32KiB, and gzipped from 1KB**
+ (`fixtures/save-queue.mjs`; Paul's "Trouble saving" in Safari,
+ 2026-10-26, #94). While a link the page opened is waiting for its answer,
+ WebKit refuses every ordinary `fetch`, XHR and Blob read the page starts,
+ at once and with nothing sent, and the page stays editable all the while;
+ keepalive requests and `sendBeacon` still go. Keepalive requests and
+ beacons share one 64KiB quota, so the unload beacon never repeats a
+ keepalive save already on the wire. WebKit never settles a keepalive save
+ answered while its page is in the back/forward cache, so the queue sends
+ again on `pageshow` and gives up on a save left unanswered. A save
+ refused with no answer is "Trouble saving" only if a probe of `/healthz`
+ cannot reach the server either. Compress through `CompressionStream`'s
+ writer, never a Blob. An edit still too large for a keepalive request
+ waits, silently, for the link to be answered.
+- **Docs drains its live streams on SIGTERM** (`cmd/docs/main.go`,
+ `app.Drain`). `net/http`'s graceful shutdown cancels no request, so an
+ open editor's stream held it for rastrillo's whole ten seconds and the
+ process exited 1 (the platform's stop of every instance, 2026-10-26
+ 12:49). `rastrillo.Serve` owns the signal and has no hook, so Docs
+ registers its own: every `signal.Notify` channel receives it. Any new
+ long-lived handler must also return on `hub.draining()`.
- **Every user-visible string is a catalog key**, resolved at render time.
Twelve base locales; a hardcoded English string is a bug.
- **WCAG 2.2 AA, no exemptions**: 24×24 targets, 320px reflow, and colour