Commit Graph

26 Commits

Author SHA1 Message Date
Will Anderson 8184859754 runtime: sync from foundation/el; HEAD method support, plus all uncommitted runtime work from prior sessions 2026-05-02 01:15:24 -05:00
Will Anderson 40691c05c8 nav order matches page; pricing moved last; setup-intent attach fix
Page section order is now: hero → pillars → how-it-works → inference →
efficiency → comparison → enterprise → mission → local-first → safety →
environmental → marketplace → viral → pricing → footer. Pricing is the
last content block so visitors scroll the whole story before being asked
to commit. Nav (desktop + mobile + dropdown) reordered to mirror the
page: How it works → Enterprise → Mission ▾ → Marketplace → Pricing →
About / Gallery / Account.

Stripe attach bug: /api/link-customer was hitting
POST /v1/payment_intents/{id} for every Intent regardless of type, so
SetupIntents (seti_*) returned 404 from Stripe. Branched on the id
prefix - SetupIntents go to /v1/setup_intents/{id} and skip the
receipt_email param (PaymentIntent-only field). Caught from a live
422 in the dashboard the moment Will tested timing=later.
2026-05-02 00:52:59 -05:00
Will Anderson 1349450b14 checkout: hold-until-launch radio actually works (SetupIntent path)
The Professional plan's "Hold until product launches" radio was wired
into the markup but ignored by both /api/payment-intent and the JS
submit handler. Buyers who picked it would still get charged
immediately because the server always created a PaymentIntent and
the client always called stripe.confirmPayment.

Fix:
  * /api/payment-intent reads body.timing. When plan=professional and
    timing=later, it creates a SetupIntent (usage=off_session) instead
    of a PaymentIntent and returns {setup_mode:true, client_secret:...}.
    Founding stays unconditional (lifetime, charge now).
  * checkout JS now reads the radio (currentTiming()), passes timing
    to the server, and re-fetches a new client_secret on radio change
    so the buyer's choice is honored even if they toggle after first
    mount.
  * window._neuronMode tracks 'payment' vs 'setup'. The submit handler
    branches: stripe.confirmSetup for save-card, stripe.confirmPayment
    for charge-now. The submit button label updates to "Save my card -
    no charge today" when in setup mode so the buyer sees the
    intent before they hit submit.
  * /api/link-customer receives timing + mode so the server can
    differentiate at attach time.

A future webhook on setup_intent.succeeded will create the actual
Subscription with trial_end at launch (Q3 2026 / 2026-09-01) - that
piece is queued via metadata[hold_until]=launch on the SetupIntent.
For now, the saved payment method sits in Stripe untouched.

The point: a buyer who picks "Hold until launch" is NOT charged. The
flow has to be airtight - no surprise charges.
2026-05-02 00:45:44 -05:00
Will Anderson 04f3afea09 account: fix duplicate billing line + always show badge for founding members
Duplicate "Lifetime · Never billed again" was caused by
insertAdjacentHTML('afterend') appending another <p> on every
renderPlanCard call - and renderPlanCard runs both in init() and on
the onAuthStateChange INITIAL_SESSION event, so the line stacks.
Replaced with a dedicated #plan-billing-note-el container that
setHtml() replaces in place.

Badge: collapsed the two-branch fetch into one path. Founding
members now always see the badge; if member_number is set we render
"#N", otherwise we fall through to "Your number awaits" via the
existing n=0 endpoint behaviour.
2026-05-01 23:51:13 -05:00
Will Anderson eea9ff8ff4 account: server-side plan lookup via /api/my-plan, scrub internal comments from JS
The /account "Loading..." spinner stayed on forever because the
browser-side waitlist read went through the anon key and didn't reach
the row. Replaced it with a POST /api/my-plan: the server verifies
the user's access_token via Supabase /auth/v1/user, then reads the
waitlist row with the service key. Bypasses RLS without exposing the
service key to the browser.

Stripped implementation comments from the served JS so the browser
doesn't broadcast how internals are shaped.

Build pipeline: declared the supabase_auth_user stub for both
build-local.sh and Dockerfile.stage so the bootstrap-injected forward
declarations match what's actually linked.
2026-05-01 23:46:26 -05:00
Will Anderson 4aa48538f6 ux: chat header + greeting + brain avatar + share button + terms + badge
Restores inline-JS styles.el (the obfuscated /assets/js/*.js path
broke the chat widget) and threads four UX fixes through it:

  - Chat header: drop the all-caps "NEURON / Live Demo" subtitle, keep
    just "Neuron" in bold white at 1rem.
  - Greeting: replace the canned "Hi. I am Neuron. You get 5 questions"
    with "Hey. What is on your mind?" in all three callsites (open,
    reset, turnstile-verified). The questions counter is already in
    the header, so we don't need to repeat it.
  - Avatar: switch chat avatar from neuron-icon.png to the brain mark
    (/assets/brand/neuron-brain.png). Thinking state now shows the
    pulsing brain plus three-dot animation instead of "thinking..."
    text.
  - Share button: from a muted t3 link to a navy pill with subtle
    background, uppercase letter-spacing, and active-press feedback.

main.el: drop the FOUNDING_SOLD = 47 floor and rewrite
fetch_founding_count_stripe to count succeeded PaymentIntents (the
live Stripe Elements path) AND legacy Checkout Sessions, excluding
refunded charges.

founding_badge.el: rewrite to the Option C "Tag" design picked from
/tmp/founding-badge-preview.html - tall card, navy top stroke, brain
mark prominent, "Neuron, LLC" footer.

terms.el: kill the "Neuron Inference - our own inference layer, live
now" claim. Inference launches Q3 2026 and the wording now says so.
2026-05-01 23:40:49 -05:00
Will Anderson d6731f7834 checkout: re-add link-customer + redirect to /account, fix success/account routes
Restores the /api/link-customer endpoint that was lost in the stash. It
runs right before stripe.confirmPayment() and:
  - searches Stripe for an existing Customer by email
  - creates one if missing (URL-encodes + and @ so Gmail aliases work)
  - attaches the Customer to the live PaymentIntent
  - upserts the Supabase waitlist row with stripe_customer_id + plan

Stripe locks customer on a Charge once set, so the webhook handler is
the second-line backstop for any race where confirmPayment beats the
link call.

Also: change return_url from /marketplace/success to /account?welcome=1
so buyers land where they need to be, and switch /marketplace/success
and /account from str_eq to str_starts_with so Stripe-appended query
strings (?payment_intent=...&redirect_status=succeeded) don't 404.
2026-05-01 23:34:52 -05:00
Will Anderson 702888d3aa checkout: drop auth wall so payment form mounts on page load
The auth-first flow blocked Stripe Elements from initialising for any
visitor without an existing Supabase session. Users hit the checkout
page, saw "Sign in to continue", and could not get to a card field at
all. Restored the inline-JS path (HEAD before extraction broke it),
flipped payment-section visible by default, kept the sign-in panel
behind an explicit "Already have an account? Sign in" link.

Build pipeline: added supabase_get stub injection and -lssl/-lcrypto
linker flags (web_stubs.c uses EVP for the AES-256-GCM transport).
Without those the Docker build aborts at link time.
2026-05-01 23:26:12 -05:00
Will Anderson 00f2323c98 v1.0 - launch: full nav on gallery, chat widget auto-open, comparison logos, checkout fixes 2026-05-01 18:13:06 -05:00
Will Anderson ff1f9577db Add marketplace section, OAuth checkout, social icons, 35% efficiency claim, preorder CTAs, enterprise Q1 2027, founding member limits, paragraph spacing in demo chat, no em dashes 2026-05-01 09:20:45 -05:00
Will Anderson 269eed41aa feat: El-native landing replaces the Next.js site, Dockerfile + build.sh
Hand-cuts the marketing surface from Next.js to a native El HTTP server.
The El landing reads the pre-rendered index.html (output of the existing
component pipeline at src/index.html) and serves it directly. ~150
lines of El at server.el; 130 KB binary; no Node, no build step at
serve-time, no runtime JS for the marketing pages.

What's here:

  - server.el: dispatcher with /, /health, /api/founding-count, /assets/*,
    /brand/*, 404 JSON for everything else. Routes go through fs_read
    against LANDING_ROOT (default /srv/landing in the container, ./src
    locally).

  - Dockerfile: two-stage build for linux/amd64 (Cloud Run target).
    Stage 1 — debian:bookworm-slim with build-essential + libcurl-dev,
    compiles the binary against el_runtime.c. Stage 2 — slim runtime
    image with libcurl4 + ca-certificates, drops the binary at
    /usr/local/bin/landing, copies src/index.html and src/assets/ into
    /srv/landing/. Uses -rdynamic so the runtime's dlsym(RTLD_DEFAULT,
    handler_name) can find handle_request inside the executable on
    glibc — macOS exposes executable symbols by default, Linux does
    not. Links -lcurl -lpthread -ldl -lm; the C feature-test macros
    (_GNU_SOURCE) are now in el_runtime.c itself.

  - build.sh: stages the foundation El runtime into ./runtime/, runs
    elc to regenerate server.c, builds the docker image. --tag and
    --push flags. Push targets us-central1-docker.pkg.dev/neuron-785695/
    neuron-marketing/marketing for the Cloud Run flip (still manual).

  - .gitignore: runtime/, /server.c, build/ — all build artifacts.

The path here was non-trivial. The original goal was to compile the
full 4325-line landing-combined.el end-to-end; that OOM'd at 8.7 GB
under the always-allocate-fresh el_list_append (the workaround for an
aliasing bug in cg_if_stmt). The runtime ARC scaffolding committed
earlier today got the compile down to 3.5 GB peak in 0.26s, but the
landing-combined still has pre-existing source bugs (http_serve(3001)
arity, neuron_origin bare expression statement) that block the build.
The structurally cleaner path was to render the HTML once, offline, and
serve the static output — which is what this server.el does. The
landing-combined.el can be revisited when those source bugs are fixed;
this server.el is the canonical production surface in the meantime.

Did not commit ./runtime/ (gitignored, staged from foundation by
build.sh on each build), ./server.c (generated by elc from server.el),
or ./build/ (build artifacts). The repo carries the source of truth
only.
2026-04-30 18:15:27 -05:00
Will Anderson 9f7996effe Fix origin hardcode; seed founding count from Stripe at startup
- NEURON_ORIGIN env var drives all Stripe redirect URLs (no more localhost)
- Load founding count from persist file or live Stripe PaymentIntents search
- Write count to founding_sold.txt on startup and each webhook increment
- Regenerate index.html with real count before serving
- Startup order: Stripe config → count → HTML → serve
2026-04-29 17:55:43 -05:00
Will Anderson 41e73b8c1a Polish: tighten styles cleanup 2026-04-29 17:44:17 -05:00
Will Anderson 4769613d10 Polish: nav hamburger, pillar alignment, wordmark, hero tightening
- Nav: responsive hamburger at ≤1060px, full mobile menu with close behaviors
- Nav: all section anchors are absolute (/#...) for correct cross-page routing
- Pillars: flex column cards with margin-top:auto on taglines — all three align
- About footer: image wordmark matches main page (was plain text "Neuron")
- Hero: "Six patents" → "Patented"; sub-copy trimmed to one clean sentence
- Environmental/efficiency/inference: remove all "memory graph" mentions, cite 40% token reduction
- Environmental: savings calculator (slider, live annual savings calculation)
2026-04-29 17:31:26 -05:00
Will Anderson 3c462b3bf8 Nav, safety, pillars updates
- Nav: all section links are absolute (/#section) - fixes about page back-nav
- Nav: add Environment link
- Safety: "I built" not "we built"; crisis hotline announcement; crisis line coming
- Pillars: rename Learns -> Sharpens with opaque copy that doesn't reveal mechanism
2026-04-29 17:24:55 -05:00
Will Anderson c84c66e5fc Safety contact required at onboarding; 988 as default option 2026-04-29 17:18:55 -05:00
Will Anderson e9209bccc1 Unify nav across all pages; broaden safety section
- about, terms, enterprise_terms now all import and use shared nav()
- Any future nav change propagates everywhere automatically
- Remove Docs from nav (no docs yet)
- Safety: Hard Bell is for everyone, not just children - reframe copy,
  update cards and bottom callout to reflect universal applicability
2026-04-29 17:16:49 -05:00
Will Anderson cc20f10d6d Remove Docs nav link 2026-04-29 17:15:17 -05:00
Will Anderson 51d2e64c22 Em dash removal, nav/form/terms updates
- Replace all em dashes with hyphens site-wide (22 files)
- Add Safety to nav
- Remove Express Interest button from enterprise header (form is the path now)
- Enterprise form: secondary headcount selection shows honest odds message; yes disables submit button
- Terms §5: add network layer indemnification (patent pending 64/036,821); no proprietary names
- Terms §4: Neuron Inference is live now, not Q3 2026
2026-04-29 17:14:56 -05:00
Will Anderson 235662c2a4 Complete enterprise agreement rewrite with all 15 sections
Add §2 License Grant, §5 SLA, §6 Security, §7 Confidentiality,
§8 IP, §9 Indemnification, §10 Term, §12 Warranties, §15 General.

Add §14 Neuron Aligned Partner Program — optional self-attestation
for partners not using Neuron primarily for headcount reduction.
Benefits: preferential pricing, partner network, public listing.
2026-04-29 17:10:02 -05:00
Will Anderson c5db615d97 Add enterprise inquiry form with headcount filter, wire /api/enterprise-inquiry 2026-04-29 17:03:03 -05:00
Will Anderson 393d982d04 Add integrated checkout, child safety section, and content polish
- checkout.el: Custom Stripe Payment Element page at /checkout?plan=...
- safety.el: Hard Bell and emergency routing architecture section
- main.el: Wire checkout + safety, /api/payment-intent, STRIPE_PUBLISHABLE_KEY
- enterprise_terms.el: Add nav bar (was missing, page had no navigation)
- styles.el: Checkout buttons now link to integrated page, not hosted Stripe
- El runtime: Auto-detect HTML responses, serve text/html vs application/json
- footer.el: Wordmark image centered above "Built Different." tagline
- environmental.el: Replace SQLite with custom on-device storage
- enterprise.el: Replace SQLite with custom on-device storage
- pricing.el: Local models degraded performance note near Ollama feature
- about.el: "left home at fifteen", remove programming language mention
2026-04-29 16:59:57 -05:00
Will Anderson d190e08f38 Fix about page voice, wire founding badge and dynamic counter
About: rewritten in memoir register — flowing connected sentences,
no staccato, no resignation mention, no employer mention.

Founding counter: polls /api/founding-count every 90s, updates DOM
in place with flash animation on new claims. Webhook now increments
the sold counter when a founding purchase completes.

Badge: founding_badge.el component with guilloché SVG background,
corner rosettes, member number, glow animation. Rendered on success page.

Pricing: "at cost" removed, parent onboarding callout added.
2026-04-29 16:38:40 -05:00
Will Anderson 1d8143cdbc Rewrite landing to El component architecture
Full El component split: nav, hero, pillars, inference, pricing, footer, about,
enterprise, mission, viral, local_first, comparison, efficiency, environmental.

- About page rewritten first-person (Will's voice), photo included, no product spoilers
- Stripe checkout wired: env() reads STRIPE_SECRET_KEY/PRICE_* at startup
- Minor parent-onboarding callout added to pricing section
- Inference pricing: "at cost" removed, now "priced below competitors"
- Nav: wordmark image, About link active on /about
- .gitignore: excludes .env, dist/, generated HTML
2026-04-29 16:21:08 -05:00
Will Anderson 686ab1ee2f iMessage-style bubbles, integrated chat input, 3-column return layout
Chat messages are now proper left/right bubbles. Input bar lives inside
the chat window with a top border separator. On return visit, manifesto
goes left, chat center, values/waitlist right in a full-width grid.
2026-04-28 18:58:09 -05:00
Will Anderson e5a5666dd7 initial commit — Neuron landing page
Bubble-style chat UI, return visit memory replay, values section,
favicon, Neuron-generated email bodies, 3-question return flow.
2026-04-28 17:57:30 -05:00