Repository navigation
chore: Re-apply the repo-ci-baseline Template - #249
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
=======================================
Coverage 89.82% 89.82%
=======================================
Files 17 17
Lines 393 393
Branches 85 85
=======================================
Hits 353 353
Misses 15 15
Partials 25 25 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Claude Review
Overview
This PR makes four changes. It reshapes Claude Review's summary and finding format in the prompt. It hardens post_claude_review.py and the workflow's mirrored answer check: credential redaction now runs in linear time, and one-click GitHub suggestions are vetted or defused. It fixes Unicode line-separator handling in release_post.py. It adds a shared headOfRef helper in Sandcastle. I traced the redaction, suggestion-vetting, line-splitting and ref-matching paths, including edge inputs and regex backtracking, and found no merge-blocking bug. One non-trivial behaviour regression is raised below. The claude-review.yml file itself was not in the context pieces, so I could only review its diff hunks.
Changes
| File | What changed |
|---|---|
.github/workflows/claude-review.yml |
The prompt asks for a sectioned Markdown summary (Overview, Changes, Advisory, Not reviewed) and bold-titled finding bodies. The inline answer check gains MAX_TOKEN_RUN, TOKEN_CHAIN, redact_credentials and redact_path, and redact() now takes a key so path fields get the lighter rule. |
.github/scripts/post_claude_review.py |
Adds the long-token-run redaction, redact_path (with MAX_PATH), SUGGESTION_FENCE, ONE_LINE_SUGGESTION, defuse_suggestions and vet_suggestions. On-diff comments are vetted. Nearest-line comments and off-diff body findings have suggestions defused. Off-diff bodies are indented under their bullet. |
.github/scripts/release_post.py |
_list, commit_subject and update_blog_index split on \n or `\r\n |
.sandcastle/lib/branches.mts, build.mts |
New headOfRef picks the exact refs/heads/<branch> line from ls-remote. originRefs.remoteHead, remoteMainIs and remoteBranchIsOnOrigin use it. Previously remoteHead took the first token of the first line, so a tail-matching ref could win. |
test_post_claude_review.py, test_release_post.py, branches.test.mts, build.test.mts |
Tests for suggestion vetting, redaction (including script/workflow parity and linear time), Unicode separators, and headOfRef. |
Advisory (not blocking)
vet_suggestions's docstring says "the prompt asks for one line only", but the prompt asks for no suggestions at all. The new test asserts the wordsuggestionappears nowhere in the prompt. The comment is stale or forward-looking, so reword it.test_the_prompt_asks_for_a_structured_summary_and_titled_findingsasserts"suggestion" not in prompt.lower()over the whole workflow file. The test will fail if any unrelated comment in the file ever mentions the word. Scope it to the prompt block.- The wall-clock thresholds in the "linear time" tests (
< 2s and< 3s) can flake on a loaded CI runner. Consider a generous multiple, or a growth-ratio check between two input sizes. - In
post_claude_review.py,redact_pathis followed by a single blank line before theSUGGESTION_FENCEcomment, andMAX_PATHsits between functions. This departs from the file's two-blank-line spacing. - Pre-existing and out of scope:
post_titlein the blog front matter is written into a double-quoted YAML scalar. Jekyll's YAML parser may treat a U+2028 or U+2029 in a PR title as a line break and fold it, even though this PR now preserves those characters when splitting.
Automated release blog posts for #248, #249, 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>
…304) ## Why Claude Review's finding on mpaulosky/TicketManager#249: `redact_credentials` replaced any dot-joined token holding a run over 128 characters. A generated test's file name quoted in a finding body or the `Changes` table (`tests/Get_Articles_When_<130 chars>_Returns_401.cs`) became `tests/[redacted]`, lost its extension and raised a false "credential-shaped string(s) were redacted" warning. ## What changed - **The rule:** the long-run replacement now applies only to a token that also holds one of the strings every `CREDENTIAL` alternative starts with (`eyJ`, `gh[pousr]_`, `sk-ant-`, `github_pat_`) — the strings that made `CREDENTIAL` quadratic. A long token without one can't match `CREDENTIAL`, so a long identifier, a digest or a generated name is left alone, and nothing credential-shaped is let through. - **Where:** `post_claude_review.py` and its mirror in the `claude-review.yml` answer check (`CREDENTIAL_START`), with the dotfiles root copies. - **Docs:** ADR 0004's redaction paragraph, `redact_path`'s docstring and the workflow comment. ## Verification - `test.sh` passes (the Python suite is 242 tests). New tests: long plain tokens are left alone with no warning, in a finding body and the summary, by the script and the workflow alike; a long token that starts a credential is still replaced whole for every start, including each `gh[pousr]_` letter and a start in another dot-separated segment; the workflow carries the script's `CREDENTIAL_START`, `MAX_TOKEN_RUN`, `TOKEN_CHAIN` and `CREDENTIAL`; every `CREDENTIAL` match starts with a `CREDENTIAL_START` string. - Mutation checks: with the condition removed, 7 tests fail; with a start dropped from `CREDENTIAL_START`, 5 fail. - Local `/pre-push-review`: 3 rounds, 7 findings (4 Critical, 1 Warning, 2 Advisory) all fixed, none open. - Landing it needs a re-Apply of the other repos, since `post_claude_review.py` and `claude-review.yml` are Owned. Fixes #301 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.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
c3b2cabApply 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.yml.sandcastle/lib/branches.mts.sandcastle/lib/branches.test.mts.sandcastle/lib/build.mts.sandcastle/lib/build.test.mtsVerification
apply.sh's output on a branch up to date withmain.scripts/gate.sh) passed onc3b2cab.🤖 Generated with Claude Code