Skip to content

Box ch. 1 content into numbered divs and callouts - #121

Open
d-morrison wants to merge 4 commits into
mainfrom
claude/ch01-divs
Open

d-morrison wants to merge 4 commits into
mainfrom
claude/ch01-divs

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Part of #77: ch. 1.

Before: ch. 1 had 7 crossref divs. Most of its definitions, examples and results were plain prose or speaker notes, so they had no number and could not be cross-referenced.

After: each one sits in a numbered div or a callout:

  • 17 definitions. New ones cover counterfactual outcomes, no interference, identification, counterfactual risk, the causal effect measures, NNT, super-population, estimator, deterministic counterfactuals, conditional risk and the association measures. Each is followed by an example from Zeus's family.
  • 4 propositions with proofs: individual effects are not identified; the average causal effect is the average of the individual effects; the sharp null implies the average null but not the reverse; the causal null holds on every scale at once.
  • 21 examples and 2 remarks. One remark says the causal risk ratio is not an average of individual ratios. The other compares causation with association.
  • 3 warning, 2 tip, 2 important and 5 note callouts, including the Fine Points and Technical Points.

How: existing text was wrapped rather than rewritten. The aspirin contrast and the NNT wording were rephrased in our own words, and the aspirin and association points moved out of the speaker notes so they show on the slides. Each definition and proposition states its conditions, for example when each ratio is defined. Existing ids (def-sharp-null, def-consistency-ch1, def-consistent-estimator, ...) are kept, and new ids were checked against every chapter for uniqueness. No theorem div sits inside a callout, inside another theorem div or inside .notes. Slide breaks were added before boxes that would crowd a slide.

Checks:

  • quarto render chapters/01-introduction.qmd --to html succeeds with no warnings, and the page has no unresolved ?@ references.
  • --profile revealjs --to revealjs fails on chalkboard + embed-resources (the known win#94 issue). With -M embed-resources:false it renders. A script found no empty boxes and no empty slides.
  • The gha semantic-line-break check passes on the added lines.
  • OpenCode adversarial review (gpt-5.6-luna) ran for several rounds, and each finding was addressed. Status is in the PR comments.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK


Generated by Claude Code

claude added 4 commits October 9, 2026 08:54
Part of #77. Wrap the chapter's definitions, results, examples and
cautions in crossref divs and callouts:

- new definitions for counterfactual outcomes, no interference,
  identification, counterfactual risk, effect measures, NNT,
  super-population, estimator, deterministic counterfactuals,
  conditional risk and association measures, each followed by an
  example from Zeus's family;
- propositions, with proofs, for the non-identification of individual
  effects, the difference of averages, the sharp null implying the
  average null, and the causal null on each scale;
- warning, tip, note and important callouts for the aspirin contrast,
  the choice of scale, the two meanings of consistency, the
  assumptions kept until Chapter 10, and association versus causation;
- slide breaks before boxes that would crowd a slide.

Existing ids (def-sharp-null, def-consistency-ch1, ...) are kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Give the estimator and the effect measures their own examples right
after the definitions, scope the risk-ratio remark to deterministic
counterfactuals, reword the aspirin contrast and the NNT definition in
our own words, and keep one equals sign per NNT display.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Write the consistency display with Y_i^{A_i}, state in the counterfactual
outcome definition that outcomes are fixed for now, and give the sharp
null its treatment and counterfactual outcomes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
…utcome definition

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@d-morrison d-morrison self-assigned this Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Claude finished review — View run


Confirmed via scripts/check-pr-fully-clean.py (exit code 1): the PR is not fully clean — review / claude-review and build-deploy are still in_progress, and no clean review verdict yet exists for HEAD e46adcf7. I'm revising my verdict accordingly.

Review: PR #121 — Box ch. 1 content into numbered divs and callouts

Scope checked: chapters/01-introduction.qmd only (the sole file touched). I verified structural integrity (div/callout nesting and fence balance), cross-reference ID uniqueness (within the chapter and across the whole chapters/ tree), the new math/definitions against the book's content and against the pre-existing Table 1.1 data, macro usage against latex-macros/macros.qmd, and repo conventions (callout types, .proof divs, rem- remarks, --- slide breaks, citation style).

Structural / correctness checks

  • Div/callout fencing is balanced with no theorem div nested inside another theorem div, a callout, or .notes — confirmed programmatically across the whole file, matching the PR description's claim.
  • All new crossref IDs (def-*, exm-*, prp-*, rem-*, eq-*) are unique both within the chapter and against every other chapter file — no collisions found (two near-misses, def-consistent-estimator and def-sharp-null, turned out to be substring false-positives/legitimate cross-file links, not real duplicates).
  • The new example exm-sharp-null-subpopulation names 8 specific family members (Demeter, Hades, Hestia, Hera / Artemis, Ares, Athena, Persephone) as having no individual effect — checked against Table 1.1's $Y^{a=0}$/$Y^{a=1}$ columns, and the counts/names match exactly. The 6-harmed/6-helped breakdown in exm-null-average-nonnull-individual also matches the table. No hallucinated data found.
  • rem- as a crossref prefix isn't a Quarto built-in theorem type, but it's used ~80+ times across the rest of the repo already, so this is consistent with established house convention.
  • Macro usage (\th, \hth, \inprob, \sb{}, \abs{}, \E{}, \ind) all resolve to real definitions in latex-macros/macros.qmd and are used correctly.
  • Citation style matches the chapter's existing convention.
  • No raw HTML was introduced.

LaTeX macro opportunity (non-blocking suggestion)

The diff repeats \Pr[Y^{a=1} = 1] / \Pr[Y^{a=0} = 1] (19 times in added lines alone) and \Pr[Y = 1 \mid A = \cdot] (15 times) — well past the "3+ recurrences" threshold, and this notation will likely recur in later chapters. macros.qmd's existing \potprob family uses subscript $\pi_{#1}$ notation, not the book's bracket style, so there's no direct substitution available. A \providecommand{\crisk}[1]{\Pr\sb{Y^{#1} = 1}} and \providecommand{\arisk}[1]{\Pr\sb{Y = 1 \mid A = #1}} pair would fit the lab's "estimand macro group" pattern, but per latex-macros/CONTRIBUTING.md that requires matching hat-estimator variants and interpretations.tsv entries — this belongs in a follow-up PR against d-morrison/macros upstream, not this win-repo PR.

CI / clean-review status (authoritative check)

python3 scripts/check-pr-fully-clean.py 121 -R Morrison-Lab/win exits 1, reporting:

  • Check run review / claude-review still in_progress
  • Check run build-deploy still in_progress
  • No valid clean review found yet for HEAD e46adcf7

No bugs, broken cross-references, incorrect math, or CLAUDE.md/lab-manual violations were found in the content itself. The only open item is that CI (notably the actual Quarto build-deploy) has not yet finished on this HEAD, so a terminal "fully clean" status cannot be certified yet regardless of the content review's outcome.

Verdict

Blocked on CI — no blocking findings from this content review, but build-deploy and the review check are still in progress on HEAD e46adcf7; re-run the fully-clean check once those complete before treating this as ready for merge.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "e46adcf7110e5911afa263003ec982b273809f6d",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked chapters/01-introduction.qmd for div/callout nesting balance, crossref ID uniqueness across all chapters, and verified new example claims (family member lists) against Table 1.1 data with no discrepancies found.",
  "holistic_assessment": "Content review found no requirement, integration, or regression concerns, but check-pr-fully-clean.py exits 1 because build-deploy and the review check are still in_progress on this HEAD."
}

Reviewed commit: e46adcf

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

💰 Cost: $1.4860 (review) — run

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Morrison-Lab.github.io/win/pr-preview/pr-121/

Built to branch gh-pages at 2026-10-09 09:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown
Collaborator Author

Adversarial review summary (OpenCode, opencode-go/gpt-5.6-luna, run on git diff origin/main...HEAD):

  • Round 1 (at 29eb89d) returned 5 findings, handled in 88eacb4:
    • Generic ids: rebutted. They were checked against every chapter and none collides; ids that do collide elsewhere carry -ch1.
    • Estimator and effect-measure definitions lacked an adjacent example: fixed. A new exm-estimator-ch1 was added, and exm-effect-measures-zeus-family now comes right after its definition.
    • The risk-ratio remark overreached: fixed. It is now scoped to deterministic counterfactuals and notes the weighted-average result in Section 1.4.
    • The aspirin and NNT wording was close to the book: reworded in our own words. The NNT display also now has one =.
  • Round 2 returned 3 findings, handled in 49eb7e9:
    • The consistency display now writes Y_i^{A_i}.
    • The counterfactual-outcome definition now says outcomes are fixed for now.
    • The sharp null now states its treatment and counterfactual outcomes.
  • Round 3 returned 1 finding, handled in e46adcf: the counterfactual-outcome definition now states the no-interference condition.
  • Round 4 (at e46adcf): no verdict. The OpenCode Go endpoint stopped responding. Even a one-word prompt timed out on luna and kimi-k3, and deepseek-v4-pro hit proxy denials. So OpenCode never gave a VERDICT: clean on the final head.

The CI Claude review at e46adcf gave CLEAN with no findings (comment). Its prose said "blocked on CI" only because build-deploy was still running. That job has since succeeded. All checks are green, including review / require-clean-verdict.


Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants