Required
id
Private: Stable Buttondown subscriber key for dedupe and ledger reconciliation.
Public: Never displayed.
MY-2571 wiring contract
Define the minimum Buttondown subscriber export shape needed to build a private Winchester referral ledger and a redacted public leaderboard.
Do not publish live rankings, email subscribers, contact referrers, fulfil rewards or expose raw Buttondown exports until attribution, abuse review and editor approval have passed.
Export inputs
Required
Private: Stable Buttondown subscriber key for dedupe and ledger reconciliation.
Public: Never displayed.
Required
Private: Hash immediately with a per-market salt before storage.
Public: Never displayed or written to public JSON.
Required
Private: Used to order referral credit and detect burst abuse.
Public: Never displayed.
Required
Private: Maps a confirmed subscriber to the inviting reader token.
Public: Used only after aggregation into confirmed referral counts.
Required
Private: Maps the subscriber to their own invite link.
Public: Never displayed raw.
Required
Private: Filters exports to Winchester only.
Public: Can only appear as broad market label.
Required
Private: Confirms website-subscribe origin and excludes imports/test rows.
Public: Never displayed.
Required
Private: Only confirmed subscribers increment referral totals.
Public: Never displayed.
Private ledger schema
buttondown_subscriber_id
confirmed_email_hash
reader_token_hash
referral_source_hash
signup_market
created_at
confirmed_at
source_tag
fraud_review_status
manual_reward_status
Public JSON schema
rank
display_name
area
confirmed_referrals
reward_tier
reviewed_at
Transform checks
Reject rows where signup_market is not good-morning-winchester.
Reject rows without website-subscribe tag unless they are manually whitelisted.
Reject rows where is_confirmed is false.
Hash email, reader_token and referral_source before writing any private ledger file.
Exclude self-referrals where subscriber hash and referrer-owned hash match.
Exclude duplicate confirmed_email_hash rows from public counts.
Emit only publicLeaderboardSchema fields to website/public/leaderboard/leaderboard.json.
Dry-run proof
Run export transform against a fixture with confirmed, unconfirmed, duplicate and self-referral rows.
Assert no email, Buttondown id, raw reader token or raw referral source appears in public JSON.
Assert the public leaderboard stays hidden if any top-ten row has fraud_review_status other than cleared.
Record fixture result in Linear MY-2571 before enabling a live Buttondown export.
Next actions
Create a local fixture for the export shape above.
Add a transform script that writes private and public outputs separately.
Wire the public page to leaderboard.json only after the privacy assertions pass.
Request explicit approval before any live Buttondown API export or reward publication.