Introduce typed age eligibility decisions - #16374
Conversation
Generated by 🚫 Danger |
|
|
|
Version |
There was a problem hiding this comment.
AI Code Review - Found 2 potential issues
Overall this is a well-structured refactor: the eligibility logic is extracted into a pure, thoroughly unit-tested AgeEligibilityEvaluator, the typed AgeRestrictionReason is persisted so a prior restriction survives inconclusive results, and the single-flight guard plus preserved-restriction handling look correct. The two notes below are minor.
Automatic review · claude-opus-4-8 · Workflow run
How to reply to a finding
Reply on this review (or inline at the line the finding refers to) with one of:
@claude addressed- I made the change. Bot verifies against the next diff before marking resolved.@claude rejected: <reason>- Will not fix; reason gets quoted on the next review.@claude not-applicable- Finding does not apply (wrong file, already covered elsewhere, etc.).
The bot honours these on the next review pass.
| sealed interface AgeEligibilityDecision { | ||
| data object Allowed : AgeEligibilityDecision | ||
|
|
||
| data object VerificationRequired : AgeEligibilityDecision |
There was a problem hiding this comment.
AI Code Review [nit]
Issue: AgeEligibilityDecision.VerificationRequired is declared but never produced by the evaluator or handled anywhere. AgeEligibilityState.isUserAgeRangeEligible returns false for any non-Allowed decision, so if this variant were ever emitted it would restrict access with the generic supervised message and no dedicated handling.
Suggestion: Remove the unused variant, or wire it up (evaluator output + message mapping + UI handling) if it's intended for an upcoming step.
There was a problem hiding this comment.
Keeping it. It is temporary dormant scaffolding wired immediately in the next PR

Fixes WOOMOB-3765
Recommended reading before checking any of the following 4 PRs: pe5sF9-5Ch-p2
Description
Introduces the stable app-owned decision, persistence, and coordination layer needed before activating Age Signals SDK 0.0.4.
Allowed,VerificationRequired, andRestricteddecisions with explicit restriction reasons.This PR keeps SDK 0.0.3 and maps its responses through a small app-owned compatibility model.
LegacyAgeVerificationStatus,AgeCheckResult, andevaluateLegacyResult()are temporary scaffolding that keeps this layer behavior-preserving and independently buildable. PR #16376 replaces that adapter path with the SDK 0.0.4 access-status flow; the typed decisions, persistence rules, and coordination introduced here remain.This is PR 1 of 4:
Test Steps
No standalone manual QA is required for this temporary compatibility layer. It retains SDK 0.0.3 behavior and has no user-visible changes. Exercise the startup, recovery, and final SDK behavior through the test instructions in the subsequent PRs.
Images/gif
N/A — no UI changes in this PR.