---
phase: 07-track-enrichment-and-verification-integration
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
  - .claude/skills/create-track/steps/03-verify-and-save.md
autonomous: true

must_haves:
  truths:
    - "System verifies rhyme quality in generated lyrics according to the track's language (French or English)"
    - "Weak rhymes are flagged with replacement suggestions, not auto-fixed"
    - "Production brief includes a per-section linguistic verification report with syllable counts and rhyme quality scores"
    - "French verification dispatches to 3 procedures (syllables, rhymes, pronunciation)"
    - "English verification dispatches to 2 procedures (syllables, rhymes -- no pronunciation)"
    - "Only 2 conditions block save: pauvre rhyme in French chorus, eye rhyme in English chorus"
    - "The Phase 4 placeholder note about future linguistic verification is removed"
  artifacts:
    - path: ".claude/skills/create-track/steps/03-verify-and-save.md"
      provides: "Linguistic verification dispatch, per-section report format, updated production brief template"
      contains: "Verification Linguistique"
  key_links:
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "reference/linguistic/french/syllables.md"
      via: "Dispatch when langue == Francais"
      pattern: "reference/linguistic/french/syllables.md"
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "reference/linguistic/french/rhymes.md"
      via: "Dispatch when langue == Francais"
      pattern: "reference/linguistic/french/rhymes.md"
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "reference/linguistic/french/pronunciation.md"
      via: "Dispatch when langue == Francais"
      pattern: "reference/linguistic/french/pronunciation.md"
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "reference/linguistic/english/syllables.md"
      via: "Dispatch when langue == English"
      pattern: "reference/linguistic/english/syllables.md"
    - from: ".claude/skills/create-track/steps/03-verify-and-save.md"
      to: "reference/linguistic/english/rhymes.md"
      via: "Dispatch when langue == English"
      pattern: "reference/linguistic/english/rhymes.md"
---

<objective>
Replace the placeholder linguistic verification note in Step 03 with a real per-section verification system that dispatches to the French (Phase 5) or English (Phase 6) linguistic procedures, and update the production brief format to include the expanded verification report.

Purpose: LING-01 requires rhyme quality verification by language, and LING-06 requires a per-section linguistic verification report in the production brief. This replaces the Phase 4 placeholder: "La verification linguistique complete sera disponible dans une phase future."

Output: Updated `.claude/skills/create-track/steps/03-verify-and-save.md` with linguistic verification dispatch, per-section report format, blocking rules, and updated production brief file template.
</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/07-track-enrichment-and-verification-integration/07-RESEARCH.md
@.claude/skills/create-track/steps/03-verify-and-save.md
@reference/linguistic/french/syllables.md
@reference/linguistic/french/rhymes.md
@reference/linguistic/french/pronunciation.md
@reference/linguistic/english/syllables.md
@reference/linguistic/english/rhymes.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add linguistic verification dispatch and per-section report procedure</name>
  <files>.claude/skills/create-track/steps/03-verify-and-save.md</files>
  <action>
In `03-verify-and-save.md`, add a new section "## Verification Linguistique" AFTER the existing "## Rapport de Verification" section header but BEFORE the "## Sauvegarde du Fichier Track" section. This new section contains:

1. **Dispatch par langue** with explicit SI/ALORS logic:

   **SI langue == Francais, ALORS executer:**
   - Procedure de Verification des Syllabes (`reference/linguistic/french/syllables.md`) -- line by line, word by word. Show work INTERNALLY, not in the report.
   - Procedure de Verification des Rimes (`reference/linguistic/french/rhymes.md`) -- IPA transcription OBLIGATOIRE before any rhyme comparison (anti-orthographic matching).
   - Procedure de Scan de Prononciation (`reference/linguistic/french/pronunciation.md`) -- 6 scans, report ALERTE and ATTENTION only.

   **SI langue == English, ALORS executer:**
   - Procedure de Verification des Syllabes Anglaises (`reference/linguistic/english/syllables.md`) -- include stress analysis (OBLIGATOIRE for English).
   - Procedure de Verification des Rimes Anglaises (`reference/linguistic/english/rhymes.md`) -- IPA transcription OBLIGATOIRE.
   - NO pronunciation scan for English.

2. **Rapport par section**: For each section with lyrics (Verse, Chorus, Pre-Chorus, Bridge -- NOT instrumental Intro/Outro):

   | Section | Syllabes/ligne | Schema de rimes | Classification des rimes | Verdict |
   |---------|---------------|-----------------|--------------------------|---------|
   | [Verse 1] | 8-10 | ABAB | suffisante/suffisante | OK |
   | [Chorus] | 9-11 | AABB | riche/riche | OK |

3. **Alertes linguistiques** section listing only problems:
   - For each alert: [section]: [problem description] -> [suggestion]
   - Suggestions come from the rhyme suggestion workflows in the respective rhymes.md files
   - Weak rhymes are flagged with suggestions, NOT auto-fixed. The user decides.

4. **Scan de prononciation** (francais uniquement): Include the pronunciation scan table ONLY for French tracks:
   | Ligne | Scan | Severite | Detail | Mitigation |

5. **Regles de blocage** (explicit):
   - **BLOQUER** si: rime pauvre en Chorus francais OU eye rhyme en Chorus anglais
   - **ATTENTION** (ne pas bloquer): rimes sous seuil en Verse/Bridge, alertes de prononciation
   - "Les avertissements linguistiques sont des recommandations -- le jugement creatif prevaut"

6. **Post-verification interaction** (when issues found after user approved lyrics in Step 02):
   - Present the report with: "Le rapport de verification a identifie les points suivants: [list]. Voulez-vous que je propose des ajustements, ou on garde les lyrics tels quels?"
   - If user says "garde" -> save as-is with alerts in the report
   - If user says "ajuste" -> revise lyrics, re-run verification, present again

7. **Two-level reporting principle**: Claude performs the full IPA decomposition and step-by-step counting INTERNALLY for accuracy. Only the SUMMARY table goes into the production brief file. No raw IPA in the brief.

IMPORTANT: Do NOT modify the "## Verification des Contraintes Suno" section. It stays as-is.
  </action>
  <verify>
Read `03-verify-and-save.md` and confirm:
- Section "## Verification Linguistique" exists
- French dispatch references all 3 procedures (syllables, rhymes, pronunciation)
- English dispatch references 2 procedures (syllables, rhymes) and explicitly excludes pronunciation
- Per-section report table format is present
- Blocking rules are explicit (2 conditions only)
- Post-verification interaction flow is documented
- Two-level reporting principle is stated
  </verify>
  <done>Linguistic verification dispatch is implemented with language-specific procedure invocation, per-section summary reporting, 2 blocking conditions, and post-verification user interaction flow</done>
</task>

<task type="auto">
  <name>Task 2: Update Rapport de Verification and production brief format to include linguistic verification</name>
  <files>.claude/skills/create-track/steps/03-verify-and-save.md</files>
  <action>
In `03-verify-and-save.md`, make the following modifications to the existing sections:

1. **Update "## Rapport de Verification"**: Rename the section to "## Rapport de Verification" (keep name) but restructure its content:
   - Add a subsection "### Contraintes Suno" containing the existing verification table (Style prompt, Lyrics, Tags style, Metatags, Langue -- all unchanged)
   - The linguistic verification results from Task 1 will follow naturally as the next subsection

2. **Remove the placeholder note**: Delete the line:
   `> La verification linguistique complete (comptage syllabes, analyse rimes) sera disponible dans une phase future.`
   This note appears TWICE in the current file -- once under "## Rapport de Verification" and once in the file format template under "## Sauvegarde du Fichier Track". Remove BOTH occurrences.

3. **Update the production brief file template** (in the "### Format du Fichier" subsection under "## Sauvegarde du Fichier Track"): Replace the current "## Rapport de Verification" section in the file template with the expanded format:

```
## Rapport de Verification

### Contraintes Suno

| Controle | Resultat | Detail |
|----------|----------|--------|
| Style prompt | [OK/OPTIMAL/WARNING] | [X] chars -- [zone] |
| Lyrics | [OK/WARNING] | [X] chars / 3000 (recommande) | 5000 (limite) |
| Tags style | [OK/WARNING] | [X] tags |
| Metatags | [OK] | [X] sections |
| Langue | [OK] | Monolingual [langue] |

### Verification Linguistique

**Langue :** [Francais/English]

| Section | Syllabes/ligne | Schema de rimes | Classification des rimes | Verdict |
|---------|---------------|-----------------|--------------------------|---------|
| [Verse 1] | [range] | [schema] | [classification] | [OK/ATTENTION] |
| [Chorus] | [range] | [schema] | [classification] | [OK/ATTENTION] |
| ... | ... | ... | ... | ... |

**Alertes linguistiques :**
- [section]: [probleme] -> [suggestion]
(ou "Aucune alerte" si tout est OK)

**Scan de prononciation** (francais uniquement):
| Ligne | Scan | Severite | Detail | Mitigation |
|-------|------|----------|--------|------------|
| ... | ... | ... | ... | ... |
(section omise pour les tracks en anglais)
```

4. **Update the "## Output de Step 2" counterpart**: The "## Rapport de Verification" section title change does NOT affect Step 02's output section -- that file is handled by Plan 07-01. Only modify Step 03.

IMPORTANT: Preserve ALL other content: Suno constraint checks table and logic, Zones du Style Prompt table, Sauvegarde procedure, Mise a Jour Discographie, Confirmation section.
  </action>
  <verify>
Read `03-verify-and-save.md` and confirm:
- "### Contraintes Suno" subsection exists under the verification report
- "### Verification Linguistique" subsection exists in the file template
- The placeholder note "sera disponible dans une phase future" does NOT appear anywhere in the file
- The production brief file template includes the expanded verification format with per-section table
- The Suno constraints table and zone descriptions are preserved unchanged
- The Sauvegarde, Mise a Jour Discographie, and Confirmation sections are intact
  </verify>
  <done>Production brief format is updated with split verification sections (Contraintes Suno + Verification Linguistique), placeholder note removed from both locations, and file template includes per-section linguistic report with pronunciation scan for French only</done>
</task>

</tasks>

<verification>
1. Read `.claude/skills/create-track/steps/03-verify-and-save.md` end-to-end
2. Confirm sections in order: Verification des Contraintes Suno, Zones du Style Prompt, Rapport de Verification (with Contraintes Suno + Verification Linguistique subsections), Verification Linguistique (dispatch procedure), Sauvegarde du Fichier Track, Mise a Jour Discographie, Confirmation
3. Confirm NO occurrence of "sera disponible dans une phase future" or "phase future"
4. Confirm French dispatch references 3 procedures, English references 2
5. Confirm blocking rules: only 2 conditions (pauvre chorus FR, eye rhyme chorus EN)
6. Confirm the file template in "Format du Fichier" includes the expanded verification format
7. Confirm all existing Suno constraint checks are preserved unchanged
</verification>

<success_criteria>
- Step 03 contains a complete linguistic verification dispatch system (French: 3 procedures, English: 2 procedures)
- Per-section verification report format with syllable ranges, rhyme schemes, classification, and verdicts
- Phase 4 placeholder note removed from both the instructions AND the file template
- Production brief file format includes expanded "Rapport de Verification" with "Contraintes Suno" and "Verification Linguistique" subsections
- Only 2 blocking conditions exist; all other issues are advisory recommendations
- Post-verification interaction flow handles the Step 02 approval / Step 03 verification tension
</success_criteria>

<output>
After completion, create `.planning/phases/07-track-enrichment-and-verification-integration/07-02-SUMMARY.md`
</output>
