Repository navigation
chore: Re-apply the repo-ci-baseline Template - #443
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Review
Overview
The PR narrows the long-token rule in the credential redactor. A token chain with a run over MAX_TOKEN_RUN is now replaced whole only if it also contains a credential start (eyJ, gh[pousr]_, sk-ant- or github_pat_). Before, any long token was replaced, which redacted long generated test names, identifiers and digests and added a spurious "credential-shaped string(s) were redacted" warning. The workflow's inline copy matches the script, and a test pins the match. The PR also moves the duplicated withUiRole test helper into one shared ui-role-fixture.mts, and adds maxRetries/retryDelay to every test rmSync cleanup. I found no blocking problems, so my verdict is approve.
I checked three things on the redaction change:
- Coverage of
CREDENTIAL: every characterCREDENTIALcan match is inTOKEN_CHAIN's class, which has letters, digits,_,-and.. So anyCREDENTIALmatch lies inside a single chain, and that chain contains a start string. - Safety of the gate: no match is missed because of the new
CREDENTIAL_STARTgate. The only chains now left alone are onesCREDENTIALcould not have matched anyway. - Linear-time guarantee: it still holds. A chain with a long run and a start is replaced whole. A chain with no start gives
CREDENTIALno starting point. A chain with a start and short runs has bounded rescans.
The leak check against the review job's own secrets is a separate step, and this change does not touch it.
I could not read build.test.mts or its other uses of ROLE_AGENTS, because it is not in the context pieces. See the advisory below.
Changes
| File | What changed |
|---|---|
.github/scripts/post_claude_review.py |
Adds CREDENTIAL_START. redact_credentials replaces a long chain only when it holds a start. The comments and the redact_path docstring are updated. |
.github/workflows/claude-review.yml |
The inline answer check carries the same CREDENTIAL_START and the same gated rule. Only comments and the regex gate changed. |
.github/scripts/tests/test_post_claude_review.py |
New tests: long plain tokens are left alone; long credential-start tokens are still replaced whole; the workflow and script definitions match; every credential CREDENTIAL matches begins with a start; a long path holding a start is left alone. The fuzz test adds LONG_NAME. |
.sandcastle/lib/ui-role-fixture.mts (new), ui-role-fixture.test.mts (new) |
One shared withUiRole(enabled, run) helper with its own tests, replacing three copies. |
.sandcastle/lib/{agents,build,plan}.test.mts |
Import the shared helper. build.test.mts now calls withUiRole(true/false, fn) with the flag first. |
.sandcastle/lib/git-sandbox-fake.mts and {checkpoint,host-safety,review-ledger,scan,shell}.test.mts |
rmSync cleanup now retries up to 5 times, 100 ms apart. |
Advisory (not blocking)
build.test.mtsdropsROLE_AGENTSfrom itsrepo-config.mtsimport. I couldn't see the whole file, so I couldn't confirm nothing else in it usesROLE_AGENTS. Node type-stripping would only fail at runtime, so confirm the suite passes.- The module docstring of
post_claude_review.pystill says only thatCREDENTIALmust match the workflow's.CREDENTIAL_START,MAX_TOKEN_RUNandTOKEN_CHAINmust match too.test_the_workflow_carries_the_scripts_long_run_ruleenforces this, but the docstring could say so. - A long token that does hold a start string by accident, for example a generated name like
Get_eyJ_AAAA…in a review body or summary, is still replaced whole, and the step still warns. Only finding paths are exempt, as the new test shows. This is a narrow remaining false positive, and the change accepts it. - The retry options on
rmSyncand thewithUiRolerefactor have no connection to the redaction change. The PR's scope is the author's call. ui-role-fixture.mtsis test-only support code inlib/next to production modules, and it has no.testsuffix. This is harmless as long as nothing outside tests imports it.
I read all pieces: diff 001.diff and context 001–008.
No findings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
=======================================
Coverage 96.65% 96.65%
=======================================
Files 42 42
Lines 568 568
Branches 100 100
=======================================
Hits 549 549
Misses 5 5
Partials 14 14 🚀 New features to boost your workflow:
|
Automated release blog posts for #443, 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#303, mpaulosky/dotfiles#304, mpaulosky/dotfiles#305 and mpaulosky/dotfiles#306.
What changed
6af2035Apply commit,apply.shoutput alone: brings feat(baseline): Add the opt-in UI developer role to Sandcastle dotfiles#303, fix(baseline): Redact only long tokens that could start a credential dotfiles#304, chore(baseline): Share the ui-role test helper across the Sandcastle tests dotfiles#305 and fix(baseline): Retry the removal of the tests' scratch directories dotfiles#306..github/scripts/post_claude_review.py.github/scripts/tests/test_post_claude_review.py.github/workflows/claude-review.yml.sandcastle/lib/agents.test.mts.sandcastle/lib/build.test.mts.sandcastle/lib/checkpoint.test.mts.sandcastle/lib/git-sandbox-fake.mts.sandcastle/lib/host-safety.test.mts.sandcastle/lib/plan.test.mts.sandcastle/lib/review-ledger.test.mts.sandcastle/lib/scan.test.mts.sandcastle/lib/shell.test.mts.sandcastle/lib/ui-role-fixture.mts(added).sandcastle/lib/ui-role-fixture.test.mts(added)Verification
apply.sh's output on a branch up to date withmain.scripts/gate.sh) passed on6af2035.🤖 Generated with Claude Code