Lead Management QA Helper

Test the quiz-to-lead pipeline from both sides.

This is the operator page for the Ceremonia quiz bridge: chatbot quiz, deterministic result buckets, admin lead scores, dry-run nurture emails, dashboard screenshots, and the future-tenant knobs that change scoring, categories, and copy.

User surface

Complete the quiz and confirm the user sees the right bucketed path.

Bridge

Signed gateway completion posts to /api/quiz/lead-intake.

Scoring

Admin scores update through /api/cron/qualify.

Nurture

Dry-run emails render by readiness bucket before real-send gates open.

User testing

Chatbot quiz path

Run the quiz in a signed-out browser first. Use synthetic QA email addresses for staging runs. The user-facing result is a bucketed readiness path; the raw numeric score is for pipeline and admin verification.

READY

Ready lead

Quiz score
92
Admin dimensions
fit 7, interest 7, readiness 8, timing 7, budget 7
Nurture
touch1:high
Preview email
Welcome - let us find your moment

Appears as a lead with a high score bar. Eligible for high-bucket Touch 1 when dry-run dispatch is enabled.

EXPLORING

Exploring lead

Quiz score
60
Admin dimensions
fit 4, interest 4, readiness 5, timing 4, budget 4
Nurture
touch1:medium
Preview email
Welcome to Ceremonia

Appears as a lead with a mid score bar. Eligible for medium-bucket Touch 1.

NOT_READY

Not ready lead

Quiz score
20
Admin dimensions
fit 1, interest 1, readiness 2, timing 1, budget 1
Nurture
touch1:low
Preview email
A warm welcome from Ceremonia

Appears as a lead with a low score bar. Eligible for low-bucket Touch 1.

Hard stop

Contraindication path

Quiz score
none, hard stop
Admin dimensions
fit clamped to 1 when a contraindication signal is present
Nurture
excluded
Preview email
No nurture email

Contact is suppressed during intake and excluded from all nurture cohorts.

How scoring works

Two scoring layers

The gateway quiz produces a 0-100 score and result bucket. The platform then emits a quiz_completed lifecycle event and recomputes five admin dimensions on a 0-10 scale. Nurture cohorts use the admin readiness dimension.

Bucket cutoffs

  • 0-40: NOT_READY
  • 41-70: EXPLORING
  • 71-100: READY
  • Any hard stop: no score, no bucket, suppressed contact

q1_motivation

Motivation category

personal_growth 25, trauma_healing 30, curiosity 10, crisis_relief 20, spiritual_seeking 20

q2_preparation

Preparation category

months_of_prep 25, weeks_of_prep 15, just_decided 5, no_prep 0

q3_support_system

Support category

strong_network 20, some_support 12, mostly_alone 5, isolated 0

q4_contraindications

Safety hard stop

No points. Any configured hard_stop_value returns contraindication_hit=true, no score, no bucket, and suppression on platform intake.

q5_themes_freetext

Personalization input

No points. Used for blurb and nurture context only.

Admin testing

Dashboard path

After the quiz completion and scoring cron run, verify the admin surfaces from the same tenant account. The inbox shows row-level lead state; metrics shows aggregate cohort movement.

1. Inbox

Open contacts, use the active leads tab, and confirm each test email appears with the expected score bar and lifecycle stage.

2. Detail

Click a row and verify timeline events: quiz_completed, campaign_attributed when UTM is present, scoring activity, and suppression for hard-stop profiles.

3. Metrics

Open the cohort view after projection and scoring. Filter to the quiz campaign and verify the lead bands match the profile mix.

Email previews

Bucketed nurture copy

These are the deterministic Touch 1 fallback emails. When the lead-nurture agent is enabled, the agent can author copy, but the dispatcher still records whether fallback or agent copy was used.

High readiness

Welcome - let us find your moment

You are ready, and we are here to help you take the next step.

Hi,

Thank you for raising your hand. It is clear you are ready to explore what is next, and we would be honored to walk alongside you.

When you have a moment, reply here or book a time to connect. We will meet you where you are.

With care,
The Ceremonia Team

Dry-run emails include a CAN-SPAM footer and List-Unsubscribe headers. Real recipients are blocked until all send gates are satisfied.

Medium readiness

Welcome to Ceremonia

A warm hello and an invitation to explore at your pace.

Hi,

Welcome. We are glad you are here. There is no rush and no pressure; this is simply an open door.

If a question comes up or you would like to learn more, just reply. We are listening.

With care,
The Ceremonia Team

Dry-run emails include a CAN-SPAM footer and List-Unsubscribe headers. Real recipients are blocked until all send gates are satisfied.

Low readiness

A warm welcome from Ceremonia

We are glad you are here. Explore whenever you are ready.

Hi,

Thank you for connecting with us. Whenever curiosity calls, we will be here. No timeline, no pressure.

Reply any time; we would love to hear what drew you here.

With care,
The Ceremonia Team

Dry-run emails include a CAN-SPAM footer and List-Unsubscribe headers. Real recipients are blocked until all send gates are satisfied.

Future tenants

What to modify for a new tenant

Keep tenant-specific categories, weights, copy, and contraindications in config whenever possible. Change shared code only when a tenant needs new behavior that config cannot express. Use Doppler for secrets and keep runtime DB access under withTenantRls.

Quiz categories and point weights

lumina-tenant-ceremonia/site/quiz-config.yaml, tenants/_template/quiz-config.example.yaml, tenants/_template/quiz-config.schema.json

Edit scoring_rules, bucket_cutoffs, contraindications, and email_templates. Keep tenant-owned source and deployed config paths in sync.

New answer types or scoring semantics

gateway-plugins/lumina-quiz/scoring.ts

Only change code here when YAML cannot express the scoring behavior. Normal tenant weights belong in quiz-config.yaml.

Platform lead dimensions

web/src/lib/scoring/deterministic.ts

Controls how lifecycle events become fit, interest, readiness, timing, and budget. Quiz bucket mapping currently drives the first score.

Nurture timing and cohort thresholds

web/src/lib/lifecycle/touch1-select.ts, web/src/lib/lifecycle/nurture-cohort.ts

Controls welcome-window days, qualified lifecycle stages, readiness thresholds, Touch 2 delay, stale claim handling, and cohort grouping.

Email copy and agent fallback

web/src/workers/nurture-worker.ts, web/src/lib/agents/nurture-copy-client.ts

Controls fallback subjects and bodies for Touch 1 and Touch 2, plus the agent copy contract when NURTURE_AGENT_ENABLED is on.

Send gate and compliance

web/src/lib/nurture/dispatch.ts, nurture_send_gate table, Doppler env

Real sends require cron enabled, dry-run explicitly off, confirmed gate timestamps, a mailing address, and UNSUB_TOKEN_SECRET.

Tenant routing and secrets

config/tenant-registry.yaml, gateway-plugins/lumina-quiz/tenant-resolver.ts, web/src/app/api/quiz/lead-intake/route.ts

Gateway HMAC uses tenant-scoped secrets. Future tenants need bridge-secret resolution, encryption keys, and config paths verified before launch.

Safe QA sequence

  1. 1. Set staging secrets through Doppler, not chat or local notes.
  2. 2. Keep NURTURE_DRYRUN on while validating inbox, metrics, and emails.
  3. 3. Run quiz profiles with synthetic addresses and UTM markers.
  4. 4. Trigger qualify and nurture cron only with the valid CRON_SECRET from Doppler.
  5. 5. Confirm no suppressed or contraindicated contact receives an email.

Real-send stop conditions

  • Do not set NURTURE_DRYRUN=0 without explicit operator approval.
  • Do not bypass hooks with git commit --no-verify.
  • Do not write ad hoc SET app.tenant_id SQL; use withTenantRls.
  • Do not add a new tenant until quiz HMAC, bridge HMAC, encryption key, and config path all resolve in staging.