Drupal Contrib Consolidation Plan
Purpose: Transition custom code to industry-standard Drupal contrib. Single source of truth for the task list. No new custom logic where contrib exists.
Scope: Custom modules in TESTING_DEMOS/DEMO_SITE_drupal_testing and WORKING_DEMOs Drupal sites; all API integration, AI, workflows, registries.
Current Custom Patterns (Audit Summary)
| Domain | Custom pattern | Contrib target |
|---|
| API / HTTP | Raw Guzzle, @http_client, one-off clients | http_client_manager, api_normalization |
| Executable actions | Custom service methods, RPC-style | drupal/tool (Tool plugins) |
| AI / LLM | Custom provider bridges, mesh scrapers | drupal/ai, drupal/ai_agents, ai_agents_ossa |
| Workflows / state | ServiceIntegrationOrchestrator, FleetOrchestratorService, PHP loops | drupal/eca, drupal/maestro, drupal/orchestration |
| Discovery / registry | McpServerProject entities, custom discovery | ai_agents, ai_agents_ossa (OSSA → Tool) |
| Observability | Custom metric tables, token logs | drupal/audit_export, tracer.bluefly.internal |
| Config / secrets | $settings, hardcoded URLs | drupal/key, config/schema, admin UI |
Phase A: Fix Broken Custom Code & Bootstrap (Completed)
Phase B: Seven Pillars (Explicit Task List)
| # | Task | Owner module | Done |
|---|
| 1.1 | Audit: list all custom PHP/Guzzle acting as executable functions (mcp_registry, ai_agents_client, code_executor, dragonfly_client, recipe_onboarding, etc.) | — | |
| 1.2 | Adopt tool_belt: if standard tools exist for fetch/read/strings, delete custom equivalents | per module | |
| 1.3 | Migrate each remaining executable to a Tool plugin under src/Plugin/Tool/ | per module | |
| 1.4 | Enforcement: no callable logic without a Tool plugin; register with tool_ai_connector/orchestration | CI / review | |
Pillar 2: State Execution (ECA, Maestro, Orchestration)
| # | Task | Done |
|---|
| 2.1 | Deprecate ServiceIntegrationOrchestrator, FleetOrchestratorService, hook-based sync loops | |
| 2.2 | Install drupal/eca, drupal/maestro (and maestro_activepieces if needed) | |
| 2.3 | Install drupal/orchestration; proxy workflows to n8n/Activepieces via orchestration | |
| 2.4 | Replace custom fleet/rollout PHP with ECA actions + Tool plugins or maestro workflows | |
Pillar 3: AI Ecosystem (drupal/ai)
| # | Task | Done |
|---|
| 3.1 | Use drupal/ai only for LLM routing and Key; remove custom provider bridges | |
| 3.2 | Replace custom discovery (McpServerProject, mesh scrapers) with ai_agents + ai_agents_ossa | |
| 3.3 | Install ai_agents_ossa; parse OSSA capabilities into Tool plugins; disable custom scrapers | |
Pillar 4: API Normalization (drupal/api_normalization)
| # | Task | Done |
|---|
| 4.1 | Ban raw @http_client in custom: add CI rule or grep gate | |
| 4.2 | Locate OpenAPI specs for Mesh, MCP, workflow-engine, compliance, dragonfly | |
| 4.3 | Import specs into api_normalization; generate Tool plugins and gateway routes | |
| 4.4 | Remove custom Guzzle wrappers in mcp_registry, ai_agents_client, cedar_policy, recipe_onboarding_fleet_extension, code_executor, dragonfly_client | |
Pillar 5: FlowDrop Ecosystem
| # | Task | Done |
|---|
| 5.1 | Install drupal/flowdrop, drupal/flowdrop_ui | |
| 5.2 | Install flowdrop_tool_provider (expose Tool plugins on canvas) | |
| 5.3 | Install flowdrop_ai, flowdrop_ai_provider | |
| 5.4 | Implement flowdrop_ui_agents, flowdrop_field_widget_actions where needed | |
Pillar 6: Observability (drupal/audit_export)
| # | Task | Done |
|---|
| 6.1 | Purge custom DB tables for time-series, token counts, agent execution logs | |
| 6.2 | Install drupal/audit_export (and audit_export_tool if present) | |
| 6.3 | Pipe tool/maestro execution through audit_export to tracer.bluefly.internal | |
Pillar 7: Architecture via Config
| # | Task | Done |
|---|
| 7.1 | Zero hardcoded endpoints: purge *.blueflyagents.com and private IPs from custom code | |
| 7.2 | Migrate secrets/API keys to drupal/key | |
| 7.3 | Add config/schema/*.schema.yml for all custom settings | |
| 7.4 | All parameters editable via admin UI (no $settings for module logic) | |
Module-to-Pillar Mapping (Where to Change What)
| Module | Pillars | Priority |
|---|
| mcp_registry | 1, 4, 3 | High |
| ai_agents_client | 1, 4, 3 | High |
| recipe_onboarding, recipe_onboarding_fleet_extension | 1, 2, 4, 7 | High |
| dragonfly_client | 1, 4, 7 | High |
| code_executor | 1, 4 | High |
| cedar_policy | 4, 7 | Medium |
| alternative_services | 1, 4, 7 | Medium |
| ai_agents_ossa (custom parts) | 1, 3, 5 | Medium |
| ai_agents_dashboard / monitoring | 1, 4, 6 | Medium |
References
- tool, orchestration, eca, maestro
- ai, ai_agents, ai_agents_ossa
- api_normalization, http_client_manager
- flowdrop, audit_export, key
- Wiki: Drupal-Community-Next-Change-Plan (Tool API first)
- AGENTS.md: Remaining rebuild list, Drupal Tool API migration priority