code wiki / _hdl_build / nx_bulk_ingest.nx
nx_bulk_ingest.nx
buildroot/runtime/_hdl_build/nx_bulk_ingest.nx
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
imports: nx_pipeline_fetch.nxnx_syscalls.nx
imported by: nx_bulk_ingest_test.nx
structs
| none |
consts
| 16 | const BI_SINGLE: i64 = 0 // ordinary page -> normal single fetch |
| 17 | const BI_BULK: i64 = 1 // harvestable repository + polite capacity -> bulk-catalog ingest |
| 18 | const BI_DEFER: i64 = 2 // a repository, but no polite spare capacity right now -> come back later |
| 21 | const BI_REPO_MIN_LINKS: i64 = 20 // fewer than this is not a catalog |
| 22 | const BI_REPO_PATTERN_PMIL: i64 = 600 // >=60% of links share the catalog's URL pattern -> it's a listing |
| 23 | const BI_MIN_CAPACITY_PMIL: i64 = 200 // need >=20% spare polite capacity before starting a bulk walk |
functions
| 27 | func bi_is_repository(link_count: i64, repeated_pattern_pmil: i64, known_bulk_endpoint: i64) -> i64 called by 1: main |
| 36 | func bi_handoff(is_repo: i64, polite_capacity_pmil: i64) -> i64 called by 1: main |
| 45 | func bi_priority(assignment_match: i64, gap_severity_pmil: i64) -> i64 called by 1: main |
| 54 | func bi_dedup_skip(content_hash: i64, seen: *i64, n_seen: i64) -> i64 called by 1: main |
| 63 | func bi_harvest_wall_ms(n_docs: i64, pace: i64, extract_ms: i64, mirror_ms: i64) -> i64 |
| 67 | func bi_harvest_is_polite(n_docs: i64, pace: i64, extract_ms: i64, mirror_ms: i64) -> i64 |
| 74 | func bi_converged(new_this_round: i64, dry_rounds: i64, max_dry: i64, rounds_done: i64, hard_cap: i64) -> i64 called by 1: main |
| 84 | func bi_self_serve_pmil(mirrored_docs: i64, needed_docs: i64) -> i64 called by 1: main |