code wiki / (root) / nx_tsvdrain.nx

nx_tsvdrain.nx

buildroot/runtime/nx_tsvdrain.nx

18492 B350 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_tsvdrain.nx -- DRAIN THE TSV LANE: migrate every UNCONSUMED .tsv into a sovereign plane, then retire the third-party file, reversibly. Composes nx_tsvcensus's partition with the two proven organs. WHY: nx_tsvcensus named 44 unconsumed .tsv files across the two knowledge trees. Doing them by hand is two tool calls plus a verification each -- the same tooling gap that made the census itself look "too slow", and a tooling gap is never a licence to sample a subset and call the lane drained. MIGRATE-THEN-RETIRE IS THE ORDER, AND IT IS NOT COSMETIC. Retiring alone would discard measured rows; migrating alone would leave the third-party format in the tree. Evidence files are NOT a special case for the ACTION -- every row survives as sovereign data -- they are only a reason never to retire WITHOUT migrating first. FAIL-SAFE BY CONSTRUCTION (rule 26 / the destructive-heuristic law): - DRY IS THE DEFAULT. Passing nothing prints the plan and changes nothing. Only the literal verb `apply` acts, so a mistyped argument does nothing rather than something. - A file is retired ONLY IF its migrate printed TSV-MIGRATE GREEN *and* verified=1. Any other outcome leaves the source exactly where it is and is counted as SKIPPED, never as done. - Retirement goes through nx_retire_path, which renames and never deletes. - If the census cannot prove coverage, NOTHING is planned and NOTHING is applied. usage: nx_tsvdrain <tsv-root> <src-root> <ext> [apply] exit 0 OK | 1 SOME-SKIPPED | 3 UNPROVEN (partial coverage -- no plan issued) | 2 usage license_tier: ORIGINAL Writes only via nx_tsv_migrate (additive) and nx_retire_path (rename). Rule 26.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_lib_std.nx nx_tsvdrain.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_lib_std.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main td_puts sys_write sys_chdir sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ td_at sys_mmap ↻ tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close_inherited sys_close_inherited_proc sys_openat_rd sys_mmap ↻ sys_getdents64 dirent_reclen sys_close ↻ sys_munmap sys_execve tr_exec_failed sys_write ↻ sys_exit ↻

structs

none

consts

28const TD_SHELLTOOL: *u8 = "/volume1/homes/elderwesto/nishihost/nx_shelltool.elf"
29const TD_MIGRATE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_tsv_migrate.elf"
30const TD_RETIRE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_retire_path.elf"
31const TD_PLANE_ROOT: *u8 = "knowledge/store/"
34const TD_CAPTURE_CAP: i64 = 8388608
35const TD_SMALL_CAP: i64 = 65536
36const TD_MAXTSV: i64 = 8192
37const TD_RC_SKIPPED: i64 = 1
38const TD_RC_USAGE: i64 = 2
39const TD_RC_UNPROVEN: i64 = 3
40const TD_SLASH: i64 = 47
41const TD_LF: i64 = 10
42const TD_DASH: i64 = 45
43const TD_DOT: i64 = 46

functions

45func td_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
46func td_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
59func td_at(buf: *u8, i: i64, n: i64, needle: *u8) -> i64
68func td_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 2: td_partialmain calls 1: td_at
73func td_num_after(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: td_at
97func td_has_span(hay: *u8, hl: i64, nee: *u8, ns: i64, nl: i64) -> i64
called by 1: main
109func td_partial(buf: *u8, n: i64) -> i64
called by 1: main calls 1: td_has
116func td_dup(src: *u8, s: i64, l: i64) -> *u8
called by 1: main calls 1: sys_mmap
135func td_plane(path: *u8, pl: i64) -> *u8
called by 1: main calls 1: sys_mmap
164func main(argc: i64, argv: *i64) -> i64