nx_docprose.nx
buildroot/runtime/nx_docprose.nx
about
nx_docprose.nx -- LIB: WHERE DOES A STORED DOCUMENT'S REAL CONTENT BEGIN?
THE DEFECT THIS EXISTS TO REMOVE, MEASURED LIVE ON nishifamily.com/search 2026-08-25 (site scope,
one result page): results were rendered with these as their TITLES --
"HTTP/1.1 200 OK Date: Thu, 02 Jul 2026 17:07:07 GMT Content-Type: text/h"
"<p align=\"center\">"
The renderer was not at fault: it faithfully took "the first non-empty LINE", and the first line of
those stored documents really IS an HTTP status line / a raw markup tag, because the evidence-mirror
captures in knowledge/fetched are indexed as documents with their wire bytes intact.
ROOT vs REACH -- STATED PLAINLY SO NOBODY MISREADS THIS LIB'S SCOPE:
The ROOT fix is at INGEST (derive clean text before indexing; nx_block_density's bd_fit_text is the
estate's shipping boilerplate remover and is the organ for that job).
This lib is the SERVE-SIDE half, and it is NOT a workaround: it repairs the ALREADY-INDEXED corpus
with no reindex, and it stays correct afterwards as defence in depth. An ingest fix alone leaves
every existing document broken until a full reindex; a serve fix alone leaves the stored text dirty
for every other consumer. Both are owed and both are real.
POLICY IS CONF, STRUCTURE IS CODE. The protocol facts (an HTTP header block ends at the first blank
line, RFC 9112 2.1) are code. The one judgement call -- how many letters make a "word" -- is a conf row.
license_tier: ORIGINAL
dependencies 3 imports · 4 importers
imports: nx_syscalls.nxnx_lane_conf.nxnx_textcut.nx
imported by: nx_docportal_lib.nxnx_docportal_search_serve.nxnx_docportal_search_serve_snip_20260912.nxnx_docprose_gate.nx
structs
| none |
consts
| 26 | const DPR_CONF: *u8 = "knowledge/docprose.conf" |
| 31 | const DPR_DEF_TITLE_MIN_WORDRUN: i64 = 2 |
| 38 | const DPR_DEF_TITLE_SCAN_BYTES: i64 = 8000 |
| 40 | const DPR_CH_LF: i64 = 10 |
| 41 | const DPR_CH_CR: i64 = 13 |
| 42 | const DPR_CH_SP: i64 = 32 |
| 43 | const DPR_CH_DASH: i64 = 45 |
| 44 | const DPR_CH_COLON: i64 = 58 |
| 45 | const DPR_CH_LT: i64 = 60 |
| 46 | const DPR_HTTPSIG_N: i64 = 5 // len("HTTP/") -- DERIVED beside the literal it measures, never hand-counted apart from it |
functions
| 59 | func dpr_conf_one(key: *u8, dflt: i64) -> i64 |
| 65 | func dpr_load_conf() -> i64 |
| 73 | func dpr_conf_reset() -> i64 { dpr_conf_loaded_g = 0; return 0 } |
| 74 | func dpr_last_http_skipped() -> i64 { return dpr_last_http_skipped_g } called by 1: main |
| 75 | func dpr_last_lines_skipped() -> i64 { return dpr_last_lines_skipped_g } called by 1: main |
| 76 | func dpr_last_budget_hit() -> i64 { return dpr_last_budget_hit_g } |
| 80 | func dpr_last_degraded() -> i64 { return dpr_last_degraded_g } |
| 86 | func dpr_http_body(txt: *u8, n: i64) -> i64 |
| 140 | func dpr_line_end(txt: *u8, n: i64, off: i64) -> i64 |
| 152 | func dpr_is_markup_line(txt: *u8, n: i64, s: i64, e: i64) -> i64 |
| 159 | func dpr_is_namech(c: i64) -> i64 |
| 168 | func dpr_is_header_line(txt: *u8, n: i64, s: i64, e: i64) -> i64 |
| 197 | func dpr_max_wordrun(txt: *u8, s: i64, e: i64) -> i64 |
| 220 | func dpr_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: dpr_find_ci |
| 223 | func dpr_find_ci(txt: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 240 | func dpr_is_html(txt: *u8, n: i64) -> i64 |
| 262 | func dpr_content_start(txt: *u8, n: i64) -> i64 |
| 298 | func dpr_title(txt: *u8, n: i64, cap: i64, offout: *i64, lenout: *i64, exactbox: *i64) -> i64 |