# 2nd Grade Homeschool Curriculum β€” Project Context

## Critical Paths (DO NOT GUESS)

| What | Path | Notes |
|---|---|---|
| Curriculum root | `~/Home_School/2nd_Grade/` | All subjects live here |
| Shared engine | `~/Home_School/shared/` | `render.py`, `generate.py`, templates |
| Venv | `~/.venvs/math-curve/` | Python 3.12, WeasyPrint |
| Math | `Math/` | Outlines in `outlines/`, templates in `templates/` |
| Science | `Science/` | Same structure as Math |
| History | `History/` | **Files in `History/lessons/` NOT `History/Week01/`** |
| ELA | `English_Language_Arts/` | Procedural generators per week |
| ELA validation | `English_Language_Arts/validate.py` | Shared validation module |
| ELA audit DB | `English_Language_Arts/audit/` | `word_db.py`, `validators/` |
| Math rewrite status | `Math/REWRITE_STATUS.md` | Phase 2 done Jul 4 |

## Per-Subject Structure

### History
- **5 days/week** (Mon–Fri)
- PDFs live in `History/lessons/` β€” NOT `History/Week01/`
- Naming: `W01_Wednesday_Clues_From_The_Past.pdf` in `lessons/`
- JSON outlines in `History/outlines/`

### Science
- **3 days/week** (Mon, Wed, Fri) β€” NO TUESDAYS or THURSDAYS
- Science Week 1: Mon β†’ Wed β†’ Fri (no Tuesday bridge)

### ELA (English Language Arts)
- **5 days/week** (Mon–Fri)
- Weeks 1-24: Procedural via `English_Language_Arts/Week_N/generate_weekN.py`
- Weeks 25-32: **Static PDFs only** β€” no generator scripts
- Naming: `Week013_Tuesday_Irregular_Words.pdf` (3-digit week in filename)
- Lessons per week in `Week_N/{Monday,Tuesday,Wednesday,Thursday,Friday}/` subdirs
- Teacher guides included in later weeks (e.g., `Week02_Teacher_Guide_Silent_E_Pattern.pdf`)

### ELA Generator Pitfalls
- **Swap data NO-OPs**: `("word", "word")` identical pairs β€” check for these
- **Story cramming**: Forced target words into unnatural sentences β€” check narrative flow
- **Phonics pattern names**: Must match `audit/word_db.py` patterns (e.g., `ie_rule`, `digraph_th`, `double_consonant`)
- **Validator bug**: `ie_rule` validator in `audit/validators/__init__.py` handles "ei" exceptions (receive, ceiling) β€” was fixed Aug 2026
- Each generator has `validate_week()` call that blocks PDF generation on failure

### Math
- Naming: `Week_1_Tuesday.pdf` (underscore, not padded)
- Outlines + templates pipeline

## Pipeline

```
Claude generates JSON outlines (git tracked)
    β†’ Python Jinja2 templates render HTML
    β†’ WeasyPrint produces PDFs
```

- Outlines per subject in `{Subject}/outlines/`
- Templates per subject in `{Subject}/templates/`
- Batch gen: Claude provides 32-week outline, then build week-by-week

## Status

- **Math:** 32-week curriculum β€” rewrite active (Phase 2 done Jul 4)
- **Science:** 32-week β€” locked (complete), Mon/Wed/Fri only
- **History:** 32-week β€” JSON outlines rendered to PDF (5 days/week)
- **ELA:** 32-week β€” 5 days/week, W1-24 procedural, W25-32 static
- **3rd grade:** No outline yet, defer

## Generate

```bash
# Single week
~/.venvs/math-curve/bin/python ~/Home_School/shared/generate.py --subject Math --week 1

# ELA week (from its own directory)
cd ~/Home_School/2nd_Grade/English_Language_Arts/Week_01
python3 generate_week1.py
```

## Watchdog

- User wants automated monitoring for page counts, content mismatches, standards alignment
- Alerts sent directly via Telegram on failure

## Common Pitfalls

- WeasyPrint pagination quirks β€” use `weasyprint-pagination` skill for page break guidance
- PyMuPDF dash pattern corruption β€” use `pymupdf-dash-workaround` skill
- Curriculum review workflow: send actual PDFs to user (MEDIA: paths), not screenshots
- User prefers week-by-week review with Claude auditing mathematical correctness
- **ALWAYS check `lessons/` subdir for History files** β€” they're not in `Week01/`
- **ELA swap data MUST have different words** β€” identical pairs are a known bug pattern
- **Science is Mon/Wed/Fri only** β€” no Tuesday or Thursday lessons
- **History and ELA are both Mon-Fri** β€” 5 days/week each