code wiki / _hdl_build / nx_nvd_ingest.nx

nx_nvd_ingest.nx

buildroot/runtime/_hdl_build/nx_nvd_ingest.nx

7893 B175 linesdepth 23pulls 155 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_nvd_ingest.nx -- NAS-side API-WRAP ingester for NIST's National Vulnerability Database (NVD REST 2.0). A DIFFERENT asset TYPE from the DCAT catalog pager (nx_nist_ingest): a JSON REST API with nested fields, not HTML/DCAT. Proves the pipeline is NOT overfit to one shape. Fetches services.nvd.nist.gov/rest/json/cves/2.0, splits vulnerabilities[] on {"cve":{"id":", prepends a CVE-id/severity/description title, and dp_ingest's each into the domain's PUBLIC corpus so the CVE id, CVSS severity, description, CPE and references are all BM25-searchable. BOUNDED + HONEST: logs totalResults available vs the slice ingested (no silent truncation). Reuses nx_fetch_any (S1/S2) + dp_ingest. Runs in nishihost CWD (trust store + seg store resolve). Anti-overfit: same fetch+ingest spine, type-appropriate parse -- exactly the ontology pipeline's per-type extractor. usage: nx_nvd_ingest <domain> <count> [startIndex] e.g. nx_nvd_ingest nishifamily.com 500 0 license_tier: ORIGINAL | genealogy_id: nishi_nvd_ingest_2026_07_14

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_fetch_any.nx nx_docportal_lib.nx nx_nvd_ingest.nx

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_fetch_any.nxnx_docportal_lib.nx

imported by: nobody (leaf or entry point)

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

main nv_puts sys_write nv_atoi nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

18const K_MAGIC_2000: i64 = 2000
19const K_MAGIC_4194304: i64 = 4194304
20const K_MAGIC_16777216: i64 = 16777216
21const K_MAGIC_8192: i64 = 8192
22const K_MAGIC_786432: i64 = 786432

functions

24func nv_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 1: main calls 1: sys_write
25func nv_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
26func nv_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
39func nv_find(hay: *u8, hl: i64, start: i64, needle: *u8, nl: i64) -> i64
called by 2: nv_fieldmain
49func nv_atoi(s: *u8) -> i64
called by 1: main
60func nv_readint(buf: *u8, hl: i64, pos: i64) -> i64
called by 1: main
72func nv_scat(buf: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { buf[o + i] = s[i]; i = i + 1 } return o + i }
73func nv_ncat(buf: *u8, o: i64, v: i64) -> i64
calls 1: sys_mmap
82func nv_copy(doc: *u8, dl: i64, doccap: i64, src: *u8, from: i64, to: i64) -> i64
called by 1: nv_ingest_record
89func nv_field(doc: *u8, dl: i64, doccap: i64, src: *u8, start: i64, limit: i64, key: *u8, keylen: i64) -> i64
called by 1: nv_ingest_record calls 1: nv_find
103func nv_ingest_record(domain: *u8, out: *u8, recstart: i64, recend: i64, doc: *u8, doccap: i64, cidp: *i64) -> i64
118func main(argc: i64, argv: *i64) -> i64