doxa-maps/deployment
Doxa Maps cab266e796 cloud dev server: the pull gate opens at git's index lock and holds public/ too; capped at 10 s
Closes the review of 11ba7bff4 (deployment/cloud/atomic-pull.mjs, vite.cloud.config.mjs; Vite 5.4.21).

- The gate now opens the moment git takes <git dir>/index.lock (fs.watch on the git dir, a 50 ms poll if that
  watch cannot be set up), before git's first write, and stays open while the lock exists: `git reset --hard`
  writes every file, public/ included (which Vite does not watch), inside that window. File events (and raw
  kernel notifications) still extend it, and still open it for any other writer. A lock that comes and goes with
  no file event (`git status`, as the dev plugin's /__dev-sha runs) closes it at once.
- What the container writes for itself under /app/repo leaves the watcher (server.watch.ignored in the overlay,
  appended to the repo's public/ by mergeConfig): .pb/ (backend logs and data), backend/bin/ (the engine
  binary), backend/pocketbase/pb_migrations/ (what PocketBase dev writes from its dashboard). They held pages
  before; a landing that changes them is still gated by the lock.
- At closing only the touched files' modules are invalidated (from the file events, plus `git diff` between
  HEAD before the lock and HEAD after when git moved it), so unchanged modules keep their transform and answer
  304. The gate's log line names the git range and file count.
- With a restart waiting, the held requests (and any that arrive until this server closes) are answered
  503 + Retry-After: 1, not passed into the closing server (504). A page gets a small page that reloads itself
  once the server answers again.
- One startup line: "[atomic-pull] armed: quiet 1200 ms, cap 10000 ms, git-lock watch on".
- The cap (ATOMIC_CEILING_MS) defaults to 10000: no browser is held longer, and it still gets its one reload.

Measured on the scratch Vite 5.4.21 project under the worktree's own overlay (paths changed), with a page of 50
modules and 80 public files in a browser: 52/52 checks pass. The earlier cases (bursts, a request mid-burst, a
single edit, a broken-then-fixed module with and without a page, a config restart and a failed one, the ceiling)
plus: a git landing of 392 files (80 under public/) where requests sent at the lock are held until git lets go
and answered new, one reload, every module and public file new after it; a .pb/ + backend/bin/ + pb_migrations/
writer every 250 ms holds nothing (slowest request 17 ms); `git status` every 300 ms holds nothing; the 10 s cap
with a never-ending writer and with a stale index.lock; the startup line once per server start; a restart
mid-burst answering 503 + Retry-After: 1 and one reload on the new server. Against 11ba7bff4 the same landing
served a public bundle and a module OLD while git wrote, and the same server writer held a request 19.8 s.
2026-10-03 09:09:09 +00:00
..
capacitor/android consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
cloud cloud dev server: the pull gate opens at git's index lock and holds public/ too; capped at 10 s 2026-10-03 09:09:09 +00:00
src-tauri bun run desktop:build <plugin> packages a desktop plugin as an app; check:targets keeps non-web plugins out of the web build 2026-09-28 06:44:14 +00:00
wordpress Decouple deployment/: no go-base / nuxtbase / doxa-base names in the Tauri README, the WordPress how-to and its contract test 2026-09-26 22:06:57 +00:00