Skip to content

Add delayed-reveal experimental condition with pre-reveal reflection#18

Open
Spbd1 wants to merge 1 commit into
codex/implement-silent-post-reveal-revision-accessfrom
codex/add-delayed-reveal-experimental-condition
Open

Add delayed-reveal experimental condition with pre-reveal reflection#18
Spbd1 wants to merge 1 commit into
codex/implement-silent-post-reveal-revision-accessfrom
codex/add-delayed-reveal-experimental-condition

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a hidden experimental variation that randomizes whether participants see the hidden-rule reveal immediately or after a brief, neutral reflection period.
  • Capture a short commitment rating and optional free-text reflection before revealing the hidden rule for delayed participants so the experiment can measure persistence of initial interpretations.
  • Assignment must be applied only after completing the pre-reveal survey so existing sessions that never submit the pre-reveal step remain unchanged.

Description

  • Add new types and fields: RevealTimingCondition and PreRevealCommitment and expose revealTimingCondition and preRevealCommitment on ResearchSession and ResearchExport in types/research.ts and include delayedReveal and standByInitialInterpretation in computed metrics.
  • Persist randomized assignment at pre-reveal submit with assignRevealTimingCondition in utils/session.ts, update components/PreRevealSurveyForm.tsx to call it when needed and branch the next navigation to either /hidden-rule-reveal or /pre-reveal-reflection based on the assigned condition.
  • Add the reflection UI and route: components/PreRevealReflectionForm.tsx implements the neutral message, required 1–7 Likert (standByInitialInterpretation) and optional trimmed text (<=500 chars), and app/pre-reveal-reflection/page.tsx provides the page shell; components/HiddenRuleReveal.tsx guards to redirect delayed participants to the reflection page if they try to open the reveal early.
  • Export/schema/admin updates: include revealTimingCondition and preRevealCommitment in the final research export via utils/researchMetrics.ts, validate them in lib/researchExportSchema.ts, and add CSV columns reveal_timing_condition, stand_by_initial_interpretation, and pre_reveal_commitment_text in lib/adminSubmissions.ts.

Files changed (high-level): types/research.ts, utils/session.ts, components/PreRevealSurveyForm.tsx, components/PreRevealReflectionForm.tsx (new), app/pre-reveal-reflection/page.tsx (new), components/HiddenRuleReveal.tsx, utils/researchMetrics.ts, lib/researchExportSchema.ts, lib/adminSubmissions.ts.

Testing

  • Ran npm run typecheck and it completed successfully with no new type errors.
  • Ran npm run lint and it completed; the run reported existing react-hooks/exhaustive-deps warnings in ParticipantBackgroundForm.tsx and PostRevealSurveyForm.tsx that were present before this change.
  • Ran npm run build and the Next.js production build completed successfully and generated the new static page for /pre-reveal-reflection.

All automated checks passed; no new lint errors or type errors were introduced (only preexisting lint warnings remained).


Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant