2.2 KiB
Editorial Video and Footer Contract Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Create each draft with one stored signature and a movable source-video block, while keeping the audience question and signature below the video in the editor and RSS output.
Architecture: Persist a safe [[VK_VIDEO]] marker in article HTML instead of an iframe. The admin converts that marker to an Editor.js video block; RSS replaces it with the trusted server-generated VK embed. The worker snapshots the configured signature when it creates a draft, and the API canonicalizes the footer so saving cannot duplicate it.
Tech Stack: FastAPI, SQLAlchemy, Celery, React, Editor.js, unittest.
Task 1: Protect the persisted article contract
Files:
-
Modify:
app/worker.py -
Modify:
app/routes.py -
Modify:
app/rss.py -
Test:
tests/test_rss.py -
Create drafts with the current global signature exactly once and with a
[[VK_VIDEO]]marker before the audience question. -
Preserve exactly one canonical signature when an article is saved; honour deliberate removal of the signature.
-
Render the marker at its saved location as the trusted VK embed, and keep the audience question and signature after it.
-
Cover a link-bearing signature and a moved video marker with regression tests.
Task 2: Expose and edit the video as an Editor.js block
Files:
-
Modify:
admin/src/App.tsx -
Include the source URL in article details.
-
Convert the persisted marker to a dedicated, movable Editor.js video block and serialize it back to the marker.
-
For older drafts without a marker, show one video block before the question and signature; saving upgrades them.
-
Remove open-time signature insertion so the signature is never recreated from settings.
Task 3: Verify the workflow
Files:
-
Test:
tests/test_rss.py -
Run focused backend tests, the full backend test suite, Python compilation, and the production frontend build.
-
Inspect the generated article payloads to confirm one signature, one video marker, and footer ordering.