System Overview
Registration-only backend. No AI, no agents, no background workers. A CRUD wizard with server-computed validation, dynamic step visibility, and a real Spark ledger.
- Legal onboarding wizard (
CLIFF_ONBmodule) - Steps
welcome→indirectTax→launch - Server-side Spark ledger (real, not display reconstruction)
- Amazon Cognito auth (backend-mediated)
- 32 onboarding screens + step resolver
- Master data seeding from
frontend/src/config/data/*.json
- Knowledge of Product module (
.kop-root) - Season / market simulation
- Company Room dashboard
- Concept, Plan, Budget, Hire, Build, Market, Record
- Real government registry integration
- AI / LLM / agent runtime
Four Domains
cognito_client.py
jwt_verifier.py
schemas.py
routes.py
models.py
reasons.py
project.py
assert_supply.py
repository.py
models.py
repository.py
schemas.py
routes.py
models.py
step_resolver.py
type_rules.py
fee_service.py
registration_service.py
Registration State Machine
review.review declarations all pass.approved + bank_opened. Calls handoff().Tech Stack
Locked Decisions (§ 4A)
uuid4(), not serial integers. registration_id is the ledger join key and must not be guessable.
DomainError → NotFoundError / ValidationError / ConflictError. One FastAPI handler renders all as {"error": {"code", "message", "details"}}.
country first-set. country is then immutable — a second PATCH attempt returns ConflictError("COUNTRY_ALREADY_SET").
The 32 Onboarding Screens
Pulled from the HTML's ONB array. Conditional steps are skipped server-side by the step resolver — the frontend renders whatever GET /steps returns.
Data Model
35 tables total: 19 master data (seeded once from JSON, read-only at runtime) + 16 transactional (written per founder session).
API Endpoints
Every onboarding route requires a valid Cognito bearer token. Master data endpoints are GET-only, no auth needed.
Spark Ledger
10,000 Spark granted flat on country selection. Every cost is a ledger event — never a field mutation. Balance is always computed by folding the event log.
Simulate Events
Event Log
Closed Reason-Code Table
Three Accounts Per Registration
delay_days per country (IN:4, UK:1, SG:5, AE:14, US:0).Build Order
Eight sequential phases. Each phase must be stable before the next begins. No step is optional.
§ 13 — Genuinely Pending (Not In Scope)
plan.ts + build-sim.ts run entirely in browser. A future domain/company/ would burn BUILD_SPEND against the same treasury this phase hands off.hiring.ts, crew.ts, desk.ts — all client-side, lost on refresh. A future domain/crew/ would burn HIRE_FEE, PAYROLL, SEVERANCE.REVENUE, PAYROLL, OVERHEAD, FUNDING_ROUND are already reserved. The ledger was designed to extend past this phase without a reshape.