fix: show 404 overlay when opening deleted or missing document (#672)
Problem: opening a URL for a deleted/missing document either fell back to
a (possibly stale) local backup or, if no local backup existed, showed
the generic "link has expired" copy. Users had no clean signal that the
doc was truly gone.
Changes:
- server/routes/documents.ts: GET /api/documents/:id/snapshot now
differentiates `code: 'not-found'` (doc row missing) from
`code: 'no-snapshot'` (doc exists but never saved). Existing callers
keep working — the HTTP status stays 404.
- src/lib/provider.ts: on a 404, parse the `code` field. If `not-found`,
emit `doc-gone` with `reason: 'not-found'` instead of silently falling
back to a local backup.
- src/lib/doc-gone-handler.ts: split the handler into a pure
`buildGoneOverlayCopy` + DOM renderer. Handles both `expired` and
`not-found` reasons with tailored copy and a `data-gone-reason`
attribute for testing. Exposes `_resetDocGoneOverlayGuard` for tests.
- tests/doc-gone-handler.test.ts: unit tests covering the copy branches
and the install/render path via a stub provider.
- tests/server/routes.test.ts: server tests for the new 404 variants.
Closes #672.