Batch ws-2-8-religion — REVIEW
Content-cleanup variant per ADR-0009. Stage-2 cleanup of WS-II Chapter 8 (“Religion”), Part 2 (“Sin and Salvation”). Seventh Phase B chapter.
What changed
- New (9 files):
resources/WorldScripture/Part2/Chapter08-religion/ws-{NN-subtheme-slug}.md. Per-sub-theme files; line counts 121–224. - Intermediate (1 file, staging-only):
staging/ws-2-8-religion/resources/WorldScripture/Part2/ws-2-8-religion.md. - Modified:
scripts/clean_ws_chapter.py— added--chapter-titleCLI override for the case where Marker dropped the title line (see below).
Sub-theme files produced
| File | Lines | Sub-sub-themes | SMM blocks | Footnotes used |
|---|---|---|---|---|
ws-01-the-purpose-of-religion.md | 148 | 3 | 3 | 1 |
ws-02-one-truth-many-paths.md | 187 | 2 | 2 | 2–5 |
ws-03-tolerance-religious-freedom-and-interfaith-solidarity.md | 180 | 3 | 3 | 6–8 |
ws-04-shamanism-polytheism-and-animism.md | 180 | 2 | 2 | 9–13 |
ws-05-buddhism.md | 131 | 3 | 3 | 14–21 |
ws-06-confucianism.md | 136 | 2 | 2 | 22–26 |
ws-07-judaism.md | 184 | 4 | 4 | 27–31 |
ws-08-christianity.md | 224 | 4 | 4 | 32–34 |
ws-09-islam.md | 121 | 2 | 2 | 35–40 |
40 inline footnote markers converted (= Ch8’s full back-matter count in ws-notes.md). Per-file footnote refs == defs (sum: 1+4+3+5+8+5+5+3+6 = 40).
Cleanup decisions (script-applied)
Same base transformations as Ch2–Ch7. One new pattern Ch8 surfaced:
-
Missing chapter title at top of raw file. Ch8’s raw
chapter-8-religion.mdstarts directly with## The Purpose of Religion(a sub-theme) — no## Religionheading. Without intervention the cleaner would have consumed “The Purpose of Religion” as the chapter title and demoted the rest of the sub-themes by one structural level. Added--chapter-titleoptional CLI flag toscripts/clean_ws_chapter.py: when supplied (--chapter-title "Religion"for this batch), the auto-detection is skipped and the first##is treated as the first sub-theme. Thestate.chapter_titleis pre-seeded for use in frontmatter.This same pattern may show up on later chapters Marker mangled similarly; if so the same
--chapter-titleflag is the fix. Strictly opt-in — when not supplied, behaviour is unchanged from the prior version.
Ch2–Ch7 regression-tested unchanged on all six.
No manual fixes needed
No SMM marker mashed into body lines this chapter. No ## Chapter N artifact. No orphan-space footnote conversions — all 40 markers matched the primary regex.
Flagged for human review
-
--chapter-titleoverride invoked for this batch (only). Recorded in the finalize-plan commands below so the run is reproducible. -
Blockquote strips (7) — all attribution lines Marker wrapped in
>. Tradition tags include Korean Shamanism, Winnebago/Igbo, Dalai Lama, ‘Abdul’l-Bahá — broader source coverage than prior chapters but the strip pattern is identical. -
SMM number-prefix convention preserved per feedback_smm_prefix.
-
Tradition-tag italics kept as-extracted per pilot convention.
-
Cleanest chapter so far — 0 manual fixes, 0 SMM mashes, 0 orphan-space footnote conversions. Marker did good work on this one.
Verification
head -16 resources/WorldScripture/Part2/Chapter08-religion/ws-01-the-purpose-of-religion.md
# Frontmatter `title:`, `chapter-title:`, and the per-file slug should reflect the override.
for f in resources/WorldScripture/Part2/Chapter08-religion/ws-*.md; do
refs=$(awk 'BEGIN{p=1} /^## Footnotes/{p=0} p' "$f" | grep -oE '\[\^[0-9]+\]' | sort -u | wc -l)
defs=$(awk '/^## Footnotes/,0' "$f" | grep -cE '^\[\^')
echo "$(basename $f): refs=$refs defs=$defs"
done
# Ch2–Ch7 regression — all unchanged.Finalize plan
When user approves:
cp staging/ws-2-8-religion/REVIEW.md _meta/batch-reviews/ws-2-8-religion.mdmkdir -p resources/WorldScripture/Part2/Chapter08-religion && mv staging/.../Chapter08-religion/ws-*.md resources/WorldScripture/Part2/Chapter08-religion/- Delete staging dir per 9c5d7a3 convention.
- Commit; Ch9 (“History of God’s Providence”) follows.
Re-run command used (for reproducibility):
uv run scripts/clean_ws_chapter.py \
--input resources-raw/WorldScripture/extracted/02-sin-and-salvation/chapter-8-religion.md \
--output staging/ws-2-8-religion/resources/WorldScripture/Part2/ws-2-8-religion.md \
--part 2 --part-title "Sin and Salvation" --chapter 8 --chapter-title "Religion" \
--flag-log staging/ws-2-8-religion/flag-log.txtOut of scope
- Chapters 9–22 (14 batches remaining).
- Front/back-matter (Phase C).
- Atomization (stage-3).