Self-serve onboarding flows
Mock mode in CI for the whole signup funnel, typed extraction from free-text company descriptions, and contracts that block hallucinated plan features.
The problem
Sign-up asks "what does your company do?" and uses the answer to suggest a plan, pre-fill CRM fields, and configure a trial. The funnel is mostly deterministic except for that one AI step - which is the step nobody tests because it needs a live key and returns different text each run.
Why Ecko
- Deterministic funnel tests
ecko testruns the onboarding handler in mock mode. Assert the suggested plan and CRM struct for a fixture description on every push.- Contracts on suggestions
@ensuresthat the suggested tier must be one of the plans you actually sell stops the model from inventing "Enterprise Plus" because it sounded helpful.- Single deploy artefact
- Web handler and enrichment logic in one binary. Scale horizontally by copying the file, not by coordinating two language runtimes.
In practice
@ensures "suggested_plan is one of: starter, team, enterprise"
fn suggest_plan(blurb: str) -> str {
ai "Suggest a plan name only" from blurb
}
Try it on your workload.