code wiki / (root) / nx_entity_dossier.nx

nx_entity_dossier.nx

buildroot/runtime/nx_entity_dossier.nx

30280 B579 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic entity
docsdependenciesstructsconstsfunctions

about

nx_entity_dossier.nx -- ENTITY DOSSIER: a superior-to-Google entity landing page, composed 100% from the LIVE sovereign corpus (NO external fetch -> fast, robust, content-agnostic: lawful content is never filtered/blurred). nx_entity_dossier <entity name> Pipeline (all over loopback 127.0.0.1:18456, the docportal search daemon): 1. RESOLVE -- GET /api/search?scope=web&q=<name> ; pick the canonical landing (first result whose url is an /idols/ profile, else the top hit) + read the matched-doc total (coverage denominator side A). 2. FETCH -- GET /api/doc?cid=<landing> ; the landing page's full indexed text. 3. EXTRACT -- CARD (jp-name/age/dob/birthplace/measurements/cup/height/hair/tags/bio = the knowledge panel), PORTFOLIO (authority work-count + a de-duped sample of work CODES = the oeuvre), RELATED entities (the M:N graph edges), and COVERAGE honesty (indexed-matched vs authority-total -> the deep-crawl gap the operator flagged: "less than hundreds of results is below toy grade"). Emits ONE JSON object to stdout (agent/workflow/MCP-shaped) AND knowledge/status/dossier-<slug>.txt (durable, survives an edge-dropped tools/call). Fixed loopback host/port + url-encoded query => no SSRF/injection (same posture as nx_websearch). Graceful degradation: any missing field -> "" (rule 14). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_entity_dossier.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ed_puts ed_out ed_slen sys_write ↻ ed_slen ↻ ed_urlenc ed_hex ed_cat ed_catb ed_jout ed_uint_after ed_find ed_slen ↻ ed_slen ↻ ed_scan_codes ed_alnum ed_addcode ed_num ed_out ↻ sys_mmap ↻ ed_host ed_find ↻ ed_qend ed_find ↻

structs

none

consts

17const ED_PORT: i64 = 18456
18const ED_CAP: i64 = 1048576 // 1 MiB per-response cap (idol doc ~6KB, search page ~30KB: ample)
19const ED_MAXCODES: i64 = 40 // oeuvre sample cap (the authority_total carries the true scale)
283const ED_VERT_CONF: *u8 = "knowledge/entity_verticals.conf"
284const ED_VERT_MAX: i64 = 8
285const ED_VSLOT: i64 = 96

functions

24func ed_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
25func ed_out(s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { ed_buf[ed_bo] = s[i]; ed_bo = ed_bo + 1; i = i + 1 } return 0 }
called by 3: ed_putsed_nummain
26func ed_puts(s: *u8) -> i64 { ed_out(s, ed_slen(s)); return 0 }
called by 1: main calls 2: ed_outed_slen
27func ed_num(v: i64) -> i64
called by 1: main calls 2: ed_outsys_mmap
38func ed_jout(src: *u8, n: i64) -> i64
called by 1: main
50func ed_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i }
called by 1: main
51func ed_catb(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { d[o + i] = s[i]; i = i + 1 } return o + n }
called by 1: main
52func ed_hex(v: i64) -> i64 { if v < 10 { return 48 + v } return 55 + v }
called by 1: ed_urlenc
53func ed_urlenc(src: *u8, slen: i64, dst: *u8) -> i64
called by 1: main calls 1: ed_hex
71func ed_find(hay: *u8, hn: i64, ndl: *u8, from: i64) -> i64
83func ed_qend(buf: *u8, s: i64, n: i64) -> i64 { var i: i64 = s; while i < n { if buf[i]==(34 as u8) { return i } i = i + 1 } return n }
called by 1: ed_host
85func ed_sub(buf: *u8, s: i64, e: i64, ndl: *u8) -> i64
calls 1: ed_slen
97func ed_uint_after(hay: *u8, hn: i64, label: *u8) -> i64
called by 1: main calls 2: ed_finded_slen
111func ed_field(hay: *u8, hn: i64, label: *u8, dst: *u8, cap: i64, stopdash: i64) -> i64
called by 1: main calls 2: ed_finded_slen
132func ed_block(hay: *u8, hn: i64, label: *u8, stopw: *u8, dst: *u8, cap: i64) -> i64
called by 1: main calls 2: ed_finded_slen
157func ed_addcode(codes: *u8, nc: *i64, tok: *u8, tl: i64) -> i64
called by 1: ed_scan_codes
173func ed_alnum(c: i64) -> i64
called by 1: ed_scan_codes
180func ed_scan_codes(hay: *u8, hn: i64, codes: *u8, nc: *i64) -> i64
called by 1: main calls 2: ed_alnumed_addcode
215func ed_host(url: *u8, ulen: i64, dst: *u8) -> i64
called by 1: main calls 2: ed_finded_qend
222func ed_slug(name: *u8, nn: i64, dst: *u8) -> i64
231func ed_loopback_sa(sa: *u8, port: i64) -> i64
238func ed_fetch(path: *u8, pathlen: i64, resp: *u8) -> i64
292func ed_vid(i: i64) -> *u8 { return ((ed_vid_g as i64) + i * ED_VSLOT) as *u8 }
293func ed_vprior(i: i64) -> *u8 { return ((ed_vprior_g as i64) + i * ED_VSLOT) as *u8 }
294func ed_vpfx(i: i64) -> *u8 { return ((ed_vpfx_g as i64) + i * ED_VSLOT) as *u8 }
296func ed_vcopy(dst: *u8, b: *u8, s: i64, e: i64) -> i64
305func ed_vlit(dst: *u8, s: *u8) -> i64 { let n: i64 = ed_cat(dst, 0, s); dst[n] = 0 as u8; return n }
306func ed_load_verticals() -> i64
352func ed_active_pfx() -> *u8
358func ed_has_query(buf: *u8, s: i64, e: i64) -> i64
364func ed_is_profile(buf: *u8, s: i64, e: i64) -> i64
375func ed_pick(resp: *u8, n: i64, out4: *i64) -> i64
403func main(argc: i64, argv: *i64) -> i64