Repository navigation
🪪 v0.4.0 — Stable Ad Identity
💡 Copy is a draft, not an account. An advertiser that rewrites its line is not a new advertiser — but the ledger used to think so. Edit one character and the book silently reset. Two advertisers running the same line collided into one tally. 😱 No more. The exchange settles by identity now, not by copy. 📈
🪙 Every ad gets a stable identity
Set an optional id and impressions, spend, and cap ride straight through a mid-flight rewrite — the account is the account, whatever the creative says today. 🎯 Two advertisers can run the identical line as two separate books.
Omit it? id falls back to a content hash of the text — exactly how the ledger always keyed — so nothing already booked moves. Back-compat is automatic. ✅ Works in the JSON ads file too.
📒 The ledger settles by account
New snapshot: { id => {text:, impressions:, cpm:} }. Text rides along as a label 🏷️ — the Command Center still reads in plain English — but caps and reporting key on id end to end, guaranteed consistent or a test fails. 🔒
🗄️ Upgrading
- 🗃️ ActiveRecord: keys on
ad_id, which for a no-id ad is the old text digest — existing rows line up untouched. Rerunrails g sponsored_logs:install(or rename the column + its unique index). - 🔴 Redis: keys on
idtoo; existing tallies reset once on upgrade. - ⚙️ Custom stores: the documented
snapshotshape changed — return the new{ id => {...} }. (Why this is a minor bump, not a patch.)
gem "sponsored_logs", "~> 0.4.0"🌊 An advertiser should never have to re-earn its own history just to fix a typo. Governance is a feature. 📈🙏