Skip to content

docs(mypolitics): questionnaire specs and tasks - #85

Merged
AdrianOrlow merged 3 commits into
mainfrom
mypolitics/questionnaire-specs
Oct 9, 2026
Merged

AdrianOrlow merged 3 commits into
mainfrom
mypolitics/questionnaire-specs

Conversation

@AdrianOrlow

Copy link
Copy Markdown
Member

What

The questionnaire (survey) view, taken from docs to specs to tasks in one pass. The specs were approved in advance by Adrian; the review stop of the concept-to-task skill was waived on his instruction.

  • 1 new doc - docs/modules/quiz/questionnaire/session-and-data.md. Nothing described where a quiz comes from, what a session is, what is submitted and what survives a refresh, and a spec may only follow a doc.
  • 17 specs in spec/quiz/: session-and-data, answer-model, phases-model, progress-and-pacing, demographics, results-saving-and-marketing, engaging-loader, event-model, checkpoints, checkpoints-random-copy, halfway-through, axis-closeness, new-trait, stats-chart, single-axis-puzzle, double-axis-puzzle, nolan-chart-path.
  • 15 tasks in tasks/epics/survey/cycle-3 to cycle-10, published as sub-issues of [Epic] Survey: SurveyApi mypolitics-app#100 to docs(mypolitics): park legacy content migration as an idea #114.
  • 2 stale tasks removed - cycle-1/survey-newsletter.md and cycle-2/survey-questionnaire.md described the 1.0 flow; their issues ([Przenoszenie quizów] Eurowyborczy 2024 #35, [Przenoszenie quizów] Warszawski Radar Wyborczy #36) were closed as deprecated with "a new task will be created". survey-email-capture (Łukasz Kałużny - Front-end repository #103) and the new survey-questionnaire (Łukasz Kałużny - Back-end repository #102) are those tasks.
  • Small edits to existing files - two broken doc links fixed (no-cross-device-resume, halfway-split); universal-axis.md gains "no value labels on checkpoint cards" and the masked state of the single axis puzzle; the two READMEs list the new files.

Read this before approving

Every doc in scope is still ⚪ idea; no Decision line was changed (the result-module specs were written the same way). The docs, the Figma frames, the legacy app and the live API disagree in a dozen places. Each was decided, and each spec lists its calls with what they cost. The ones that change what the taker gets:

Topic Call Cost
Skip "Pomiń" exists on every question (Figma, legacy); it is not an answer kind The answer-model doc says a taker with no opinion has nothing to press
Category select Prioritises (the chosen ids go to prioritizedCategories), does not cut the question list The doc's "cut the quiz to them" is not delivered - the API cannot do it
Result submission One hand-in, when results calculation starts A taker who leaves during the closing phases leaves no result (the phases doc promises otherwise)
Demographics Exact years 13-99 (the API validates 13-120), sent only when all four fields are chosen No age bands, no per-field skipping, not stored between sessions
E-mail capture The card only collects; the link is requested after the result exists; skipped for a declared age under 18 The address is never stored, so a refresh in the closing phases loses it silently
Results destination The production results page, until this app has a results screen The taker leaves the new app at the end
Scoring The running state ports the production algorithm mp-qu-2025-1.0.1 Not checked against a live result (that needs a POST to production)
Pacing and confidence Numbers set here (no card before 5 or within the last 3 questions, at least 6 apart, at most 6 per quiz; axis lean 70 / 15 points; position puzzle 5 points) None of them comes from data; they are first guesses to tune
Copy Pool lines are gender-neutral, so several Figma lines are reworded ("Zdobyłeś", "Przeszedłeś", "myślałeś") The cards differ from the frames in wording

Three things cannot run with today's data, and the tasks say so:

Axis closeness and the axis puzzle run only in the three identity-quiz versions: 11 of the 14 live surveys send no axes.

Not in this PR

Short results card and the results screen (results module), post-survey module (roadmap 4.2), any back-end work. results/module-statistics.md is still an empty template.

Checks

  • Relative links and images in the 23 new or edited files: 476 links, 23 images, none missing (script).
  • mkdocs build --strict stops on six warnings, all in files this PR does not touch (links to editor/README.md, platform/frontend-reimplementation.md, spec/platform/accounts.md). Not fixed here.
  • The task files link the specs on main, so those links in the issues are dead until this PR is merged.

🤖 Generated with Claude Code

AdrianOrlow and others added 3 commits October 8, 2026 04:01
Seventeen specs for the questionnaire view, written from the docs under
modules/quiz/questionnaire and the frames they link: session and data,
answer model, phases model, progress and pacing, demographics, results
saving and marketing, the results calculation loader, the checkpoint
event model, the shared checkpoint card, the copy pools and the seven
checkpoint cards.

- New doc: questionnaire/session-and-data.md - nothing described where a
  quiz comes from, what a session is and what is submitted, and a spec
  may only follow a doc.
- Two broken doc links fixed (no-cross-device-resume, halfway-split).
- universal-axis.md: no value labels on checkpoint cards, and the masked
  state of the single axis puzzle.
- spec/quiz/README.md and the questionnaire README list the new files.

Every doc in scope is still an idea; each spec lists the calls it made
where the docs, the frames and the API disagree, and what each costs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fifteen tasks under tasks/epics/survey, cycles 3 to 10, cut from the
questionnaire specs: the survey API layer, the session, the questionnaire
screen and route, e-mail capture, the results calculation loader, the
running state, the checkpoint engine with its copy pools, the shared
checkpoint card and the seven cards.

- cycle-1/survey-newsletter.md and cycle-2/survey-questionnaire.md are
  removed: they describe the myPolitics 1.0 flow and their issues (#35,
  #36) were closed as deprecated. survey-email-capture and the new
  survey-questionnaire replace them.
- double-axis-puzzle spec: a hit without an image draws the cap in the
  band colour, which is what the shared bar can do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fifteen tasks are published as sub-issues of [Epic] Survey
(gi-org-pl/mypolitics-app#29), issues #100 to #114. Each task now names
its branch with its issue number and its dependencies by issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T02:55:07.582319Z 0da8a8b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0da8a8b0c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +189 to +191
export const readCheckpointRecord = (stored: SurveyCheckpointRecord): CheckpointRecord => ...
// The session's record with its cards checked. An item of `cardsShown` is kept when it holds a card with a known
// `type`, a whole-number `boundary` and a `line` that exists in the pools; any other item is dropped. Never throws.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate complete checkpoint payloads when restoring records

Validate every card's discriminated payload before narrowing stored JSON to CheckpointRecord. As specified, a persisted item such as an axis-closeness card with a valid type, boundary, and pool line but missing axisId, start, or end is retained as a fully typed card; after a reload the checkpoint registry can then render it and dereference absent fields instead of dropping it and advancing to the next question. This also lets malformed cards affect pacing and duplicate suppression. The reader should validate the required fields and compatible line pool for each card variant.

Useful? React with 👍 / 👎.

@AdrianOrlow
AdrianOrlow merged commit 4c17ee3 into main Oct 9, 2026
2 checks passed
AdrianOrlow added a commit that referenced this pull request Oct 9, 2026
Brings in the questionnaire specs and tasks (#85). universal-axis.md was
changed on both sides and merged without conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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