Skip to content

Add check-citation-authors: flag author names typed beside their citation - #2149

Merged
d-morrison merged 4 commits into
mainfrom
claude/project-thread-bro8fn
Nov 20, 2026
Merged

d-morrison merged 4 commits into
mainfrom
claude/project-thread-bro8fn

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Closes #2144.

What

A new diff-scoped check for psw's rule Let the citation name the source (psw#679).

  • Flagged: The figure follows the layout of a figure in James et al. [@james2021islr, Figure 6.7].
  • Preferred: The figure follows the layout of @james2021islr [Figure 6.7].

A capitalized word within six words before a citation key is flagged when the key starts with that word in lower case.
The comparison folds case and accents, drops a possessive 's, and joins a lowercase particle (van Buuren and @vanbuuren2018).
The window reaches back onto the previous line of the paragraph and stops at the previous sentence end (et al. and initials don't end one).

Not flagged: an author-suppressed [-@key], crossrefs, emails, names in link text or emphasis ([Cook's distance](#def-x), **Cox proportional hazards**), and a line with <!-- check-citation-authors: allow: <reason> --> (reason required, as the issue asks).

It reuses check-write-idiom's engine like check-avoided-words: added lines only, moved lines exempt, skip-not-fall-back. Warn-only by default, per the issue.

Measurement (whole tree, 2026-11-20)

Repo Hits Notes
psw 2 Bienaymé derived the bound [@bienayme1853] (psw's own ✅ example in #exm-cite-original, which this rule now contradicts), and ISO 80000-2:2019 [@iso80000_2_2019] (false: a standard's name)
rme 2 Allen and Cady [@AllenCady1982] across a line break, and *Applied Linear Regression* by Sanford Weisberg [@weisberg2005applied]. Both true
lds 190 Nearly all true, mostly video lists (Starmer explains [x](url) [@starmer2018x], Hastie ... [@hastie2023statlearning]). One false: the Elman recurrent layer [@elman1990time] (eponym outside emphasis)

Before link and emphasis masking were added, rme also hit [Cook's distance], **Cox proportional hazards** and *Practical R for Epidemiologists*; those now pass.

Files

  • check-citation-authors/ (action, script, 44 pytest cases; 5 mutations confirmed to turn a case red)
  • .github/workflows/check-citation-authors.yml, examples/check-citation-authors.yml, website/reference/check-citation-authors.qmd
  • _selftest.yml citation-authors job, website/_quarto.yml, README table row and lists, CLAUDE.md lists, layout and tests notes, changelog fragment

Checked locally: check-diff-scoped.sh (new-line-breaks, phi, math-letters, serial-comma) clean, check-avoided-words and check-write-idiom clean, lint-qmd clean. typos not run locally (not installed); CI covers it.

After merge, the v3 slide and caller PRs in the notes repos follow (wiring issue to be filed).


Generated by Claude Code

…tion

psw#679's rule "Let the citation name the source": an in-text @key already
prints the author names, so a sentence should not type them again beside the
citation. The check flags a capitalized word within six words before a
citation key when the key starts with that word in lower case, as in
"James et al. [@james2021islr, Figure 6.7]".

Diff-scoped and warn-only by default, on check-write-idiom's engine.
Measured whole-tree on psw, rme, and lds: 2, 2, and 190 hits, nearly all true.

Closes #2144.

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

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I fetched PR #2149 live and ran the suite, and the earlier verdict holds. The PR is open, not a draft and not merged, and its head is ce96f24231abb232cadbf7838fae2b39cfae5ec9, the commit I reviewed.

pytest was missing at first, so I installed it into /tmp/pt. check-citation-authors/tests then gave 43 passed and 1 skipped. The skip is test_defaults_agree_across_action_workflow_and_script, which skips because this job restores the default branch's workflows. That is the intended behavior of the new guard, and in normal CI the test still runs. The earlier "checked by reading the diff" caveat is now replaced by this run.

The findings are unchanged: none, and the prior round's clean verdict still stands (posted 2026-11-20T07:50:27Z).

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "ce96f24231abb232cadbf7838fae2b39cfae5ec9",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Ran the check-citation-authors suite after installing pytest: 43 passed and 1 skipped, the skip being the restored-workflows guard in the defaults-agreement test.",
  "holistic_assessment": "PR confirmed open at the reviewed head, the two new commits only fix the prior round's noted artifacts, and wiring issue 2150 still covers rollout."
}

Reviewed commit: ce96f24

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.8277 (review) — run

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/gha/pr-preview/pr-2149/

Built to branch gh-pages at 2026-11-20 07:56 UTC.

@d-morrison
d-morrison merged commit e77793f into main Nov 20, 2026
184 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-bro8fn branch November 20, 2026 08:12

Copy link
Copy Markdown
Collaborator Author

Merged under Ezra's mwc grant. The squash commit is e77793f.

check-pr-fully-clean.py exited 0 on head ce96f24. All 184 check runs are green or skipped, and both Claude reviews returned a clean verdict.

The cross-harness review was waived because no reviewer could run from this session. The agy, codex, cursor-agent, gemini, and opencode CLIs are not installed. The egress proxy refused opencode.ai with a 403.


Generated by Claude Code

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.

New check: flag author names typed next to a citation of the same source

2 participants