Skip to content

docs(chapter_1): restore truncated tutorials + add completeness CI check#27

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/restore-truncated-howto-tutorials
Jul 11, 2026
Merged

docs(chapter_1): restore truncated tutorials + add completeness CI check#27
Jammy2211 merged 1 commit into
mainfrom
feature/restore-truncated-howto-tutorials

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Overview

Phase 1 (HowToLens) of #26. Two chapter-1 tutorials were cut off mid-generation
during the workspace bootstrap — tutorial_1_grids_and_galaxies and
tutorial_2_ray_tracing each ended on a docstring that promised a plot with no
code following and no Wrap Up, and had been frozen at the truncated length since
bootstrap commit #1 (the original workspace source no longer exists). This
restores the lost content and adds a CI check so the regression cannot silently
recur.

Root cause

Not a runtime bug — an LLM output-token cutoff while re-emitting a long file
during the bootstrap. Line counts had been frozen ever since (tutorial_1 at 429
vs the complete 654-line HowToGalaxy sibling).

What changed

  • tutorial_1 (429 → 672): restored log10 image + __Galaxies__ +
    __Units__ + __Wrap Up__ + advanced topics, adapted from the complete
    HowToGalaxy sibling to the autolens API and lens framing.
  • tutorial_2 (214 → 391): restored log-space convergence/potential +
    __Ray Tracing Grids__ (the lens equation) + __Ray Tracing Images__ +
    __Galaxies__ + __Tracer__ + __Mappings__ + __Wrap Up__, sourced from
    guides/tracer.py.
  • Prevention: .github/scripts/check_tutorials_complete.py + the
    Tutorials Complete CI workflow — every non-stub tutorial must contain a
    terminal __Wrap Up__/__Summary__ section (a truncated script never reaches
    its wrap-up, so absence of the marker reliably flags lost content; a second
    guard flags a final docstring ending on :). Verified to catch the original
    truncation and pass the restored tree.
  • Normalization: five complete-but-unmarked tutorials
    (tutorial_4_dealing_with_failure, tutorial_4_bayesian_regularization,
    tutorial_6_slam, tutorial_8_model_fit, tutorial_searches) get the
    terminal marker so they pass the new check.
  • Notebooks + navigator catalogue regenerated.

Deliberate not written yet stubs (tutorial_4_point_sources,
tutorial_5_lensing_formalism) already carry a __Wrap Up__ and are correctly
left untouched.

Scripts Changed

  • scripts/chapter_1_introduction/tutorial_1_grids_and_galaxies.py — restored truncated tail (log10 / Galaxies / Units / Wrap Up)
  • scripts/chapter_1_introduction/tutorial_2_ray_tracing.py — restored truncated tail (ray-tracing grids / images / Galaxies / Tracer / Mappings / Wrap Up)
  • scripts/chapter_2_lens_modeling/tutorial_4_dealing_with_failure.py — add __Wrap Up__ marker (already complete)
  • scripts/chapter_4_pixelizations/tutorial_4_bayesian_regularization.py — add __Wrap Up__ marker (already complete)
  • scripts/chapter_3_search_chaining/tutorial_6_slam.py — add __Wrap Up__ marker (already complete)
  • scripts/chapter_4_pixelizations/tutorial_8_model_fit.py — add __Wrap Up__ marker (already complete)
  • scripts/chapter_optional/tutorial_searches.py — add __Wrap Up__ section (already complete)
  • .github/scripts/check_tutorials_complete.py — new tutorial-completeness linter
  • .github/workflows/tutorials_complete.yml — new CI workflow running the linter
  • notebooks/**, llms-full.txt, workspace_index.json — regenerated

Validation checklist (--auto)

  • Tests: n/a — HowToLens is a tutorial/doc repo with no pytest suite; no library API touched.
  • Smoke: PASS — curated smoke_tests.txt 6/6 (including restored tutorial_1 & tutorial_2), run on this branch. Both restored scripts also run standalone end-to-end (EXIT 0).
  • Review: CLEAN — self-review; fixed one over-promised overview bullet (Mappings no longer claims a lines=/positions= overlay API it doesn't use).
  • Heart: YELLOW acknowledged by the maintainer at ship. The 6 reasons are ambient organism state unrelated to HowToLens (stale 2026-07-09 workspace validation, 58 stale parked scripts, autolens_assistant pin, 11-day-old PyAutoMind PR, install/release validation not run).
  • Completeness check: python .github/scripts/check_tutorials_complete.py . → all 35 tutorials pass; confirmed it fails on the pre-restore truncated tutorial_1/tutorial_2.

Phases 2–3 (HowToGalaxy, then HowToFit — same audit + restore + CI) follow as their own PRs. This PR does not close #26.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KExk2jkn2ya21b6NZLALpB

tutorial_1_grids_and_galaxies and tutorial_2_ray_tracing were cut off
mid-generation during the workspace bootstrap, each ending on a docstring that
promised a plot with no code following and no Wrap Up (frozen at the truncated
length since bootstrap commit #1; the original workspace source no longer
exists).

Restore the lost content:
- tutorial_1: log10 image + __Galaxies__ + __Units__ + __Wrap Up__ + advanced
  topics, adapted from the complete HowToGalaxy sibling to the autolens API and
  lens framing (429 -> 672 lines).
- tutorial_2: log-space convergence/potential + __Ray Tracing Grids__ (lens
  equation) + __Ray Tracing Images__ + __Galaxies__ + __Tracer__ + __Mappings__
  + __Wrap Up__, sourced from guides/tracer.py (214 -> 391 lines).

Both validated end-to-end and via the curated smoke suite (6/6).

Prevent recurrence: add .github/scripts/check_tutorials_complete.py + a CI
workflow that fails when any tutorial lacks a terminal __Wrap Up__/__Summary__
section — a truncated script never reaches its wrap-up, so absence of the marker
reliably flags lost content. Normalize five complete-but-unmarked tutorials
(tutorial_4_dealing_with_failure, tutorial_4_bayesian_regularization,
tutorial_6_slam, tutorial_8_model_fit, tutorial_searches) with the terminal
marker so they pass.

Regenerate notebooks + navigator catalogue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KExk2jkn2ya21b6NZLALpB
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 11, 2026
@Jammy2211 Jammy2211 merged commit e9c791c into main Jul 11, 2026
10 checks passed
@Jammy2211 Jammy2211 deleted the feature/restore-truncated-howto-tutorials branch July 11, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: restore truncated HowTo tutorials + add completeness CI check

1 participant