code wiki / _hdl_build / nx_ad_intake.nx

nx_ad_intake.nx

buildroot/runtime/_hdl_build/nx_ad_intake.nx

5929 B144 linesdepth 4pulls 6 transitivereach 4 importersview sourcekind librarytopic ad
docsdependenciesstructsconstsfunctions

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

nx_ad_serve.nx nx_ad_store.nx nx_seg_store.nx nx_syscalls.nx nx_ad_intake.nx nx_ad_exceed.nx nx_ad_intake_gate.nx

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

21const IN_OK: i64 = 0
22const IN_BAD_GOAL: i64 = 0 - 1
23const IN_BAD_FEE: i64 = 0 - 2
24const IN_BAD_CREA: i64 = 0 - 3
25const IN_COMMIT_ERR: i64 = 0 - 4

functions

28func in_appn(dst: *u8, off: i64, v: i64) -> i64
called by 1: in_build_record calls 1: sys_mmap
42func in_campaign_key(id: *u8, out: *u8) -> i64
called by 2: in_create_campaignmain calls 1: as_append
50func in_build_record(business: *u8, goal: *u8, fee: i64, banner: *u8, status: *u8, out: *u8) -> i64
called by 1: in_create_campaign calls 2: as_appendin_appn
65func in_goal_known(goalname: *u8) -> i64
78func in_fee_max() -> i64
called by 1: in_create_campaign calls 2: sys_mmapads_get
99func in_creative_ok(business: *u8, banner: *u8) -> i64
called by 1: in_create_campaign calls 1: as_len
110func in_streq_store(key: *u8, val: *u8, vlen: i64) -> i64
called by 1: in_create_campaign calls 2: sys_mmapads_get
125func in_create_campaign(id: *u8, business: *u8, goal: *u8, fee: i64, banner: *u8) -> i64