Batch ws-1-5-life-after-death-and-the-spirit-world — REVIEW

Content-cleanup variant per ADR-0009. Stage-2 cleanup of WS-II Chapter 5 (“Life after Death and the Spirit World”), Part 1 (“God and the Creation”). Fourth Phase B chapter. Largest chapter in Part 1 by sub-theme count (13) and by footnote count (37).

What changed

  • New (13 files): resources/WorldScripture/Part1/Chapter05-life-after-death-and-the-spirit-world/ws-{NN-subtheme-slug}.md. Per-sub-theme files; line counts 84–279.
  • Intermediate (1 file, staging-only): staging/ws-1-5-life-after-death-and-the-spirit-world/resources/WorldScripture/Part1/ws-1-5-life-after-death-and-the-spirit-world.md. Includes a manual fix for the mashed SMM line on raw line 1069 (see “Manual fix” below).
  • Modified: scripts/clean_ws_chapter.py — added two new orphan-space footnote-marker fallbacks (see below).

Sub-theme files produced

FileLinesSub-sub-themesSMM blocksFootnotes used
ws-01-the-spirit-world.md146221–5
ws-02-the-immortal-soul.md175226–9
ws-03-preparation-for-eternity.md2794410–13
ws-04-dreams.md940114
ws-05-the-passage-beyond.md1772215–16
ws-06-the-judgment.md19644(none)
ws-07-heaven.md2593317–20
ws-08-hell.md2243321–23
ws-09-angels.md1583324–30
ws-10-spirits-of-the-departed.md1532231–36
ws-11-reincarnation.md8401(none)
ws-12-spiritual-error-and-the-occult.md1323337
ws-13-uniting-heaven-and-earth.md9801(none)

37 inline footnote markers converted (= Ch5’s full back-matter count in ws-notes.md). Per-file footnote refs == defs in every sub-theme file (total: 5+4+4+1+2+0+4+3+7+6+0+1+0 = 37).

Cleanup decisions (script-applied)

Same base transformations as Ch2/Ch3/Ch4. Two new Marker-artifact patterns Ch5 surfaced — scripts/clean_ws_chapter.py extended in this batch:

  • …end-of-quote." NN (close-quote + space + digit). Raw line 32: …shown to you on the mountain." 1. The primary regex requires no space between the lookbehind anchor and the digit; the existing orphan-space fallback requires <char>.\s<digit> (period then space), but here we have ."<space><digit> — the close-quote breaks the pattern. Without this fix, footnote [^1] was never detected, so the entire chain (which advances expected_footnote only on a successful match) failed for the whole chapter (0/37 markers converted on the first run). Added INLINE_FOOTNOTE_RE_QUOTE_FALLBACK ((?<=[.!?]"\s)).
  • …(citation) NN (close-paren + space + digit). Raw line 111: (91:280, February 27, 1977) 5. SMM speech citations of the form (volume:page, Month DD, YYYY) followed by a footnote marker put a close-paren before the digit, which neither the primary regex nor the period-orphan-space fallback catch () is in the primary lookbehind class but the digit is separated by a space; the fallback wants . before the space). Without this fix, footnote [^5] was never detected, breaking the chain after [^4] (1..4 of 37). Added INLINE_FOOTNOTE_RE_PAREN_FALLBACK ((?<=\)\s)).

Both fallbacks gated on n == state.expected_footnote so they cannot speculatively grab numbers that look like footnote markers but aren’t. Ch2/Ch3/Ch4 regression-tested after these script changes — output unchanged on all three (footnote counts and flag counts identical to prior runs).

Manual fix (staging-only edit)

Raw line 1069 mashed two attributions and the SMM heading marker onto a single line — same pattern Ch4 line 1083 surfaced. The SMM_INLINE_RE flag (added in the Ch4 batch) identified it; split by hand:

Before:                                      After:
                                             ...Yama! let him go!
To the sage-poets, ... Yama! let him go!
Rig Veda 10.154.1-5 *(Hinduism)*             Rig Veda 10.154.1-5 *(Hinduism)*
*Teachings of Sun Myung Moon*
                                             ## SMM — 2. Fellowship with the
                                                Saints and Our Ancestors

The Rig Veda passage (continuation of 10.154, the prayer to Yama) is now its own paragraph, the attribution sits on its own line, and the SMM heading takes its proper place in the heading hierarchy. The SMM body content immediately below (The Kingdom of Heaven is an extension of family life…) was already in place.

Flagged for human review

  1. Manual SMM split decision above — confirm the split matches the printed book layout.

  2. Two orphan-space footnote conversions — line 33 (mountain." 1) and line 1561 (worldwide." 33) used the post-quote fallback; line 111 (1977) 5) used the post-paren fallback; line 1313 used the existing post-period fallback (23). All four are gated by expected_footnote so they cannot be false positives.

  3. Blockquote strips (6 in this chapter, on the higher end). All six are attribution lines Marker wrapped in >. Consistent with prior chapters’ pattern.

  4. SMM number-prefix convention preserved per feedback_smm_prefix.

  5. Tradition-tag italics kept as-extracted per pilot convention.

  6. Largest chapter so far — 13 sub-themes, 30 SMM blocks, 37 footnotes, ~225 KB cleaned. If any structural problem went undetected the per-file refs==defs check (above) would catch it; both per-file and chapter-wide counts match ws-notes.md.

Verification

# Frontmatter validates.
head -16 resources/WorldScripture/Part1/Chapter05-life-after-death-and-the-spirit-world/ws-01-the-spirit-world.md
 
# Per-file footnote ref/def match.
for f in resources/WorldScripture/Part1/Chapter05-life-after-death-and-the-spirit-world/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/Ch3/Ch4 regression-check.
for C in 2 3 4; do
  uv run scripts/clean_ws_chapter.py \
    --input resources-raw/WorldScripture/extracted/01-god-and-creation/chapter-${C}-*.md \
    --output /tmp/ch${C}-recheck.md --part 1 --part-title "God and the Creation" --chapter ${C}
done
# Expected: Ch2 1..23, Ch3 1..15, Ch4 1..16, no new flags.

Finalize plan

When user approves:

  1. cp staging/ws-1-5-life-after-death-and-the-spirit-world/REVIEW.md _meta/batch-reviews/ws-1-5-life-after-death-and-the-spirit-world.md
  2. mkdir -p resources/WorldScripture/Part1/Chapter05-life-after-death-and-the-spirit-world && mv staging/.../Chapter05-.../ws-*.md resources/WorldScripture/Part1/Chapter05-life-after-death-and-the-spirit-world/
  3. Delete staging dir per 9c5d7a3 convention.
  4. Commit; Ch6 follows (first chapter of Part 2 — “Evil, Sin and the Human Fall”). This batch closes Part 1.

Out of scope

  • Chapters 6–22 (17 batches remaining across Parts 2–4: Ch6–10 Part 2, Ch11–18 Part 3, Ch19–22 Part 4).
  • Front/back-matter (Phase C).
  • Atomization (stage-3).