Skip to content

Add check-gradient-lhs for stated gradients without a symbol on the left - #1652

Merged
d-morrison merged 3 commits into
mainfrom
claude/project-thread-yoywtv
Nov 8, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/project-thread-yoywtv

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Closes #1538.

Adds check-gradient-lhs, a diff-scoped, warn-by-default check for the psw gradient rule (psw#488): a line a PR adds that says "the gradient is ..." and then gives an equation with no \grad, \gradf, \gradwrt or \nabla before its first = is flagged.

  • Reuses check-write-idiom's engine for the diff model (added lines only, moved lines exempt, skip-not-fall-back).
  • Looks ahead up to 8 lines for a display equation after the stating sentence.
  • Skips code, HTML comments, front matter and <!-- check-gradient-lhs: allow -->.
  • Warns by default (fail: false), as the issue asks.
  • Wired per the "Adding a new check" list: README, CLAUDE.md, website pages, dependabot, _quarto.yml, changelog fragment, and a gradient-lhs job in _selftest.yml.

Tests: 15 unit tests pass locally; the audit for versioning docs and the permissions-docs suite pass.

The wiring issue (v3 slide plus caller PRs) is filed separately.


Generated by Claude Code

Diff-scoped, warn-by-default check for the psw gradient rule (psw#488):
a line the PR adds that says "the gradient is ..." and then gives an
equation with no gradient symbol before its first equals sign.
Reuses check-write-idiom's engine for the diff model.

Closes #1538

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9qHcYVZ9pfvuZZYpVo
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9qHcYVZ9pfvuZZYpVo
The antigravity preflight needs a leading bullet in each changelog
fragment, and lint-qmd flags prose lines over 80 characters.

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

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Review of PR #1652 (update): tests run, live state fetched

I installed pytest in a venv and ran check-gradient-lhs/tests and check-write-idiom/tests. 83 passed and 1 failed.

The failure is test_defaults_agree_across_script_action_and_workflow, with FileNotFoundError on .github/workflows/check-gradient-lhs.yml. That is an artifact of this review checkout, not a defect in the PR. The checkout restored .github/workflows/ from the default branch, so the PR's new workflow file isn't on disk. I read the test's regexes against the workflow text in the saved diff instead. fail defaults to false and globs defaults to '*.qmd *.md', so both match the script and action. I expect the test to pass in CI.

I fetched the PR live with gh pr view: it is OPEN, not a draft, not merged, and its head is 75a3d57666d81c1e775328bbaefd937d0e7ed80f, the commit I reviewed.

The earlier non-blocking note still stands: confirm the gha#1606 wiring issue exists.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "75a3d57666d81c1e775328bbaefd937d0e7ed80f",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Ran the check-gradient-lhs and check-write-idiom pytest suites: 83 passed, and the one failure is a missing workflow file caused by the default-branch restore of the review checkout.",
  "holistic_assessment": "Live PR state is open on the reviewed head, wiring lists and docs are complete, permissions stay contents read, and only confirming the gha#1606 wiring issue remains."
}

Reviewed commit: 75a3d57

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.9863 (review) — run

@github-actions

github-actions Bot commented Nov 8, 2026

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

Built to branch gh-pages at 2026-11-08 05:31 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check: a stated gradient has its symbol as the left-hand side

2 participants