Skip to content

Add cost visibility condition before reveal#21

Open
Spbd1 wants to merge 1 commit into
codex/add-randomized-explanation-framing-conditionfrom
codex/add-cost-visibility-gradient-condition
Open

Add cost visibility condition before reveal#21
Spbd1 wants to merge 1 commit into
codex/add-randomized-explanation-framing-conditionfrom
codex/add-cost-visibility-gradient-condition

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a pre-reveal cost-visibility experimental condition so participants receive varied levels of cost-related context on the /visible-results page without revealing the hidden-profile mapping (to study effects on attribution and later revision).
  • Persist the assigned condition in the session and include it in exports and computed metrics for analysis while preserving compatibility with older sessions.

Description

  • Data model: added CostVisibilityCondition and costVisibilityCondition?: { condition: "no-cost-info" | "partial-cost-hint" | "full-cost-preview"; assignedAt: string } to ResearchSession and ResearchExport, plus computed metric fields costVisibilityCondition, hadAnyCostHint, and hadStrongCostHint in ComputedResearchMetrics and exports; bumped schema version to hidden-cost-game-research-schema-5.
  • Assignment: assign a random condition (1/3 each) when reaching the visible-results stage using assignCostVisibilityCondition in utils/session.ts (triggered from components/ResultsTable.tsx), and persist it in local storage; existing sessions without the field remain supported.
  • UI: show a non-identifying pre-reveal note in ResultsTable via a new CostVisibilityNote component: no UI change for no-cost-info, a neutral hint for partial-cost-hint, and a stronger pre-reveal hint for full-cost-preview (both avoid revealing profile mapping).
  • Exports & schema: included costVisibilityCondition in the research export, updated Zod lib/researchExportSchema.ts to validate the field and the new metric fields, added CSV columns in lib/adminSubmissions.ts (top-level cost_visibility_condition and metric columns metric_cost_visibility_condition, had_any_cost_hint, had_strong_cost_hint).
  • Files changed: types/research.ts, utils/session.ts, components/ResultsTable.tsx, utils/researchMetrics.ts, lib/researchExportSchema.ts, lib/adminSubmissions.ts.

Testing

  • Ran npm run typecheck — passed.
  • Ran npm run lint — passed; reported an existing React Hook dependency warning in components/ParticipantBackgroundForm.tsx that pre-existed this change.
  • Ran npm run build — production build succeeded and pages compiled (same existing lint warning reported).

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