code wiki / (root) / nx_revimg_crawl_run.nx

nx_revimg_crawl_run.nx

buildroot/runtime/nx_revimg_crawl_run.nx

9071 B174 linesdepth 21pulls 181 transitivereach 0 importersview sourcekind tooltopic revimg
docsdependenciesstructsconstsfunctions

about

nx_revimg_crawl_run.nx -- LIVE reverse-image discovery CLI: the operator-driven assembly that runs the whole loop on the real web. Given a SEED page (the entity's media, e.g. the Diora Baird page) and one or more CANDIDATE site pages, it: fetches each over the team's OWN validated HTTPS (sovereign DNS+TCP+ TLS1.3+X.509, the nx_media_gather path), extracts image URLs (nx_html_extract_imgs), politely fetches each image, decodes it (nx_img_to_gray -- PNG today, JPEG since the FF-D8-FF wiring, so the real web works), perceptual-hashes it (nx_phash dHash), then runs nx_revimg_discover to report WHICH candidate sites host the seed media (recompression/format-robust, which a sha256 byte-hash can't) and HARVESTS those hosts' OTHER media -- the "grow the search results" answer. SAFETY: with no args it prints usage and exits (the build-time self-run never touches the network). BOUNDED: <= MAX_PER_PAGE images per page, polite 1.2s pacing, total fetches kept under the per-process certloop ceiling (~19) -- the cap is LOGGED, never silent. Composes nx_media_gather's HTTPS pattern + nx_revimg_crawl/discover -- ZERO new transport or ranking logic. Usage: nx_revimg_crawl_run <seed_page_url> [candidate_url ...] license_tier: ORIGINAL

dependencies 11 imports · 0 importers

nx_str.nx nx_itoa_lib.nx nx_syscalls.nx nx_csprng.nx nx_x509_trust_store.nx nx_pem_loader.nx nx_https_get.nx nx_html_extract_imgs.nx nx_image_gray.nx nx_phash.nx nx_revimg_crawl_run.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_str.nxnx_itoa_lib.nxnx_syscalls.nxnx_csprng.nxnx_x509_trust_store.nxnx_pem_loader.nxnx_https_get.nxnx_html_extract_imgs.nxnx_image_gray.nxnx_phash.nxnx_revimg_discover.nx

imported by: nobody (leaf or entry point)

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

main cr_puts sys_write nx_str_len sys_exit trust_store_alloc sys_mmap nx_pem_trust_load_file sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_pem_trust_load nx_str_len ↻ _pem_find nx_str_len ↻ sys_mmap ↻ b64_decode b64_grab b64_dec_char 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 ↻ x509_read_alg_id sys_mmap ↻ asn1_expect_tag ↻ trust_store_add cr_num

structs

none

consts

27const CR_MAGIC_131072: i64 = 131072
28const CR_MAGIC_4096: i64 = 4096
29const CR_MAGIC_1200: i64 = 1200
31const CR_PAGE_CAP: i64 = 4194304
32const CR_IMG_CAP: i64 = 8388608
33const CR_MAX_EXTRACT: i64 = 256
34const CR_MAX_PER_PAGE: i64 = 5
35const CR_CORPUS_CAP: i64 = 256
36const CR_THRESH: i64 = 10

functions

38func cr_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 }
43func cr_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: cr_ingest_pagemain calls 1: nxi_out
44func cr_putn(p: *u8, n: i64) -> i64 { if n>0 { sys_write(1, p, n) } return 0 }
called by 1: cr_ingest_page calls 1: sys_write
47func cr_body_off(resp: *u8, n: i64) -> i64
called by 1: cr_ingest_page
55func cr_write_file(path: *u8, buf: *u8, n: i64) -> i64
67func cr_ingest_page(page_url: *u8, store: *TrustStore, site_id: i64,
117func main(argc: i64, argv: *i64) -> i64