---
phase: 08-coherence-engine
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - .claude/skills/create-track/steps/03-verify-and-save.md
autonomous: true

must_haves:
  truths:
    - "System checks genre alignment between track style prompt and artist bible genre/sous-genres"
    - "System checks vocal style consistency between track delivery metatags and artist vocal identity"
    - "System checks theme relevance between track concept and artist defined themes"
    - "System checks emotion alignment between track emotion and artist palette (primaires, secondaires, interdites)"
    - "System enforces artist-specific Regles de Coherence from the bible"
    - "Coherence checks produce tiered severity verdicts (OK / ATTENTION / ALERTE) not binary pass/fail"
    - "User is presented with ALERTE findings and given choice to adjust or keep"
  artifacts:
    - path: ".claude/skills/create-track/steps/03-verify-and-save.md"
      provides: "Verification de Coherence subsection in Rapport de Verification"
      contains: "Verification de Coherence"
  key_links:
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "artists/[name]/bible.md"
      via: "Reading bible sections for comparison"
      pattern: "bible.*Genre|Vocal|Themes|Emotions|Coherence"
---

<objective>
Add bible alignment verification to the track production workflow (COH-01, COH-02, COH-03, COH-04).

Purpose: Every new track must be verified against the artist's identity before finalization. Genre, vocal style, themes, and emotions must align with the bible, and artist-specific negative constraints (Regles de Coherence) must be enforced. This is the core quality gate that ensures artistic coherence.

Output: Updated `03-verify-and-save.md` with a "Verification de Coherence" subsection in the Rapport de Verification, plus updated production brief template including the coherence report.
</objective>

<execution_context>
@C:/Users/zekho/.claude/get-shit-done/workflows/execute-plan.md
@C:/Users/zekho/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/08-coherence-engine/08-RESEARCH.md
@.claude/skills/create-track/steps/03-verify-and-save.md
@.claude/skills/create-artist/examples/example-bible.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add Verification de Coherence procedure to Step 03</name>
  <files>.claude/skills/create-track/steps/03-verify-and-save.md</files>
  <action>
Add a new major section "## Verification de Coherence" in Step 03, positioned AFTER the "## Verification Linguistique" section and BEFORE "## Sauvegarde du Fichier Track". This section contains the bible alignment verification procedure.

The section must include:

1. **Introduction instruction:** "Verifier l'alignement entre le track produit et la bible de l'artiste. Lire `artists/[name]/bible.md` sections: Identite Musicale, Style Vocal, Palette Emotionnelle, Themes, Regles de Coherence."

2. **5 checks as numbered subsections**, each with the pattern: what to compare (Bible field vs Track field), how to determine the verdict, and severity rules:

   **1. Alignement Genre (COH-01):**
   - Bible: Genre principal + Sous-genres
   - Track: tags genre dans le style prompt
   - Verdict: OK si le genre principal OU un sous-genre apparait dans les tags du style prompt. SI le style prompt a ete auto-genere (Phase 7) sans modification utilisateur: "OK (auto-genere depuis la bible)". SI modifie par l'utilisateur et aucun genre de la bible present: ATTENTION avec detail.

   **2. Coherence Vocale (COH-02):**
   - Bible: Type de voix + Style vocal + Techniques preferees
   - Track: delivery metatags utilises dans les lyrics (ex: [Whispered], [Belted])
   - Verdict: OK si les delivery tags correspondent aux Techniques preferees. SI un tag contredit le style vocal (ex: [Aggressive] pour un artiste Breathy): ATTENTION. SI le style prompt a ete auto-genere sans modification: "OK (auto-genere depuis la bible)" pour les tags vocaux du style prompt.

   **3. Pertinence Thematique (COH-03):**
   - Bible: Themes recurrents + Univers thematique
   - Track: concept/mood du track + themes explores dans les lyrics
   - Verdict: OK si au moins un theme du track connecte aux themes recurrents ou a l'univers thematique. ATTENTION si aucun lien thematique identifiable (avec suggestion de connexion possible).

   **4. Alignement Emotionnel (COH-04):**
   - Bible: Emotions primaires + Emotions secondaires + Emotions interdites
   - Track: emotion dominante du track
   - Verdict: OK si emotion dans Emotions primaires. OK (secondaire) si emotion dans Emotions secondaires. ALERTE si emotion dans Emotions interdites ou completement hors palette. Detail requis.

   **5. Regles Specifiques de Coherence:**
   - Bible: section Regles de Coherence (contraintes vocales, thematiques, emotionnelles, themes interdits)
   - Track: verification point par point de chaque contrainte negative
   - Verdict: OK si aucune regle violee. ALERTE pour chaque regle violee avec citation de la regle et explication de la violation.

3. **Severity rules block:**
   - OK: alignement confirme, aucune action requise
   - ATTENTION: ecart mineur, noter dans le rapport mais ne pas bloquer la sauvegarde
   - ALERTE: ecart majeur (emotion interdite, regle de coherence violee) -- presenter a l'utilisateur

4. **Post-verification coherence interaction** (extends the existing post-verification pattern from Verification Linguistique):
   - SI au moins une ALERTE est trouvee dans la Verification de Coherence: presenter le rapport et demander "Le rapport de coherence signale [X]. Voulez-vous ajuster ou garder tel quel ?"
   - SI l'utilisateur dit "garde": sauvegarder tel quel, les ALERTE restent dans le rapport
   - SI l'utilisateur dit "ajuste": reviser les elements concernes, re-executer la verification de coherence

5. **Output format -- Coherence table:**

```
### Verification de Coherence

| Controle | Bible | Track | Verdict |
|----------|-------|-------|---------|
| Genre | [Genre principal + Sous-genres] | [Tags genre du style prompt] | [OK/ATTENTION + detail] |
| Vocal | [Type + Techniques preferees] | [Delivery metatags utilises] | [OK/ATTENTION + detail] |
| Theme | [Themes recurrents] | [Concept + themes explores] | [OK/ATTENTION + detail] |
| Emotion | [Palette emotionnelle] | [Emotion dominante] | [OK/ATTENTION/ALERTE + detail] |
| Regles specifiques | [Regles de Coherence] | [Verification point par point] | [OK/ALERTE + detail] |
```

Also update the "### Post-verification : interaction avec l'utilisateur" section to mention BOTH linguistic AND coherence alerts. The existing text says "Le rapport de verification a identifie les points suivants" -- extend this to include coherence alerts alongside linguistic alerts when presenting to the user.
  </action>
  <verify>
Read `03-verify-and-save.md` and confirm:
1. "## Verification de Coherence" section exists after Verification Linguistique and before Sauvegarde du Fichier Track
2. All 5 checks are present (Genre, Vocal, Theme, Emotion, Regles Specifiques)
3. Three severity levels defined (OK, ATTENTION, ALERTE)
4. Post-verification interaction mentions coherence alerts
5. Table format matches the specified template
  </verify>
  <done>Step 03 contains a complete "Verification de Coherence" procedure with 5 bible alignment checks, tiered severity, and user interaction for ALERTEs</done>
</task>

<task type="auto">
  <name>Task 2: Add Verification de Coherence to the production brief file template</name>
  <files>.claude/skills/create-track/steps/03-verify-and-save.md</files>
  <action>
In the production brief file template (the large markdown code block inside "## Sauvegarde du Fichier Track > ### Format du Fichier"), add a "### Verification de Coherence" subsection inside the "## Rapport de Verification" section, AFTER "### Verification Linguistique" and its content.

Add the following block to the template:

```
### Verification de Coherence

| Controle | Bible | Track | Verdict |
|----------|-------|-------|---------|
| Genre | [Genre + Sous-genres] | [Tags genre] | [OK/ATTENTION] |
| Vocal | [Type + Techniques] | [Delivery metatags] | [OK/ATTENTION] |
| Theme | [Themes recurrents] | [Concept + themes] | [OK/ATTENTION] |
| Emotion | [Palette emotionnelle] | [Emotion dominante] | [OK/ATTENTION/ALERTE] |
| Regles specifiques | [Contraintes] | [Verification] | [OK/ALERTE] |
```

This ensures the saved production brief file contains the coherence verification results for future reference.
  </action>
  <verify>
Read the file template section of `03-verify-and-save.md` and confirm:
1. The production brief template includes "### Verification de Coherence" after "### Verification Linguistique"
2. The coherence table format is present in the template
3. The existing template sections (Contraintes Suno, Verification Linguistique, Notes) are preserved
  </verify>
  <done>The production brief file template includes a Verification de Coherence subsection so every saved track file contains its coherence report</done>
</task>

</tasks>

<verification>
1. Read `03-verify-and-save.md` end to end
2. Verify the section ordering: Contraintes Suno -> Verification Linguistique -> Verification de Coherence -> Sauvegarde -> Discographie
3. Verify the template ordering inside Format du Fichier: Contraintes Suno -> Verification Linguistique -> Verification de Coherence -> Notes
4. Verify the post-verification interaction covers both linguistic and coherence concerns
5. Verify coherence checks reference bible sections by their exact names from the example bible (Identite Musicale, Style Vocal, Palette Emotionnelle, Themes, Regles de Coherence)
</verification>

<success_criteria>
- Step 03 contains a complete coherence verification procedure that checks 5 dimensions of artist-track alignment
- Severity is tiered (OK/ATTENTION/ALERTE), not binary
- ALERTEs trigger user interaction before saving
- The production brief template includes the coherence report
- No existing verification functionality (Suno constraints, linguistic) is broken
</success_criteria>

<output>
After completion, create `.planning/phases/08-coherence-engine/08-01-SUMMARY.md`
</output>
