Skip to main content

Adversarial review: Donation Receipt Generator rules (Opus, 2026-09-25)

Files reviewed (not edited): sources/donation-receipts/rules.yaml, test-cases.yaml, receipt-templates.md, open-questions.md.

Counts: 1 critical, 2 major, 10 minor.

Fetches: 15 WebFetch calls, plus one direct download of https://www.irs.gov/pub/irs-pdf/p526.pdf. The WebFetch summary of the Pub 526 HTML page left out the paragraph I needed, so I downloaded the IRS PDF directly and extracted its text. I also extracted the Pub 1771 PDF text locally, from the file WebFetch returned. The Pub 1771 and Pub 526 quotes below are therefore verbatim from IRS's own PDFs.

What I verified as correct (no finding)​

  • Reg. 3501(1) elements. Every element (a)–(j) maps to a field: (a) → F-CA-02/03; (b) → F-CA-04; (c) → F-CA-05; (d) → F-CA-06; (e) → F-CA-07; (f) → F-CA-08; (g) → F-CA-09..13; (h), (h.1), (h.2) → F-CA-14..17; (i) → F-CA-18; (j) → F-CA-19. Element (e.1) (non-cash) is correctly handled as refer.
    • Source: the CRA list at .../what-information-must-on-official-donation-receipt-a-registered-charity.html (modified 2018-11-02).
    • (1)(j) verified verbatim: "the name and Internet website of the Canada Revenue Agency."
    • The laws-lois fetch would not return all of s.3501 verbatim. Only (1)(j), the chapeau of (1.1) and (3.1) came back.
  • CRA website line. CRA: "The CRA website address must be 'canada.ca/charities-giving' on receipts" (the deadline to update was March 31, 2019). CA-13 is correct.
  • Statement text. CRA: "a statement that it is an official receipt for income tax purposes". CA-01's title contains it.
  • De minimis threshold. CRA Split receipting (modified 2018-05-22): "not more than $75 or 10% of the FMV of the gift, whichever is less". The rule "does not apply to: cash or near-cash equivalents (for example, redeemable gift certificates, vouchers, and coupons)". Folio S7-F1-C1 ¶1.12–1.13 agrees. CA-09 and its boundaries are correct.
  • 80% test. Split receipting: "more than 80% ... no true intention to make a gift". Folio ¶1.5 (s.248(30)(a)): "does not exceed 80%". CA-10, including the "exactly 80% is still a gift" boundary, is correct.
  • Eligible amount of $0, and an advantage above 80%. Under CA-10 plus CA-16, the eligible amount can never be $0: A ≤ 80%·G gives eligible ≥ 20%·G, and G > 0 is enforced. An advantage above 80% blocks the receipt. Both are correct.
  • Non-arm's-length benefits. Folio ¶1.9: the advantage "might accrue either to the taxpayer or to a person or partnership not dealing at arm's length with the taxpayer". This resolves the second half of open question Q1 and supports the CA-08 UI note.
  • Postmark rule (CA-05) is verbatim. Joint account: either name or both names; "A charity cannot issue an official donation receipt in the name of anyone but the true donor." (.../what-you-need-know-issue-official-donation-receipt.html)
  • Replacement receipts (CA-12) are correct. See m-1, which closes open question Q5.
  • US statute. s.170(f)(8)(A), (B) and (C), s.170(f)(17), and s.6115(a) and (b) are all quoted correctly (law.cornell.edu).
  • US thresholds.
    • $250 is "or more" (≥).
    • The $75 quid pro quo test is "in excess of" (>).
    • The intangible-religious-benefits exclusion in s.6115(b) is correct.
    • The $10 / $5,000 penalty matches Pub 1771.
    • "Charities typically send written acknowledgments to donors no later than January 31" (Pub 1771 p.3) is correct.
    • The contemporaneous test ("on or before the earlier of" the filing date or the due date including extensions) is correct.
    • The 2023 token figures ($125 / 2%; $62.50 / $12.50) are correct.
    • The Pub 1771 sample wording "No goods or services were provided in exchange for your contribution." is verbatim.

Cases recomputed​

I recomputed all 41 cases by hand: CA-TC-01 to CA-TC-21 and US-TC-01 to US-TC-20.

  • Arithmetic. Every total, advantage, eligible amount and deductible amount is arithmetically correct.
    • I checked the calendar in CA-TC-02: 2026-01-04 and 2026-12-27 are both Sundays, which gives exactly 52 gifts. The total is $2,800.
  • Legal flags. One legal flag is wrong: US-TC-18 cwa_required (M-1).
  • Tests that cannot fail. One test cannot detect the bug it claims to guard against: CA-TC-19 (M-2).

Critical​

C-1: US-09 "safe path (b)" omits two of the three conditions of the token exception, which leads to a false "No goods or services" statement​

  • Location: rules.yaml US-09 (rule text: "confirm with the current-year IRS inflation figures and, if within them, choose goods_status 'none'"). The same wording appears in test-cases.yaml US-TC-15 reason, option (b).

  • Problem: A payment only qualifies for the token exception if it meets ALL of the following:

    1. it is made in the context of a fundraising campaign;
    2. the charity informs the donor of the deductible amount;
    3. it passes one of the two dollar tests. Test 2 is measured on the charity's COST of the logo items, not their FMV.

    The rule and the UI text tell the treasurer to check only the dollar figures. Consider a church that hands out a mug at the door with no fundraising solicitation and no deductibility statement. If it follows path (b), it prints "No goods or services were provided". That acknowledgment is then materially false: s.170(f)(8)(B)(ii)–(iii) is not met, and the s.6115 disclosure is missing. The donor's deduction for any gift of $250 or more is at risk, and the church faces the s.6714 penalty.

  • Verbatim (IRS Pub 1771 Rev. 11-2023, p.4, https://www.irs.gov/pub/irs-pdf/p1771.pdf): "Good and services are considered to be of insubstantial value if the payment the donor makes occurs in the context of a fundraising campaign, the charitable organization informs the donor as to the amount of the payment that is a deductible contribution, and: 1. the fair market value ... does not exceed the lesser of 2 percent of the donor's payment or $125,* or 2. ... the cost of these items, in the aggregate, is within the limit for 'low-cost articles,' which is $12.50.*"

  • Fix:

    • Rewrite path (b) as a three-part checklist: fundraising campaign? donor told the deductible amount? within this year's dollar limits (test 2 is on COST)? Allow goods_status: none only when all three are answered yes. Otherwise force path (a).
    • Update the US-TC-15 reason to match.
    • Better still for Phase 1: remove path (b) entirely and offer only path (a) (disclose the item), which is always compliant.

Major​

M-1: The $250 CWA test is measured on the NET contribution, not the gross payment. US-TC-18 is wrong, and open question Q12 is answerable.​

  • Location:

    • rules.yaml US-01 formula cwa_required_c = (c.amount >= 25000 cents);
    • US-02 ("whenever any listed gift is >= $250");
    • test-cases.yaml US-TC-18 (cwa_required: true for a $250 payment with $100 of goods, and its derivation "the $250 test is on the PAYMENT");
    • open-questions.md Q12 ("The fetched sources do not resolve...").
  • Problem: IRS Pub 526 resolves it: the contribution is the payment minus the value of the goods. US-TC-18's contribution is $150, so a CWA is not legally required. The s.6115 disclosure still is, because the payment is over $75.

    The generated document is still valid either way, because the tool always builds to CWA standard. That is why this is major rather than critical. However, the tool tells treasurers that the law requires an acknowledgment when it does not, and the test case locks in a wrong legal proposition.

    Also note Pub 1771's own phrase "contribution that is valued at $250 or more" (p.4).

  • Verbatim (IRS Pub 526 (2025), "Contributions of $250 or More", https://www.irs.gov/pub/irs-pdf/p526.pdf): "If you made a payment that is partly for goods and services, as described earlier under Contributions From Which You Benefit, your contribution is the amount of the payment that is more than the value of the goods and services."

  • Fix:

    • US-01: cwa_required_c = (c.amount - c.fmv) >= 25000.
    • US-TC-18: cwa_required: false and disclosure_required: true (deductible $150 is unchanged).
    • Add a boundary case: $350 payment with $100 of goods gives net $250, so a CWA is required.
    • Close Q12 with the citation above. Keep building every statement to CWA standard, since that is harmless.

M-2: CA-TC-19 cannot detect the pre-rounding bug it was written to catch, and the formulas invite floating-point arithmetic​

  • Location: test-cases.yaml CA-TC-19 (its own derivation admits: "the result is the same here"); rules.yaml CA-09 MIN(0.10 * G, 7500 cents) and CA-10 A > 0.80 * G.

  • Problem: With G = 333.33 and A = 33.33, both exact comparison and round-to-cent comparison return "nominal". The test passes for a buggy implementation, so a wrong eligible amount would ship unnoticed.

    I also checked the float forms. 0.8*G and 0.1*G happen to equal the exact integer result for every multiple-of-5 or multiple-of-10 cent value up to $20,000 (I ran a Python sweep). A positive control with 0.7*G produced 37,443 mismatches, so the sweep can detect errors. The safety of 0.8 and 0.1 is luck, not design.

  • Verbatim (the threshold being tested, CRA Split receipting, https://www.canada.ca/en/revenue-agency/services/charities-giving/charities/operating-a-registered-charity/issuing-receipts/split-receipting.html): "Advantages that have a combined FMV that is not more than $75 or 10% of the FMV of the gift, whichever is less".

  • Fix:

    • Specify integer-cent comparisons: nominal ⇔ A <= 7500 AND 10*A <= G; fails the 80% test ⇔ 5*A > 4*G.
    • Replace or add a discriminating case: G = 333.35, A = 33.34. Exact: 10% = 33.335, and 33.34 > 33.335, so the advantage is NOT nominal and eligible = $300.01. An implementation that rounds the cap half-up to 33.34 would wrongly print $333.35.

Minor​

m-1: Open question Q5 (lost receipts) is answered by the CRA page​

m-2: Open question Q2 (how to print a nominal advantage) is partly answered​

  • Location: CA-09 notes; Q2.
  • Verbatim (Split receipting, URL above): a charity "does not have to subtract these advantages from the FMV of the gift when issuing receipts." The CRA example: a $100 gift with a $6 mug and a $2 pen ($8 total) is within the $10 threshold.
  • Fix: Cite it. Printing $0.00 with an explanatory description is consistent with this. The CRA sample-receipts page (modified 2021-12-01) shows no nominal-advantage sample, so the exact description wording stays a product choice.

m-3: CA-06 has no gate for non-individual donors​

  • Location: CA-06 formula (REQUIRE donor.first_name); scope header ("from INDIVIDUALS").
  • Problem: A business or estate giving cash has no first name. The tool would force the treasurer to invent one, or would block with a misleading error.
  • Verbatim (Reg. 3501(1)(g) as quoted in rules.yaml; the CRA list is at the URL above): "the full name, including middle initial, and address of the donor". The "first name and initial" requirement in Reg. (1)(g) applies only "in the case of an individual".
  • Fix: Add donor_type: individual | organization. For an organization, require the legal name and address and hide the first-name field, or refer it if Phase 1 must stay individual-only.

m-4: The CA-11 citation of (3.1) could mislead, and (1.1) is never distinguished​

  • Location: CA-11 excerpt ("Except as provided in subsection (3) or (3.1)"); open-questions Q3.
  • Verbatim (https://laws-lois.justice.gc.ca/eng/regulations/C.R.C.,_c._945/section-3501.html): (3.1) "Where all official receipt forms of another recipient of the gift are (a) distinctively imprinted ... (b) serially numbered by a printing press or numbering machine..."; (1.1) "Every official receipt issued by another recipient of a gift shall contain...".
  • Problem: Subsections (1.1) and (3.1) govern non-charity qualified donees, not churches. Neither provides a computer-receipt facsimile path. The CRA computer-generated-receipts page (modified 2020-02-24) likewise ties facsimile signatures to printer-imprinted, machine-numbered forms.
  • Fix: Add a note: registered charities use (1), (2) and (3) only; (1.1) and (3.1) do not apply. The Phase 1 position (the treasurer signs) stays correct.

m-5: The US-06 disclosure text overstates the deduction​

  • Location: US-06 printed text and template F-US-13: "Your deductible contribution is therefore $[P − FMV]."
  • Problem: P − FMV is a ceiling. Whether it is actually deductible depends on the donor's return: itemizing, AGI limits, and so on.
  • Verbatim (Pub 1771 p.7, URL above): "the donor's tax deduction may not exceed $60".
  • Fix: Replace with: "The amount you may deduct for this payment is limited to $[P − FMV]."

m-6: US-07 attributes a donor-side rule to the church, and misses Pub 526's stronger support​

  • Location: US-02 notes ("s.170(f)(17) ... requires the church's written communication to show the date"); US-07; Q15.
  • Problem: s.170(f)(17) is a donor recordkeeping condition. The per-gift date is better anchored in Pub 526.
  • Verbatim (Pub 526 (2025), URL above): "If you made more than one contribution of $250 or more, you must have either a separate acknowledgment for each or one acknowledgment that lists each contribution and the date of each contribution and shows your total contributions." Also: "If the acknowledgment doesn't show the date of the contribution, you must also have a bank record or receipt ... that does show the date of the contribution."
  • Fix: Cite this in US-02, US-07 and Q15. It makes the per-gift table (F-US-08) directly mandated for annual summaries of gifts of $250 or more.

m-7: The refer table misroutes US gift cards​

  • Location: receipt-templates.md §3, row "Gift card donated by its issuer", US column: "(non-cash → US-10)".
  • Verbatim (Pub 1771 p.2, URL above): "A monetary contribution includes cash, check, a transfer of a gift card redeemable for cash, ..."
  • Fix: US column should read: "refer; may be monetary if redeemable for cash — accountant". Don't label it non-cash.

m-8: The mixed "intangible religious benefits plus other goods" case is unhandled (unverified)​

  • Location: US-02 ("Exactly one of (4), (5) or (6)"); US-14(6) rejects IRB together with FMV > 0.
  • Problem: A payment for a retreat can include both tangible goods and intangible religious benefits. The statute's IRB statement applies only when the goods "consist solely of intangible religious benefits". Treas. Reg. 1.170A-13(f) on the mixed case was not fetched. Unverified.
  • Verbatim (s.170(f)(8)(B)(iii), https://www.law.cornell.edu/uscode/text/26/170): "...or, if such goods or services consist solely of intangible religious benefits, a statement to that effect."
  • Fix: Keep rejecting, but change the error to "refer": "Mixed religious and other benefits — ask your accountant". Don't call it "contradictory".

m-9: Ambiguous refusal messages and a grammar fault​

  • Location: CA-TC-08 reason, "more than 80% of the gift ($80.00)", which reads as though the gift were $80. CA-TC-21 has the same problem. US-TC-06 goods_line: "we gave you harvest dinner".
  • Verbatim (CRA sample receipts, https://www.canada.ca/en/revenue-agency/services/charities-giving/charities/sample-official-donation-receipts.html): "If the amount of the advantage is more than 80% of the cash gift, you cannot issue an official donation receipt."
  • Fix: Reword to "…is more than 80% of the $100.00 gift (80% = $80.00)". Require the description to carry its own article, or template it as "{description}".

m-10: Unverified items (not fetched this pass; treat as open)​

  • CA-01: The CRA sample-receipt title "Official donation receipt for income tax purposes". The sample page fetch did not render the title verbatim. The legal requirement is only "a statement that it is an official receipt for income tax purposes" (verified), so the risk is low.
  • CA-04 / CA-TC-02: The "by February 28" CRA tip. I did not fetch "When should a charity issue a receipt?".
  • ITA s.248(30)–(32): The verbatim statute text (Q1) is still unfetched. The folio (¶1.5, ¶1.9, ¶1.12, ¶1.13) is verified and consistent.
  • Q8 (per-gift vs aggregate de minimis): The folio is silent. Unresolved.
  • Current-year token figures (Q10): Not fetched.