nx_wiki_article.nx
buildroot/runtime/wiki/nx_wiki_article.nx
about
nx_wiki_article.nx -- Gitea x Wikipedia component articles for the Nishi wiki.
Each "component" (crawler, X25519, ranking math, the wiki engine itself,
...) gets a rich, RESEARCHED + BENCHMARKED article that doubles as a repo
view: overview, the math/algorithm, how-it-works, LOCAL vs GLOBAL
functionality, the real files (Gitea-style), the measured benchmark, the
research citations, and a PARTNERSHIP WORKLOG -- the durable record of
human<->Claude work on that item (what was built: the math, the crypto,
the specific thing). The worklog is the spine of the "trigger Claude
partnership work" loop: work on a component appends a worklog entry
documenting its local + global functionality.
SOVEREIGN: all NishiLang, rendered by the wiki engine, served by the Nishi
daemon. No shell, no TSV, no external lib (operator mandate; see
feedback-sovereign-medium-not-shell-tsv). Reuses the wiki render
primitives (legacy header ships table CSS; write_z / write_byte / footer).
COMPOSED BY: wiki/nx_wiki_routes (dynamic /wiki/component/<slug>) and
bin/nx_sites_daemon (renders each article once at startup
into a hoisted buffer; served verbatim, constant memory).
TLS RECORD BUDGET: the live sites daemon sends one TLS 1.3 record
(<=16384 plaintext), so each article response is kept under ~15 KB.
Status: V1. 2026-05-29.
dependencies 2 imports · 3 importers
imports: nx_syscalls.nxnx_wiki_doc_render.nx
imported by: nx_sites_daemon.nxnx_sites_daemon_v2.nxnx_wiki_routes.nx
structs
| none |
consts
| 31 | const NX_ART_OK: i64 = 0 |
| 32 | const NX_ART_OVERFLOW: i64 = 2900 |
| 35 | const NX_ART_RENDER_CAP: i64 = 131072 // 128 KB render scratch |
| 36 | const NX_ART_SCRATCH_CAP: i64 = 4096 |
| 37 | const NX_ART_STRLEN_CAP: i64 = 65536 |
| 38 | const NX_ART_PUTZ_CAP: i64 = 1048576 |
functions
| 41 | func nx_art_strlen(s: *u8) -> i64 |
| 51 | func nx_art_put_z(dst: *u8, off: *i64, cap: i64, s: *u8) -> i64 called by 1: nx_art_finish_http |
| 68 | func nx_art_slug_eq(slug: *u8, slug_n: i64, target: *u8) -> i64 |
| 81 | func nx_aw_h2(ctx: *NxWikiDocCtx, title: *u8) -> i64 calls 1: nx_wiki_doc_write_z |
| 88 | func nx_aw_partnership_panel(ctx: *NxWikiDocCtx, slug: *u8) -> i64 |
| 101 | func nx_article_wiki_engine(ctx: *NxWikiDocCtx) -> i64 |
| 127 | func nx_art_stub(ctx: *NxWikiDocCtx, title: *u8, line: *u8) -> i64 |
| 136 | func nx_article_crawler(ctx: *NxWikiDocCtx) -> i64 |
| 147 | func nx_article_x25519(ctx: *NxWikiDocCtx) -> i64 |
| 158 | func nx_article_ranking(ctx: *NxWikiDocCtx) -> i64 |
| 169 | func nx_article_notfound(ctx: *NxWikiDocCtx, slug: *u8, slug_n: i64) -> i64 |
| 175 | func nx_wiki_article_render_body(ctx: *NxWikiDocCtx, slug: *u8, slug_n: i64) -> i64 |
| 184 | func nx_art_finish_http(ctx: *NxWikiDocCtx, resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64 |
| 220 | func nx_wiki_article_handle(slug: *u8, slug_n: i64, |
| 244 | func nx_wiki_components_handle(resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64 |
| 275 | func nx_wiki_projects_handle_curated_unused(resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64 |