school-of-freedom: scaffold gateway (manifesto · founder · pioneers · apply)#2
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| .replace(/^-+|-+$/g, "") | ||
| .slice(0, 32) |
There was a problem hiding this comment.
🟡 slugify is not idempotent: .slice(0, 32) after stripping trailing hyphens can reintroduce them
The slugify function at components/sections/apply-form.tsx:28-35 applies .slice(0, 32) as the final step, after .replace(/^-+|-+$/g, "") strips trailing hyphens. If a long input produces a slug where character 32 is a hyphen, the truncation reintroduces a trailing hyphen — making slugify non-idempotent.
This causes two issues:
- The
canAdvance[2]check (state.slug === slugify(state.slug)at line 56) blocks the user from advancing because the stored slug doesn't survive a secondslugify()pass. - The error message shown (line 214-218) reads "Slug must be lowercase letters, numbers, and hyphens only" — which is misleading since the actual problem is a trailing hyphen from truncation, not invalid characters.
For example, an input like "abcdefghijklmnopqrstuvwxyz12345 xy" produces "abcdefghijklmnopqrstuvwxyz12345-" (32 chars, trailing hyphen), which fails the idempotency check and blocks the form.
| .replace(/^-+|-+$/g, "") | |
| .slice(0, 32) | |
| .replace(/^-+|-+$/g, "") | |
| .slice(0, 32) | |
| .replace(/-+$/g, "") |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed and fixed in #3 — applied your suggested re-strip after the slice cap, plus a comment explaining why the second pass is necessary so a future reader doesn't "clean up" the apparent redundancy.
Summary
First slice of sof.ai → School of Freedom: the unifying gateway over the two sister schools (
thevrschool.org+ai.thevrschool.org). This PR is intentionally the marketing/identity surface only — auth + database wiring lands next so we can eyeball the aesthetic before flipping the apex DNS.What ships
/Hero Manifesto + Movement Thinking (Dreaming · Building · Launching · Liberating) + Founder card + sister-school cards, each sister gets its own gradient so the gateway never flattens them/founderDr. Freedom Cheteni's deep profile + 5-entry timeline (2017 Moonshot ID → 2026 School of Freedom)/studentsPioneers directory (founder seeded; reads from shared Postgres in next PR)/[slug]dynamic Pioneer profile — manifesto opener · projects with Movement state · identity tags/apply4-step application form (Identity → Pathway → Slug → Manifesto) — UI only, submit handler is a placeholder until the DB landsMovement/The Architect/Pioneer/Applicant)Brand
Per your call: VR-Enrollment palette (cream paper · deep emerald · warm orange · amber gold) with Geist Sans/Mono for body and Instrument Serif for editorial headlines. Editorial register on the manifesto pages, sans elsewhere.
Architecture (locked from chat)
Single identity across all three sites = same user database + same
NEXTAUTH_SECRET. Cross-TLD cookies aren't possible, so a Pioneer signs in once per top-level domain — but the user record/profile/journals are unified.Out of scope (next PRs)
/applyactually persisting (right now the submit handler is a placeholder that simulates the round-trip)/adminapproval dashboard/settingsself-service editorsofairepo + flipping thesof.aidomain off the redirect and onto this projectReview & Testing Checklist for Human
/(Hero, Movement Thinking) and/founder? Do the two sister-school cards read as related-but-distinct?/studentsand/freedom-chetenishould both render (placeholder data; founder is the only seeded Pioneer for now).Notes
pnpm build, 7 routes, no TS/lint errors).sof.airedirect or DNS yet. The redirect fromsof.ai→ai.thevrschool.orgstays live until you've eyeballed the preview and explicitly say "flip it" — same pattern as the apex swap./applysubmit + admin approval flow. After that: Vercel project + DNS flip.Link to Devin session: https://app.devin.ai/sessions/091fc09f81b5489292102ebcdc173dbb
Requested by: @DearMrFree