code wiki / _hdl_build / nx_reader_census.nx
nx_reader_census.nx source
↩ module page · 115 lines · 24922 B
1// nx_reader_census.nx -- the reader S-class CENSUS as a CODE-DEFINED SEED into the sovereign seg-store
2// (knowledge/store/rcen-*, via nx_seg_store) -- operator 2026-06-21: "stop using tsv, nishi ecosystem hardware-
3// rung-up, not use tsv again" + 2026-06-22 evolve to a code-defined seed so even the retired .tsv backup is
4// unnecessary. The 62 capability cells are AUTHORED HERE (author-by-organ, the nx_known_issue_seed pattern); NO
5// .tsv is read. IDEMPOTENT (rule#10): a record is written only if absent-or-changed, then EVERY record is read
6// back + byte-verified -- GREEN only when the store holds exactly the authored census. To GROW the census: add a
7// keys[]/vals[] pair + the id to rc:ids, re-run. Record = id<tab>tier<tab>dimension<tab>capability<tab>
8// best_in_class<tab>status<tab>exceed_angle. expect_exit: 0 license_tier: ORIGINAL
9import "nx_reader_census_store.nx" // RC_PREFIX / rc_seg_next_p / rc_streq_store
10import "nx_seg_store.nx" // ss_begin / ss_add / ss_commit
11import "nx_syscalls.nx"
12
13func cw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
14func cn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
15func clen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
16
17func main() -> i64 {
18 cw("=== nx_reader_census: code-defined seed -> sovereign seg-store (NO TSV) ===\n" as *u8)
19 let keys: *i64 = sys_mmap(8 * 80) as *i64
20 let vals: *i64 = sys_mmap(8 * 80) as *i64
21
22 keys[0]="rc:ids" as *u8 as i64; vals[0]="SC01\tSC02\tSC03\tSC04\tSC05\tSC06\tSC07\tSC08\tSC09\tSC10\tSC11\tSC12\tSC13\tSC14\tSC15\tSC16\tSC17\tSC18\tSC19\tSC20\tSC21\tSC22\tSC23\tSC24\tSC25\tSC26\tSC27\tSC28\tSC29\tSC30\tSC31\tSC32\tSC33\tSC34\tSC35\tSC36\tSC37\tSC38\tSC39\tSC40\tSC41\tSC42\tSC43\tSC44\tSC45\tSC46\tSC47\tSC48\tSC49\tSC50\tSC51\tSC52\tSC53\tSC54\tSC55\tSC56\tSC57\tSC58\tSC59\tSC60\tSC61\tSC62\tSC63\tSC64" as *u8 as i64
23
24 keys[1]="rc:SC01" as *u8 as i64; vals[1]="SC01\t1\tsync\tcross-device position sync (last page)\tKindle Whispersync / Kobo\tMISSING\tcontent-addressed locator survives re-conversion (Kindle is per-account-cloud only)" as *u8 as i64
25 keys[2]="rc:SC02" as *u8 as i64; vals[2]="SC02\t1\tsync\tcross-device annotation/highlight sync\tKindle Whispersync\tMISSING\tsovereign sync server, no vendor cloud, content-hash re-anchor" as *u8 as i64
26 keys[3]="rc:SC03" as *u8 as i64; vals[3]="SC03\t1\tsync\tebook<->audiobook position handoff\tKindle Whispersync for Voice\tMISSING\tone engine owns both; no Audible-account dependency" as *u8 as i64
27 keys[4]="rc:SC04" as *u8 as i64; vals[4]="SC04\t1\tcomics\tguided-view auto panel detection\tComiXology / bloopworm AI / Magi(arXiv 2401.10224)\tPARTIAL\tBUILT+GATED+LIVE 2026-07-02: nx_reader_panels = sovereign integer CV (Otsu ink + interior X-Y gutter-cut + trim + banded RTL/LTR reading order), PIXEL-EXACT through a real JPEG (nx_reader_panels_gate 6/6), served live via /api/zoomprep + the zoom viewer. PARTIAL: clean axis-aligned gutters only; bleed/diagonal/overlap pages = the Magi-class ML rung" as *u8 as i64
28 keys[5]="rc:SC05" as *u8 as i64; vals[5]="SC05\t1\tpdf\tPDF reading-order/table/font->Unicode/OCR recovery\t(all admit weak; Calibre \"unusable\")\tPARTIAL\twe render PDF->page-images; structure recovery is the open S-class win" as *u8 as i64
29 keys[6]="rc:SC06" as *u8 as i64; vals[6]="SC06\t1\trender\tMIXED reflow+fixed layout in one book\t(NOBODY -- foliate explicitly cannot)\tMISSING\tunified Nishi format keeps structure-tree + fixed pages -> mixed" as *u8 as i64
30 keys[7]="rc:SC07" as *u8 as i64; vals[7]="SC07\t2\trender\treflowable paginator (CSS columns, page turn)\tfoliate-js Paginator\tPARTIAL\tcurrent reader is scroll-only; add paginator" as *u8 as i64
31 keys[8]="rc:SC08" as *u8 as i64; vals[8]="SC08\t2\trender\tscroll<->paginate toggle without reload\tfoliate-js\tMISSING\tone View, switch mode live" as *u8 as i64
32 keys[9]="rc:SC09" as *u8 as i64; vals[9]="SC09\t2\trender\tfixed-layout renderer (PDF/comics pages + zoom)\tfoliate-js / Chunky\tHAVE\tpage JPGs served image/jpeg, native browser zoom" as *u8 as i64
33 keys[10]="rc:SC10" as *u8 as i64; vals[10]="SC10\t2\trender\ttypography (fonts, line-height, measure, justify, hyphen)\tApple Books / Kobo\tHAVE\tserif/sans, line-height, measure column, hyphens:auto" as *u8 as i64
34 keys[11]="rc:SC11" as *u8 as i64; vals[11]="SC11\t2\trender\tthemes light/sepia/dark + brightness/invert filter\tKindle / foliate CSS filter\tHAVE\t5 themes + warm low-blue NIGHT + AMOLED BLACK + color-temp warmth + brightness + BOOK-ONLY invert; blue-light MEASURED by nx_night_grade" as *u8 as i64
35 keys[12]="rc:SC12" as *u8 as i64; vals[12]="SC12\t2\trender\tinstant page turns / large-library performance\tKindle\tHAVE\tsingle-digit-ms loopback serve, paginated /api/list over 5761" as *u8 as i64
36 keys[13]="rc:SC13" as *u8 as i64; vals[13]="SC13\t2\tnav\tTOC drawer + chapter jump + is_nav skip\tall\tHAVE\tRESOLVED 2026-06-22: the zero-JS reader renders the hierarchical nav-doc TOC in a <details> drawer with anchor chapter-jump (built+gated via SC51/SC52, asserted by nx_reader_render_gate); the old flat-spine PARTIAL is gone" as *u8 as i64
37 keys[14]="rc:SC14" as *u8 as i64; vals[14]="SC14\t3\tnav\tvisual nav: Book Map / Page Browser\tKOReader\tMISSING\tthumbnail/heatmap nav over the unified model" as *u8 as i64
38 keys[15]="rc:SC15" as *u8 as i64; vals[15]="SC15\t2\tnav\tprogress bar + percent + resume position\tall\tHAVE\tpinned progress bar + pct + scroll position" as *u8 as i64
39 keys[16]="rc:SC16" as *u8 as i64; vals[16]="SC16\t2\tcomics\twebtoon vertical-scroll + RTL manga + auto format\tWEBTOON / Mihon / Panels\tPARTIAL\t2026-07-02: RTL manga READING ORDER live (banded panel order in the zoom viewer, rtl param); paged mode live; continuous-vertical webtoon + double-page spread + auto-detect pending" as *u8 as i64
40 keys[17]="rc:SC17" as *u8 as i64; vals[17]="SC17\t2\tcomics\tauto-zoom to panel\tComic Trim / ComiXology guided view\tHAVE\tBUILT+GATED+LIVE 2026-07-02: double-tap hit-tests panels.json -> animated zoomRect to THAT panel; prev/next steps panels in reading order w/ page continuity (past last panel -> next page's first); 0-panel pages honestly fall back to whole-page fit. Organ-emitted viewer (nx_reader_zoom_emit) live at /library/zoom over the public edge (TLS probe 200)" as *u8 as i64
41 keys[18]="rc:SC18" as *u8 as i64; vals[18]="SC18\t2\tlibrary\tlarge library list + pagination (50k+)\tKavita (50k+ tested)\tHAVE\t5761 paginated at ~5-7ms; scale-test beyond 20k" as *u8 as i64
42 keys[19]="rc:SC19" as *u8 as i64; vals[19]="SC19\t2\tlibrary\tmetadata editing + scraping\tCalibre / Kavita\tMISSING\tread Calibre metadata.db directly (team has _sqlite_read)" as *u8 as i64
43 keys[20]="rc:SC20" as *u8 as i64; vals[20]="SC20\t2\tsearch\tfull-text search across the whole library\tKavita\tHAVE\tBM25 engine (nx_book_search_lib) + /api/search route + browser search box, verified over 5761" as *u8 as i64
44 keys[21]="rc:SC21" as *u8 as i64; vals[21]="SC21\t2\tsearch\tin-book full-text search\tfoliate-js search\tPARTIAL\tengine DONE (nx_inbook_search: ranks chapters + context snippets, gated 4/4); in-reader wiring pending" as *u8 as i64
45 keys[22]="rc:SC22" as *u8 as i64; vals[22]="SC22\t2\tlibrary\tcollections / series tracking\tKavita / Komga\tMISSING\tseries model in the unified format" as *u8 as i64
46 keys[23]="rc:SC23" as *u8 as i64; vals[23]="SC23\t2\tinterop\tOPDS / OPDS-PS feeds (last-mile interop)\tKavita / Calibre-Web / Komga\tMISSING\tserve OPDS so Panels/Mihon/Moon+ can consume our library" as *u8 as i64
47 keys[24]="rc:SC24" as *u8 as i64; vals[24]="SC24\t2\tannotate\thighlights + notes (multi-color)\tfoliate annotations / Kindle\tMISSING\tstructural locator + content-hash anchor" as *u8 as i64
48 keys[25]="rc:SC25" as *u8 as i64; vals[25]="SC25\t2\tannotate\thighlight/note export\tKOReader multi-page export\tMISSING\texport to markdown/json, sovereign" as *u8 as i64
49 keys[26]="rc:SC26" as *u8 as i64; vals[26]="SC26\t2\taids\tinline dictionary lookup\tKindle / Moon+\tMISSING\toffline sovereign dictionary" as *u8 as i64
50 keys[27]="rc:SC27" as *u8 as i64; vals[27]="SC27\t2\taids\tinstant translation\tMoon+ / Kobo (Google Translate)\tMISSING\tpluggable; offline-first" as *u8 as i64
51 keys[28]="rc:SC28" as *u8 as i64; vals[28]="SC28\t2\taids\ttext-to-speech (TTS)\tVoice Dream / Speechify / Kindle\tMISSING\tsovereign TTS or last-mile Web Speech" as *u8 as i64
52 keys[29]="rc:SC29" as *u8 as i64; vals[29]="SC29\t3\taids\tX-Ray (characters/places/terms index)\tKindle X-Ray\tPARTIAL\tBUILT+GATED 2026-06-22: nx_reader_xray auto-derives a deterministic notable-term/entity index (mid-sentence caps + bigrams, stopword/title-filtered) from the book's OWN text -> zero-JS <details> X-Ray panel w/ occurrence counts + jump-to-first-mention; works on ANY book (Kindle X-Ray is provisioned-only). nx_reader_xray_gate 13/0 + exceed-gate coverage-EXCEEDS. PARTIAL: term index done, curated bios/relationship-graphs (richness) pending" as *u8 as i64
53 keys[30]="rc:SC30" as *u8 as i64; vals[30]="SC30\t3\taids\tWord Wise (inline defs for hard words)\tKindle Word Wise\tMISSING\tfrequency-gated inline glosses" as *u8 as i64
54 keys[31]="rc:SC31" as *u8 as i64; vals[31]="SC31\t3\tstats\treading stats (time, pace, streaks)\tKobo\tPARTIAL\tBUILT 2026-06-21: estimated reading TIME per book + chapter count, organ-computed, zero-JS; live tracking/streaks need persistence" as *u8 as i64
55 keys[32]="rc:SC32" as *u8 as i64; vals[32]="SC32\t3\tstats\tread-later / article save\tKobo Pocket\tMISSING\tingest web articles into the unified format" as *u8 as i64
56 keys[33]="rc:SC33" as *u8 as i64; vals[33]="SC33\t2\taudio\taudiobook playback speed 0.5-5x\tSmart AudioBook / ListenBook\tMISSING\twe only LIST audiobooks (153 zips); add player" as *u8 as i64
57 keys[34]="rc:SC34" as *u8 as i64; vals[34]="SC34\t2\taudio\tsleep timer (chapter/time, fade)\tall audiobook apps\tPARTIAL\t2026-06-23: nx_audio_serve daemon caps the served stream to sleep_min*BYTES_PER_MIN server-side (?sleep=N) -> playback ends, NO browser JS; nx_audio_serve_gate. Refine: derive bytes/min from track bitrate; fade" as *u8 as i64
58 keys[35]="rc:SC35" as *u8 as i64; vals[35]="SC35\t2\taudio\tbookmarks w/ timestamps + auto-rewind after pause\tVoice / Listen\tPARTIAL\t2026-06-23: nx_audio_serve POST /bookmark stores the byte position server-side (reader/<slug>/audio_pos.txt); gated. Refine: named/multiple bookmarks + client seek-to-bookmark + auto-rewind" as *u8 as i64
59 keys[36]="rc:SC36" as *u8 as i64; vals[36]="SC36\t2\taudio\tchapters + equalizer/volume-boost/skip-silence\tSmart AudioBook\tMISSING\tchapters=daemon segmentation (M4B chpl/MP3 CHAP) + EQ/skip-silence=DSP pre-render (audit+reuse audio-ecosystem DSP) -- next rung" as *u8 as i64
60 keys[37]="rc:SC37" as *u8 as i64; vals[37]="SC37\t2\taudio\taudiobook position sync across devices\tAudio Books App\tPARTIAL\t2026-06-23: nx_audio_serve GET /resume returns the stored position {\"pos\":N} server-side -> any device resumes there; gated. Refine: per-user position + the SC01 sync layer" as *u8 as i64
61 keys[38]="rc:SC38" as *u8 as i64; vals[38]="SC38\t2\ta11y\tscreen-reader support (semantic markup / VoiceOver)\tReadium 2\tHAVE\tBUILT+GATED 2026-06-21: zero-JS reader+shelf skip-to-content link + ARIA landmarks + semantic HTML + labeled controls + alt text" as *u8 as i64
62 keys[39]="rc:SC39" as *u8 as i64; vals[39]="SC39\t2\ta11y\tdyslexia font (OpenDyslexic)\tKindle\tPARTIAL\tBUILT+GATED 2026-06-22: zero-JS dyslexia reading MODE in nx_reader_render (BDA style guide: Atkinson-Hyperlegible/Verdana sans stack + letter .045em/word .16em spacing + line-height 1.9 + no hyphen/justify) via name=nxfont radio:checked + toolbar toggle (nx_reader_render_gate). PARTIAL: typographic mode done; embedded OpenDyslexic font file (vs system stack) pending" as *u8 as i64
63 keys[40]="rc:SC40" as *u8 as i64; vals[40]="SC40\t2\ta11y\tfont/color/line-spacing/contrast customization\tall\tHAVE\tthemes + font toggle + measure" as *u8 as i64
64 keys[41]="rc:SC41" as *u8 as i64; vals[41]="SC41\t2\tformat\tEPUB\tfoliate / all\tHAVE\tfull-chapter + TOC-skip + entity-decode" as *u8 as i64
65 keys[42]="rc:SC42" as *u8 as i64; vals[42]="SC42\t2\tformat\tMOBI / KF8 / AZW3 decode\tfoliate / Kindle\tPARTIAL\tWIRED-LIVE 2026-06-25 (the BUILT-not-LIVE gap CLOSED): ms_handle_open now classifies .mobi/.azw/.azw3/.prc as kind=4 and routes them through the nx_kf8_book||nx_mobi_book extractor chain into the zero-JS reader (kf8 first; it declines a MOBI6-only file so the mobi extractor catches it; DRM declines both -> honest /file). PREVIOUSLY kind=0 -> dead-end 302 /file + 'not readable in-browser' alert for ~390 library kindle books (137 mobi + 190 azw3 + ~55 azw). Server rebuilt + deployed via nx_aw_send to NAS nishi-reader (nx_media_server_auth.elf + _offc/nx_kf8_book.elf + _offc/nx_mobi_book.elf), reader kickreader-respawned UP. NEW ACTIVE AUDITOR nx_reader_liveness probes real artifacts (library-index format counts x _offc extractor .elf x serving-binary wiring) -> GREEN: every format the library holds is BUILT+WIRED, anti-wave liar-kill fires. User click-test (login + open an azw3) pending. PRIOR BUILD: nx_mobi_book decodes DRM-FREE MOBI/AZW (PDB container + PalmDOC decompress via nx_palmdoc round-trip-gated + EXTH title/author) -> the SAME book.json the zero-JS reader renders (lock-in format LIBERATED to Nishi format). DETECTS+DECLINES DRM (encryptionType flag -> exit 2, NO circumvention). nx_mobi_book_gate 8/0 + nx_palmdoc_gate 3/0. HUFF/CDIC (compression 17480) NOW WIRED end-to-end 2026-06-23: sovereign nx_huffcdic (huff_load+cdic_load+hc_unpack, clean-room from the registered Calibre-huffcdic spec) routed into nx_mobi_book; nx_huffcdic_gate 13/0 + nx_mobi_huff_gate 7/0. HUFF/CDIC VALIDATED ON A REAL kindlegen FILE 2026-06-23 (libmobi LGPL sample, fetched+registered libmobi-sample-huffdic.ref 484KB): nx_mobi_book decoded 28 real text records -> decompressed length == declared textLen exactly (111701) -> genuine readable prose -> .nmz @kind=book; nx_mobi_huffreal_gate 9/0 = the multi-codelen mincode-walk + recursive phrases proven on real data. Caught+fixed a real-file-only bug: the spec's Huffman-Record-Offset 0x70/0x74 are RECORD-0-relative (incl the 16B PalmDOC hdr), not MOBI-header-relative. KF8/AZW3 RUNG 1 (text) DONE 2026-06-23: nx_kf8_book finds the KF8 part via EXTH 121 (boundary record) + decodes its HUFF/CDIC text records (record refs RELATIVE to the boundary, B+offset) reusing nx_huffcdic/nx_palmdoc -> readable book.json -> .nmz; nx_kf8_gate 9/0 on the real dual file's KF8 part. ALL DRM-free Kindle variants now yield readable text (MOBI6 PalmDOC+HUFF + KF8/AZW3). PARTIAL: KF8 rung-1 has minor inline SKEL/FRAG markers (FDST/SKEL/FRAG reassembly = rung 2 for pristine structure) + pure-KF8-only file path built-not-yet-tested + pagebreak chapter-split = next rungs" as *u8 as i64
66 keys[43]="rc:SC43" as *u8 as i64; vals[43]="SC43\t2\tformat\tCBZ comics\tfoliate / Kavita\tHAVE\tordered page JPGs + cbx.json" as *u8 as i64
67 keys[44]="rc:SC44" as *u8 as i64; vals[44]="SC44\t2\tformat\tCBR (rar) comics\tKavita / Chunky\tPARTIAL\tCBZ(zip) done; CBR(rar) needs unrar" as *u8 as i64
68 keys[45]="rc:SC45" as *u8 as i64; vals[45]="SC45\t3\tformat\tDjVu / FB2\tKOReader\tPARTIAL\tFB2 (FictionBook) decode->.nmz @kind=book done (nx_fb2_book, Nishi equiv of Calibre FB2 input, gate 13/0); DjVu pending" as *u8 as i64
69 keys[46]="rc:SC46" as *u8 as i64; vals[46]="SC46\t2\tformat\tin-app conversion / send-to-Kindle/Kobo/email + print/PDF export\tCalibre-Web / Kavita\tPARTIAL\tBUILT 2026-06-21: sovereign @media print stylesheet = clean print / save-as-PDF, zero-JS; native conversion + send-to-device pending" as *u8 as i64
70 keys[47]="rc:SC47" as *u8 as i64; vals[47]="SC47\t1\tarch\tsovereign single static binary, 0 runtime deps\t(NONE -- all are python/JS stacks)\tHAVE\t75744B static ELF, no PT_INTERP (rung-4 proven exceed)" as *u8 as i64
71 keys[48]="rc:SC48" as *u8 as i64; vals[48]="SC48\t1\tarch\towns rendering engine (no epub.js wrapper)\t(Calibre-Web wraps stale epub.js)\tHAVE\thand-written dependency-free reader.html/cbx.html" as *u8 as i64
72 keys[49]="rc:SC49" as *u8 as i64; vals[49]="SC49\t1\tarch\tcontent-addressed streamable format (read p1 before p1000)\tReadium RWPM (manifest only)\tHAVE\tThe OWNED format ALREADY EXISTS as the sovereign storage substrate: nx_canon_cid (byte-deterministic NXR1 canonical form, key-sorted fields, CID=nxc1-+sha256) + nx_uxf_cid (self-describing MULTICODEC/profile CID: DATA/DOC/MEDIA/CONFIG/ARCHIVE, add-an-id-never-a-new-format) + nx_uxf_decode (tolerant-reader forward-compat) + nx_seg_store (append-only immutable store of canon_cid records). AUDIT 2026-06-22: nx_nbk/.nbk (djb2) was a DUPLICATE -> DEPRECATED. BUILT+GATED ON the substrate instead: nx_nmz = the OMNI Nishi Media container (.nmz) = binary-safe NXR1 record + REUSED uxf_cid_profiled (nxc1-05-+sha256 multicodec CID, NOT a new hash), @kind tags book/comic/audio/video (.nbk = the @kind=book profile). nx_nmz_pack migrates EPUB+MOBI -> .nmz; nx_nmz_gate 8/0 (substrate-CID-reuse codec=UXF_ARCHIVE + kind + book.json round-trip + content-addr tamper-detect + determinism + MOBI converge)" as *u8 as i64
73 keys[50]="rc:SC50" as *u8 as i64; vals[50]="SC50\t3\tdelight\toffline-first everything\tKobo/Kindle (partial)\tPARTIAL\tsovereign + local NAS = naturally offline; formalize" as *u8 as i64
74 keys[51]="rc:SC51" as *u8 as i64; vals[51]="SC51\t2\tnav\thierarchical TOC from the EPUB navigation document (nav.xhtml epub:type=toc / toc.ncx): nested + curated labels\tKindle / Apple Books / foliate-js\tHAVE\tBUILT+GATED 2026-06-21: nx_epub_book emits hierarchical toc[] from nav.xhtml/NCX, reader renders nested (toc gates 11/0 + 9/0)" as *u8 as i64
75 keys[52]="rc:SC52" as *u8 as i64; vals[52]="SC52\t2\tnav\tcorrect chapter titles + numbering (real nav labels; no front-matter-skewed \"Chapter K\")\tall\tHAVE\tcurated nav-doc titles drive the drawer; spine-fallback made 1-based (2026-06-21)" as *u8 as i64
76 keys[53]="rc:SC53" as *u8 as i64; vals[53]="SC53\t2\tartwork\tcover image: extract (OPF cover-image / <meta name=cover>) -> serve -> reader + library card\tKindle / Kobo / Apple Books / Calibre\tHAVE\tBUILT+GATED 2026-06-21: nx_epub_book extracts cover (both conventions) -> served -> reader drawer (nx_epub_art_gate, byte-exact)" as *u8 as i64
77 keys[54]="rc:SC54" as *u8 as i64; vals[54]="SC54\t2\tartwork\tembedded illustrations: extract <img>/manifest image items -> inline render at correct position in prose\tKindle / Apple Books\tHAVE\tBUILT+GATED 2026-06-21 R-ART-2: nx_epub_book img_markerize preserves <img> positions -> reader inline same-origin <img>; byte-exact" as *u8 as i64
78 keys[55]="rc:SC55" as *u8 as i64; vals[55]="SC55\t1\tarch\timage asset ingestion: content-addressed (CID) + foundationed into the Nishi Library (no-link-rot + lineage)\t(NONE -- all vendor-cloud)\tPARTIAL\tassets extracted + djb2 fingerprinted + served; canonical CID + ed25519 foundation = R-ART-2 (coordinate library ws)" as *u8 as i64
79 keys[56]="rc:SC56" as *u8 as i64; vals[56]="SC56\t2\trender\tdesktop wide reading: two-column / paginated large-screen layout (not just bigger font)\tApple Books / Kindle desktop\tMISSING\treader only bumps font+measure at >=760px; add desktop columns/pagination" as *u8 as i64
80 keys[57]="rc:SC57" as *u8 as i64; vals[57]="SC57\t2\ta11y\tmenus+controls fit ALL viewports (scrollable popovers, safe-area insets, >=44px touch targets)\tApple HIG / Material\tHAVE\tBUILT+GATED 2026-06-22: scrollable popovers + safe-area + >=44px touch targets on touch devices (@media pointer:coarse min-height:44px) in zero-JS reader+shelf, asserted by nx_reader_render_gate + nx_library_shelf_gate" as *u8 as i64
81 keys[58]="rc:SC58" as *u8 as i64; vals[58]="SC58\t1\tarch\tlast-mile UI organ-EMITTED + fail-closed sovereignty at emit (no hand-dropped HTML; refuses any 3rd-party load)\t(NONE -- incumbents ship hand-built/bundled JS)\tHAVE\tBUILT+GATED 2026-06-21 R-EMIT: nx_reader_page emits reader.html byte-identical, refuses 3rd-party (nx_reader_page_gate 9/0 + sovereignty 11/0)" as *u8 as i64
82 keys[59]="rc:SC59" as *u8 as i64; vals[59]="SC59\t1\tarch\tZERO-JavaScript reader: ALL logic in the Nishi organ, browser runs NO code (interactions = pure HTML+CSS)\t(NONE -- Kindle/Kobo/foliate/Calibre-Web all ship client JS)\tHAVE\tBUILT+GATED 2026-06-21 (no js, nishi everywhere): nx_reader_render static HTML+CSS, 0 script/eval/onclick (nx_reader_render_gate)" as *u8 as i64
83 keys[60]="rc:SC60" as *u8 as i64; vals[60]="SC60\t2\tlibrary\tlibrary browse/shelf: ZERO-JS card grid (covers shown), each card -> the book's reader\tKindle/Kobo/Calibre-Web (all ship client JS)\tHAVE\tBUILT+GATED 2026-06-21: nx_library_shelf static CSS-grid shelf w/ cover art + author + <a> links; 0 script (nx_library_shelf_gate)" as *u8 as i64
84 keys[61]="rc:SC61" as *u8 as i64; vals[61]="SC61\t1\tarch\tdeploy via the sovereign Publisher (pub_submit -> verify-sha -> atomic-promote -> ledger), NEVER a direct push\tKindle/Kobo (vendor CD), Calibre-Web (manual)\tHAVE\tBUILT+GATED 2026-06-21: nx_pub_reader_handoff ships THROUGH the publisher to a sha-verified ledgered liveroot + built pub_mkdirp subdir rung (handoff gate 9/0, publisher gates 4/4)" as *u8 as i64
85 keys[62]="rc:SC62" as *u8 as i64; vals[62]="SC62\t1\tarch\tsigned deployment RECEIPT / return-and-report (Ed25519 non-repudiation; live-bytes==ledger-sha proof)\t(NONE -- vendors give no cryptographic deploy proof)\tHAVE\tBUILT+GATED 2026-06-21: nx_pub_reader_receipt uses the publisher Ed25519 receipt system -> signed PUBLISHED receipts, live-bytes==ledger-sha (receipt gate 7/0)" as *u8 as i64
86 keys[64]="rc:SC63" as *u8 as i64; vals[64]="SC63\t2\trender\tfootnote/endnote rendering (linked notes, not inline mid-prose)\tKindle/Apple Books/foliate (popup footnotes)\tHAVE\tBUILT+GATED 2026-06-22: nx_epub_book fn_markerize extracts EPUB epub:type=noteref/footnote -> chapters[].fn[] + inline [[fnref]] markers; nx_reader_render renders zero-JS superscript refs + per-chapter <ol> note list w/ :target highlight + back-links; notes pulled OUT of prose flow (nx_reader_render_gate footnote asserts + extraction teeth)" as *u8 as i64
87 keys[63]="rc:provenance" as *u8 as i64; vals[63]="authored=organ code-defined-seed 2026-06-21/22, extended 2026-07-02 (+SC64 tiled zoom; SC04/SC16/SC17 updated by the intelligent-zoom arc); 64 cells; migrated off reader_sclass_capability_target.tsv; coverage+gate read this store; seg-store NOT tsv" as *u8 as i64
88 keys[65]="rc:SC64" as *u8 as i64; vals[65]="SC64\t1\tcomics\ttiled-pyramid deep zoom (DZI-class only-visible-tile fetch = smooth mobile zoom of huge scans)\tDeepZoom/OpenSeadragon/IIIF (libraries; NO cohort READER ships it; Kindle renders PDF as-is)\tHAVE\tBUILT+GATED+LIVE 2026-07-02: nx_reader_tile (decode->box-downscale levels->/8 JPEG tiles + dz.json manifest, gate 6/6) + /api/zoomprep lazy prep (nx_reader_zoomserve_gate 6/6) + organ-emitted viewer w/ blob-auth tile fetch; tiles ride the existing /api/book allowlist; LIVE at /library/zoom (sovereign TLS probe HTTP 200). Next: JXL/AVIF tile recompression + .nmz packing" as *u8 as i64
89 let nrec: i64 = 66
90
91 // write absent-or-changed records (idempotent / additive)
92 let w: *i64 = ss_begin()
93 var towrite: i64 = 0
94 var i: i64 = 0
95 while i < nrec {
96 let key: *u8 = keys[i] as *u8
97 let val: *u8 = vals[i] as *u8
98 if rc_streq_store(key, val, clen(val)) == 0 { ss_add(w, 1, key, val, clen(val)); towrite = towrite + 1 }
99 i = i + 1
100 }
101 var committed: i64 = 0
102 if towrite > 0 { if ss_commit(RC_PREFIX, w, rc_seg_next_p(RC_PREFIX)) == 0 { committed = 1 } } else { committed = 1 }
103
104 // verify EVERY record reads back exactly (the gate)
105 var verified: i64 = 0
106 i = 0
107 while i < nrec { if rc_streq_store(keys[i] as *u8, vals[i] as *u8, clen(vals[i] as *u8)) == 1 { verified = verified + 1 } i = i + 1 }
108
109 cw(" records=" as *u8); cn(nrec); cw(" written_this_pass=" as *u8); cn(towrite); cw(" verified=" as *u8); cn(verified); cw(" store=knowledge/store/rcen-\n" as *u8)
110 var ok: i64 = 1
111 if verified != nrec { ok = 0 }
112 if committed == 0 { ok = 0 }
113 if ok == 1 { cw("READER-CENSUS verdict=GREEN (code-defined census in the sovereign seg-store; verified byte-for-byte; NO TSV)\n" as *u8); sys_exit(0); return 0 }
114 cw("READER-CENSUS verdict=RED\n" as *u8); sys_exit(1); return 1
115}