8 Commits

Author SHA1 Message Date
Claude e5b81f46b0 Store readiness: in-app account deletion, privacy policy, terms, listing copy
Closes the remaining store-compliance gaps before App Store / Play
submission:

- Account deletion (App Store guideline 5.1.1): DELETE /me removes the
  user row (usage cascades). The app exposes it through one quiet
  'Account' caption link under the chat, visible only when signed in,
  driving two native dialogs (Sign out / Delete account with a
  destructive confirm) — no new views, no menus, minimalism intact.
  Deletion signs out and resets the app; copy notes that store
  subscriptions are cancelled in App Store / Play settings.
- docs/store/privacy-policy.md: the complete data inventory (matching
  the actual schema), transient OpenAI processing with no training, no
  profiling or ads, GDPR legal bases and rights, in-app erasure.
- docs/store/terms-of-service.md: not-therapy positioning with crisis
  guidance, AI-generated-content caveat, 18+ eligibility,
  auto-renewal/cancellation terms, liability, Swedish governing law.
- docs/store/listing.md: App Store and Play copy written to the
  honest-claims rule (subtitle 'Think Beyond Thought', keywords,
  descriptions), plus App Privacy and Data safety questionnaire
  mappings.
- LAUNCH.md updated: host the policy/terms, set store URLs, use the
  prepared listing copy.
- Tests: 30 passing (adds DELETE /me coverage).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 22:37:25 +00:00
Claude bf5c4e5f00 Beta readiness: full API test suite, EAS build config, launch checklist
Takes V1 from code-complete toward the closed beta:

- Tests: the suite grows from 5 to 29. handler.test.ts covers route
  dispatch, guest device-id validation and user creation, JWT provider
  derivation, the paywall flag pass-through, free/premium mode
  selection, the assistant-final transcript rule (post-unlock delivery),
  the 402 abuse cap and its premium exemption, and purchase-verify
  validation. chat.test.ts covers structured-output parsing, premium
  masking of analysis_ready, the exact Responses API payload (knowledge
  base + strict JSON schema + the no-manufactured-suspense rule) and
  error handling. subscription.test.ts covers the Apple adapter
  (active/expired/wrong-product/sandbox retry on 21007) and the Google
  adapter (real RS256 JWT signing against a generated key, token
  exchange, expiry, 410-gone), with fetch and secrets mocked.
- EAS: apps/mobile/eas.json with development/preview/production
  profiles for TestFlight and Play internal-testing builds.
- LAUNCH.md: step-by-step path to 20-50 beta users — AWS deploy and
  secrets, migration, sign-in providers, store products at
  $5.99/$49.99, EAS builds, CI role, and the beta measurement plan
  (retention, dialogue depth, upgrade timing, tester interviews).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 22:08:39 +00:00
Claude 720a8fdca4 Insight-first monetization: trust-building free tier and pricing
Adjusts the paywall strategy from withholding toward insight-first:

- Free-tier instructions rewritten around the monetization philosophy:
  the goal is not to interrupt the conversation but to build trust. The
  free experience should leave the user feeling understood, respected
  and curious to continue, and should help the user reach a meaningful
  insight of their own. The rule is included verbatim: 'Never
  manufacture suspense. Create genuine curiosity by helping the user
  reach a meaningful insight, then offer a deeper level of analysis in
  Premium.'
- Premium transition sharpened: analysis_ready may only fire when the
  conversation has reached a meaningful point and the natural next step
  is a complete analysis, structured framework, personalised strategy,
  practical exercises or a step-by-step action plan — pausing
  immediately before that delivery, never mid-sentence or mid-
  explanation. Transition example updated to the new wording. Product
  feeling encoded: always 'I genuinely want to continue this
  conversation', never 'they stopped me just to make me pay'.
- Pricing: paywall now shows plan prices — localized prices fetched
  from the store via react-native-iap, falling back to $5.99/month and
  $49.99/year (~30% below monthly) until store config exists — plus
  the Premium includes list (unlimited conversations, unlimited
  analyses, personalised guidance, future feature updates).
- README: monetization philosophy, product feeling and pricing sections
  updated to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 15:15:46 +00:00
Claude 77d0322c09 Align codebase with the V1 production brief
Reconciles the implementation against the final MVP brief:

- Data model: rename users.provider to auth_provider and
  users.subscription_status to subscription, matching the brief's schema
  exactly (id, email, auth_provider, subscription, created_at). External
  API field names are unchanged.
- Suggestions: replace the starter list with the brief's eight examples.
- Instructions: personality updated to calm, warm, intelligent, curious,
  respectful, pedagogical — never judging, manipulative, dramatic,
  overly positive, overconfident or preaching. Added per-reply goals:
  feel personal, be calm, instill safety, give hope without promising
  results, deepen thinking, and always contain at least one genuinely
  new thought or question. Added the conversation outcome goal (greater
  clarity, greater calm, a new perspective, increased trust in one's own
  ability) and 'not a chatbot for general questions' to positioning.
- Paywall transition example updated to the brief's wording ('I'm
  starting to see some recurring patterns… Unlock Premium to continue.').
- Knowledge base completed per the brief: communication models
  (perceptual positions, observation vs interpretation, chunking,
  backtracking, boundaries), reflection exercises (meaning audit,
  meta-question, five frames, observer replay, well-formed outcome,
  evening question) and a question library organized by purpose.
  Appreciation in the Lift step must be anchored in what the user
  actually expressed; the Challenge step never preaches.
- README: product principle (one user, one conversation, one analysis,
  one recommendation), the removal rule, design words per the brief,
  Definition of Done (7 steps), V2 not-now list (journal, saved
  insights, community, coaches, courses, voice), and a closed-beta plan
  for 20-50 testers with what the minimal data model can already
  measure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 14:58:56 +00:00
Claude 8f7eca7fa8 Add Human Experience Doctrine and four-step conversation philosophy
Refines the product philosophy in the system instructions, the knowledge
base and the README:

- Meet users where they are: never assume the user is struggling — some
  seek change or guidance, others are simply curious and want to grow.
- Human Experience Doctrine: every user should feel seen, respected,
  understood, capable and hopeful. The system must never create
  dependency or imply it alone has the answers.
- Conversation philosophy: every conversation follows a four-step arc —
  acknowledge (reflect meaning, not words), explore (discover
  perspectives together, no interrogating or over-analyzing), lift
  (concrete, credible praise of resources and strengths — no generic
  compliments), challenge (leave at least one new perspective).
- Personality: experienced coach, calm mentor, skilled teacher, wise
  conversation partner — never therapist, salesperson, preacher or guru.
  A thoughtful mentor rather than a stage performance.
- Educational philosophy: teach the user how to reflect so they
  gradually need the tool less.
- Roadmap in README: V1 is person-to-Semantika only; reflection groups
  (V2) and coaches/live sessions/courses (V3) come after the core
  product is strong. Community is deliberately absent from V1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 14:51:16 +00:00
Claude 07234cc9a8 Rebrand as Semantika with honest, inspiration-based claims
Applies the brand platform consistently across the codebase:

- Name: Semantika everywhere — app name/slug/scheme, bundle ids
  (com.semantika.app), workspace package names, CDK stack, Cognito
  domain prefix, secret name (semantika/app), database name, product
  ids (semantika_monthly/_yearly), and storage keys.
- System instructions: Semantika is positioned as an intelligent
  reflection partner — not therapy, not self-help, not a course. It
  starts by exploring how the user interprets their situation and
  supports reflection and perspective-taking rather than delivering
  finished answers. Tone rules added: never judging, dramatic,
  overenthusiastic or preaching; always calm, curious, clear,
  respectful, structured, thoughtful.
- Honest claims: instructions and knowledge base now explicitly frame
  neurosemantics and NLP as models and inspiration for reflection, not
  scientifically established methods — including a note that several
  NLP claims lack support in controlled studies. Claiming or implying
  proven effects is forbidden.
- README: brand section (position, promise, mission, vision,
  positioning, tone, design words) and updated product philosophy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 14:46:10 +00:00
Claude 6b7f0263e4 Add chat-first onboarding and intelligent context-based paywall
Replaces the hardcoded message limit with a model-driven paywall and
removes registration before the first question:

- Onboarding: the app opens directly into the chat. Dynamic conversation
  starters are served by GET /suggestions (services/api/suggestions.json),
  updatable with a deploy — no app release needed. Guests chat via
  POST /guest/chat, identified by an app-generated device id; sign-in
  moves to the paywall, where a purchase must attach to an account.
- Free experience: the model runs in discovery mode — follow-up
  questions, pattern identification, visible understanding — building an
  analysis without delivering the full solution.
- Intelligent paywall: the model returns structured output (reply +
  analysis_ready). Only when the problem is described, the information is
  sufficient and an action plan is ready does it write a calm transition
  and pause the conversation. Manufactured urgency, emotional pressure,
  fake readiness and mid-answer stops are explicitly forbidden.
- Premium: on unlock the app resends the transcript and the backend
  immediately delivers the full analysis, strategies and exercises, then
  the dialogue continues without restriction.
- The old FREE_MESSAGE_LIMIT becomes MESSAGE_CAP (default 200/30 days),
  kept purely as an abuse backstop — it is not the paywall.
- WelcomeScreen removed; the app is now two views (Chat, Paywall).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 14:42:44 +00:00
Claude 07fbeea09b Bygg NeuroSemantics AI: minimal mobilapp, en backend, IaC och CI/CD
Ersätter den tidigare webappen på denna branch med ett fokuserat monorepo:

- apps/mobile: Expo/React Native med tre vyer (Welcome, Chat, Paywall),
  Cognito hosted UI-inloggning (Apple/Google/e-post) och In-App
  Purchase/Play Billing via en gemensam purchases-modul.
- services/api: en enda Lambda-backend — OpenAI Responses API med
  Markdown-kunskapsbas som systeminstruktioner, free tier-gräns i
  PostgreSQL (HTTP 402 -> paywall) och kvittoverifiering bakom ett
  delat PaymentProvider-interface (Apple/Google, Stripe kan läggas
  till för webb senare).
- infra: AWS CDK-stack med API Gateway (JWT-authorizer), Lambda,
  Cognito, Aurora Serverless v2 och Secrets Manager.
- db/migrations: minimal datamodell (users + usage), inga
  konversationer sparas.
- GitHub Actions: CI (lint, typecheck, test) och deploy från main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118DaxZR36RpnY524vRqx3z
2026-08-03 14:35:48 +00:00