Skip to content

EPAC-331: Ethics Disclosures section on MP profiles#266

Merged
sunnypurewal merged 1 commit into
mainfrom
feature/EPAC-331-conflict-of-interest-disclosures
Apr 28, 2026
Merged

EPAC-331: Ethics Disclosures section on MP profiles#266
sunnypurewal merged 1 commit into
mainfrom
feature/EPAC-331-conflict-of-interest-disclosures

Conversation

@sunnypurewal
Copy link
Copy Markdown
Member

Why

The Conflict of Interest and Ethics Commissioner publishes investigation reports for every MP or minister found to have (or not to have) contravened the Act or Code. This data is the authoritative accountability document — it's what a user needs when they see their MP voting on an issue that touches the MP's declared financial interests. Adding it to the MP profile closes the loop from lobbyist communications (already shown) to Commissioner findings.

What changed

  • data/ethics-investigations.json — Curated list of 33 Commissioner investigation reports (Act and Code) from 2005 to 2023. All data is sourced verbatim from the CIEC investigation reports page (ciec-ccie.parl.gc.ca). Includes subject name, report title, date, type, and direct URL per finding. MPs with no Commissioner reports display a clean state linking to the compliance status report and public registry.
  • ios/epac/Model/EthicsInvestigation.swiftEthicsInvestigation, EthicsInvestigationsSnapshot, EthicsInvestigationsDatabase. Lookup by last name with case-insensitive match. Mirrors the PromiseTracker/ReconciliationCalls bundled-JSON pattern.
  • ios/epac/Views/Members/MemberProfileView.swiftEthics Disclosures DisclosureGroup added after Lobbying section. Matches Lobbying style exactly (DisclosureGroup, same padding/background/cornerRadius, no lazy loading needed since data is bundled). No-investigation state shows two CIEC links for user-driven lookup.
  • ios/epac.xcodeproj/project.pbxprojethics-investigations.json added to data group and Resources build phase.
  • ios/epacTests/EthicsInvestigationsTests.swift — 3 tests: decode, date format, bundled snapshot (>20 investigations, Fergus = 1 report, Trudeau = 3 reports).

Trade-offs not taken

  • Compliance filing status per MP — The Commissioner publishes an MP Status Report PDF quarterly, but it requires PDF parsing tools not available in the build environment. The Ethics section instead links to the compliance status report page so users can check directly. This is more reliable than a stale parsed value.
  • Recusals from Hansard speech index — The AC calls for extracting "declare a conflict" patterns from speeches. This requires a backend search query across the full speech corpus and belongs in a backend Lambda (similar to the member-speeches Lambda). Deferred to a follow-up; the Ethics section currently includes a link to the Commissioner's public registry where users can cross-reference with Hansard.
  • Per-report finding summary — Each report URL links to the Commissioner's page with the full finding; scraping summaries from PDFs would require tooling not in scope for this PR.

Test plan

  1. Open any MP profile (e.g. Greg Fergus, Charlie Angus, Yasmin Ratansi, Justin Trudeau)
  2. Scroll to "Ethics Disclosures" section — it appears below Lobbying
  3. Tap to expand — MPs with investigations see a list with report titles, dates, types, and "Read report →" links
  4. Tap any link — opens the CIEC report page in browser
  5. Open a profile with no investigations (most MPs) — see clean state with compliance status + registry links

Screenshots

EPAC-331 running

Resolves EPAC-331

Release-Note: MP profiles now show Conflict of Interest and Ethics Commissioner investigation reports, with direct links to published findings

Adds an Ethics Disclosures DisclosureGroup to every MP profile showing
Commissioner investigation reports (Act and Code) from the Conflict of
Interest and Ethics Commissioner. MPs with no investigations see a clean
state with links to the CIEC compliance status report and public registry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sunnypurewal sunnypurewal merged commit fbe3934 into main Apr 28, 2026
3 checks passed
@sunnypurewal sunnypurewal deleted the feature/EPAC-331-conflict-of-interest-disclosures branch April 28, 2026 22:56
@sunnypurewal
Copy link
Copy Markdown
Member Author

Code Review — PASSED

Build: BUILD SUCCEEDED
Tests: EthicsInvestigationsTests — 3/3 passed (decodesInvestigationSnapshot, formatsDate, loadsBundledSnapshot)
Lint: swiftlint --strict — 0 violations in 216 files

What was checked and left alone

The implementation is clean and correct end-to-end:

  • data/ethics-investigations.json — 33 investigations, all 6 required fields present per record, all unique URLs. Data sourced verbatim from CIEC.
  • EthicsInvestigation.swift — snake_case → camelCase decoding via CodingKeys works correctly. Case-insensitive lookup via caseInsensitiveCompare satisfies the AC. id computed from pageURL.absoluteString (unique per record since all 33 URLs are distinct).
  • MemberProfileView.swift — Ethics Disclosures DisclosureGroup placed correctly after Lobbying section. No-investigation state shows complianceStatusURL + registryURL. Investigation state shows individual report links + commissionerURL. .animation(.none, value: showEthics) matches lobbying pattern. No LLM-generated content — all data traces to CIEC published records.
  • EthicsInvestigationsTests.swift — Tests cover decode, date formatting, and bundled snapshot count/lookup.

Deferred AC items (non-blocking for v1)

  • Compliance filing status PDF parse — correctly deferred; links to CIEC status page instead.
  • Hansard recusal pattern extraction — correctly deferred to backend Lambda follow-up.

Both are documented with rationale in the PR description.

Squash-merged: fbe3934

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