code wiki / wiki / nx_wiki_article.nx

nx_wiki_article.nx

buildroot/runtime/wiki/nx_wiki_article.nx

46837 B305 linesdepth 10pulls 22 transitivereach 7 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_wiki_doc_render.nx nx_wiki_article.nx nx_sites_daemon.nx nx_sites_daemon_v2.nx nx_wiki_routes.nx

imports: nx_syscalls.nxnx_wiki_doc_render.nx

imported by: nx_sites_daemon.nxnx_sites_daemon_v2.nxnx_wiki_routes.nx

structs

none

consts

31const NX_ART_OK: i64 = 0
32const NX_ART_OVERFLOW: i64 = 2900
35const NX_ART_RENDER_CAP: i64 = 131072 // 128 KB render scratch
36const NX_ART_SCRATCH_CAP: i64 = 4096
37const NX_ART_STRLEN_CAP: i64 = 65536
38const NX_ART_PUTZ_CAP: i64 = 1048576

functions

41func nx_art_strlen(s: *u8) -> i64
51func nx_art_put_z(dst: *u8, off: *i64, cap: i64, s: *u8) -> i64
called by 1: nx_art_finish_http
68func nx_art_slug_eq(slug: *u8, slug_n: i64, target: *u8) -> i64
81func nx_aw_h2(ctx: *NxWikiDocCtx, title: *u8) -> i64
88func nx_aw_partnership_panel(ctx: *NxWikiDocCtx, slug: *u8) -> i64
101func nx_article_wiki_engine(ctx: *NxWikiDocCtx) -> i64
127func nx_art_stub(ctx: *NxWikiDocCtx, title: *u8, line: *u8) -> i64
136func nx_article_crawler(ctx: *NxWikiDocCtx) -> i64
147func nx_article_x25519(ctx: *NxWikiDocCtx) -> i64
158func nx_article_ranking(ctx: *NxWikiDocCtx) -> i64
169func nx_article_notfound(ctx: *NxWikiDocCtx, slug: *u8, slug_n: i64) -> i64
175func nx_wiki_article_render_body(ctx: *NxWikiDocCtx, slug: *u8, slug_n: i64) -> i64
184func nx_art_finish_http(ctx: *NxWikiDocCtx, resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64
220func nx_wiki_article_handle(slug: *u8, slug_n: i64,
244func nx_wiki_components_handle(resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64
275func nx_wiki_projects_handle_curated_unused(resp_buf: *u8, resp_cap: i64, out_resp_n: *i64) -> i64