[TAN-8649] Add demographic data to demo data authors - #14735
Open
amanda-anderson wants to merge 1 commit into
Open
[TAN-8649] Add demographic data to demo data authors#14735amanda-anderson wants to merge 1 commit into
amanda-anderson wants to merge 1 commit into
Conversation
Extracts the random answer generation from the seed_native_survey_responses rake task into RandomCustomFieldValuesService, and uses it to fill the enabled registration fields on the fake authors that create_demo_inputs builds — so demographics and representativeness dashboards populate on demo platforms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194zd7Y2UVtWuNhcTqcsxH1
amanda-anderson
commented
Sep 8, 2026
| @@ -0,0 +1,196 @@ | |||
| # frozen_string_literal: true | |||
Contributor
Author
There was a problem hiding this comment.
RE: Irene's question on whether the fake demographic data follows a specific distribution:
Random, but shaped (not uniform noise), e.g.
- Which questions: whatever registration fields the platform actually has enabled
- Per-field distributions:
- birthyear — uniform ages 18–80
- domicile — 90% a random platform area, 10% "outside"
- selects (gender, custom questions) - thes are weighted toward earlier options (so charts show a realistic skew, not a flat line), with ~10% picking "other" where it exists
- rating/linear scales — skewed positive (more 4s and 5s than 1s)
- ~20% of optional fields are skipped per user (so dashboards show realistic "no answer" gaps instead of 100% completion)
- What it does NOT do: no correlations. A user's gender answer has no relationship to their Faker-generated name (you can get a "male" answer on a user named Sarah), age doesn't influence domicile, etc.
Individually inspecting a demo user can therefore look slightly off; in aggregate — which is what the demographics/representativeness dashboards show — it looks right, and that's what demos display.
The logic is shared with the survey-seeding rake task (same service), so demo survey answers follow the same shaped randomness.
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.
Demo authors from
create_demo_inputs(TAN-8648) now get random answers for the enabled registration fields, populating the demographics and representativeness dashboards on demo platforms.Extracts the answer generation from the
demos:seed_native_survey_responsesrake task intoRandomCustomFieldValuesService; the rake task now uses it too.Testing: specs + engine suite green, rake smoke-tested, verified live over MCP.
🤖 Generated with Claude Code.
Changelog
Added