Skip to content

Remove Anuva Prompts Implementation Log

Created: 2026-05-19 04:37 UTC

Status

Implementation completed on 2026-05-19.

flowchart LR
  planned["Implementation plan"] --> runtime["Runtime prompt lookups removed"]
  runtime --> schema["Payload schema and seeds removed"]
  schema --> docs["Docs updated"]
  docs --> verified["Targeted verification complete"]
  verified --> blocked["Full-suite blockers documented"]

Code Changes

  • Added code-owned prompt builders:
  • src/mastra/tools/presentation/prompt-builders.ts
  • src/mastra/tools/rag/prompt-builders.ts
  • Updated presentation actions to remove src/lib/anuvax-prompts imports and prompt-record lookups.
  • generatePresentationDescription now uses a code prompt builder.
  • generatePresentationConfig remains as a compatibility path but uses code prompt builders rather than anuva_prompts.
  • Per-scene voiceover/caption edits use editAgent with code prompts.
  • Scene image regeneration uses visualAgent with code prompts.
  • Updated RAG refinement actions to use code prompt builders while preserving normalized JSON parsing for user_facing_description, asset_query, t0, and t1.
  • Updated scripts/presentation-worker.ts to use scene/job prompts first and a code-owned generated-image fallback via visualAgent.
  • Removed src/lib/anuvax-prompts/render.ts and src/lib/anuvax-prompts/resolve.ts.
  • Removed AnuvaPrompts from AnuvaxCollections, removed prompt seed data, regenerated src/payload-types.ts, and regenerated src/app/(payload)/admin/importMap.js.
  • Added src/migrations/20260519_000001_drop_anuva_prompts.ts and registered it in src/migrations/index.ts.

Test And Harness Changes

  • Removed integration harness mocks for legacy prompt helpers.
  • Removed resolvePrompt runtime mocking.
  • Updated presentation assistant tests to assert code-owned prompt-builder metadata on AI interactions.
  • Replaced the prompt-missing compile failure test with an agent failure test because prompt records are no longer a runtime dependency.

Docs Changes

  • Updated:
  • docs/core/PresentationVideoWorkflow.md
  • docs/core/MastraAgentsAndTools.md
  • docs/core/PayloadDataModel.md
  • docs/state/CollectionMap.md
  • docs/state/ServerActionsMap.md
  • docs/state/WorkflowMap.md
  • docs/state/KnownGaps.md
  • Docs now describe code-owned Mastra prompt builders and no longer list anuva_prompts as an active Payload collection.

Verification

  • node .agents/skills/mastra/scripts/provider-registry.mjs --provider openai: passed.
  • pnpm generate:types: passed; Payload emitted a non-fatal hosted SMTP DNS warning while verifying Nodemailer transport.
  • pnpm generate:importmap: passed; Payload emitted the same non-fatal hosted SMTP DNS warning.
  • Targeted Biome check on changed files: passed.
  • pnpm typecheck: passed.
  • Targeted presentation integration tests:
  • pnpm exec vitest run --config ./vitest.config.mts tests/integration/presentation-compile.integration.test.ts tests/integration/presentation-assistants.integration.test.ts tests/integration/presentation-failures.integration.test.ts tests/integration/presentation-scene-edit-preview.integration.test.ts
  • passed: 4 files, 20 tests.
  • Active reference search:
  • No runtime/source/test references remain for src/lib/anuvax-prompts, resolvePrompt, renderPromptTemplate, formatRagContext, or resolveVideoUseCaseId.
  • Remaining anuva_prompts references are in historical migrations, the new drop migration, and the change artifacts.

Verification Blockers

  • pnpm lint failed on pre-existing unrelated docs issues:
  • docs/web/stylesheets.css uses !important and has formatting differences.
  • docs/_stale/archive/globals.css has formatting differences.
  • pnpm test:int failed one unrelated unit assertion in tests/unit/anuva-orchestration-service.test.ts.
  • Presentation integration tests passed.
  • The failing assertion expects every generated-run action metadata record to have artifactRefs; current service output has agent.presentation.analyzeNarrative with an empty artifact ref list.
  • pnpm test:e2e failed before running tests because playwright.config.ts imports package dotenv, which is not installed in the current dependency tree.

Remaining Risks

  • The drop migration is hand-authored and should be reviewed before applying to production.
  • generatePresentationConfig is still a large compatibility path even though it no longer reads prompt records; retiring it later would reduce duplicate generation behavior.
  • RAG refinement behavior now depends on code prompt wording, so production output should be spot-checked with real provider calls.