code wiki / _hdl_build / nx_bulk_ingest.nx

nx_bulk_ingest.nx

buildroot/runtime/_hdl_build/nx_bulk_ingest.nx

5487 B88 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_bulk_ingest.nx -- the POLITE-FETCH -> BULK-CATALOG HAND-OFF (operator 2026-06-05): "a hand off function when its being polite that if we can download the whole catalog of research papers like arxiv that triggers like we were doing with the nishi search engine and we grow and grow our library so we can self serve more." When the team's polite single-fetch (nx_pipeline_fetch) lands on a page that is actually a HARVESTABLE REPOSITORY (a catalog/listing/OAI-PMH/sitemap), it HANDS OFF to bulk-catalog ingest: walk the catalog, mirror each doc into the Library (content-addressed dedup), so over time the team SELF-SERVES from its own Library and depends on the live web less. Two hard rules from the operator's prior laws: - STAY POLITE: the bulk walk runs at the SAME one-IP polite floor (pf_polite_floor) -- never a blast. - SERVE THE RAISED HANDS: prioritize repositories that fill the gaps the team raised its hand about. Convergent (K dry rounds = catalog exhausted), resumable, never infinite. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_pipeline_fetch.nx nx_syscalls.nx nx_bulk_ingest.nx nx_bulk_ingest_test.nx

imports: nx_pipeline_fetch.nxnx_syscalls.nx

imported by: nx_bulk_ingest_test.nx

structs

none

consts

16const BI_SINGLE: i64 = 0 // ordinary page -> normal single fetch
17const BI_BULK: i64 = 1 // harvestable repository + polite capacity -> bulk-catalog ingest
18const BI_DEFER: i64 = 2 // a repository, but no polite spare capacity right now -> come back later
21const BI_REPO_MIN_LINKS: i64 = 20 // fewer than this is not a catalog
22const BI_REPO_PATTERN_PMIL: i64 = 600 // >=60% of links share the catalog's URL pattern -> it's a listing
23const BI_MIN_CAPACITY_PMIL: i64 = 200 // need >=20% spare polite capacity before starting a bulk walk

functions

27func bi_is_repository(link_count: i64, repeated_pattern_pmil: i64, known_bulk_endpoint: i64) -> i64
called by 1: main
36func bi_handoff(is_repo: i64, polite_capacity_pmil: i64) -> i64
called by 1: main
45func bi_priority(assignment_match: i64, gap_severity_pmil: i64) -> i64
called by 1: main
54func bi_dedup_skip(content_hash: i64, seen: *i64, n_seen: i64) -> i64
called by 1: main
63func bi_harvest_wall_ms(n_docs: i64, pace: i64, extract_ms: i64, mirror_ms: i64) -> i64
67func bi_harvest_is_polite(n_docs: i64, pace: i64, extract_ms: i64, mirror_ms: i64) -> i64
74func bi_converged(new_this_round: i64, dry_rounds: i64, max_dry: i64, rounds_done: i64, hard_cap: i64) -> i64
called by 1: main
84func bi_self_serve_pmil(mirrored_docs: i64, needed_docs: i64) -> i64
called by 1: main