Skip to content

Harden production integrations and disclose data handling (#18) - #45

Closed
wschenk wants to merge 3 commits into
mainfrom
cursor/production-hardening-a201
Closed

wschenk wants to merge 3 commits into
mainfrom
cursor/production-hardening-a201

Conversation

@wschenk

@wschenk wschenk commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Ticket

Closes #18 — Harden production integrations and disclose data handling (parent #1)

Claim note: this PR claimed #18 (label applied 02:34 UTC). PR #46 was opened ten minutes later against the already-claimed ticket; both claim-checks now flag the collision. This PR holds the earlier claim.

What this PR does

Makes the deployed application operable and honest about its external dependencies, security boundaries, offline limits, and provider processing.

  • Health surface. GET /api/health now reports all six services — database (real Neon round-trip), object storage, Clerk, gateway (with the selected model), queue (open durable Enrichment jobs), and push (VAPID pair) — each as ok | degraded | error | not_configured with secret-free details. Overall status is configuration_required (503) until Clerk is configured, degraded on any service error. Verified live on this PR's Preview.
  • Private Vercel Blob for real. The media store's in-memory "vercel-fallback" is replaced by a real @vercel/blob adapter: access: "private", per-user media/<userId>/… pathnames, no permanent public URLs, existsForOtherUser so the authenticated media route's cross-user 403 branch works against real storage.
  • Data-handling disclosure. /privacy (linked from the shell footer, cached for offline reading) states: local-first Capture durability, dependable foreground vs best-effort background sync, private cloud storage with separate preview/production resources, complete Thread content is sent through Vercel AI Gateway to the selected provider with the exact model recorded, TLS transport, and explicitly no end-to-end encryption claim.
  • Transport. Strict-Transport-Security on every response.
  • Cross-user boundaries. tests/production-boundaries.spec.ts locks identifier scoping for sync records, media objects, Enrichment history/jobs, and push subscriptions despite single-user v1.
  • Preview smoke tests. tests/preview-smoke.spec.ts exercises real isolated preview instances at low volume — Clerk backend API, Neon round-trip plus a real-repository cross-user check, private Blob put/get/delete, one tiny gateway completion, one web search, and a push send whose VAPID auth must be accepted. Each skips without its credential; mise run smoke:preview runs them against the preview vault. No secrets in fixtures or logs (health test asserts no secret values serialize).

Environment separation (Neon/Blob/Clerk/gateway/push/queue per environment, fnox-backed vaults) is documented in docs/operations/README.md.

Verification

  • Full suite: 78 passed, 10 skipped (Clerk E2E + smoke credentials absent in this environment); lint and typecheck clean.
  • Live Preview: /api/health returns the new report (Clerk, gateway, push ok; database/blob honestly not_configured on this preview) and /privacy returns 200.
  • Two-axis code review run; findings folded in (real-storage existsForOtherUser, stronger push smoke assertion, Clerk smoke, smoke:preview task).
Open in Web Open in Cursor 

Co-authored-by: Will Schenk <wschenk@gmail.com>
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
walking-thoughts Ready Ready Preview, Comment Jul 19, 2026 2:52am

Request Review

- /api/health reports database, object storage, Clerk, gateway, queue, and
  push with secret-free details and a degraded overall status
- Private Vercel Blob adapter (access: private, per-user pathnames) replaces
  the in-memory fallback whenever BLOB_READ_WRITE_TOKEN is configured
- /privacy discloses provider processing via Vercel AI Gateway, TLS-only
  transport, no end-to-end encryption claim, foreground-vs-background sync,
  and offline durability; linked from the shell footer and cached offline
- Strict-Transport-Security header on every response
- Cross-user boundary tests for sync records, media, Enrichment, and push
- Skip-gated preview smoke tests for Neon, Blob, gateway, search, and push

Co-authored-by: Will Schenk <wschenk@gmail.com>
- Blob adapter implements existsForOtherUser so the media route's cross-user
  403 branch works against real storage; simpler stream reading
- Clerk smoke test against the backend API; Neon smoke adds a real-repository
  cross-user check; push smoke requires the service to accept VAPID auth
- mise run smoke:preview wires the smoke suite to the preview vault

Co-authored-by: Will Schenk <wschenk@gmail.com>
@wschenk wschenk closed this Jul 19, 2026
cursor Bot pushed a commit that referenced this pull request Jul 19, 2026
Co-authored-by: Will Schenk <wschenk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden production integrations and disclose data handling

2 participants