Files
yidaima/RuoYi-Vue/docs/superpowers/plans/2026-07-11-plugin-rehearsal-durable-outbox-release-gate.md

2.3 KiB

Plugin Rehearsal Durable Outbox And Release Gate Implementation Plan

Goal: Move local H2 rehearsal execution out of HTTP requests and produce a comparable, integrity-verified release decision.

Tech Stack: Java 8, Spring Boot 2.5, MyBatis, H2 MySQL mode, JUnit 4, Vue 2, Element UI.

Task 1: Durable Command Ledger

  • Add one Outbox row per Attempt with a unique foreign key.
  • Persist lease owner, private token, deadline, heartbeat, delivery count, availability, error, and terminal time.
  • Insert Attempt, six Receipts, and PENDING Outbox in one transaction.
  • Return from the start API without opening H2.

Task 2: Lease Worker

  • Atomically claim due PENDING and expired PROCESSING commands.
  • Fence every mutation with the current lease token.
  • Renew before state transitions and periodically during scenario execution.
  • Keep target execution outside Spring transactions.
  • Remove the legacy unleased Attempt start Mapper path.

Task 3: Recovery

  • Rebuild H2 and replay all six scenarios after takeover.
  • Reset only non-terminal Attempt evidence before replay.
  • Reject manual takeover while a lease is active.
  • Requeue an expired lease for normal Worker claim.
  • Abort open Attempt, Receipts, and Outbox atomically.

Task 4: Comparison And Gate

  • Compare only complete successful Attempts.
  • Preserve raw evidence SHA-256 verification.
  • Exclude volatile transport identity from semantic fingerprints.
  • Block release on latest Attempt state, Outbox state, missing evidence, tampering, or semantic drift.
  • Let the first successful delivered Attempt establish a baseline.

Task 5: API And Workspace

  • Add reconcile, comparison, and release-gate endpoints under generator:delivery:verify.
  • Poll PENDING/RUNNING Attempts from the delivery report.
  • Show Outbox status, delivery count, Worker, heartbeat, and lease deadline.
  • Add semantic comparison and release-gate views.
  • Keep lease token and local H2 connection identity out of REST responses.

Task 6: Regression

  • Run 29 focused rehearsal and schema tests with no failures.
  • Run 193 Plugin tests with no failures.
  • Run 836 generator tests with the exact 18 known failures and 38 admin tests with no failures.
  • Run frontend contract tests.
  • Run the production frontend build.