code wiki / _hdl_build / nx_claude_harvest.nx

nx_claude_harvest.nx

buildroot/runtime/_hdl_build/nx_claude_harvest.nx

59546 B1268 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tooltopic claude
docsdependenciesstructsconstsfunctions

about

nx_claude_harvest.nx -- CLAUDE TRANSCRIPT HARVESTER + OUTSIDE-GAUGE (miner-sota lane F964/F973, 2026-07-23). PORTABLE organ (gen-image pattern: runs where the transcripts live -- laptop WSL today, NAS, any host): parses Claude Code transcript JSONL into sovereign actlog frames, bulk-ingests staged frames into a journal (validated, marker-idempotent), and derives the outside_permil gauge (nishi vs outside tool split) that MUST FALL as capabilities move inside (MG00 baseline 651, 2026-07-23). Composes nx_sovjson_lib (sj_*) -- no helper dup (D001 discipline). State derived; journals append-only (O_APPEND, conflict-free, ws_sync lineage). No hw writes (Rule 26). frames <transcript.jsonl> <ws> <outjournal> -> parse transcript, append actlog frames; HARVEST OK ingest <framesfile> <journal> -> validated bulk append, idempotent by marker frame gauge <journal> [days] -> JSON outside_permil (0 days = all frames) selftest <scratch-prefix> -> gate T1..T8 (unique per-run scratch names) license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_claude_harvest.nx

imports: nx_sovjson_lib.nxnx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main sj_puts sys_write sys_exit sj_vlen sj_lit_eq ch_selftest gv_ctr sys_mmap gv_head gv_puts sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_mmap ↻ sj_cat sj_catn sys_mmap ↻ sys_openat_append sys_write ↻ sys_close ch_frames sys_mmap ↻ ch_read sys_openat_rd sys_read sys_close ↻ sys_openat_append ↻ sj_le ch_find_from ch_iso_epoch ch_digits sj_atoi_span ch_epoch_ymdhms ch_frame_write sj_catn ↻ sj_cat ↻ sys_write ↻ sys_close ↻

structs

none

consts

17const CH_MAGIC_146097: i64 = 146097
18const CH_MAGIC_719468: i64 = 719468
19const CH_MAGIC_86400: i64 = 86400
20const CH_MAGIC_3600: i64 = 3600
21const CH_MAGIC_1784764900: i64 = 1784764900
22const CH_MAGIC_1784764901: i64 = 1784764901
23const CH_MAGIC_1784764803: i64 = 1784764803
25const CH_WIN: i64 = 67108864
26const CH_JWIN: i64 = 4194304
27const CH_OUT: i64 = 65536
28const CH_LINE: i64 = 4096
29const CH_NAME_MAX: i64 = 120
30const CH_NAME_SCAN: i64 = 400
31const CH_MODE_644: i64 = 420
376const CH_WS_MAX: i64 = 4096
911const CH_MK_MAX: i64 = 64
912const CH_CONF_WIN: i64 = 65536
913const CH_TXTWIN: i64 = 262144

functions

33func ch_read(path: *u8, buf: *u8, cap: i64) -> i64
43func ch_find_from(q: *u8, from: i64, endlim: i64, lit: *u8) -> i64
61func ch_find(q: *u8, n: i64, lit: *u8) -> i64
66func ch_starts(q: *u8, s: i64, e: i64, lit: *u8) -> i64
75func ch_digits(q: *u8, s: i64, e: i64) -> i64
82func ch_epoch_ymdhms(y: i64, mo: i64, d: i64, h: i64, mi: i64, s: i64) -> i64
called by 1: ch_iso_epoch
94func ch_iso_epoch(q: *u8, s: i64, lim: i64) -> i64
120func ch_frame_write(fd: i64, ln: *u8, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8, note: *u8) -> i64
137func ch_frame_append(path: *u8, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8, note: *u8) -> i64
148func ch_frames(tpath: *u8, ws: *u8, outj: *u8, tcx: *i64) -> i64
208func ch_hwm_read(path: *u8) -> i64
220func ch_hwm_write(path: *u8, v: i64) -> i64
230func ch_delta(tpath: *u8, ws: *u8, outj: *u8, hwmpath: *u8, hcx: *i64) -> i64
302func ch_ingest(fpath: *u8, jpath: *u8, mcx: *i64) -> i64
355func ch_nishi_tool(q: *u8, s: i64, e: i64) -> i64
called by 2: ch_bootgaugech_gauge_calc calls 1: ch_starts
362func ch_key(d: *u8, o: i64, name: *u8) -> i64
called by 2: ch_bootgaugech_gauge_json calls 1: sj_cat
377func ch_bg_intern(q: *u8, cs: i64, ce: i64, wss: *i64, wse: *i64, np: *i64) -> i64
called by 1: ch_bootgauge
394func ch_bootgauge(journal: *u8, k: i64, d: *u8) -> i64
467func ch_gauge_calc(jpath: *u8, days: i64, g: *i64) -> i64
513func ch_gauge_json(jpath: *u8, days: i64, d: *u8) -> i64
554func ch_page(jpath: *u8, outp: *u8, days: i64) -> i64
599func ch_allow_path(name: *u8, outp: *u8) -> i64 { return sj_allow_path(name, outp) }
called by 1: ch_propose calls 1: sj_allow_path
600func ch_propose(jpath: *u8, ipath: *u8, thr: i64, filer: *u8, cout: *u8, colen: *i64) -> i64
638func ch_selftest(prefix: *u8) -> i64
917func ch_run_of(q: *u8, s: i64, e: i64, g: *u8) -> i64
called by 1: ch_rank_text calls 1: sj_vlen
946func ch_conf_load(path: *u8, cbuf: *u8, mk: *i64, sc: *i64) -> i64
993func ch_isalpha(c: u8) -> i64
called by 1: ch_rank_text
1002func ch_rank_text(q: *u8, s: i64, e: i64, cbuf: *u8, mk: *i64, sc: *i64) -> i64
1032func ch_learn(tpath: *u8, ws: *u8, outp: *u8, confp: *u8, cx: *i64) -> i64
1141func main(argc: i64, argv: *i64) -> i64