@gurupanguji

My Web This Week Backfill Design

Date: 2026-03-26 Issue: #101

Goal

Backfill historical My web this week roundup posts starting from a fixed start date of 2025-01-01.

The change should generate and commit the actual historical files under _posts/ for qualifying Sundays. It should not generate or update _snippets/ as part of the backfill.

Scope

In scope:

Out of scope:

Architecture

Keep scripts/generate_my_web_this_week.py as the single source of truth for roundup generation.

Add a backfill execution path that:

  1. derives the first Sunday on or after the configured start date
  2. iterates Sunday by Sunday through an explicit end date
  3. reuses the current Monday-through-Saturday source selection logic for each Sunday
  4. writes a weekly roundup post only when that week has at least one qualifying source item
  5. overwrites an existing historical weekly post if the generator is rerun

This keeps one implementation for extraction and rendering instead of splitting live generation and backfill into separate scripts.

Backfill Rules

Range rules:

Generation rules:

Reporting rules:

CLI Shape

Keep the current single-date behavior and add an explicit backfill mode.

Single Sunday:

python3 scripts/generate_my_web_this_week.py --date YYYY-MM-DD --write

Backfill:

python3 scripts/generate_my_web_this_week.py \
  --backfill-start YYYY-MM-DD \
  --backfill-end YYYY-MM-DD \
  --write

Safety rules:

Testing And Validation

Add tests for:

Validation steps:

python3 -m unittest tests/test_generate_my_web_this_week.py tests/test_validate_posts.py
python3 scripts/generate_my_web_this_week.py --backfill-start 2025-01-01 --backfill-end 2026-03-29
python3 scripts/generate_my_web_this_week.py --backfill-start 2025-01-01 --backfill-end 2026-03-29 --write
python3 scripts/validate_posts.py --today 2026-03-26

Risks