Skip to main content

Epic 73 Drupal Canvas Automation Platform

Epic 73: Drupal Canvas Automation Platform

GitLab: blueflyio/-/epics/73
Due: Mar 31, 2026
Constraint: Use Drupal AI and Tool API only. Do not build custom LLM clients, custom migration engines, or duplicate AI logic. Rely on contrib: ai, tool, tool_ai_connector, ai_automators, ECA, migrate_plus, migrate_tools.


Mission

Build a contrib-first, low-custom-code migration + page-building automation platform: point at an external website, rebuild it deterministically in Drupal, compose pages in Canvas using studio-ui components, run end-to-end in CI/CD with governance.


Mandatory Stack (No Custom Replacements)

NeedUseDo not build
LLM / chat / completionsai.provider, AI providers (OpenAI, Anthropic, etc.)Custom HTTP client or SDK wrapper
Agent-callable operationsTool plugins (tool module); exposed to AI via tool_ai_connectorCustom RPC or agent API
Chained AI workflowsai_automators (Automator chains, AutomatorsTool)Custom pipeline engine
Event-driven automationECA (events, conditions, actions)Custom event bus
Migrationmigrate_plus, migrate_tools, optional ai_migrateCustom migration runner
Validation / field AIai validations, AI content, AI CKEditorCustom validators

All new capabilities must be exposed as Tool plugins so agents and Drupal AI can invoke them. Existing canvas pipeline services (MigrationGraphService, CanvasPipelineService, etc.) are called from Tool plugins only; no custom agent-facing API.


Architecture (4 Layers)

LayerResponsibilityRepo / moduleSubmodule
1. IngestionCrawl, extract DOM/assets, emit contractexternal_migrationexternal_migration_canvas (contract), ingest in main module
2. Domain mappingNormalize layouts, map content types, resolve componentsexternal_migrationexternal_migration_canvas_mapper
3. Canvas compositionPlace components on Canvas, design tokensexternal_migration, agentic_canvas_theme, agentic_canvas_blocks, studio-uiexternal_migration_canvas_composer
4. OrchestrationFidelity scoring, gates, CI/CD, verificationcode_executor, cedar_policy, drupal_patch_frameworkexternal_migration_canvas_governance

Contract: migration.graph.v1 (JSON Schema + PHP value objects in external_migration_canvas). No layer-to-layer coupling.


Existing Tool Plugins (external_migration)

  • RunMigration, MapMigrationFields, ExecuteTransform, AnalyzeMigrationErrors, AiMapFields (main module)
  • SandboxedMigrationTool (external_migration_executor)
  • Canvas: add RunCanvasPipeline Tool in external_migration_canvas that delegates to CanvasPipelineService (so Drupal AI / agents can run the canvas pipeline via Tool API).

Fidelity Scoring

Formula: 0.35 x structure + 0.30 x content + 0.25 x layout + 0.10 x a11y

GateThresholdAction
Publishscore >= 0.80 AND a11y_critical == 0Auto-publish to Drupal
Review0.60 <= score < 0.80Flag for human review
Rejectscore < 0.60Block, return to mapping

Implement using existing services (FidelityScoreService); expose as Tool or ECA if needed.


Config Entities (external_migration_canvas)

  1. source_profile — connection/auth per source site
  2. composition_policy — rules for Canvas page assembly (regions, fallbacks)
  3. migration_map — source-to-target field/component mapping per content type

Use Drupal config entity APIs only; no custom storage.


90-Day Plan

PhaseDaysDeliverablesKey repos
1. Foundation1–20migration.graph.v1 schema (JSON + PHP), ingest adapter refactor, Tool plugin for canvas pipelineexternal_migration
2. Mapping15–45Layout normalizer, content type mapper, component resolver stubslayout_system_converter
3. Composition30–60Canvas page builder, design tokens, studio-ui registryagentic_canvas_theme, studio-ui
4. Governance50–90Fidelity scoring, verification checks, CI/CD runner, recipe packagingcode_executor, recipe_onboarding

References