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)
| Need | Use | Do not build |
|---|---|---|
| LLM / chat / completions | ai.provider, AI providers (OpenAI, Anthropic, etc.) | Custom HTTP client or SDK wrapper |
| Agent-callable operations | Tool plugins (tool module); exposed to AI via tool_ai_connector | Custom RPC or agent API |
| Chained AI workflows | ai_automators (Automator chains, AutomatorsTool) | Custom pipeline engine |
| Event-driven automation | ECA (events, conditions, actions) | Custom event bus |
| Migration | migrate_plus, migrate_tools, optional ai_migrate | Custom migration runner |
| Validation / field AI | ai validations, AI content, AI CKEditor | Custom 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)
| Layer | Responsibility | Repo / module | Submodule |
|---|---|---|---|
| 1. Ingestion | Crawl, extract DOM/assets, emit contract | external_migration | external_migration_canvas (contract), ingest in main module |
| 2. Domain mapping | Normalize layouts, map content types, resolve components | external_migration | external_migration_canvas_mapper |
| 3. Canvas composition | Place components on Canvas, design tokens | external_migration, agentic_canvas_theme, agentic_canvas_blocks, studio-ui | external_migration_canvas_composer |
| 4. Orchestration | Fidelity scoring, gates, CI/CD, verification | code_executor, cedar_policy, drupal_patch_framework | external_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
| Gate | Threshold | Action |
|---|---|---|
| Publish | score >= 0.80 AND a11y_critical == 0 | Auto-publish to Drupal |
| Review | 0.60 <= score < 0.80 | Flag for human review |
| Reject | score < 0.60 | Block, return to mapping |
Implement using existing services (FidelityScoreService); expose as Tool or ECA if needed.
Config Entities (external_migration_canvas)
- source_profile — connection/auth per source site
- composition_policy — rules for Canvas page assembly (regions, fallbacks)
- migration_map — source-to-target field/component mapping per content type
Use Drupal config entity APIs only; no custom storage.
90-Day Plan
| Phase | Days | Deliverables | Key repos |
|---|---|---|---|
| 1. Foundation | 1–20 | migration.graph.v1 schema (JSON + PHP), ingest adapter refactor, Tool plugin for canvas pipeline | external_migration |
| 2. Mapping | 15–45 | Layout normalizer, content type mapper, component resolver stubs | layout_system_converter |
| 3. Composition | 30–60 | Canvas page builder, design tokens, studio-ui registry | agentic_canvas_theme, studio-ui |
| 4. Governance | 50–90 | Fidelity scoring, verification checks, CI/CD runner, recipe packaging | code_executor, recipe_onboarding |
References
- Drupal AI (drupal.org)
- Tool module — Tool plugins, tool_ai_connector for AI
- External Migration README — migration.graph.v1 contract, pipeline layers
- Drupal CI (this wiki)