feat(claude-automerge): expand auth/billing/secret risk-tier alternations#78
Conversation
…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>
|
Risk class: This PR touches one of the blocked path categories from Auto-merge is refused by (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.") |
|
Coverage Floor — mode:
|
|
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 |
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
(auth|login|session|oauth|oauth2|sso)(auth|login|signin|signup|logout|session[s]?|oauth|oauth2|sso|jwt|mfa|totp|webauthn|passkey)(billing|payment[s]?|pricing|invoice[s]?)(billing|payment[s]?|pricing|invoice[s]?|subscription[s]?|checkout|refund[s]?)^(.*/)?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).Scope limit (documented inline)
Pattern remains path-segment-anchored, not filename-prefix. Rails/Django/Express conventions like
controllers/sessions_controller.rborroutes/logout.pyare intentionally NOT matched globally — those belong in per-caller.github/risk-paths.yml. Catching them via the global regex would also over-matchhelpers/auth_helper.pyand 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-workflowsdoesn'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.shpasses locally (60 RISKY + 25 SAFE)actionlintbinary that got accidentally staged (follow-up commit + .gitignore)internal/jwt/orapi/checkout/on a fleet repo🤖 Generated with Claude Code