Skip to content

feat: assimilate statmath package macros (#90) - #95

Merged
dem-extra1 merged 2 commits into
mainfrom
90-assimilate-statmath
Sep 26, 2026
Merged

dem-extra1 merged 2 commits into
mainfrom
90-assimilate-statmath

Conversation

@dem-extra1

Copy link
Copy Markdown
Collaborator

Closes #90

Assimilates all 137 commands and notations from the CTAN statmath package (https://ctan.org/pkg/statmath) into macros.qmd and interpretations.tsv, adding bold Roman/Greek letters, blackboard bold symbols, convergence arrows, matrix operations, distribution families, expectation variants, operators, and estimator pairs.

@dem-extra1

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

👀 Claude Review Dispatched — run reviewing PR #95 at ad980e9.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-09-26 21:28 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Review: PR #95 — feat: assimilate statmath package macros (#90)

Scope: Adds 186 new macro definitions to macros.qmd (in the corresponding sections) and 186 matching entries to interpretations.tsv, porting the CTAN statmath package's notation (bold letters, blackboard-bold sets, convergence arrows, matrix operators, distribution operators, expectation variants) plus repo-specific \h.../\e... estimator-pair wrappers for Corr/MSE/Bias.

Verification performed

  • Symmetry check: extracted all 186 macro names newly defined in macros.qmd and all 186 names newly added to interpretations.tsv — they match exactly 1:1 in both directions (no macro without an interpretation, no orphan interpretation entry). Satisfies the CONTRIBUTING.md rule "Add an entry for every new macro to interpretations.tsv — the macros-table.qmd build fails if any macro is missing an interpretation."
  • Collision check: scanned every newly-defined macro name against the pre-existing macros.qmd (origin/main) for duplicate \def/\providecommand definitions. Found none — the pre-existing duplicate defs of \resid/\stdresid/\modresid at lines 559–561 predate this PR and are untouched.
  • Correctly avoided a real collision: statmath's vectorization operator is actually named \vc (verified against the upstream statmath.sty: \DeclareMathOperator{\vc}{vec}), but this repo already defines \vc for something else (\providecommand{\vc}[1]{\boldsymbol{#1}}, bold vector notation). The PR correctly ported it under the alias \vct instead, avoiding a silent macro clobber. Good catch by the author — worth a one-line callout in the PR description since "assimilates all 137 commands" is otherwise a literal claim and this is the one renamed exception.
  • Anti-hallucination check: fetched the real statmath.sty source and cross-checked \dBeta/\dBern/\dBin/\dF/\dGam/\dInvGam/\dInvW/\dLaplace/\dMN/\dN/\dPo/\dt/\dW/\dWeib, \Corr/\MSE/\Bias/\sign/\tr/\diag/\rank, \bbN/\bbZ/\bbQ/\bbR/\bbC, \inas/\indist/\inprob, \Ebar/\Ehat/\Etilde, \vcs/\vch, \bfzero — all match the upstream operator text exactly. Nothing appears fabricated.
  • Convention compliance (per CONTRIBUTING.md):
    • No comments introduced into macros.qmd (required, since no comment syntax is safe across all four consumption paths).
    • \h.../\e... estimator pairs correctly mirror \hat/\widehat width choice: \hCorrt/\hMSEt/\hBiast use \widehat directly (multi-letter operatorname symbols), and the matching \eCorrt/\eMSEt/\eBiast correctly use \Est (the \widehat-composing indirection), exactly as the "mirror whichever width the original \h... macro chose" rule requires.
    • The \Ebarf/\Ehatf/\Etildef argument-forms use \sb{#1} (square brackets) rather than \paren{#1} like the other new "f"-suffixed forms — verified this matches the pre-existing \E/\Ef expectation convention (\providecommand{\E}[1]{\distop{E}\sb{#1}}), so this is correct, not an inconsistency.
    • The "duplicate expansion rather than delegate" pattern for aliases (e.g. \hCorr and \hCorrf both independently expand to \hCorrt\paren{#1} instead of one calling the other) matches an existing precedent in the file (\eSD/\eSDf at lines 696–697), so it's consistent with established style, not a new DRY violation.
  • Syntax check: wrote a brace-balance scanner over every \def/\providecommand line in the file; the only imbalanced lines are pre-existing (\cbl by design, and the pre-existing multi-line \thmHessij), neither touched by this diff.
  • TSV integrity: confirmed every line has exactly one tab (two fields), no trailing whitespace, and a trailing newline at EOF.
  • CI: Quarto Preview Build, CodeQL, and Analyze all passed for this PR's head commit (ad980e9). The downstream workflow_run-triggered Quarto Check Equation Renders / Quarto Preview Deploy checks had not yet produced a run against this PR's branch as of this review (only against main's latest push), so I could not confirm the equation-render check specifically passes for this PR. Note that the most recent run of that check on main did fail with Missing argument for \operatorname at macros-table.html — but I traced every \operatorname{...} call this PR adds and all have well-formed, non-empty single-word arguments, so that failure looks pre-existing/unrelated to this PR's content. Worth a human double-check once that workflow does run against this commit, but nothing in the diff itself points to a rendering break.

Non-blocking nit

  • interpretations.tsv:818,834,836 (\dBern, \dN, \dPo) append "(statmath prefix)" while the other 11 new d-prefixed distribution operators (\dBeta, \dBin, \dF, \dGam, \dInvGam, \dInvW, \dLaplace, \dMN, \dt, \dW, \dWeib) don't get the same annotation. Purely cosmetic — either drop it or apply it uniformly for consistency.

No correctness bugs, no CLAUDE.md-equivalent (CONTRIBUTING.md) violations, no naming collisions, and no hallucinated symbols found.

Verdict

Ready for merge (minor optional doc nit noted above; recommend confirming the Quarto Check Equation Renders workflow completes cleanly against this PR's own commit before merging, since that hadn't fired yet at review time).

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "ad980e9c40496c8fbad3d621fe38ae190a3244d6",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked interpretations.tsv and macros.qmd for symmetry, duplicate macro names, brace balance, and TSV formatting; found no defects in the 186 newly added macro definitions.",
  "holistic_assessment": "Verified statmath fidelity against upstream statmath.sty, confirmed CONTRIBUTING.md estimator-pair conventions are followed, and found no regression risk to existing macros aside from a correctly-handled vc/vct rename."
}

CI/fully-clean instrument correction

Per the check-pr-fully-clean.py gate (the authoritative instrument for a terminal clean claim, not gh pr checks):

python3 scripts/check-pr-fully-clean.py 95 -R Morrison-Lab/macros
→ exit 1, NOT fully clean:
  - Check run 'review / claude-review' is still in status 'in_progress'
  - No automated review comments or reviews found on PR #95

Both findings are self-referential to this very review run (the in-progress check run is this Claude Code Review workflow invocation, and no review has posted yet because this message is that review). I could not independently corroborate the check-runs endpoint directly (gh api .../check-runs) since gh api is disabled in this review-only session — only the wrapper script's read is available to me here. I have no basis to declare a code-defect-driven "Ready for merge"/"Needs more work" split beyond what's in the review body above; the content-level findings stand as written (no blocking defects found in the diff itself), but I'm not asserting the PR is externally/CI-fully-clean, since the one instrument that can authorize that claim currently returns NOT_CLEAN for reasons intrinsic to this review's own lifecycle rather than the code.

Verdict

Content review: no blocking findings (see full analysis above) — but the automated fully-clean gate currently reports NOT_CLEAN, solely because this review/check run had not yet completed/posted at the time of the gate check (self-referential), not due to any defect identified in interpretations.tsv or macros.qmd. Treat this as a progress report on the code content, not a terminal "Ready for merge" claim; re-run the gate after this review posts and the check run resolves.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "ad980e9c40496c8fbad3d621fe38ae190a3244d6",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked interpretations.tsv and macros.qmd for symmetry, duplicate macro names, brace balance, and TSV formatting; found no defects in the 186 newly added macro definitions.",
  "holistic_assessment": "Verified statmath fidelity against upstream statmath.sty, confirmed CONTRIBUTING.md estimator-pair conventions are followed, and found no regression risk to existing macros aside from a correctly-handled vc/vct rename."
}

Stopping Point: Clean stopping point reached — full content review completed and posted; the fully-clean CI gate is self-referentially pending this review's own completion, which is expected and requires no further action from me in this turn.

Reviewed commit: ad980e9

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $1.8324 (review) — run

@dem-extra1
dem-extra1 merged commit e1c2eb1 into main Sep 26, 2026
10 checks passed
@dem-extra1
dem-extra1 deleted the 90-assimilate-statmath branch September 26, 2026 21:28
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.

assimilate statmath

1 participant