Skip to content
SprecherEast
Issue 363

enhancement: Agent suggestions carry a summary, categories and an image, and editors see the card before publishing

Back to our plan
Done
enhancementcmstoolingpriority: high

Problem

The agents' suggestions (#336, #344) carry a title, body, dates and place, but not what a resident sees first: the card summary, the category and an image. A suggested post today shows a placeholder card with no category and no summary, and an editor has to fill all three by hand. Editors also can't see how a draft will look as a card before publishing: Live Preview shows the post page only, and events have no card preview.

Owner decisions (2026-10-25, Claude session): images come from category defaults plus links to source images for the editor to approve (never uploaded by an agent), one shared category tree (previous issue), and a card preview in admin.

Proposed fix

  1. Contract (intelligence/schemas/): the draft and submitSuggestion gain summary (1–160 characters, plain text, used as the card text), categories (1–2 category slugs from the live tree), and the draft gains imageCandidates (0–2 links to an image on the source page, each with the page link and the credit as the source states it). The item gains a taxonomy section the runtime fills from the CMS (slug, title, parent) so the draft stage only picks existing categories. Prompts and evals are updated in the same PR.
  2. Server (submitSuggestion): summary → the post's meta.description / the event's description; slugs → category ids (an unknown slug is refused); the image → the first category's defaultImage, or its parent's, set as heroImage and the post's meta.image. Image candidates are not stored on the draft: the submit stage reports them with reportItem and a new image-candidate flag, so the editor sees the link and credit and decides.
  3. Card preview in admin: a sidebar field on posts and events that renders the site's own card component from the unsaved form data (title, summary, categories, image, date), so the editor sees the card as residents will.

Acceptance criteria

  • Not done: Schemas, prompts, evals and the CI check agree; the contract test (schemas.contract.test.ts) passes.
  • Not done: A suggestion with categories gets their default image (or the parent's), the summary and the category ids; an unknown slug is refused with a clear error; tests cover each.
  • Not done: image-candidate is a valid review flag end to end.
  • Not done: Posts and events show a card preview in the sidebar that updates as the editor types; it uses the real card component.
  • Not done: Docs updated (intelligence/README.md, security.md agent paragraph, data-model.md).

Area

cms, tooling

Priority

high

See it on GitHub, opens in a new tab