Files
content-factory/tasks/014-assets-and-media-library.md
T

2.3 KiB

Task 014: Assets And Media Library

Development description: Implement asset specifications, generated or uploaded asset records, object-storage file handling, approval/rejection, replacement, and a media library view.

Implementation Details

  • Backend endpoints:
    • POST /api/articles/{article_id}/assets/generate-specs
    • GET /api/articles/{article_id}/assets
    • PATCH /api/articles/{article_id}/assets/{asset_id}
    • POST /api/articles/{article_id}/assets/{asset_id}/approve
    • Upload/replacement endpoint for asset files.
  • Asset types:
    • Hero image.
    • Inline diagram.
    • Table.
    • Flowchart.
    • Comparison matrix.
    • Architecture diagram.
    • Inline image.
  • Asset record fields:
    • Title.
    • Type.
    • Prompt or diagram/table code.
    • File URL/object key.
    • Alt text.
    • Caption.
    • Status.
    • Linked section/article.
  • Frontend:
    • Asset review page.
    • Media library.
    • Replacement upload.
    • Approval/rejection controls.

Public Interface

  • Editor reviews generated asset specs.
  • Editor approves, rejects, or replaces assets.
  • Approved assets are included in draft/publish bundle.

Acceptance Criteria

  • TDD pre-requirement: before implementation, write one failing public API test for approving an asset and seeing it become available to the article; proceed one asset behavior at a time and record evidence in Result.
  • Asset specs are generated and linked to article or section.
  • File uploads store objects in object storage and persist object keys.
  • Asset approval writes workflow event.
  • Rejected assets are excluded from publish bundle.
  • Replacement preserves audit history.
  • Media library lists article assets with status, type, title, preview/file link, alt text, and caption.
  • Draft preview uses approved asset references where available.

Verification

  • Run asset API tests.
  • Run object-storage upload integration tests.
  • Run frontend media library tests.
  • Run smoke flow approving and replacing an asset.

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.