Skip to content

follow-up(brief): document or close synthesis-prompt category divergence #3752

Description

@koala73

Surfaced by: /ce-code-review adversarial finding A-004 on PR #3751
Severity: P3 (advisory)

Problem

digestStoryToSynthesisShape in scripts/lib/brief-compose.mjs:580 reads s.category from the raw buildDigest output (canonical lowercase EventCategory enum value), while the envelope path uses Title-Cased values from filterTopStories. Two-path divergence — every digest's synthesis prompt content changes from `… — General · …` (pre-PR) to `… — · …` (post-#3751).

This bypasses the "one place" titleCase doctrine the plan explicitly committed to (capitalize once at the envelope-build site so all consumers see the same form). The display path is consistent (threads card, magazine story-page, public-thread fallback all see Title-Case via the envelope). The LLM-prompt path silently isn't.

Options

  1. Apply titleCase at digestStoryToSynthesisShape so the prompt also sees Title-Case. Risk: changes LLM prompt content for every digest, every user — could affect output behavior non-deterministically.
  2. Apply titleCase upstream at the buildDigest source so both surfaces agree. Same prompt-content change risk but more architecturally clean.
  3. Document the intentional divergence — make explicit that synthesis prompt uses canonical lowercase enum (semantic anchor) while display uses Title-Case (presentation). No code change.

Recommendation

Probably (3) — the synthesis prompt benefits from the canonical enum form for LLM pattern-matching, and the display layer benefits from Title-Case for readability. The divergence is defensible; it's just undocumented.

Context

🤖 Surfaced by /ce-code-review

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions