/kb/wizard renders the contract only.
Phase 12F เปิด Premium Wizard contract: 8 steps (profile → goal → pain → target → service → outcome → upload → review) · trilingual TH/EN/ZH · 4 approval gates · output bundle shape กำหนด. เป้าหมาย: ให้ Premium subscribers กรอก input แล้วระบบ map → persona + journey + dashboard + service → output เป็น personal KB-view bundle. ไม่ใช่ tenant factory · ใช้สำหรับ individual user customisation เท่านั้น.
output_bundle_shapeuser_preferences.dashboards JSONB · consumed by Dashboard Runtimetrilingual_policy · keyboard variants · input methodsSource: premium_wizard.steps[*] (each step has id · order · labels × 3 · purpose × 3 · fields · validation_rules · related_* · required_review · honest_note).
| B Field | B Type | A Runtime Target | A Owner | Approval Gate | Binding | Notes |
|---|---|---|---|---|---|---|
| id | string | Route param · /app/wizard/{step_id} |
Frontend | none | mapped-not-bound | Deep-linkable per step · resume draft |
| order | integer | Step indicator · progress bar | Frontend | none | mapped-not-bound | 1..8 |
| label_th / label_en / label_zh | string × 3 | i18n dict · step title in current lang | Frontend | none | mapped-not-bound | Trilingual parity enforced |
| purpose_th / purpose_en / purpose_zh | string × 3 | Step header subtitle · hint system | Frontend | none | mapped-not-bound | Never hand-typed in A code |
| fields[] | array<field> | Dynamic form generator · component per field type | Frontend | none | mapped-not-bound | Validation rules picked up from contract |
| validation_rules | object | Client-side + server-side validator · Zod-like schema | Backend + FE | none | mapped-not-bound | Both layers must enforce · never trust client alone |
| related_truth_nodes | array<id> | Deep-link to KB truth tree entry | Frontend | none | mapped-not-bound | Context panel · "learn more" link |
| related_lexicon | array<id> | Glossary popover on term hover | Frontend | none | mapped-not-bound | Uses lexicon.json |
| related_journeys | array<id> | Persona match hint · feeds output bundle | Backend | gate-ai-faithfulness | mapped-not-bound | AI inference · faithfulness floor enforced |
| related_services | array<id> | Service recommendation in output bundle | Backend | gate-ai-faithfulness | mapped-not-bound | From services.json current state |
| related_dashboards | array<id> | Dashboard preset targets | Backend | none | mapped-not-bound | Feeds personal_dashboard_model preset |
| required_review | boolean | Yellow review banner on step · blocks progress | Frontend | gate-review | mapped-not-bound | Typically on sensitive steps · user + reviewer confirmation |
| honest_note_th / honest_note_en | string × 2 | Footer caption on step · verbatim | Frontend | none | mapped-not-bound | Must render as-authored |
Source: premium_wizard.approval_gates.
| Gate (B) | A Runtime Enforcement | A Owner | Binding | Notes |
|---|---|---|---|---|
| gate-sensitive | Sensitive-flag detection → dual-approval path | Backend | mapped-not-bound | Per approval_matrix.sensitive_surface_markers |
| gate-ai-faithfulness | RAGAS ≥0.70 per AI suggestion | Backend | mapped-not-bound | Retry 1 · decline + fallback to user-input if still <0.70 |
| gate-upload-pii | PII scan before persist upload | Backend | mapped-not-bound | OCR output scrubbed too |
| gate-finalize | Step-8 user confirmation checkbox + signature | Frontend | mapped-not-bound | Cannot finalize without explicit user review |
Source: premium_wizard.output_bundle_shape.
| B Field | A Runtime Storage | A Owner | Binding | Notes |
|---|---|---|---|---|
| id_pattern | Bundle ID generator (e.g., PWB-YYMMDD-{user}-{seq}) | Backend | mapped-not-bound | Deterministic + auditable |
| fields | wizard_bundles table · JSONB shape | Backend | mapped-not-bound | Persona · journey · dashboards · services · upload refs · AI suggestions + RAGAS scores |
| not_allowed | Validation blocklist · rejects attempts to set forbidden fields | Backend | mapped-not-bound | E.g., tenant_id, auto-publish, cross-tenant share — all blocked |
not_allowed validation · output scoped to user · UI cannot expose tenant-grantwizard_bundles + Dashboard presetnot_allowed fields rejected at API layerwizard.runtime_v1 staged rollout + rollback drill