fix(swift): accept webAuth(clientId:domain:) in async/await grader#144
Merged
sanchitmehtagit merged 1 commit intoJul 23, 2026
Merged
Conversation
The L5 async/await grader regex required `webAuth()` with empty parens,
so the explicit-credentials factory `webAuth(clientId:domain:)` never
matched and valid solutions failed the grader. Both `Auth0.webAuth()`
(reads Auth0.plist) and `Auth0.webAuth(clientId:domain:)` are valid
public Auth0.swift factories.
Widen the parens to `webAuth\([^)]*\)` to accept arguments while keeping
`.start()` empty — the empty call is what distinguishes async/await usage
from the completion-handler form (`.start { result in ... }`) this grader
is meant to reject.
📝 WalkthroughWalkthroughThe Swift L5 grader regex now accepts both parameterless and parameterized ChangesSwift L5 grader
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/auth0-evals/src/evals/quickstarts/swift/graders.ts`:
- Around line 45-46: Replace the broad webAuth matcher in the Swift grader with
validation that requires the supported named arguments and accepts nested
expressions such as function calls within argument values, while rejecting
unsupported forms like webAuth(foo).start(). Add regression coverage for both
accepted and rejected invocation shapes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 127a4fb4-9f3e-4018-a1fe-3004ed32ba03
📒 Files selected for processing (1)
apps/auth0-evals/src/evals/quickstarts/swift/graders.ts
yogeshchoudhary147
approved these changes
Jul 23, 2026
sanchitmehtagit
deleted the
fix/swift-webauth-grader-explicit-credentials
branch
July 23, 2026 04:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Swift quickstart L5 async/await grader regex required
webAuth()with empty parens:So the explicit-credentials factory
webAuth(clientId:domain:)never matched, and valid solutions failed the grader. Both forms are valid public Auth0.swift factories (verified against SDK source + README):public func webAuth(session:bundle:) -> WebAuth— reads fromAuth0.plistpublic func webAuth(clientId:domain:session:) -> WebAuth— explicit credentialsThis grader for hardcoding credentials should fail however webauth structural l5 grader should pass
Change
Widen the factory parens to
webAuth\([^)]*\)so arguments are accepted, while keeping.start()empty — the empty call is what distinguishes async/await usage from the completion-handler form (.start { result in ... }) that this L5 grader is designed to reject.Eval signal
From
swift_quickstart/agent-mcp-skillsin eval run 29835398213, 5 of 8 models failed this grader despite writing correct async/await code:NOT matchedwebAuth())webAuth())Opus scored an A (94.5) with correct code but still failed the version grader purely because it used the
webAuth(clientId:domain:)form — a false negative this change fixes.Test plan
Validated the new regex against positive and negative cases:
webAuth().start()-> matchAuth0.webAuth(clientId: "...", domain: "...").start()-> matchAuth0.webAuth(clientId: "...", domain: "...").useHTTPS().start()-> matchwebAuth().scope("openid").start()-> matchwebAuth(clientId:domain:)\n.start()-> matchwebAuth().start { result in }-> no match (completion handler still rejected)webAuth(clientId:domain:).start { result in }-> no matchnpm run build+npm run lintpassContext
Part of the eval flywheel. The grader should accept any valid API form; the companion skill fix (auth0/agent-skills#155) separately stops the skill from teaching the hardcoded-credentials variant that made lower-tier models trip the L3 security graders.