Skip to content

Feature/candidate eligibility - #6

Open
SURYANSH-RAI wants to merge 1 commit into
bug-fixxingfrom
feature/candidate-eligibility
Open

SURYANSH-RAI wants to merge 1 commit into
bug-fixxingfrom
feature/candidate-eligibility

Conversation

@SURYANSH-RAI

@SURYANSH-RAI SURYANSH-RAI commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Enforce candidate eligibility on every results path

Hidden, incomplete, removed, and other-event participants no longer appear through any results path: fresh search/match retrieval, cached search results, or saved matches.

Builds on R04 (bug-fixxing), which this needs because saved matches are read by rank.

Rules agreed for this item

  • Complete profile = the participant has saved their event profile at least once (profile_updated_at is set). This is the same rule the app already uses to send people to the profile page.
  • Hidden viewers can still browse. Hiding stops others from seeing you; it doesn't stop you searching or viewing your own matches.
  • Saved matches are filtered when read, not deleted. Someone who becomes eligible again reappears without a recompute.

Changes

Path Before After
Fresh retrieval (listCandidates) visible + named visible + named + profile saved
Cached search results (findCandidatesByIds) visible only same rule as fresh retrieval
Saved matches (listForParticipant) no check same rule as fresh retrieval
Pipeline candidate filter visible visible + completed profile
Pipeline viewer profile row exists profile saved (search and match computation)
Intro request recipient visible visible + completed profile
  • The rule is defined once as ELIGIBLE_CANDIDATE in infrastructure/postgres/participant.repo.ts and used by all three queries.
  • New CompleteProfileSpecification in domain/matching/specifications/, used by the intent filter stage.
  • Removed participants were already handled: deleting their event row removes their saved matches, and every query joins the event roster. The new test covers this.

Hidden, incomplete, removed, and other-event participants no longer
appear in fresh retrieval, cached search results, or saved matches.

- One SQL rule (visible, named, profile saved) shared by listCandidates,
  cached-id hydration, and saved-match reads; saved matches are filtered
  on read, so a participant who becomes eligible again reappears
- The pipeline filter also requires a completed profile
- Viewers must have saved their event profile to search or compute
  matches; hidden viewers can still browse
- Intro requests require a visible recipient with a completed profile
- Unit tests for the rules and a real-Postgres test for all three paths
@SURYANSH-RAI
SURYANSH-RAI changed the base branch from dev to bug-fixxing November 2, 2026 18:17
@SURYANSH-RAI
SURYANSH-RAI added this pull request to stack #29 November 3, 2026 12:16
@SURYANSH-RAI
SURYANSH-RAI removed this pull request from stack #29 November 3, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant