code wiki / (root) / nx_cam_chaturbate_gate.nx

nx_cam_chaturbate_gate.nx

buildroot/runtime/nx_cam_chaturbate_gate.nx

11403 B229 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic cam
docsdependenciesstructsconstsfunctions

about

nx_cam_chaturbate_gate.nx -- REFEREE for nx_cam_chaturbate (/compare/mediaingest R9 lr_watch, site half). NO NETWORK, BY CONSTRUCTION. Every fixture host is under the reserved .invalid TLD and nothing is ever fetched: the whole subject under test is the adapter's PURE decision core -- the state machine, the JSON field reader and the CMAF rewrite -- so a flaky exit IP or an offline room can never make this gate red, and a green here is never evidence that the live endpoint answered. The live half (one real resolve against one real room) is a separate, declared step and is NOT claimed by this gate. The teeth that matter most are the three the incumbent recorder paid for in production: - a PUBLIC room with an EMPTY url is RESTRICTED, not PUBLIC (else the capture path is handed an empty input and retries forever); - 403 is RATELIMIT, not ERROR (else fast retries lengthen a Cloudflare block); - an unrecognised room_status lands in UNKNOWN and NEVER in a known bucket. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_cam_chaturbate.nx nx_gate_verdict.nx nx_cam_chaturbate_gate.nx

imports: nx_syscalls.nxnx_cam_chaturbate.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

20const G_BUFCAP: i64 = 1024
23const G_JSON_PUBLIC: *u8 = "{\"room_status\": \"public\", \"url\": \"https://edge1.example.invalid/live-abc/amlst:xyz/playlist.m3u8?tkn=1\", \"cmaf_edge\": true}"
24const G_JSON_RESTRICTED: *u8 = "{\"room_status\": \"public\", \"url\": \"\", \"cmaf_edge\": false}"
25const G_JSON_OFFLINE: *u8 = "{\"room_status\": \"offline\", \"url\": \"\"}"
27const G_URL_IN: *u8 = "https://edge1.example.invalid/live-abc/amlst:xyz/playlist.m3u8?tkn=1"
28const G_URL_CMAF: *u8 = "https://edge1.example.invalid/live-c-fhls/amlst:xyz/playlist_sfm4s.m3u8?tkn=1"
29const G_URL_PLAIN: *u8 = "https://edge1.example.invalid/hls/stream.ts"
31const G_HTTP_200: i64 = 200
32const G_HTTP_403: i64 = 403
33const G_HTTP_404: i64 = 404
34const G_HTTP_429: i64 = 429
35const G_HTTP_503: i64 = 503
36const G_HTTP_418: i64 = 418 // an unmapped status: must land in UNKNOWN, not in a known bucket
38const G_URLLEN_PRESENT: i64 = 40 // any non-zero: the DECISION keys on presence, never on length
39const G_URLLEN_EMPTY: i64 = 0

functions

41func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
44func g_eqs(buf: *u8, off: i64, len: i64, lit: *u8) -> i64
54func g_has(buf: *u8, n: i64, lit: *u8) -> i64
68func g_decide_lit(status: i64, rs: *u8, url_len: i64) -> i64
72func main() -> i64