Repository navigation
Switch join eligibility gate to canivote (#406) - #425
Merged
Merged
Conversation
canivote has since published an OpenAPI contract and no longer accepts the `event` alias; its response carries `policy`. `_eligibility_detail` still read `event`, so the cached detail was always empty against a real response — and the test hid it by fabricating `event=`. - `_eligibility_detail` reads `policy`. Criteria are not cached: nothing reads them yet (#406 adds the failed-rule view), and they are where prose/username could leak. - `_check_join_eligibility`'s docstring points at canivote's `/openapi.json` and states exactly what is cached. - Tests build a canivote-shaped response and assert the cache holds only the policy id, with no prose or username. - `guide_deployment.md` documents `ACCOUNT_ELIGIBILITY_URL` as the canivote base URL (not an endpoint) and when to set it.
2 of 8 tasks
Owner
Staging verificationRan against the Environment note: Results
Fix included in this PR
Filed from this work
|
This was referenced Sep 19, 2026
This was referenced Sep 21, 2026
Closed
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
eligibleboolean to canivoteGET /checkwithuserandpolicy.eligibleandnot_eligibleto the existing join contract; keepindeterminateand all non-200 responses, timeouts, and malformed bodies on the could-not-check path.logger.exceptioncall with logging limited to policy id, response status or exception class, and Retry-After.Scope
This PR implements #406 work item 1 only. Policy picker, schema/migration changes, verdict persistence, invitations, shared access checks, and background re-checks are deliberately left for the other work items and lanes.
The requested recommendation to close #257 as superseded by #406 work item 2 was posted separately; the issue was not closed.
Review follow-ups
ACCOUNT_ELIGIBILITY_URLstill opts into checks.indeterminatenow logs only the policy ID, internal participant ID, and unmeasured metric IDs; no username or upstream response prose is logged.Logging note
I checked
v2/logging_setup.py:41-56: its redactions cover credentials, hashes, and sensitive key/value fields, but do not match auser=query parameter in a requests traceback. The eligibility logger avoids attaching the raw exception or URL.Tests
uvx ruff check .fromv2: passeduv run --frozen pytest -q: 837 passed, 1 skippedPart of #406; context: #409.