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
- 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.
- Apply titleCase upstream at the buildDigest source so both surfaces agree. Same prompt-content change risk but more architecturally clean.
- 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
Surfaced by:
/ce-code-reviewadversarial finding A-004 on PR #3751Severity: P3 (advisory)
Problem
digestStoryToSynthesisShapeinscripts/lib/brief-compose.mjs:580readss.categoryfrom the raw buildDigest output (canonical lowercase EventCategory enum value), while the envelope path uses Title-Cased values fromfilterTopStories. 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
digestStoryToSynthesisShapeso the prompt also sees Title-Case. Risk: changes LLM prompt content for every digest, every user — could affect output behavior non-deterministically.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
docs/plans/2026-05-17-002-fix-persist-story-track-category-plan.md.context/compound-engineering/ce-code-review/20260517-183801-744b2d26/adversarial.jsonfinding Add related-asset cards to clusters and map highlighting for infrastructure #4🤖 Surfaced by
/ce-code-review