nx_jobfollow_parse.nx
buildroot/runtime/nx_jobfollow_parse.nx
about
nx_jobfollow_parse.nx -- THE PURE HALF of the job-pointer follower: parsing and buffer arithmetic,
with NO transport dependency at all.
WHY IT IS A SEPARATE FILE. The follower has to live in TWO places: nx_jobfollow_lib (which an
explicit caller composes) and nx_https_post_lib (so that EVERY caller of hp_post_json inherits it
without editing 81 organs). But nx_jobfollow_lib imports nx_https_post_lib to do its polling, so
putting the follow INTO the post lib would close an import cycle. Splitting the pure half out is the
standard break: this file imports only nx_syscalls, so both layers above can share ONE implementation
and there is still exactly one job-id parser in the estate.
AND THE PURE HALF IS THE HALF WORTH GATING. Everything here is buffer arithmetic over inputs a test
can construct, so a gate walks it without opening a socket -- the same reason the TLS fragmentation
split was pulled out of its loop on the same day.
THE ANCHORED PARSE IS THE POINT. jf_job_id matches the whole literal `JOB-STARTED id=`, never a bare
`id=`. MEASURED 2026-09-04: a client scanning unanchored read the JOB id as the ORGAN id -- they are
both epoch-derived, so 1788537161 looked like a plausible prefix of the real 1788537161795845 -- and
then reported a receipt that never existed.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_https_post_lib.nxnx_jobfollow_lib.nxnx_jobfollow_parse_gate.nx
structs
| none |
consts
| 22 | const JF_PATHCAP: i64 = 256 |
| 23 | const JF_REQCAP: i64 = 4096 |
| 24 | const JF_QUOTE: i64 = 34 |
| 25 | const JF_BACKSLASH: i64 = 92 |
| 26 | const JF_SPACE: i64 = 32 |
| 27 | const JF_DEL: i64 = 127 |
| 37 | const JF_UNKNOWN: *u8 = "\x22stage\x22:\x22read-after-accept\x22" as *u8 |
| 38 | const JF_KEYED: *u8 = "\x22_idem\x22" as *u8 |
| 39 | const JF_REPLAY: *u8 = "NX-IDEM REPLAY" as *u8 |
| 40 | const JF_INFLIGHT: *u8 = "NX-IDEM IN-FLIGHT" as *u8 // the transport's literal (nx_tools_api ta_mcp_call), hyphenated -- verified by grep, not recalled |
functions
| 42 | func jf_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 43 | func jf_eo(s: *u8) -> i64 { sys_write(2, s, jf_slen(s)); return 0 } |
| 44 | func jf_enum(v: i64) -> i64 |
| 55 | func jf_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 69 | func jf_has(buf: *u8, n: i64, needle: *u8) -> i64 { if jf_find(buf, n, needle) >= 0 { return 1 } return 0 } |
| 71 | func jf_job_id(buf: *u8, n: i64) -> i64 |
| 92 | func jf_append(out: *u8, o: i64, s: *u8) -> i64 |
| 99 | func jf_append_num(out: *u8, o: i64, v: i64) -> i64 |
| 113 | func jf_json_safe(s: *u8, n: i64) -> i64 |
| 128 | func jf_artifact_ready(buf: *u8, n: i64) -> i64 |
| 136 | func jf_outcome_unknown(buf: *u8, n: i64) -> i64 { if n <= 0 { return 0 } return jf_has(buf, n, JF_UNKNOWN) } |
| 138 | func jf_req_keyed(req: *u8, n: i64) -> i64 { if n <= 0 { return 0 } return jf_has(req, n, JF_KEYED) } |
| 140 | func jf_inflight(buf: *u8, n: i64) -> i64 { if n <= 0 { return 0 } return jf_has(buf, n, JF_INFLIGHT) } |
| 143 | func jf_should_reissue(buf: *u8, n: i64, req: *u8, reqlen: i64) -> i64 |