Skip to main content

Prompt Composition

1 requirement · 5 scenarios

Prior AI Email Response Tagging

JR-prompt-composition-001
The system SHALL detect and tag prior AI email responses in quoted email threads before rendering the system prompt. AI responses are detected by:
- Start: Lines matching From:.*<email> where email is in DEFAULT_BLOCKED_EMAILS
- End: Detected using fallback markers in priority order:
1. -Junior or - Junior signature (primary - keeps signature, strips after)
2. Triple ZWSP (\u200B\u200B\u200B) - progress block indicator
3. Workflow emojis: 🔧, 🕒, ⚙️ - tool output indicators
4. [[ticket_...]] marker - final boundary (never included)

AI response content after the detected end marker SHALL be truncated and replaced with a summary note referencing [prior_analyses].

Each detected AI response SHALL be wrapped in semantic tags:
- Opening: [PRIOR_EMAIL_RESPONSE_BY_AI]
- Closing: [/PRIOR_EMAIL_RESPONSE_BY_AI]
5 test scenarios
  • AI response with signature JR-prompt-composition-001.1
  • Interim AI response without signature JR-prompt-composition-001.2
  • Multiple AI responses in thread JR-prompt-composition-001.3
  • User-only thread JR-prompt-composition-001.4
  • AI response detection from blocked emails list JR-prompt-composition-001.5