# Task D.7.9 – Installation Profiles & Setup Plugin Registry ## Objective Transform the ALLA OS Setup Platform into a fully extensible platform by introducing Installation Profiles and a Setup Plugin Registry. The current Setup Platform (D.7.1–D.7.10) already supports: - Readiness - Verification - CSV Templates - CSV Preview - CSV Commit - Setup Wizard - Setup State - Seed Manifest - Reset / Reseed - Golden Dataset D.7.9 must remove remaining CRM-specific assumptions so future modules (CRM, HR, Asset, Inventory, Purchase, Service, etc.) can integrate into the Setup Platform without modifying the core wizard. No existing setup behavior may regress. --- # Review Before Implementation Review - AGENTS.md - plans/task-d.7.md - plans/task-d.7.1.md - plans/task-d.7.2.md - plans/task-d.7.3.md - plans/task-d.7.4.md - plans/task-d.7.5.md - plans/task-d.7.6.md - plans/task-d.7.7.md - plans/task-d.7.8.md - plans/task-d.7.10.md Review docs/setup/* Review setup/templates/* Review setup/golden-dataset/* Review src/features/setup/** --- # Objective Replace hardcoded setup behavior with configuration-driven module registration. The Setup Platform must become reusable by every ALLA OS module. --- # Implementation Scope Create src/features/setup/plugins/ Recommended structure src/features/setup/plugins/ plugin-registry.ts plugin-types.ts installation-profile.ts crm/ crm-setup-plugin.ts crm-installation-profile.ts foundation/ foundation-plugin.ts --- # Installation Profiles Introduce Installation Profiles. Supported profiles minimal crm_starter crm_demo production restore_backup custom Each profile defines - visible wizard steps - required templates - verification checks - setup sequence - supported reset scopes - reseed targets - default options Profile interface ```ts export interface InstallationProfile { id:string; name:string; description:string; wizardSteps:string[]; requiredTemplates:string[]; verificationChecks:string[]; resetScopes:string[]; reseedTargets:string[]; defaultOptions:Record; } ``` --- # Setup Plugin Interface Create plugin-types.ts ```ts export interface SetupPlugin { id:string; version:string; displayName:string; description:string; installationProfiles():InstallationProfile[]; templates():SetupTemplateDefinition[]; wizardSteps():SetupWizardStep[]; readinessChecks():SetupReadinessCheck[]; verificationChecks():SetupVerificationCheck[]; previewValidators():CsvPreviewValidator[]; importHandlers():CsvImporter[]; resetScopes():ResetScopeDefinition[]; reseedTargets():ReseedTargetDefinition[]; } ``` --- # Plugin Registry Create plugin-registry.ts Responsibilities Register plugins Resolve plugins Resolve installation profiles Resolve templates Resolve verification checks Resolve reset scopes Resolve reseed targets Resolve wizard steps Example registerPlugin(new FoundationPlugin()); registerPlugin(new CrmSetupPlugin()); --- # Foundation Plugin Move common setup behavior into Foundation Plugin. Foundation Plugin owns Readiness Verification Setup State Seed Manifest CSV Framework Reset Framework Golden Dataset framework No CRM assumptions. --- # CRM Setup Plugin CRM Plugin owns CRM Templates CRM CSV Importers CRM Verification CRM Wizard Steps CRM Reset Scope CRM Golden Dataset registration CRM Approval registration CRM Document Sequence registration CRM Reports registration --- # Dynamic Wizard Current wizard should stop hardcoding steps. Instead Plugin Registry ↓ Installation Profile ↓ Resolve Wizard Steps ↓ Render Wizard Adding a module must not require editing the wizard. --- # Dynamic Verification Current verification service should allow plugins to register checks. Instead of CRM Check Approval Check PDF Check Hardcoded Use Plugin Registry ↓ Collect Checks ↓ Execute ↓ Aggregate Report --- # Dynamic Readiness Allow plugins to register readiness checks. Example Storage Plugin ↓ Storage Check PDF Plugin ↓ Template Check CRM Plugin ↓ CRM Readiness --- # Dynamic Template Registry Extend setup/templates/templates.json Support plugin profile visibility Example { "file":"customers.csv", "plugin":"crm", "profiles":[ "crm_demo", "production" ] } Wizard automatically filters templates. --- # Dynamic Navigation Wizard should display Installed Modules Foundation CRM Approval Storage Future HR Asset Inventory Purchase Modules not installed ↓ Hidden --- # Profile Resolution Selecting crm_demo Automatically Enable CRM plugin Foundation plugin Demo dataset CRM templates CRM verification Demo reset Disable Restore Backup steps Selecting minimal Only Foundation Verification No CRM --- # API Updates Extend GET /api/setup/templates Include plugin profile visible supported Update GET /api/setup/readiness Collect plugin readiness. Update POST /api/setup/verify Collect plugin verification. No API breaking changes. --- # Setup Wizard Updates Wizard ↓ Load Installation Profiles ↓ User selects profile ↓ Resolve Plugin Graph ↓ Build Wizard ↓ Render Steps ↓ Run Setup Wizard must no longer contain CRM-specific logic. --- # Golden Dataset Integration Allow every plugin to register Golden Dataset Example CRM ↓ setup/golden-dataset/crm/ Future HR ↓ setup/golden-dataset/hr/ Asset ↓ setup/golden-dataset/asset/ --- # Future Module Example Adding Asset Should require only registerPlugin( AssetSetupPlugin ); No modification Wizard Verification Reset Template Registry CSV Engine --- # Out Of Scope New business module HR implementation Asset implementation Inventory implementation Purchase implementation Plugin marketplace External plugin loading Remote plugins Installation package download Backup restore implementation CRM business behavior changes --- # Deliverables Required src/features/setup/plugins/plugin-types.ts src/features/setup/plugins/plugin-registry.ts src/features/setup/plugins/installation-profile.ts src/features/setup/plugins/foundation/foundation-plugin.ts src/features/setup/plugins/crm/crm-setup-plugin.ts src/features/setup/plugins/crm/crm-installation-profile.ts Update Setup Wizard Readiness Service Verification Service Template Metadata Service Template Registry Optional docs/setup/setup-plugin-development.md docs/setup/installation-profiles.md --- # Acceptance Criteria ✓ Installation Profiles exist. ✓ Plugin Registry exists. ✓ Foundation Plugin exists. ✓ CRM Plugin exists. ✓ Wizard builds dynamically from selected profile. ✓ Wizard no longer hardcodes CRM steps. ✓ Readiness collects plugin checks. ✓ Verification collects plugin checks. ✓ Template registry supports plugin ownership. ✓ Template registry supports profile visibility. ✓ Golden Dataset supports plugin registration. ✓ Future modules can integrate by registering one plugin. ✓ Existing Setup Wizard behavior remains unchanged. ✓ Existing APIs remain backward compatible. ✓ Existing CSV Preview/Commit logic is unaffected. ✓ Typecheck passes. ✓ Existing setup integration tests continue to pass. --- # Suggested Verification Run npm run typecheck npm run test:setup Verify Minimal Profile ↓ Foundation only CRM Starter ↓ CRM steps only CRM Demo ↓ CRM + Demo dataset Production ↓ Production profile Confirm Readiness still PASS Verification still PASS CSV Preview unchanged CSV Commit unchanged Setup Resume unchanged Golden Dataset unchanged Register a temporary mock plugin ↓ Confirm Wizard automatically includes plugin steps Verification automatically executes plugin checks Template API exposes plugin templates Without modifying Setup Wizard source code. --- # Completion Criteria After D.7.9 The ALLA OS Setup Platform is officially module-driven. All future modules (CRM, HR, Asset, Purchase, Inventory, Service, Calendar, etc.) must integrate through the Setup Plugin Registry rather than extending the Setup Wizard directly. D.7.9 marks the architectural freeze of Setup Platform v1.0.