Files
pitchfast/backlog/tasks/task-49 - Improve-audit-outreach-email-tone.md

44 lines
2.8 KiB
Markdown

---
id: TASK-49
title: Improve audit outreach email tone
status: In Progress
assignee: []
created_date: '2026-06-08 19:30'
updated_date: '2026-06-08 19:48'
labels: []
dependencies: []
priority: high
ordinal: 51000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Add evidence-first, collegial-direct tonal guidelines for generated outreach emails, wire them into the existing German copy stage without extra AI calls, and hard-block unnatural email copy before outreach_ready.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Shared customer tone guidelines capture the selected collegial-direct email style and banned patterns
- [x] #2 German copy prompts use the tone guidelines, explicit lead context, at most two verified findings, and no extra AI stage or model call
- [x] #3 Deterministic German copy guard blocks unnatural email subjects and bodies while keeping public audit tone checks limited to existing rules
- [x] #4 Quality review applies the same first-contact email rubric
- [x] #5 Focused and full regression tests cover natural email pass cases, unnatural email failures, source wiring, and no new generation stage
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1. Add failing tests for natural vs. formulaic outreach email tone
2. Add shared collegial-direct tone guideline module
3. Add deterministic hard guard for email subject/body tone
4. Wire guidelines into German copy and quality review prompts without a new AI stage
5. Run focused tests, full regression, lint, diff check, and Convex dev sync
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Implemented the evidence-first outreach email tone pass. Added `lib/ai/customer-tone-guidelines.ts` with the selected collegial-direct sender posture, short first-contact email constraints, banned phrases, and prompt helper. Updated German copy generation to remove the old Ich-Ich instruction, include the shared tone section, pass normalized evidence context, and keep the existing generation call structure. Added hard deterministic email tone checks for subject length/pitch patterns, email length, sentence/paragraph count, formulaic Ich-habe/Ich-schlage-vor patterns, brochure language, mini-audit structure, informal address, and missing low-friction asks. Public audit hard guard behavior remains limited to the existing rules. Quality review now explicitly asks whether the email sounds like a real first email from Matthias, not AI sales copy, and whether concrete claims are backed by verified findings. Verification: focused tests 60/60 passed; full `pnpm test` 395/395 passed; targeted ESLint passed; `git diff --check` passed; `npx convex dev --once` synced successfully after fixing the Convex-only typecheck issue by passing `evidenceInput` instead of raw evidence.
<!-- SECTION:NOTES:END -->