code wiki / (root) / nx_mode.nx

nx_mode.nx

buildroot/runtime/nx_mode.nx

4976 B134 linesdepth 1pulls 1 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mode.nx -- WRITING arc, rung W-MODE-1: the data-driven MODE / PERSONA ROUTER. One assistant, many modes (correspondence / manga / erotica / paper / scenario / language / social). Each mode is a ROW in a registry (operator DATA, rule 11), tab-separated: mode <TAB> register <TAB> lane <TAB> structure register = sfw | mixed | explicit lane = tutor | local so the runner dispatches the right structure organ + governance + generation lane without any hardcoded per-mode logic. THE SEAM, MADE MECHANICAL (not a promise): md_seam_audit proves that EVERY explicit-register mode routes to the LOCAL lane. A registry that points an explicit mode at the tutor lane is a VIOLATION the audit COUNTS -- the operator's "Claude never authors explicit prose" rule is enforced by construction and checkable, exactly as the never-brick law is gate-proven rather than asserted. Pure integer, NO syscalls; reuses nx_scenario's line iterator (DRY). license_tier: ORIGINAL module: nishi-core.write.mode depends: nishi-core.write.scenario capability: WRITE_MODE_ROUTER

dependencies 1 imports · 3 importers

nx_scenario.nx nx_mode.nx nx_mode_gate.nx nx_writer_page.nx nx_writer_run.nx

imports: nx_scenario.nx

imported by: nx_mode_gate.nxnx_writer_page.nxnx_writer_run.nx

structs

none

consts

none

functions

23func md_streq(a: *u8, b: *u8) -> i64
called by 2: md_seam_auditmain
35func md_first_field_is(buf: *u8, n: i64, i: i64, mode: *u8) -> i64
called by 1: md_find_row
58func md_find_row(buf: *u8, n: i64, mode: *u8) -> i64
73func md_col(buf: *u8, n: i64, rowoff: i64, colidx: i64, out: *u8, cap: i64) -> i64
101func md_lookup(buf: *u8, n: i64, mode: *u8, colidx: i64, out: *u8, cap: i64) -> i64
108func md_register(buf: *u8, n: i64, mode: *u8, out: *u8, cap: i64) -> i64 { return md_lookup(buf, n, mode, 1, out, cap) }
called by 1: main calls 1: md_lookup
109func md_lane(buf: *u8, n: i64, mode: *u8, out: *u8, cap: i64) -> i64 { return md_lookup(buf, n, mode, 2, out, cap) }
called by 2: mainmain calls 1: md_lookup
110func md_structure(buf: *u8, n: i64, mode: *u8, out: *u8, cap: i64) -> i64 { return md_lookup(buf, n, mode, 3, out, cap) }
called by 2: mainmain calls 1: md_lookup
114func md_seam_audit(buf: *u8, n: i64, scratch: *u8, cap: i64) -> i64
called by 2: mainmain calls 3: md_colmd_streqsc_next_line