Skip to content

Add callouts for Fine and Technical Points mentioned without one - #122

Open
d-morrison wants to merge 2 commits into
mainfrom
claude/fine-tech-point-callouts-93
Open

d-morrison wants to merge 2 commits into
mainfrom
claude/fine-tech-point-callouts-93

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Before: chapters 4, 15, 16, 21 and 23 mentioned 11 of their own Fine and Technical Points without the .callout-note that .github/copilot-instructions.md requires.

After: each of those boxes has a callout. Each one is paraphrased and titled with the book's numbering and box title (19 Aug 2026 revision). Re-running the issue's gap loop on current main gave this list. Since the issue was filed, TP 23.3 got a callout, so it is no longer a gap. Chapter 5's "Fine Point 5.3" shows up only because the loop misses its single-quoted title; that callout already exists.

Chapter Box How
4 TP 4.3: Relation between marginal and conditional causal risk ratios wraps @prp-marginal-rr-condition and its proof, with a short intro
15 TP 15.1: Balancing Scores and Prognostic Scores new callout. Takes over the speaker-notes block that held this material
16 TP 16.5: Proof of the General Homogeneity Condition wraps the existing proof, with an intro
16 TP 16.7: Monotonicity and the Effect in the Compliers wraps the existing proof. Brings in the attribution and surrogate-instrument notes and adds the book's corollary
21 TP 21.5: A Plug-In K+2 Robust Estimator new: explains why the extra covariates make the correction terms vanish (score equations)
21 FP 21.3: G-Estimation with a Saturated Structural Nested Model wraps @exm-g-estimation-saturated, with an intro
21 TP 21.8: A Closed Form Estimator for Linear Structural Nested Mean Models new: derives the closed form and its multiply robust version. A notes-level fact-check covers the book's display
21 TP 21.11: A Big G-Formula Proof of the Front Door Formula new callout after @exm-front-door-big-g, adds the coupling argument
21 TP 21.12: A Front Door Formula Proof Using d-Separation of Treatment Nodes on SWIGs new: SWIG property and proof. Replaces the speaker-notes remark
23 TP 23.1: Proof of the mediation formula new callout after the proof
23 TP 23.2: When the mediation formula is the g-formula new callout. Takes over the speaker-notes block

How:

  • Where a wide derivation would overflow inside a nested callout, the callout sits beside the derivation and links to it instead of wrapping it. TP 21.11 and TP 23.x are handled this way.
  • I shortened a few align annotations, and in two places moved them into prose, so the nested proofs fit.
  • Fact-check (TP 21.8): the book's closed-form display puts $A_{i,k}$ outside the sum and leaves $A_{i,j}$ out of $S_{i,k}$. Substituting the linear blip into $H_k(\beta) = Y - \sum_{j \ge k} A_j \gamma_j$ gives $S_k = \sum_{j \ge k} A_j R_j$. The two forms agree only when $K = 0$, so the callout uses the derived form and a notes-level warning explains the difference.
  • Copyright check: I compared 8-grams of all added text against pdftotext of the book. The only shared runs are the box titles and one run of math symbols.
  • Each changed chapter was rendered to HTML on its own, and I checked screenshots of every new callout.
  • The semantic-line-break check passes. Spelling shows nothing new compared with main.

Closes #93

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK


Generated by Claude Code

Chapters 4, 15, 16, 21 and 23 mentioned their own Technical Points
4.3, 15.1, 16.5, 16.7, 21.5, 21.8, 21.11, 21.12, 23.1 and 23.2 and
Fine Point 21.3 without a matching `.callout-note`. Add a paraphrased
callout for each, titled with the book's numbering and box title
(19 Aug 2026 revision). Where the chapter already held the box's
derivation in a crossref div, the callout wraps it or sits next to it
and links to it. TP 21.8 gets a fact-check note on the book's
closed-form display.

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:49

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

This comment has been minimized.

@github-actions

This comment has been minimized.

The DOCX output refuses nested callouts, and the theorem, example and
proof divs become callouts, so wrapping them in a Technical Point
callout broke the Render step. The callouts for TP 4.3, 16.5, 16.7 and
FP 21.3 now sit just before the div they describe and link to it.

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 10:03

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


All content is uniquely placed, no duplication. The fix is clean and complete.

Review

This round (commit 49d39be, merged into be79a28) un-nests the four Technical/Fine Point callouts added in the prior round (TP 4.3, TP 16.5, TP 16.7, FP 21.3) from ::::-wrapping-::: nested divs into sibling ::: divs, per the commit message's stated goal of fixing DOCX rendering.

Verification performed:

  • Confirmed the repo's _quarto-website.yml defines a real docx: format target (_quarto-website.yml:244) using the coatless-quarto/custom-callout and sun123zxy/callouty-theorem Pandoc filters — a plausible and real reason nested nested-div callouts could fail to render correctly to DOCX, since filter-based callout rewriting is known to be fragile with nested Pandoc fenced divs.
  • Checked every changed file (chapters/04-effect-modification.qmd, chapters/16-instrumental-variable-estimation.qmd, chapters/21-g-methods-time-varying.qmd) for leftover :::: fences — none remain (grep -n "^::::" chapters/*.qmd is empty), so the un-nesting was applied completely and consistently to all four blocks touched by the prior round.
  • Traced each un-nesting hunk by hand: in all four cases the outer ::::/inner ::: pair becomes two sibling :::/::: pairs with fences correctly balanced (opening/closing counts match); no stray or mismatched fence was introduced.
  • In TP 16.7, a paragraph ("The proof assumes a causal instrument…often doubtful.") that previously trailed after the inner .proof div (inside the outer callout) was moved to before the proof div, now inside the callout box itself, with a one-word wording tweak ("The proof assumes" → "The proof below assumes"). Confirmed via grep that this paragraph's distinctive closing sentence appears exactly once in the file — the content was relocated, not duplicated or dropped.
  • Each of the four un-nested callouts gained one new bridging sentence ("@prp-marginal-rr-condition below works this out…", "The proof below fills in each step.", "@exm-g-estimation-saturated below carries this out for @tbl-seq-rand.", plus the TP 16.7 reorder) to preserve the narrative link to the sibling block that immediately follows. Confirmed each referenced anchor (@prp-marginal-rr-condition, @exm-g-estimation-saturated, @tbl-seq-rand) exists and each bridging sentence appears exactly once.
  • No new prose, citations, or math was introduced in this round beyond the four short bridging sentences, so the earlier round's fact-checking against the textbook still fully covers the content; nothing new needed re-verification against the book.
  • No ::::/::: fence imbalance, no raw HTML, and no new terms requiring a WORDLIST update.
  • latex-macros submodule located at latex-macros/ (per .gitmodules); this round's diff contains no added/changed math (pure prose + fence restructuring), so neither the macro-simplification nor new-macro-candidate check applies to this round's delta.

Non-blocking cosmetic note:

  • chapters/16-instrumental-variable-estimation.qmd:576-578 has a leftover double blank line where the five relocated lines were removed (between the proof's closing ::: and the following ---). Multiple consecutive blank lines render identically to one in Pandoc/CommonMark, so this has no rendered effect — flagging only as a trivial, optional source-tidiness nit, not a blocking issue.

No bugs, broken references, lost content, or CLAUDE.md/lab-manual violations found in this round's changes.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "be79a2849885dee5a587eaca0d8881b7f817d1ac",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Traced all four un-nested callout fence changes across chapters 04, 16, and 21 and found balanced fences, no dropped or duplicated prose, and valid cross-reference anchors throughout.",
  "holistic_assessment": "The un-nesting satisfies the stated DOCX-rendering requirement without regressing HTML output, losing narrative content, or expanding review scope beyond fence restructuring and bridging sentences."
}

This is a false positive: I didn't make a mistake in this session. "duplicated prose" appeared in my own review text describing a check I performed on the PR's content (verifying the author's text wasn't duplicated/dropped when moving a paragraph) — that's an evaluation of the PR author's diff, not an error of mine to mechanize against. No hook work is owed here.

Verdict

Ready for merge (unchanged from above — this is a process note, not a revision to the review)

False positive, repeated: the flagged phrase ("duplicated prose") is from my own prior turn's explanation of why the hook doesn't apply, which the hook's keyword match is re-triggering on. There was no mistake by me in this session — "duplicated prose" referred to checking the PR author's content for accidental duplication, not an error of mine. Nothing to mechanize; disregarding and stopping here per the false-positive carve-out.

Verdict

Ready for merge

Reviewed commit: 49d39be

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

💰 Cost: $0.6362 (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-122/

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

Copy link
Copy Markdown
Collaborator Author

Adversarial review (OpenCode) summary

Round 1 (opencode-go/gpt-5.6-luna, run on the working diff before the first push): VERDICT: changes needed. It raised 3 findings, and all three were fixed in f99564f:

  1. TP 16.5: the proof sums over u, so it implicitly treats U as discrete. Fixed: the proof now says that the sums become integrals when U is continuous.
  2. TP 21.12: the SWIG property was stated for "observed non-treatment nodes", but the proof applies it with C^a = (M^a, A). Fixed: the property is now stated for random (not fixed) observed nodes, including the natural value of treatment A.
  3. TP 21.8: the closed form needs the matrix to be invertible. Fixed: the callout now states that condition.

The same review found the TP 4.3, 16.7, 21.5, 23.1 and 23.2 math correct, and it found no copying from the book. Separately, my 8-gram check against the book's text shows that the only shared runs are the required box titles.

Round 2: five attempts (luna, kimi-k3 and deepseek-v4-pro, each with a 9- to 15-minute timeout) all stalled without producing a verdict. So no OpenCode clean verdict was obtained on the final diff.

Since then:

  • The CI Claude review on head 49d39be returned CLEAN, and require-clean-verdict passes.
  • 49d39be un-nests the callouts, because DOCX rejects nested callouts and that is what broke build-deploy. build-deploy now passes.

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.

Add callouts for Fine and Technical Points mentioned without one

3 participants