Skip to content

feat(claude-automerge): expand auth/billing/secret risk-tier alternations#78

Merged
topcoder1 merged 2 commits into
mainfrom
claude/expand-automerge-risk-globs
May 24, 2026
Merged

feat(claude-automerge): expand auth/billing/secret risk-tier alternations#78
topcoder1 merged 2 commits into
mainfrom
claude/expand-automerge-risk-globs

Conversation

@topcoder1
Copy link
Copy Markdown
Owner

Summary

Sibling-gap audit follow-up to #77 (which added oauth2 + main.go). The same literal-segment-alternation trap exists for several other auth-adjacent and billing-adjacent directory names the global policy intends to cover but the regex never enumerated.

Additions

Category Before After
Auth alternation (auth|login|session|oauth|oauth2|sso) (auth|login|signin|signup|logout|session[s]?|oauth|oauth2|sso|jwt|mfa|totp|webauthn|passkey)
Billing alternation (billing|payment[s]?|pricing|invoice[s]?) (billing|payment[s]?|pricing|invoice[s]?|subscription[s]?|checkout|refund[s]?)
Secrets ^(.*/)?secrets(/|$) ^(.*/)?secret[s]?(/|$)

Test coverage

Selftest grows from 41 → 60 RISKY cases (19 new segment-match examples across all three categories) and 16 → 25 SAFE cases (9 new substring/filename-prefix counter-examples like sessionsutil.go, passkeystore.go, subscriber.go, secretly.go, test_authorization_logic.py, docs/checkout-flow.md).

$ bash selftest/test_automerge_risk_patterns.sh
OK: all risk-pattern cases pass.

Scope limit (documented inline)

Pattern remains path-segment-anchored, not filename-prefix. Rails/Django/Express conventions like controllers/sessions_controller.rb or routes/logout.py are intentionally NOT matched globally — those belong in per-caller .github/risk-paths.yml. Catching them via the global regex would also over-match helpers/auth_helper.py and similar adjacent files. Precision over recall.

Vendor names (stripe, paypal, braintree) intentionally skipped for the same reason — per-caller.

Auto-merge rationale

In the manual-merge category (touches .github/workflows/**). The risk-tier path-scan will correctly block this PR on the new patterns themselves; manual click-merge required. (Also, topcoder1/ci-workflows doesn't install the caller, so PRs to this repo always require manual merge regardless.)

Codex pre-review

Skipped — purely additive regex + test cases (~50 LOC), regression surface covered by the selftest.

Test plan

  • bash selftest/test_automerge_risk_patterns.sh passes locally (60 RISKY + 25 SAFE)
  • Untracked the actionlint binary that got accidentally staged (follow-up commit + .gitignore)
  • Post-merge: spot-check on next Claude-authored PR touching e.g. internal/jwt/ or api/checkout/ on a fleet repo

🤖 Generated with Claude Code

topcoder1 and others added 2 commits May 24, 2026 14:12
…ions

Sibling-gap audit follow-up to #77 (oauth2 + main.go). Same
literal-segment-alternation trap exists for other auth-adjacent and
billing-adjacent dirs that the global policy intends to cover but the
regex didn't enumerate.

Auth alternation: add signin, signup, logout, sessions (plural),
jwt, mfa, totp, webauthn, passkey.

Billing alternation: add subscription[s]?, checkout, refund[s]?.

Secrets pattern: extend secrets → secret[s]? to also catch the
singular `secret/` directory convention.

Selftest grows from 41 → 60 RISKY cases (19 new segment-match
examples across all three categories) and 16 → 25 SAFE cases
(9 new substring/filename-prefix counter-examples like
`sessionsutil.go`, `passkeystore.go`, `subscriber.go`,
`secretly.go`, `test_authorization_logic.py`).

Scope limit (documented inline in the selftest): pattern is
path-segment-anchored, not filename-prefix. Rails/Django/Express
conventions like `controllers/sessions_controller.rb` or
`routes/logout.py` are intentionally NOT matched globally — those
belong in per-caller `risk-paths.yml`. Catching them here would
also over-match `helpers/auth_helper.py` and similar adjacent
files. Precision over recall.

Vendor names (stripe, paypal, braintree) intentionally skipped —
also per-caller.

Auto-merge rationale: in the manual-merge category (touches
.github/workflows/**). Risk-tier path-scan correctly blocks this
PR on the new patterns themselves.

Codex pre-review: skipped — additive regex + test cases, ~50 LOC,
regression surface covered by selftest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Accidentally staged in the previous commit. Add to .gitignore so
local downloads of the linter don't get picked up again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:blocked Risk class: blocked label May 24, 2026
@github-actions
Copy link
Copy Markdown

Risk class: blocked — manual merge required.

This PR touches one of the blocked path categories from .github/risk-paths.yml (Dockerfiles, docker-compose, .github/workflows/**, **/.env*, **/secrets*, infra/, terraform/, k8s/, or the classifier config itself).

Auto-merge is refused by claude-author-automerge.yml. A maintainer should review the diff and click "Squash and merge" themselves.

(This is a policy notice, not a code-quality failure. The classify job itself does not fail — required CI checks remain authoritative for "is the code green.")

@github-actions
Copy link
Copy Markdown

Coverage Floor — mode: enforce

metric value
measured 100.0%
floor (current) 99.0%
target 100.0%
last bumped 2026-05-12

@claude
Copy link
Copy Markdown

claude Bot commented May 24, 2026

No issues found. Regex changes are correct, segment-anchoring holds for all new SAFE/RISKY cases, and patterns are in sync between the workflow and selftest. Procedural note: the inline comment asks to also update install-automerge-policy.sh and the global CLAUDE.md policy block — worth confirming those were updated out-of-band if they exist externally.

@topcoder1 topcoder1 merged commit 85fb4f7 into main May 24, 2026
13 checks passed
@topcoder1 topcoder1 deleted the claude/expand-automerge-risk-globs branch May 24, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:blocked Risk class: blocked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant