Sync stage fixes into dev #11

Merged
will.anderson merged 14 commits from sync/dev-stage into dev 2026-05-07 06:05:54 +00:00

14 Commits

Author SHA1 Message Date
will.anderson 494f4ef585 Merge stage fixes into dev — HAVE_CURL, free-tier checkout, Stripe dedup, escaped styles 2026-05-07 01:05:36 -05:00
will.anderson e68de7892f Merge pull request 'Fix free tier checkout and Stripe duplicate customers' (#10) from fix/have-curl-define into stage
Stage — Build, push & deploy to marketing-stage / deploy-stage (push) Successful in 3m41s
2026-05-07 06:01:02 +00:00
will.anderson 00e62bb010 Fix free tier checkout and Stripe duplicate customers
Free tier:
- checkout-stripe.el bails out immediately for plan=free (no Stripe init)
- checkout-auth.el skips payment section reveal and initStripe for free plan
- checkout-free.el shows #free-success panel after auth (no card ever shown)
- /api/payment-intent returns early for free plan — no Stripe call

Stripe dedup (all paid plans):
- Stripe init now deferred to window.initStripe(email, name), called by
  checkout-auth.el after sign-in — email is known before intent is created
- /api/payment-intent finds-or-creates Stripe Customer by email before
  creating the PaymentIntent/SetupIntent and attaches customer upfront
- Eliminates the window between intent creation and /api/link-customer
  that was producing duplicate guest customers
2026-05-07 01:00:51 -05:00
will.anderson 1cf2ef8835 Merge pull request 'fix: -DHAVE_CURL for el_runtime OTLP — resolves emit_metric linker error' (#8) from fix/have-curl-define into stage
Stage — Build, push & deploy to marketing-stage / deploy-stage (push) Successful in 3m12s
2026-05-07 02:35:32 +00:00
will.anderson f0a6b55a13 fix: add -DHAVE_CURL to el_runtime.c compilation, restore el_runtime.o for soul-demo
Root cause: the staged el_runtime.c (from el.git) wraps the entire OTLP
observability section (emit_metric, emit_log, trace_span_start/end) in
#ifdef HAVE_CURL. Without -DHAVE_CURL, those symbols are compiled out,
causing the undefined reference linker errors.

libcurl IS available (installed via libcurl4-openssl-dev), so -DHAVE_CURL
correctly enables the OTLP code path.

Also reverts the soul-demo compile to use el_runtime.o (the pre-compiled
cached object) now that the object will contain the correct symbols.
2026-05-06 21:35:16 -05:00
will.anderson 843b6e07a7 Merge pull request 'fix: soul-demo emit_metric linker error — rebuild from source, compile with el_runtime.c' (#7) from fix/soul-demo-emit-metric into stage
Stage — Build, push & deploy to marketing-stage / deploy-stage (push) Failing after 2m26s
2026-05-07 02:30:46 +00:00
will.anderson 0202b09d37 fix: rebuild soul-demo.c from source, compile against el_runtime.c directly
soul-demo.c was previously an older compiled artifact that triggered an
undefined reference to emit_metric/emit_log/trace_span_* at link time in CI.

Two fixes:
1. Rebuild soul-demo.c from soul-demo.el using current elc — cleaner
   codegen (no double-wrapped el_from_float), same logic, unix_timestamp
   collision with el_runtime.c removed.
2. Dockerfile.stage: compile soul-demo against el_runtime.c directly
   (not el_runtime.o) so all runtime symbols are always resolved from the
   staged source, bypassing any Docker layer cache divergence on el_runtime.o.
2026-05-06 21:30:25 -05:00
will.anderson f19403ba68 Merge pull request 'fix: security hardening from pentest findings' (#6) from fix/pentest-security-hardening into stage
Stage — Build, push & deploy to marketing-stage / deploy-stage (push) Failing after 2m37s
2026-05-07 02:02:50 +00:00
will.anderson 8d741fac20 Fix pentest security findings
- Turnstile server-side verification: reject requests with no cf_token;
  read secret from TURNSTILE_SECRET_KEY env (no longer hardcoded); fix
  siteverify URL from v0 to v1
- Security headers: wrap all responses via http_response() with HSTS,
  X-Content-Type-Options, X-Frame-Options, Referrer-Policy,
  Permissions-Policy, and Content-Security-Policy
- GCS error info leak: guard /share/<id> response — only return content
  that starts with '<' (valid HTML); GCS error JSON is silently 404d
- robots.txt: remove Sitemap reference to sitemap.xml that returns 404
- SRI hash: add integrity + crossorigin attributes to marked.min.js CDN tag
- Attestations bucket: write /api/attest records to GCS_ATTEST_BUCKET
  (dedicated private bucket) instead of the share bucket; falls back to
  GCS_SHARE_BUCKET if GCS_ATTEST_BUCKET is not set (legacy deploys)
2026-05-06 20:58:29 -05:00
will.anderson 28c47c11c9 ci: fix EL_HOME to use lang/ subdirectory for El repo clone
El repo is organized under lang/ — runtime and dist/platform binaries
are at lang/el-compiler/runtime/ and lang/dist/platform/, not at root.
Setting EL_HOME=$DEST/lang makes RUNTIME_SRC resolve correctly so
build-stage.sh can cp el_runtime.{c,h,js} from the right location.
2026-05-05 11:01:47 +00:00
Will Anderson 8a8762ad4f ci: trigger stage CI after API merge 2026-05-05 04:46:30 -05:00
Will Anderson a936d2ebb7 ci: trigger stage build after API merge 2026-05-05 04:45:07 -05:00
will.anderson c49a838aad Merge pull request 'promote: dev → stage' (#2) from dev into stage
promote: dev to stage
2026-05-05 09:40:51 +00:00
will.anderson 6075f49e8a Merge pull request 'feat(account): email/password sign-up on account page' (#2) from dev into stage
Stage — Build, push & deploy to marketing-stage / deploy-stage (push) Successful in 2m47s
2026-05-04 14:05:04 +00:00