Files
yidaima/RuoYi-Vue/docs/superpowers/plans/2026-07-11-plugin-menu-target-executor.md

4.5 KiB

Plugin Menu Target Executor Implementation Plan

For agentic workers: Implement task-by-task with tests first. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Bind approved execution batches to the configured JDBC environment and deliver reviewed RuoYi admin menus through a real, idempotent adapter with target ownership and conservative compensation.

Architecture: The Worker propagates the frozen execution environment into every contribution context, and a shared policy rejects JDBC target mismatches before connection. A strict JSON parser produces a semantic menu document; menu-jdbc:v1 reuses the isolated target connection and durable receipt lease while a dedicated repository owns fixed prepared statements for RuoYi menu, role grant, and ownership tables.

Tech Stack: Java 8, Spring Boot 2.5, JDBC, Fastjson2, MySQL 5.7-compatible SQL, H2 MySQL mode, JUnit 4, Vue 2, Element UI.

Task 1: Approved Environment Gate

Files:

  • Modify: PluginContributionExecutionContext.java

  • Modify: PluginTransitionOutboxWorker.java

  • Create: PluginJdbcTargetEnvironmentPolicy.java

  • Modify: SQL and permission JDBC Executors and their tests

  • Propagate the execution batch's frozen environment to every target context.

  • Reject blank or mismatched approved environments before opening a JDBC connection.

  • Apply the shared policy to SQL, permission, and menu adapters.

  • Prove Worker propagation and zero-connection mismatch failure.

Task 2: Menu Document Contract

Files:

  • Create: PluginMenuDocument.java

  • Create: PluginMenuDocumentParser.java

  • Test: PluginMenuDocumentParserTest.java

  • Write tests for strict fields, canonical roles, identity mismatch, unsafe paths, invalid routes, wildcards, and bounds.

  • Implement bounded JSON parsing and semantic fingerprints.

  • Run parser tests.

Task 3: Target Ownership And Real Executor

Files:

  • Modify: sql/factory_plugin_sql_target.sql

  • Create: PluginMenuTargetRepository.java

  • Create: MenuJdbcPluginContributionTargetExecutor.java

  • Test: MenuJdbcPluginContributionTargetExecutorTest.java

  • Add menu and role-grant ownership tables with ACTIVE/REMOVED lifecycle state.

  • Support only MENU + admin_frontend + idempotent=true and APPLY/ROLLBACK.

  • Require an active factory-owned permission dependency, existing parent/roles, full parent-menu access, and the required permission grant.

  • Reject unowned path/route collisions, drift, unmanaged grants, and child menus.

  • Reuse durable receipt leases and deterministic external receipts.

  • Use one lock order for menu ownership and permission dependency.

Task 4: First Menu Delivery Plugin

Files:

  • Create: PreviewMenuBaselinePlugin.java

  • Create: plugin-delivery/preview-menu/delivery-verification.json

  • Create: plugin-delivery/preview-menu/rollback-delivery-verification.json

  • Test: PreviewMenuBaselinePluginTest.java

  • Publish one trusted reversible menu contribution with an explicit permission Plugin dependency.

  • Prove permission apply, menu apply, duplicate delivery, role visibility, reverse compensation, and receipt history end to end.

Task 5: Probe And Delivery Page

Files:

  • Modify: PluginSqlTargetProbeService.java

  • Modify: PluginSqlTargetProbeStatus.java

  • Create: PluginDeliveryVerificationStatus.java

  • Modify: FeaturePluginController.java

  • Create: ruoyi-ui/src/views/generator/delivery/index.vue

  • Modify: Plugin API, Plugin page, and static tests

  • Require permission and menu ownership tables when menu-jdbc:v1 is routed.

  • Expose a distinct non-secret menu-schema failure state.

  • Add a dedicated permission-protected delivery verification endpoint.

  • Implement the real component declared by the menu document.

  • Show menu ownership readiness and recognize menu-jdbc:v1 in Plugin management.

Task 6: Documentation And Regression

Files:

  • Create: docs/superpowers/specs/2026-07-11-plugin-menu-target-executor-design.md

  • Create: docs/superpowers/plans/2026-07-11-plugin-menu-target-executor.md

  • Modify: docs/superpowers/specs/2026-07-10-ai-software-factory-roadmap.md

  • Document activation, environment binding, ownership, dependencies, and compensation boundaries.

  • Run 149 focused Plugin tests.

  • Run generator full regression against the 18 known baseline failures.

  • Run 38 admin critical tests, four frontend static tests, and the production build.

  • Confirm EasyCode and RuoYi UI development endpoints return HTTP 200.