Files
yidaima/RuoYi-Vue/docs/superpowers/plans/2026-07-10-database-prompt-publication-center.md

2.2 KiB

Database Prompt Publication Center Plan

Goal: Make Prompt releases editable and publishable without rebuilding the application while preserving immutable execution identities for queued tasks.

Architecture: factory_prompt_template owns stable Prompt code/generation type and a current release pointer. factory_prompt_version stores immutable content versions; only publication status changes. DatabasePromptRegistry is the primary runtime registry when explicitly enabled and falls back to built-ins otherwise. Admin services lock templates during version creation and pointer changes.

Task 1: Persistence

  • Add Prompt template/version domain models, mapper contracts, and MyBatis mappings.
  • Add base/upgrade SQL, built-in seeds, uniqueness constraints, and publication indexes.
  • Keep Prompt version content immutable after insertion.

Task 2: Publication Service

  • Create templates and monotonically numbered versions with canonical fingerprints.
  • Publish drafts and roll back to retired releases transactionally.
  • Validate ownership, content hashes, provider availability, and publication state.

Task 3: Runtime Registry

  • Resolve current database publication by generation type.
  • Resolve exact published/retired versions for queued task replay.
  • Use an explicit database-enabled switch and retain built-in fallback.

Task 4: Admin Experience

  • Add permission-guarded Prompt list/detail/create/edit/version/publish/rollback APIs.
  • Add RuoYi API client, Prompt management page, and menu SQL.
  • Show current release, version history, fingerprints, and publication actions.

Task 5: Verification

  • Add mapper/schema, registry, service, controller, and frontend source-contract tests.
  • Run targeted backend tests, frontend tests/build, and full generator baseline.
  • Update the factory roadmap and migration order.

Boundaries

  • P2-B2 versions the current system Prompt plus the existing user Prompt builder contract; parameterized user Prompt bodies migrate in later slices.
  • One-click multi-stage Prompt manifests remain P2-C pipeline work.
  • A/B experiments, approval workflows, provider secrets, and semantic model capability routing are not included.