code wiki / _hdl_build / nx_ad_intake.nx
nx_ad_intake.nx
buildroot/runtime/_hdl_build/nx_ad_intake.nx
about
nx_ad_intake.nx -- LIB: advertiser SELF-SERVE SIGNUP / campaign creation for the "Brought to you
by" ad engine (the "businesses sign up to advertise" face). A business picks a goal, sets a flat
fee, and submits creative copy; we VALIDATE at the boundary (rule 12), then persist a campaign
record ADDITIVELY to the sovereign store (rule 13, append-only versioned). Idempotent (rule 10):
re-creating an unchanged campaign is a no-op.
PRIVACY LAW (feedback-no-server-side-visitor-identity): this is an ADVERTISER B2B ACCOUNT -- a
business deliberately identifying itself as a paying customer. The campaign record holds ONLY
advertiser-supplied business data (name, goal, fee, banner, status). It has NO parameter and NO
field for any SITE-VISITOR identity -- signup can never become visitor tracking by construction.
Record (store key adcamp:<id>): business<tab>goal<tab>fee<tab>banner<tab>status. Creative text is
stored RAW and HTML-ESCAPED at emission by nx_ad_serve (the proven boundary), so a "<script>" name
is safe on the page. Goals are DATA-DRIVEN (rule 11): a goal is valid iff adgoal:<goal> exists in
the store, so adding a goal needs no code change. license_tier: ORIGINAL
dependencies 4 imports · 2 importers
imports: nx_ad_serve.nxnx_ad_store.nxnx_seg_store.nxnx_syscalls.nx
imported by: nx_ad_exceed.nxnx_ad_intake_gate.nx
structs
| none |
consts
| 21 | const IN_OK: i64 = 0 |
| 22 | const IN_BAD_GOAL: i64 = 0 - 1 |
| 23 | const IN_BAD_FEE: i64 = 0 - 2 |
| 24 | const IN_BAD_CREA: i64 = 0 - 3 |
| 25 | const IN_COMMIT_ERR: i64 = 0 - 4 |
functions
| 28 | func in_appn(dst: *u8, off: i64, v: i64) -> i64 |
| 42 | func in_campaign_key(id: *u8, out: *u8) -> i64 |
| 50 | func in_build_record(business: *u8, goal: *u8, fee: i64, banner: *u8, status: *u8, out: *u8) -> i64 |
| 65 | func in_goal_known(goalname: *u8) -> i64 |
| 78 | func in_fee_max() -> i64 |
| 99 | func in_creative_ok(business: *u8, banner: *u8) -> i64 |
| 110 | func in_streq_store(key: *u8, val: *u8, vlen: i64) -> i64 |
| 125 | func in_create_campaign(id: *u8, business: *u8, goal: *u8, fee: i64, banner: *u8) -> i64 called by 1: main calls 11: in_goal_knownin_fee_maxin_creative_oksys_mmapin_build_recordin_campaign_key+5 |