code wiki / _hdl_build / nx_adnet_advreport.nx

nx_adnet_advreport.nx

buildroot/runtime/_hdl_build/nx_adnet_advreport.nx

4521 B82 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_advreport.nx -- RUNNER: the per-advertiser delivery report, made REACHABLE. THE GAP: `ainv_report_for_advertiser` is gated (tenant isolation proven: own campaigns included, a rival's EXCLUDED, unknown advertiser gets an EMPTY report rather than everyone's) but nothing could CALL it. The public /advertise page promises "you see the delivery ratio -- served and viewable side by side", and a claim on a public page with no surface behind it is a promise you will be asked to honour. A gated function with no caller is, by this ecosystem's own law, still the baseline. Shipped as a REGISTERED ORGAN, not a mgmt route, for two reasons: 1. every new route widens the control plane, and this needs no authority beyond reading four files; 2. the mgmt API currently cannot be modified at all -- /api/srcwrite truncates source at the ampersand character and nx_mgmt_api.nx has 25 of them, so the route path is physically blocked until that is fixed. Choosing the reachable door is not a workaround; it is the door that exists. ★ AUTH IS THE CALLER'S JOB, STILL. This takes an advertiser_bk on argv and does NOT authenticate it. organ_run is operator-gated, so today that IS the boundary. Do NOT expose this to an advertiser without establishing identity first -- baking a token check in here is how the check gets skipped by the second caller. nx_adnet_advreport <advertiser_bk> (live confs) nx_adnet_advreport <advertiser_bk> <camps> <rates> <served> <view> <clicks> (fixtures; read-only) expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_adnet_invoice.nx nx_adnet_advreport.nx

imports: nx_syscalls.nxnx_adnet_invoice.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main adr_puts sys_write adr_run aslot_id_ok adr_puts ↻ sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ainv_report_for_advertiser aslot_id_ok ↻ sys_mmap ↻ ad_eol aslot_field_b ad_tab ainv_line_for aslot_id_ok ↻ ainv_rate sys_mmap ↻ ad_eol ↻ aslot_field_b ↻ ainv_num ad_event_count ad_slen ad_eol ↻ anb_invoice_line_v anb_capped anb_total_milli anb_deliv_permille ad_cat anb_catd sys_mmap ↻ sys_write ↻

structs

none

consts

25const ADR_CAMPS: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_campaigns.conf" as *u8
26const ADR_RATES: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_rates.conf" as *u8
27const ADR_SERVED: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_impressions.log" as *u8
28const ADR_CLICKS: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_clicks.log" as *u8
29const ADR_VIEW: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_viewable.log" as *u8
30const ADR_CAP: i64 = 262144

functions

32func adr_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: adr_runmain calls 1: sys_write
34func adr_run(adv: *u8, pc: *u8, pr: *u8, ps: *u8, pv: *u8, pk: *u8) -> i64 {
73func main(argc: i64, argv: *i64) -> i64 {
calls 2: adr_putsadr_run