Skip to content

[EPAC-1766]: centralize parliamentary topic taxonomy#375

Merged
riddim-developer-bot[bot] merged 1 commit into
mainfrom
claude/epac-1766-centralize-epac-topic-taxonomy-across-ios-and-ba
May 8, 2026
Merged

[EPAC-1766]: centralize parliamentary topic taxonomy#375
riddim-developer-bot[bot] merged 1 commit into
mainfrom
claude/epac-1766-centralize-epac-topic-taxonomy-across-ios-and-ba

Conversation

@riddim-developer-bot
Copy link
Copy Markdown
Contributor

Why

The parliamentary topic taxonomy had drifted between iOS and backend adapters. iOS already carried the fuller product-policy taxonomy, including the existing naturalresources topic and broader defence/justice keyword sets, while backend/topic-notifier used 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

  • Added shared/topic-taxonomy/parliamentary_topics.json as the canonical source of truth for topic IDs, backend display names, and keyword lists.
  • Added scripts/topic_taxonomy/generate_topic_taxonomy.py to generate the Swift and Go adapters plus a --check mode that fails when generated outputs drift from the canonical taxonomy.
  • Regenerated ios/epac/Model/ParliamentaryTopic.swift from the canonical taxonomy, preserving stable topic IDs for stored user preferences.
  • Replaced the hand-copied backend topic list with generated Go code in backend/topic-notifier, keeping notification payload keys and topic preference semantics unchanged.
  • Updated backend/search personalization to expand followed topic IDs into canonical keyword hints instead of guessing matches from the slug text alone.
  • Recorded the explicit naturalresources decision in the canonical taxonomy metadata and added a minimal use-case catalog entry for FollowTopic, MatchParliamentaryTopics, and NotifyTopicFollowers.
  • Added backend tests and expanded iOS topic-matching tests around the retained natural-resources topic and the broadened defence/justice keywords.

Trade-offs not taken

  • I did not introduce runtime taxonomy file loading in either iOS or Lambda code. The adapters stay compile-time/generated so deployment packaging and app startup behavior remain unchanged.
  • I kept backend notification copy/backing display names compatible with the prior backend strings where possible, since this issue is about data-source centralization rather than changing notification copy strategy.

Test plan

  • python3 scripts/topic_taxonomy/generate_topic_taxonomy.py --check
  • cd backend/topic-notifier && go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
  • cd backend/search && go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
  • swiftlint --strict
  • python3 scripts/localization/check_localizations.py --github-warnings
  • cd ios && xcodebuild -project epac.xcodeproj -scheme epac -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max' -derivedDataPath .build build
  • cd ios && xcodebuild test -project epac.xcodeproj -scheme epac -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max' -derivedDataPath .build -enableCodeCoverage YES -only-testing:epacTests/NaturalResourcesStatisticsTests

Verification notes

  • cd ios && make build could not be used because xcbeautify is not installed in this environment, so I ran the equivalent xcodebuild command directly.
  • No UI screens changed, so no screenshots were required.

Resolves EPAC-1766
Reviewer-Boundary: review-only

@riddim-developer-bot riddim-developer-bot Bot added the autonomous Enrolled in prconverged daemon for automated review and merge label May 8, 2026
@riddim-developer-bot riddim-developer-bot Bot enabled auto-merge (squash) May 8, 2026 00:29
@riddim-reviewer-bot riddim-reviewer-bot Bot added agent:needs-human Set by cap-hit or guard-script; blocks auto-merge until removed and removed autonomous Enrolled in prconverged daemon for automated review and merge labels May 8, 2026
@riddim-reviewer-bot
Copy link
Copy Markdown

Autonomous review failed schema validation: invalidVerdict("missing or invalid string field: decision")

@riddim-developer-bot riddim-developer-bot Bot merged commit 3b248a0 into main May 8, 2026
3 checks passed
@riddim-developer-bot riddim-developer-bot Bot deleted the claude/epac-1766-centralize-epac-topic-taxonomy-across-ios-and-ba branch May 8, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:needs-human Set by cap-hit or guard-script; blocks auto-merge until removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant