Repository navigation
docs(mypolitics): add universal orientation spec and tasks - #82
Conversation
Add the spec of the one orientation definition the app uses and how it is read from the survey API, and the two front-end tasks cut from it: the definition with its API reading, and its adoption across the result modules in place of "party" and "candidate". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 164e08c1d3
ℹ️ 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".
| export const selectOrientations = <T extends OrientationBase>(orientations: T[], type?: OrientationType): T[] => ... | ||
| ``` | ||
|
|
||
| `readQuizOrientations` is the **only** place in the app that knows an API field name or packed text. Nothing past it reads `generalName`, `logoUrl` or a JSON string. |
There was a problem hiding this comment.
Reconcile the single-reader rule with the required file split
This invariant cannot be satisfied with the structure prescribed above and in the Files to create section: orientationResponseSchema must name the API fields, toQuizOrientation.ts must read those fields, and the separately required parsePackedText.ts parses packed text. An implementation following the task will therefore fail the Definition of Done even when correctly factored. Define the boundary as the API orientation layer/directory, or colocate the schema and parsing logic under the one reader.
Useful? React with 👍 / 👎.
| } | ||
| ``` | ||
|
|
||
| `Orientation.name` is **optional** where `AxisOrientation.name` was a required string. Every module already has a rule for a missing name in its spec; keep that rule working when the name is `undefined` and not only when it is `""`. |
There was a problem hiding this comment.
Define missing-name behavior before widening the type
This assertion is false for at least ResultsHeader and Archetype: their specs cover a missing orientation/image or an overlong name, but not a present orientation whose name is absent, even though the new universal spec explicitly permits that input. The adoption tests also omit those two components from the nameless-orientation cases, so an implementation can render an empty main heading or leader without violating the task. Specify and test the fallback behavior for every affected module before making name optional.
Useful? React with 👍 / 👎.
What
One definition of an orientation for the myPolitics app, and the two front-end tasks cut from it.
mypolitics/spec/quiz/universal-orientation.md, plus its row in the quiz spec README (Contents and build order, step 0).mypolitics/tasks/epics/modules/cycle-4/universal-orientation.md: the types, the Zod schema and the reading of the API's orientation. Published as UniversalOrientation mypolitics-app#85.mypolitics/tasks/epics/modules/cycle-5/universal-orientation-adoption.md: every result module moves to that one type and to the word "orientation" in place of "party" and "candidate". Published as UniversalOrientation: one type and one term in the result modules mypolitics-app#86, blocked by docs(mypolitics): questionnaire specs and tasks #85.Why
PARTYis a type of orientation.What the spec decides
How it was checked
The reading rules were run against the OpenAPI document of the survey API and against every orientation of its 14 public quizzes (369 orientations): none is dropped as broken and no packed key is left unread.
Notes for the reviewer
main, so those links resolve once this is merged.mkdocs buildwas not run; the spec's relative links were checked by hand.🤖 Generated with Claude Code