Repository navigation
chore: Re-apply the repo-ci-baseline Template - #330
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Review
Overview
This PR makes the Claude Review pipeline harder to abuse and easier to read. The prompt now asks for a structured Markdown summary and titled findings. post_claude_review.py gets a single-line-suggestion vetting layer, and credential redaction is capped so long token runs can't be used for quadratic regex time. release_post.py stops splitting on U+2028/U+2029 (and lone CR in commit subjects). I found no blocking problems. Only the diff was reviewed. The workflow file's full text was not among the context pieces, so I checked the inline workflow code only through the diff and the tests that extract it.
Changes
| File | What changed |
|---|---|
.github/workflows/claude-review.yml |
The prompt now requests Overview / Changes / Advisory / Not reviewed sections and a bold one-line title on each finding. The inline answer check gains MAX_TOKEN_RUN, TOKEN_CHAIN, redact_credentials and redact_path, mirroring the script. redact() now takes a key so that path fields get the lenient rule. |
.github/scripts/post_claude_review.py |
Adds redact_credentials, which replaces any dot-joined token chain holding a run over 128 characters before CREDENTIAL runs, and redact_path, which skips that rule for paths of 1024 characters or fewer. Adds SUGGESTION_FENCE, defuse_suggestions and vet_suggestions, which keep only one well-formed single-line suggestion on the cited line. Suggestions on a nearest-line fallback or in an off-diff body finding are turned into ```text fences. Off-diff bodies are indented under their bullet. |
.github/scripts/release_post.py |
_list, commit_subject and update_blog_index now split on newlines (and CR for subjects and index rows) only, instead of splitlines(). |
.github/scripts/tests/test_post_claude_review.py |
Adds tests for suggestion vetting, redaction (including script/workflow parity and fuzzing), path handling, linear-time behaviour and the new prompt text. |
.github/scripts/tests/test_release_post.py |
Adds tests for U+2028/U+2029 in jq records, commit subjects and blog index rows, and for a lone CR in a subject. |
Paths I traced and found sound:
- Fence regexes:
SUGGESTION_FENCEandONE_LINE_SUGGESTIONare linear and over-defuse rather than under-defuse. The cases I considered were\r,\v,\f,ſunder(?i), quoted or listed fences, and fences nested in longer fences. - Parity of the two copies: the workflow copy matches the script copy (the tests also fuzz this). The test's slice from
CREDENTIAL = re.compile(to\n\n\ndef answer_inmatches the blank-line layout the diff produces. - Which script runs: the post job runs the base's script and the review job runs the PR's workflow. The mix is safe in both orders, because text redacted by the new check passes through the older
CREDENTIALunchanged. - Redaction ordering: a credential glued to a long run is replaced whole, not left half-redacted.
Advisory (not blocking)
test_the_prompt_asks_for_a_structured_summary_and_titled_findingsasserts"suggestion" not inthe lower-cased text of the whole workflow file, comments and heredoc included. It is meant to guard the prompt, but any later comment, log message or identifier inclaude-review.ymlcontaining that word will fail it. Scoping the check to theprompt:block would match its intent.- The
TOKEN_CHAINrule applies to summaries and bodies as well as to paths. Any unbroken run of letters, digits,_or-over 128 characters is redacted (for example, a long generated identifier, or a base64 or hash blob quoted in a finding). The text becomes[redacted]and the review warns about a credential. The docstring accepts this ("no legitimate review text has one"), so it is a known trade-off, not a defect. first_paragraphinrelease_post.pystill usesblock.strip().splitlines(), andre.split(r"\n\s*\n", …)treats U+2028 as whitespace. These only affect blog card excerpts, but they are not yet consistent with the "split on Markdown line endings only" rule this PR applies elsewhere.- Off-diff bodies are indented only after
\n. A body containing a lone\r(a Markdown line ending) would still leave its bullet. Normalising\r\nand\rto\nbefore indenting would close that. - The timing tests (
< 2s and< 3s of wall clock) leave a very large margin over the quadratic case, so they are unlikely to flake. They do depend on runner speed.
No findings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
=======================================
Coverage 85.42% 85.42%
=======================================
Files 117 117
Lines 2717 2717
Branches 387 387
=======================================
Hits 2321 2321
Misses 318 318
Partials 78 78 🚀 New features to boost your workflow:
|
Automated release blog posts for #328, #329, #330, opened by the release workflow. It holds every Release whose post isn't on main yet, rebuilt from main on each run. The [skip-release] title marker keeps its merge from starting another release. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Why
Re-Apply the repo-ci-baseline Template so this repo carries the Template changes from mpaulosky/dotfiles#298 and mpaulosky/dotfiles#300.
What changed
dd366daApply commit,apply.shoutput alone: brings fix(baseline): Split release_post.py's gh api output on newlines only dotfiles#298 and feat(baseline): Ask Claude Review for a structured summary and titled findings with suggestions dotfiles#300..github/scripts/post_claude_review.py.github/scripts/release_post.py.github/scripts/tests/test_post_claude_review.py.github/scripts/tests/test_release_post.py.github/workflows/claude-review.ymlVerification
apply.sh's output on a branch up to date withmain.scripts/gate.sh) passed ondd366da.🤖 Generated with Claude Code