Remove Anuva Prompts Change Breakdown
Created: 2026-05-19 04:37 UTC
Summary
Presentation Creation should stop using prompts stored in the anuva_prompts Payload collection and stop depending on src/lib/anuvax-prompts for generation prompts. The creation flow should route through Mastra presentationVideoWorkflow and its related agents, tools, and inline code prompts. Additional Mastra agents, workflows, tools, or inline prompt builders may be added when the current workflow does not yet cover a UI capability.
This breakdown does not implement the change. It identifies the likely work, affected surfaces, risks, and questions that should be resolved before writing the implementation plan.
Target Flow
flowchart TD
ui["Presentation Creation UI"] --> action["Presentation server action"]
action --> workflow["presentationVideoWorkflow"]
workflow --> intent["intentAgent inline instructions"]
workflow --> rag["ragWorkflow and RAG tools"]
workflow --> narrative["narrativeWorkflow"]
workflow --> visuals["visualsWorkflow and media tools"]
workflow --> slides["slidesWorkflow"]
workflow --> direction["directionWorkflow"]
workflow --> persisted["Persist scenes, compilation, jobs"]
oldCollection["anuva_prompts collection"]:::legacy
oldHelpers["src/lib/anuvax-prompts"]:::legacy
oldCollection -. remove from creation path .-> oldHelpers
oldHelpers -. no dependency .-> action
classDef legacy fill:#f7d7d7,stroke:#a33,color:#111
Current Touchpoints
The current codebase has both workflow-backed and pre-upgrade prompt-backed paths.
src/app/(frontend)/app/presentation/actions.tsimportsformatRagContext,renderPromptTemplate,resolvePrompt, andresolveVideoUseCaseIdfromsrc/lib/anuvax-prompts.generatePresentationVideoScenesWithWorkflowalready invokespresentationVideoWorkflowand records workflow metadata.generatePresentationDescription, the older scene/config generation path, per-scene voiceover/caption/image assistant actions, and some queue metadata still callresolvePromptor helpers fromsrc/lib/anuvax-prompts.src/app/(frontend)/app/rag/actions.tsusesanuva_promptsfor RAG image/video description refinement. This is adjacent to, but not strictly Presentation Creation UI.scripts/presentation-worker.tsusesanuva_promptsas a fallback prompt source for scene image generation.scripts/seed.tsseedsanuva_prompts.src/collections/anuvax/index.tsregisters theAnuvaPromptscollection, and generated Payload types include it.docs/core/PayloadDataModel.mdanddocs/state/CollectionMap.mdstill documentanuva_promptsas prompt/config support data.
Grouped Changes
1. Presentation Creation UI routing
The creation flow should have one canonical generation route: Mastra presentationVideoWorkflow.
Likely work:
- Identify the client calls from
src/app/(frontend)/app/create/presentation/page.tsxand related components intosrc/app/(frontend)/app/presentation/actions.ts. - Confirm whether the UI still calls any pre-workflow generation action for scenes/config.
- Retire or redirect older generation actions that call
resolvePromptfor initial presentation creation. - Keep action return shapes stable where the UI expects
ActionResultandPresentationCompileResultpayloads.
Explanation:
The user goal is not just to remove a collection lookup. It is to prevent the Presentation Creation UI from splitting generation between old prompt records and the new workflow. The UI should trigger workflow contracts rather than orchestrating old prompts itself.
Likely affected code:
src/app/(frontend)/app/create/presentation/page.tsxsrc/app/(frontend)/app/presentation/actions.tssrc/app/api/presentations/[id]/generate/route.tssrc/app/api/presentations/[id]/description/route.tssrc/mastra/anuvax-adapter.tssrc/mastra/workflows/presentationvideo.workflow.ts
2. Inline prompt ownership in Mastra workflow code
Prompts needed by creation should live in code as agent instructions, workflow prompt builders, or tool inputs rather than anuva_prompts documents.
Likely work:
- Extend
src/mastra/agents/presentationvideo-agent-contracts.tsor nearby prompt-builder helpers for any missing creation behavior. - Keep prompt builders typed around contracts such as
VideoDescriptionBrief,VoiceoverScriptJson,RevealSceneModel,SceneDirectionModel, andPresentationCompilationConfig. - Preserve deterministic validation and normalization in tools instead of moving it into free-form prompts.
- Add new agents/workflows/tools only where the current workflow cannot support a creation UI capability.
Explanation:
The existing presentationVideoWorkflow already has inline buildIntentPrompt and agent definitions. The change should continue that pattern and avoid a new prompt registry unless a code-native, typed helper is needed.
Likely affected code:
src/mastra/agents/presentationvideo-agent-contracts.tssrc/mastra/agents/*.agent.tssrc/mastra/workflows/presentationvideo.workflow.tssrc/mastra/workflows/sub/*.workflow.tssrc/mastra/tools/presentation/index.tssrc/mastra/tools/compiler/index.tssrc/lib/anuva/contracts-v1.ts
3. Remove legacy prompt helper dependencies from presentation code
Presentation code should no longer import or call src/lib/anuvax-prompts for creation behavior.
Likely work:
- Replace
resolvePromptusage in presentation generation paths with workflow calls or inline prompt builders. - Replace
formatRagContextwith a non-legacy helper if it remains useful as plain formatting, or move the formatting into Mastra/RAG tooling. - Replace
resolveVideoUseCaseIdwith a relationship utility that is not coupled to the legacy prompt module. - Update integration test mocks that currently mock
@/lib/anuvax-prompts/*.
Explanation:
Even if anuva_prompts remains in the schema temporarily, Presentation Creation should not depend on the old helper module. Utility functions that are still useful should be moved to neutral modules so imports do not imply prompt registry usage.
Likely affected code:
src/lib/anuvax-prompts/render.tssrc/lib/anuvax-prompts/resolve.tssrc/app/(frontend)/app/presentation/actions.tstests/integration/helpers/presentation-harness.tstests/integration/helpers/mock-runtime.ts
4. Per-scene assistants and image generation path decision
The current per-scene actions use anuva_prompts for voiceover edits, caption edits, and image prompt regeneration. These are related to the Presentation Video surface but may or may not be part of "Presentation Creation UI" for this change.
Likely work:
- Decide whether edit actions should move to Mastra
editAgentand partial scene edit workflow now. - Decide whether image regeneration should use
visualAgent, a dedicated inline prompt builder, or a tool-level prompt builder. - Preserve stale preview/audio markers after edits.
- Preserve AI interaction metering metadata with explicit workflow and step IDs.
Explanation:
Leaving these paths on anuva_prompts would satisfy a narrow "initial creation" interpretation but leave the presentation surface partially dependent on legacy prompts. Moving them now increases scope but aligns with the agentic upgrade direction.
Likely affected code:
src/app/(frontend)/app/presentation/actions.tssrc/mastra/agents/edit.agent.tssrc/mastra/agents/visual.agent.tssrc/lib/anuva/orchestration-service.tssrc/app/api/presentations/[id]/scenes/[sceneId]/edit/route.ts
5. Worker and queued generation cleanup
The presentation worker currently uses anuva_prompts as a fallback for image prompt generation.
Likely work:
- Prefer scene-level
visualGenerationPromptemitted by the workflow. - Replace the fallback with a code inline prompt builder or Mastra visual tool path.
- Keep robust fallback text for image generation if agent calls fail or no prompt exists.
Explanation:
The workflow-generated visual strategy should be the primary source for generated image prompts. The worker should not reach back into old Payload prompt records.
Likely affected code:
scripts/presentation-worker.tssrc/mastra/tools/presentation/index.tssrc/mastra/tools/media/index.ts
6. Payload collection and seed data scope
The anuva_prompts collection exists as Payload schema and seed data. Removing it entirely is larger than disconnecting creation from it.
Likely work if the collection is removed:
- Remove
AnuvaPromptsfromsrc/collections/anuvax/index.ts. - Generate a migration that drops the table and enum types only if the project accepts removal from the active database.
- Regenerate
src/payload-types.tsand the Payload import map if needed. - Remove prompt seed data from
scripts/seed.ts. - Update docs that list the collection.
Likely work if the collection is retained temporarily:
- Mark it as legacy or unused in docs.
- Remove creation code dependencies while leaving schema and seed cleanup for a later change.
Explanation:
Schema removal affects generated types, migrations, seed behavior, and any existing admin data. It should be an explicit decision, not a side effect of rerouting the UI.
Likely affected code/docs:
src/collections/anuvax/index.tssrc/payload-types.tssrc/migrations/*scripts/seed.tsdocs/core/PayloadDataModel.mddocs/state/CollectionMap.md
7. Adjacent RAG prompt usage
RAG library actions use anuva_prompts for image user context edits and video section edits.
Likely work:
- Decide whether these are out of scope because the request targets Presentation Creation UI.
- If in scope, replace them with RAG-specific inline prompt builders, Mastra tools, or agents.
- Keep returned JSON shape for
user_facing_description,asset_query, and video time bounds.
Explanation:
These paths are not the creation UI, but they are source-preparation paths that feed presentation generation. They may need a follow-up cleanup to fully remove anuva_prompts from runtime usage.
Likely affected code:
src/app/(frontend)/app/rag/actions.tssrc/mastra/tools/rag/index.tssrc/mastra/workflows/sub/rag.workflow.ts
Affected Product Surfaces
- Presentation setup and generation under
src/app/(frontend)/app/create/presentation. - Presentation edit and preview workflows under
src/app/(frontend)/app/videos/[id]. - Background image/audio generation through
presentation_generation_jobs. - Payload admin only if the
anuva_promptscollection is removed or hidden. - RAG library only if adjacent prompt usage is included in scope.
Likely Affected Tests
- Integration tests around presentation actions in
tests/integration. - Test harness mocks in
tests/integration/helpers. - Unit tests for
src/lib/anuvacontracts or orchestration if new workflow services are added. - E2E presentation workflow tests if UI route behavior changes.
Expected verification for implementation:
pnpm lintpnpm typecheckpnpm test:intpnpm test:e2eif route-level creation behavior changespnpm generate:typesandpnpm generate:importmapif Payload schema changes
Likely Docs Impact
docs/core/PresentationVideoWorkflow.md: update current server action and workflow ownership.docs/core/MastraAgentsAndTools.md: document any new agents/tools or prompt-builder locations.docs/core/PayloadDataModel.md: remove or markanuva_promptsdepending on schema decision.docs/state/CollectionMap.md: remove or markanuva_promptsdepending on schema decision.docs/state/ServerActionsMap.md: update presentation action behavior if old actions are removed or redirected.docs/state/WorkflowMap.md: update if workflow sequence or related sub-workflows change.docs/state/KnownGaps.md: close or adjust any gap about workflow-only presentation creation.
Risks
- Removing old prompt-backed paths may break UI flows that still expect incremental description generation or direct scene editing responses.
- Moving prompts inline can accidentally reduce admin configurability if
anuva_promptswas still used for production tuning. - Removing the Payload collection requires migration care and can affect existing data, locks, generated types, and seed expectations.
- The old helper module includes generic utilities mixed with prompt lookup; deleting it without moving neutral utilities can create avoidable churn.
- Per-scene edit behavior may need a partial edit workflow that is not fully complete yet.
- Worker fallback behavior must remain resilient when generated scenes do not have a usable
visualGenerationPrompt. - Existing tests mock legacy helpers, so passing tests may require harness updates before code behavior can be verified.
Dependencies
- Current Mastra API usage should be verified through the repo-local Mastra skill before workflow or agent changes.
- Provider/model names should remain on shared constants unless an implementation plan explicitly changes them.
- Payload schema removal depends on migration strategy and the active hosted database assumptions.
- The final implementation should preserve workspace boundaries and AI interaction metering.
Out Of Scope
- Rebuilding the entire Presentation Video workflow.
- Introducing a new database compatibility layer for old prompt records.
- Changing billing, coin conversion, or provider pricing behavior.
- Changing render output semantics beyond what is required to remove legacy prompt usage.
- Migrating historical
anuva_promptscontent into a new CMS prompt management product. - Removing stale docs under
docs/_stale.
Questions
Q1. Should this change remove the anuva_prompts Payload collection and table, or only remove Presentation Creation runtime dependencies on it?
Answer: Remove the anuva_prompts Payload collection and table
Q2. Should adjacent RAG library actions that use anuva_prompts be included in this change, or should this change only cover the Presentation Creation and Presentation Video surfaces?
Answer: Adjacent RAG library actions that use anuva_prompts should be included in this change
Q3. Should per-scene voiceover, caption, and image assistant actions be moved to Mastra agents/workflows now, or is the initial creation path the only required scope?
Answer: Per-scene voiceover, caption, and image assistant actions should be moved to Mastra agents/workflows now
Q4. Should old prompt-backed presentation actions be deleted when no longer called, or kept as deprecated wrappers that forward into presentationVideoWorkflow until the UI and tests settle?
Answer: Old prompt-backed presentation actions should kept as deprecated wrappers that forward into presentationVideoWorkflow until the UI and tests settle
Q5. Is admin-configurable prompt editing intentionally going away for Presentation Video, or should a future code-native prompt versioning approach be planned separately?
Answer: Admin-configurable prompt editing is intentionally going away