Skip to content

docs(mypolitics): add universal orientation spec and tasks - #82

Merged
AdrianOrlow merged 1 commit into
mainfrom
mypolitics/universal-orientation-definition
Oct 7, 2026
Merged

AdrianOrlow merged 1 commit into
mainfrom
mypolitics/universal-orientation-definition

Conversation

@AdrianOrlow

Copy link
Copy Markdown
Member

What

One definition of an orientation for the myPolitics app, and the two front-end tasks cut from it.

Why

  • Each result module described an orientation in its own words, and none matched what the survey API sends.
  • The API packs the same property differently from quiz to quiz: the presidential quiz packs a candidate's name one way, the identity quiz packs an identity's another.
  • The other person in a comparison was called a party, while in the API PARTY is a type of orientation.

What the spec decides

  • An orientation carries an identifier, a type, a name, an image, a colour, two descriptions, a slogan, a website, an official mark, a hidden mark, an explanation and linked orientations.
  • "Party" is a type that covers parties and candidates. The other side of a comparison is an orientation of type person.
  • JSON packed into a text field is not valid. It is read only because old quiz versions hold it; the list of keys is closed, and a new property is asked of the back-end as a field. The seven properties that have no field today are listed.
  • The official mark is a moderator's claim and is ignored in a community quiz.
  • A hidden orientation takes no part in rankings, in choosing a leader or in the comparison picker.

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

  • No dedicated doc exists for this. The spec hangs off the "every entity with points is an orientation" rule in the result modules doc and the glossary.
  • Other specs in the folder still say "the other party". The new spec states that its wording decides; they are not edited here.
  • Both issues link the spec on main, so those links resolve once this is merged.
  • mkdocs build was not run; the spec's relative links were checked by hand.

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-07T01:37:57.374790Z 164e08c 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.

@AdrianOrlow
AdrianOrlow merged commit dac88c4 into main Oct 7, 2026
2 checks passed

@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: 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.

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 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 `""`.

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 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 👍 / 👎.

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