Skip to content

Box ch. 7 content into numbered divs and callouts - #124

Open
d-morrison wants to merge 9 commits into
mainfrom
claude/ch07-divs
Open

d-morrison wants to merge 9 commits into
mainfrom
claude/ch07-divs

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Part of #77

Before: ch. 7 (confounding) had 6 definitions, 1 theorem and 2 examples in numbered divs. Most of the chapter sat in plain prose, speaker notes, or Fine Point and Technical Point callouts. Some terms were used before they were defined, such as "confounding" itself and "no unmeasured confounding".

After: 65 numbered boxes. Each definition comes before its first use and is followed by a concrete example.

  • 16 definitions. New ones: confounding (with "common cause"), no unmeasured confounding, M-bias, the open-backdoor-path definition of confounding, signed causal diagrams, surrogate confounder, non-confounder given data on L, g-methods versus conventional methods, negative outcome control, and additive equi-confounding.
  • 2 theorems and 5 propositions. Each states its estimand and every condition it uses.
    • Identification under marginal exchangeability.
    • Stratum-specific identification.
    • Standardization (#thm-standardization-ch7, kept; its statement now lists its conditions).
    • Backdoor criterion and conditional exchangeability, with a SWIG proof sketch in 7.5.
    • Adjusting for L alone under the repaired traditional definition (Technical Point 7.2), with a proof that I wrote.
    • Difference-in-differences.
    • The front door formula.
  • 29 examples. New ones include conditional exchangeability without the backdoor criterion under an NPSEM-IE, the Technical Point 7.2 conditions checked on Figure 7.4, and a worked aspirin difference-in-differences calculation with hypothetical numbers.
  • 13 remarks.
  • 7 proofs.
  • 19 callouts: 11 notes, 5 warnings, 2 tips and 1 important.

The Fine Point and Technical Point callouts now hold short summaries that point to the boxes after them, as in ch. 6 and ch. 12. No theorem div sits inside a callout or .notes.

How:

Checks:

  • quarto render chapters/07-confounding.qmd succeeds with no warnings to html, docx and revealjs. The page has no unresolved ?@ references.
  • A script confirmed that every crossref resolves, no @ reference points forward, no id is duplicated across chapters, and the divs balance. The links into ch. 2, 4 and 6 point to ids or headings that exist.
  • The gha check-new-line-breaks and check-informal-definitions checks pass.
  • An 8-gram overlap scan against the book chapter finds no added prose shared with the book. The remaining 10-gram matches are citations and the Technical Point title.
  • mmHg was added to inst/WORDLIST.
  • Five rounds of separate adversarial review (a Claude Sonnet reviewer, since OpenCode is hanging) checked math, conditions, forward references and closeness to the book. All findings were fixed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK


Generated by Claude Code

claude added 8 commits October 9, 2026 10:51
Part of #77.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
State every condition in the identification results, add faithfulness
where exchangeability is said to fail, separate the sign rule from the
signed-diagram definition, reword passages close to the book, and add
examples after definitions that lacked one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
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 11:43
@d-morrison d-morrison self-assigned this Oct 9, 2026

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.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Also require the common cause's path to A to avoid Y.

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 11:57

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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Claude finished review — View run


Div balance holds (105/105), no duplicate ## box headings anywhere in the chapter, and the old ### section headings remain intact as section titles (now followed by distinctly-titled boxes) with no leftover stray references to the old duplicate phrasing.

Review: PR #124 — follow-up round

What changed since the last review round

Per the computed range b390b5f5..1b64cbe, the only change is commit 76129fe ("ch07: give two boxes titles distinct from their section headings"), a 3-line edit to chapters/07-confounding.qmd touching exactly the two issues flagged in the prior review round (posted 2026-10-09T11:55:46Z, https://github.com/Morrison-Lab/win/actions/runs/37925503433):

  1. Duplicate-heading fix (both instances): ## Two Settings in Which the Backdoor Criterion Holds → ## No Confounding, or Confounding That $L$ Removes (line 405), and ## Confounding Is Absolute; Confounder Is Relative → ## Whether a Variable Is a Confounder Depends on the Adjustment Set (line 834). Both now read as distinct titles under their matching ### section headings, matching the pattern used by every other box in this PR. I re-checked div balance (105 open / 105 close) and confirmed no other ## heading duplicates a ### section heading anywhere in the file.
  2. #def-confounding precision nit fix: the common-cause definition at line 116 now reads "a directed path to $A$ that does not pass through $Y$ and a directed path to $Y$ that does not pass through $A$" — symmetric and self-contained as requested, rather than relying on the book's implicit $A$-precedes-$Y$ convention.

Both prior findings are resolved exactly as proposed, with no new issues introduced by this small, surgical diff. No other files changed in this range (inst/WORDLIST, macros, crossrefs, etc. are untouched), so none of the previously-verified checks (crossref integrity, cross-chapter anchor slugs, WORDLIST sort order, macro usage) need to be re-run.

Verdict

Ready for merge — both outstanding findings from the prior round are fixed correctly and nothing new was introduced.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "1b64cbea0b9240577f994a77d47410335e2ad95c",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Verified chapters/07-confounding.qmd's two renamed box headings no longer duplicate their parent section headings and div balance remains 105 open/105 close.",
  "holistic_assessment": "The 3-line follow-up commit fully addresses both prior-round findings without touching crossrefs, WORDLIST, or macro usage, so regression risk and review scope are both minimal."
}

Reviewed commit: 76129fe

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

💰 Cost: $0.2981 (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-124/

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

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