Repository navigation
Only count individuals in "Individual Contributions by State" - #5
Merged
Merged
Conversation
The by-state query summed every non-memo Schedule A row, so PAC contributions (11C), party contributions (11B), other receipts (15) and joint fundraising transfers (12) were attributed to the sending committee's state. Restrict to line 11(a)(i) plus the line 12 memo entries for individuals behind JFC transfers, matching FEC.gov's by-state breakdown. State links use the same predicate via _where. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Line 12 memo attributions can be to tribes (entity ORG), which FEC counts alongside individuals, as it does for tribes on line 11(a)(i). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On F3X, line 11(a)(i) also carries contributions from corporations, LLCs and other non-committee persons, which dominate at super PACs (e.g. Fairshake: ~$316M org vs ~$7.6M individual). Title the widget "Contributions from Individuals & Other Persons by State" there and note that it includes corporations and LLCs. F3 is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The "Individual Contributions by State" table on committee pages was overcounting. It correctly filtered for schedule A itemizations for a specific committee in a fundraising cycle, but didn't filter down to just "individual" contributions not including PACs/organizations, ie just
SA111AIand SA12 (from JFC I think?) rows.Now this is closer to what fec.gov reports in their "Individual contributions grouped by state" graphic on their committee pages, but there's still small descrepencies.
🤖 Claude-generated PR description
Problem
The "Individual Contributions by State" widget summed every non-memo Schedule A row, not just individuals. For Valadao For Congress (C00499392, 2026 cycle) it showed a $4,830,501.91 total that is exactly 11AI + 11B + 11C + 12 + 15. The top states (VA, DC, GA) were really the locations of JFCs and PACs:
The individual donors behind JFC transfers are reported as line 12 memo rows, so the
memo_code != 'X'filter dropped them entirely.Fix
INDIVIDUAL_CONTRIBUTIONS_WHEREpredicate instateContributorsFetcher.ts:SA11AInon-memo (includes WinRed earmarks, which are itemized under the donor; the conduit-details rows are memo and stay excluded)SA12memo rows withentity_type IN ('IND', 'ORG')(JFC attributions;ORGhere is tribes, which FEC counts as it does on 11(a)(i))_where, so the linked table rows sum to the displayed amount.formTypeFilterprop. It only affected the link, never the query. Committee scope is always F3/F3X, and both use lines 11AI/12.Verification
Against a
libfec export CA22 --election 2026DB, compared with FEC.gov's by-state view (01/01/2025–06/30/2026):TX, NY, VA and LA match to the cent. I reconciled every remaining state against FEC's itemized rows (
/schedules/schedule_a/?is_individual=true) by(file_number, transaction_id). Each remaining gap comes from FEC'sis_individual()coding, not from this query:15(individual). For the other 21 LLCs it drops the parent.receipt_type, so FEC never counts them. They're also missing from theindiv26bulk file.PAC) as15Jindividual.ORGrow filed on 11(a)(i). It's probably a mis-lined corporate PAC receipt, but it is on the line.18G, line 12) gets through FEC'samount < 200"inferred individual" heuristic.The overall total is $3,121,763.04 here vs $3,137,364.54 on FEC.gov (including OR, fixed by the second commit).
Checked in a browser: Valadao (F3) shows the original title, and Fairshake (F3X) shows the new title and note. For Fairshake 2024, CA is exactly $25M under FEC.gov. That matches two $12.5M memo attributions of an AH Capital Management contribution, which looks like the same LLC double count, though it isn't reconciled row by row.
npm run checkreports 0 errors. The 5 warnings are pre-existing and outside the touched files. The_wherelink was checked against a running datasette instance.🤖 Generated with Claude Code