Batch ws-1-2-truth-and-universal-law — REVIEW

Content-cleanup variant per ADR-0009. Stage-2 cleanup of WS-II Chapter 2 (“Truth and Universal Law”), Part 1 (“God and the Creation”). First Phase B chapter — first batch to use the full resources/WorldScripture/ws-notes.md (committed in e7a993b) for footnote backfill.

What changed

  • New (8 files): resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/ws-{NN-subtheme-slug}.md. Per-sub-theme files; line counts 81–255, total ~1,220 lines across the 8.
  • Intermediate (1 file, kept in staging only — not moved to final per pilot precedent): staging/ws-1-2-truth-and-universal-law/resources/WorldScripture/Part1/ws-1-2-truth-and-universal-law.md — splitter’s input.
  • New script: scripts/clean_ws_chapter.py — deterministic stage-2 cleaner. Replaces the per-chapter manual AI cleanup of the pilot with a reproducible script that handles the patterned transformations (heading re-leveling, italics strip, blockquote unwrap, SMM rename, footnote-marker conversion, word-break fixes) and writes a flag-log for the few cases that need human judgment.

Sub-theme files produced

Filenames carry a 2-digit ordinal prefix (ws-NN-) so alphabetical sort matches print order.

FileLinesSub-sub-themesSMM blocksFootnotes used
ws-01-eternal-truth.md206331–3
ws-02-the-moral-law.md155224–5
ws-03-the-golden-rule.md86016
ws-04-the-ten-commandments.md153017–10
ws-05-beyond-the-law.md9601(none)
ws-06-duality.md2553311–16
ws-07-interdependence.md810117, 19
ws-08-cause-and-effect.md1882218, 20–23

Per-file footnote scoping (markdown footnotes are file-local) verified: body [^N] refs match [^N]: definitions in every file. Total inline markers: 23 (= ch2’s full count from the back-matter notes).

Cleanup decisions (applied deterministically by scripts/clean_ws_chapter.py)

  • Chapter title (## Truth and Universal Law, raw line 1): dropped. Lives in per-file frontmatter title + chapter-title.
  • Sub-themes (8 of them: Eternal Truth, The Moral Law, The Golden Rule, The Ten Commandments, Beyond the Law, Duality, Interdependence, Cause and Effect): kept as H1 (# Title) — the splitter slices on these.
  • Numbered sub-sub-themes (10 total across 4 sub-themes): ### *N. Title*## N. Title. Italics stripped, depth dropped one. Number prefix preserved per the pilot convention (still under review: confirm/strip).
  • SMM blocks (14 total): rewritten as ## SMM — {parent}. Parent = most-recent numbered sub-sub-theme (with N. prefix preserved) for sub-themes that have sub-sub-themes; or the sub-theme title for the four sub-themes without sub-sub-themes (Golden Rule, Ten Commandments, Beyond the Law, Interdependence). Three SMM-block formats Marker produced — all caught: #### *Teachings of Sun Myung Moon*, ### *Teachings of Sun Myung Moon*, and the bare *Teachings of Sun Myung Moon* (no heading marker at all, at raw lines 791 and 871).
  • Blockquote wrappers (4 stray): Marker wrapped four attribution lines in > . Pilot stripped these; the script does the same and flags each. The four: Immanuel Kant, Majjhima Nikaya 3.251-52, Chou Tun-i, Shantideva (all author/citation lines following long scripture passages).
  • Inline footnote markers: bare digits after a word/punctuation (e.g. God.1, child;2, Milan4) → [^N]. Uses sequence validation (each match must equal the next expected number 1, 2, …) and excludes verse-reference patterns like Rig Veda 10.85.1 / Qur'an 42.11 / Genesis Rabbah 13.13 via negative lookbehind on <digit>.. One orphan-space marker handled via fallback (raw line 1021 Ill. 23).
  • Word-break artifacts: birth-anddeathbirth-and-death applied. (No other word-break artifacts in this chapter’s text — script’s shared dictionary with clean_ws_notes.py is conservative.)
  • Frontmatter: synthesised by the splitter from the chapter file’s frontmatter + per-file subtheme slug derived from the H1 title.

Flagged for human review

  1. SMM slug still includes the N. number prefix on sub-sub-theme SMM blocks (e.g. ## SMM — 1. In the Beginning Was the Word). This was flagged on the pilot as an unresolved question: keep prefix, or strip to ## SMM — In the Beginning Was the Word. Script preserves the pilot’s choice. Confirm.

  2. Mid-paragraph hard breaks from Marker preserved as-is (consistent with pilot).

  3. Tradition-tag italics kept as-extracted (e.g. Rig Veda 10.85.1 *(Hinduism)*). Same convention as pilot. African Traditional Religions attributions also italicised inconsistently in raw; left untouched.

  4. > blockquote strips (4) — all four were author/attribution lines. None should reasonably remain blockquoted. Script auto-strips and flags; the four flags in flag-log.txt correspond to the cases.

  5. Note 23’s orphan-space form (raw Ill. 23 at line 1021) — the only marker in this chapter where Marker inserted a space between the sentence-terminator and the digit. Script’s fallback regex caught it; flagged for visual confirmation.

  6. Generality of the script. This is the first chapter to use clean_ws_chapter.py. Patterns observed in chapters 3–22 may differ (e.g. unusual SMM-block forms, more aggressive Marker artifacts). Each batch’s flag-log will surface deviations; the script will need extending if a new pattern recurs.

Verification

# Frontmatter validates.
head -16 resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/ws-01-eternal-truth.md
 
# Heading structure (each file: zero or more `## N. Title` numbered sub-sub-themes,
# each followed by `## SMM — N. Title`; for files without numbered sub-sub-themes,
# one bare `## SMM — {Sub-theme}` block).
for f in resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/ws-*.md; do
  echo "=== $(basename $f) ==="
  grep -E '^## ' "$f"
done
 
# Per-file footnote ref/def match.
for f in resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/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
 
# Quartz preview.
cd _meta/quartz && npm run serve
# Navigate: WorldScripture → Part1 → Chapter02-truth-and-universal-law → ws-01-eternal-truth

Finalize plan

When user approves this batch:

  1. cp staging/ws-1-2-truth-and-universal-law/REVIEW.md _meta/batch-reviews/ws-1-2-truth-and-universal-law.md
  2. mv staging/ws-1-2-truth-and-universal-law/resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/ws-*.md resources/WorldScripture/Part1/Chapter02-truth-and-universal-law/
  3. Delete staging/ws-1-2-truth-and-universal-law/ per ADR-0009 + CONTEXT convention (9c5d7a3). Stage-2 intermediate ws-1-2-truth-and-universal-law.md lives in the staging commit’s git history.
  4. Commit.
  5. Proceed to Ch3 (chapter-3-the-purpose-of-human-life.md).

Out of scope (deferred)

  • Chapters 3–22 (20 batches remaining).
  • Front/back-matter at root level (Preface, Invocation, list-of-sources) — Phase C.
  • Atomization (stage-3, separate batches).