# KRB next-20 live scrape import v3 — missing sections repair

This is a corrective Code Lab script generated after the v2 run appeared to set hero/images successfully but left many content sections unadded.

## Root cause found

In v2, `CONFIG.insertMissingTopLevelSections` was still `false`. The script detected missing components and logged count warnings, but `insertInMain()` returned immediately, so those missing `Section / Text Content`, `Section / Two Column Text & Image`, `Section / Gateway CTA`, `Section / Downloads`, and `Section / Next Pages` instances were never inserted. The later population loop only writes into existing instances, so source blocks were reported as `not placed`.

## v3 repair defaults

- `dryRun: false` — live repair run by default. Set to `true` first if you want another read-only report.
- `runMode: 'all-pages'` — processes the 16 live-source pages included in v2.
- `insertMissingTopLevelSections: true` — inserts missing top-level section components before populating props/images.
- No publish/delete/redirect/global style operations.
- Keeps the API-confirmed hero asset IDs/fallbacks from v2.

## Pages still excluded

Same as v2; these WordPress source URLs returned 404 and are not in this script:

- All Girls Senior School and Boarding
- Our School
- Beyond Class
- International Boarding Scholarships

## What to check after run

Look for console prefix `KRB_LIVE_SCRAPE_REPAIR_AUTO_RESULT`. For each page, verify:

- `inserted` includes the components that were missing before.
- `countsAfter` meets the `EXPECTED` counts.
- `warnings` no longer includes `Text Content block(s) not placed` / `Two Column block(s) not placed` for components that should now exist.
- `manual` still lists genuinely unmapped source blocks such as videos/galleries/complex CTAs; those require separate handling.

## Code Lab product notes

This failure is exactly where Code Lab could be better for migration workflows: it needs a preflight that distinguishes “source blocks detected” from “target components missing”, a visible toggle for “insert missing sections”, and a post-run counts/readback panel rather than leaving the user to infer from a long console blob.
