Skip to content

CLAUDE.md: check that chapter model fits converge - #1506

Merged
dem-extra1 merged 3 commits into
mainfrom
claude/project-thread-yn1t83-claudemd
Nov 20, 2026
Merged

dem-extra1 merged 3 commits into
mainfrom
claude/project-thread-yn1t83-claudemd

Conversation

@dem-extra1

@dem-extra1 dem-extra1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

This PR adds one bullet to CLAUDE.md under "Quarto". It asks agents to check that every model fit a chapter shows has converged, not only that its chunk ran. That means reading the fitting warnings and the fit's own convergence fields: fit$converged for glm()/MASS::glm.nb(), and fit$fit$convergence == 0 plus fit$sdr$pdHess for glmmTMB(). For a negative binomial fit on small, zero-heavy data, it points to glmmTMB(family = nbinom2).

Why: MASS::glm.nb() on the needle-sharing data never converged. It passed one Quarto Publish run with a warning and failed the next one with an error, with no content change in between. The content fix is in #1505. This instruction change is kept separate, as CLAUDE.md asks for config changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FWgYrGaqBPMWkVzew6UErH

A non-converging MASS::glm.nb() fit passed one Quarto Publish run with a
warning and failed the next with an error, with no content change
(#1505). Record the check and the glmmTMB alternative.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrGaqBPMWkVzew6UErH
@dem-extra1 dem-extra1 self-assigned this Nov 20, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator Author

Annotation dispositions for head 80822b7:

  • link-checker, https://epiresearch.org/membership/ser-careers/ returned 520 (_subfiles/syllabus/_sec-course-evaluations.qmd:4, 2 annotations): false positive for this PR. It is a transient server error on a line this PR does not touch, and the checker itself marks it "not failing the check".
  • link-checker, https://web.stanford.edu/class/stats191 network error (chapters/Linear-models-overview.qmd:41, chapters/index.qmd:31): false positive. Stanford's host refused the runner's connection, on lines this PR does not touch.
  • link-checker, https://web.stanford.edu/class/stats202/intro.html network error (chapters/other-resources.qmd:150): false positive, for the same reason.
  • link-checker, https://github.com/Morrison-Lab/ai-config/blob/main/shared/workflow/track-useful-resources.md returned 503 (CLAUDE.md:168): false positive. It is a transient GitHub 503 on an existing line this PR does not change.
  • review / claude-review, notice "SUBMODULES_TOKEN is empty; cloning submodules anonymously": a routine notice. The only submodule (latex-macros) is public.

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


Generated by Claude Code

beam-free (cross-model review) noted glmmTMB fits have no converged
flag; name fit$fit$convergence and fit$sdr$pdHess for glmmTMB and
fit$converged for glm()/glm.nb(), checked in R.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrGaqBPMWkVzew6UErH
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


The new commit bb95920 only rewrites the convergence bullet in CLAUDE.md, which is the same bullet the two earlier rounds reviewed. I found no new issues. The prior verdict still stands: the 2026-11-20T18:04Z round on 80822b7 found the PR clean and ready for merge. I did not run the code behind the new field names. I checked them from what I know of the packages, so my confidence is high but not tested.

The bullet now names where each package keeps its convergence record:

  • glm() and MASS::glm.nb(): fit$converged is correct. glm.nb() returns a glm-class object that carries this field.
  • glmmTMB::glmmTMB(): fit$fit$convergence == 0 and fit$sdr$pdHess are the standard checks. The first is the optimizer's exit code, and the second says whether the Hessian is positive definite.
  • Other claims: the Fit the needle-sharing negative binomial model with glmmTMB #1505 incident and the glmmTMB::nbinom2 recommendation are unchanged from the earlier rounds.

The change touches no .qmd content or math, so the notes-content and macro rules do not apply. The new continuation lines stay one phrase per line.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "bb959207335dad9cb33974482c0154f6d02186f0",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The rewritten CLAUDE.md convergence bullet names fit$converged for glm and glm.nb and fit$fit$convergence plus fit$sdr$pdHess for glmmTMB, which match those packages' actual fields.",
  "holistic_assessment": "A docs-only convention clarification with no math, notes content, or build impact; scope is appropriate and the prior clean verdict still stands."
}

Reviewed commit: bb95920

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.1994 (review) — run

Copy link
Copy Markdown
Collaborator Author

Cross-model review (OpenCode Go, beam-free):

  • Round 1 on 80822b7 was NOT_CLEAN. It found that the bullet named a converged flag, but glmmTMB fits, which the bullet recommends, have no such field. Fixed in bb95920: the bullet now names fit$converged for glm()/glm.nb(), and fit$fit$convergence == 0 plus fit$sdr$pdHess for glmmTMB(). I checked these fields in R on a converged nbinom2 fit (0 and TRUE).
  • Round 2 on the fixed diff came back CLEAN. Its one nit: glm.nb()'s converged covers only the last IRLS fit, and the theta alternation reports through warnings. The bullet already says to read fitting warnings.

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


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Annotation dispositions for head bb95920:

  • link-checker, https://web.stanford.edu/class/stats191 network error (chapters/Linear-models-overview.qmd:41, chapters/index.qmd:31): false positive. Stanford's host refused the runner, on lines this PR does not touch.
  • link-checker, https://web.stanford.edu/class/stats202/intro.html network error (chapters/other-resources.qmd:150): false positive, for the same reason.
  • link-checker, https://epiresearch.org/membership/ser-careers/ 520 (_subfiles/syllabus/_sec-course-evaluations.qmd:4, 2 annotations): false positive. A transient server error on a line this PR does not touch, and the checker says it is not failing the check.
  • review / claude-review notice "SUBMODULES_TOKEN is empty": routine. The only submodule is public.

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


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Cross-model review on the pushed head bb95920 (OpenCode Go beam-free, via curl):

  • Round 1 was NOT_CLEAN. It said the glmmTMB accessor should be fit$convergence, not fit$fit$convergence. That's a false positive. In R, on a converged glmmTMB(count ~ mined, family = nbinom2, data = Salamanders) fit:

    • str(fit$convergence) is NULL;
    • str(fit$fit$convergence) is int 0;
    • str(fit$sdr$pdHess) is logi TRUE.

    The bullet's accessors are correct.

  • Round 2 had that evidence and came back CLEAN ("No blocking findings").


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


Generated by Claude Code

@dem-extra1
dem-extra1 merged commit 12c8624 into main Nov 20, 2026
37 checks passed
@dem-extra1
dem-extra1 deleted the claude/project-thread-yn1t83-claudemd branch November 20, 2026 18:37
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.

2 participants