Files
content-factory/tasks/013-draft-assembly-editor-preview.md
T

2.4 KiB

Task 013: Draft Assembly, Editor, And Generic Preview

Development description: Assemble section scaffolds into a canonical Markdown/MDX draft, provide versioned draft editing, and render a generic rich preview for editor review.

Implementation Details

  • Backend endpoints:
    • POST /api/articles/{article_id}/draft/assemble
    • GET /api/articles/{article_id}/drafts
    • GET /api/articles/{article_id}/drafts/{draft_id}
    • PATCH /api/articles/{article_id}/drafts/{draft_id}
  • Markdown is the canonical editable draft format.
  • Draft assembly includes:
    • Title.
    • Meta title.
    • Meta description.
    • Body Markdown/MDX.
    • FAQ block when applicable.
    • Visual placeholders.
    • Evidence references.
    • Unsupported claim warnings.
  • Approval-relevant draft edits create new immutable versions.
  • Frontend includes:
    • Draft editor.
    • Generic Markdown/MDX preview.
    • Version selector/history.
    • Unsupported-claim warnings near content.
  • The preview is for editor UX and content-shape validation, not target-site build/runtime validation.

Public Interface

  • Editor assembles a draft after production artifacts are ready.
  • Editor edits Markdown and metadata.
  • Editor views a generic preview.

Acceptance Criteria

  • TDD pre-requirement: before implementation, write one failing behavior test that assembles a draft from successful section scaffolds through the public API; proceed one draft behavior at a time and record evidence in Result.
  • Draft assembly includes all planned sections in order.
  • Draft includes metadata, FAQ, visual placeholders, evidence references, and unsupported claim warnings.
  • Draft version 1 is immutable after approval-relevant edits; edits create a new version.
  • Generic Markdown/MDX preview renders headings, links, tables, images/placeholders, and FAQ.
  • Editor can compare or select draft versions.
  • Draft assembly fails clearly if required section scaffolds are missing.

Verification

  • Run draft assembly API tests.
  • Run frontend editor/preview tests.
  • Run Docker Compose smoke flow from production artifacts to previewed draft.

Result

  • Status: Pending execution.
  • TDD plan: To be filled during execution.
  • Red evidence: To be filled during execution.
  • Green evidence: To be filled during execution.
  • Refactor notes: To be filled during execution.
  • Verification output: To be filled during execution.