Skip to content

Conversation

@clebouleau
Copy link

Description:

This PR introduces a new experimental template designed for a Leadership Rejection experiment. The goal of the experiment is to investigate how repeated experiences of rejection from leadership roles affect future leadership ambitions, and whether these dynamics differ by gender.

To implement this, I created a fully new template inspired by the existing Lost-at-Sea template: frontend/src/shared/templates/leader_rejection_template.ts

Key Features Added:

  1. New leader-selection mechanism
    A new selection system to get leaders (compared to Condorcet elections):
  • Applicants receive a weight based on their baseline performance in two initial individual tasks.
  • A leader is selected via a performance-weighted lottery. If no one applies, all participants enter the lottery under the same rules. A counterfactual is computed for non-candidates and their hypothetical outcome (accepted/rejected) is stored. This logic required a dedicated backend utility system and integration inside ranking-stage processing.
  1. New ranking type (RankingType.LR) and custom ranking view:
    To avoid rewriting the entire reveal/payout logic, I reused ranking stages but introduced a new ranking type that:
  • Does not involve actual ranking input,
  • Displays instructions only,
  • Triggers the leader-selection logic on “Next”.
  1. Custom reveal page for leadership status
    A new reveal component shows each participant: their status (accepted, rejected, hypothetical).
    New frontend file: frontend/src/components/stages/leader_status_reveal_view.ts

  2. New survival task (Desert Scenario)
    Added a new set of items, images, and expert solutions for a desert-survival task. Assets added under:
    frontend/assets/survival_desert/

Main Files Added / Modified
Backend
functions/src/stages/leadership_rejection.utils.ts — full leader-selection logic & utilities.
utils/src/stages/ranking_stage.ts — new RankingType.LR
utils/src/stages/ranking_stage.validation.ts — validation schema for LR ranking.
utils/src/stages/reveal_stage.ts — support for LR reveal items.
utils/src/stages/reveal_stage.validation.ts — validation schema updates.
utils/src/utils/algebraic.utils.ts — extended helpers for leader-selection logic.

Frontend
frontend/src/shared/templates/leader_rejection_template.ts — new experiment template.
frontend/src/components/experiment_builder/stage_builder_dialog.ts — import LR metadata + card rendering.
frontend/src/components/stages/ranking_editor.ts — new ranking type added to editor UI.
frontend/src/components/stages/ranking_participant_view.ts — new info-only LR ranking view.
frontend/src/components/stages/reveal_summary_view.ts — LR reveal routing.
frontend/src/components/stages/leader_status_reveal_view.ts — new reveal page.
frontend/src/shared/file.utils.ts — export of leader selection outcome + status.
frontend/src/components/stages/payout_summary_view.ts temporarily replaced “Election winner’s answer” with “Leader’s answer” to avoid confusion.

Assets
frontend/assets/survival_desert/ — images + expert solution PDF.

Verifications:
Verified locally in emulator
All stages progress correctly

@google-cla
Copy link

google-cla bot commented Nov 28, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

2 participants