[EPAC-1766]: centralize parliamentary topic taxonomy#375
Merged
riddim-developer-bot[bot] merged 1 commit intoMay 8, 2026
Conversation
|
Autonomous review failed schema validation: invalidVerdict("missing or invalid string field: decision") |
sunnypurewal
approved these changes
May 8, 2026
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.
Why
The parliamentary topic taxonomy had drifted between iOS and backend adapters. iOS already carried the fuller product-policy taxonomy, including the existing
naturalresourcestopic and broader defence/justice keyword sets, whilebackend/topic-notifierused a stale copy. This PR moves topic IDs and keyword matching data behind one canonical repo source so topic follows, notifications, and search personalization all consume the same contract.What changed
shared/topic-taxonomy/parliamentary_topics.jsonas the canonical source of truth for topic IDs, backend display names, and keyword lists.scripts/topic_taxonomy/generate_topic_taxonomy.pyto generate the Swift and Go adapters plus a--checkmode that fails when generated outputs drift from the canonical taxonomy.ios/epac/Model/ParliamentaryTopic.swiftfrom the canonical taxonomy, preserving stable topic IDs for stored user preferences.backend/topic-notifier, keeping notification payload keys and topic preference semantics unchanged.backend/searchpersonalization to expand followed topic IDs into canonical keyword hints instead of guessing matches from the slug text alone.naturalresourcesdecision in the canonical taxonomy metadata and added a minimal use-case catalog entry forFollowTopic,MatchParliamentaryTopics, andNotifyTopicFollowers.Trade-offs not taken
Test plan
python3 scripts/topic_taxonomy/generate_topic_taxonomy.py --checkcd backend/topic-notifier && go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.outcd backend/search && go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.outswiftlint --strictpython3 scripts/localization/check_localizations.py --github-warningscd ios && xcodebuild -project epac.xcodeproj -scheme epac -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max' -derivedDataPath .build buildcd ios && xcodebuild test -project epac.xcodeproj -scheme epac -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max' -derivedDataPath .build -enableCodeCoverage YES -only-testing:epacTests/NaturalResourcesStatisticsTestsVerification notes
cd ios && make buildcould not be used becausexcbeautifyis not installed in this environment, so I ran the equivalentxcodebuildcommand directly.Resolves EPAC-1766
Reviewer-Boundary: review-only