code wiki / _hdl_build / nx_claude_harvest.nx
nx_claude_harvest.nx
buildroot/runtime/_hdl_build/nx_claude_harvest.nx
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
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
structs
| none |
consts
| 17 | const CH_MAGIC_146097: i64 = 146097 |
| 18 | const CH_MAGIC_719468: i64 = 719468 |
| 19 | const CH_MAGIC_86400: i64 = 86400 |
| 20 | const CH_MAGIC_3600: i64 = 3600 |
| 21 | const CH_MAGIC_1784764900: i64 = 1784764900 |
| 22 | const CH_MAGIC_1784764901: i64 = 1784764901 |
| 23 | const CH_MAGIC_1784764803: i64 = 1784764803 |
| 25 | const CH_WIN: i64 = 67108864 |
| 26 | const CH_JWIN: i64 = 4194304 |
| 27 | const CH_OUT: i64 = 65536 |
| 28 | const CH_LINE: i64 = 4096 |
| 29 | const CH_NAME_MAX: i64 = 120 |
| 30 | const CH_NAME_SCAN: i64 = 400 |
| 31 | const CH_MODE_644: i64 = 420 |
| 376 | const CH_WS_MAX: i64 = 4096 |
| 911 | const CH_MK_MAX: i64 = 64 |
| 912 | const CH_CONF_WIN: i64 = 65536 |
| 913 | const CH_TXTWIN: i64 = 262144 |
functions
| 33 | func ch_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 9: ch_framesch_deltach_ingestch_bootgaugech_gauge_calcch_propose+3 calls 3: sys_openat_rdsys_readsys_close |
| 43 | func ch_find_from(q: *u8, from: i64, endlim: i64, lit: *u8) -> i64 |
| 61 | func ch_find(q: *u8, n: i64, lit: *u8) -> i64 |
| 66 | func ch_starts(q: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 75 | func ch_digits(q: *u8, s: i64, e: i64) -> i64 |
| 82 | func ch_epoch_ymdhms(y: i64, mo: i64, d: i64, h: i64, mi: i64, s: i64) -> i64 called by 1: ch_iso_epoch |
| 94 | func ch_iso_epoch(q: *u8, s: i64, lim: i64) -> i64 |
| 120 | func ch_frame_write(fd: i64, ln: *u8, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8, note: *u8) -> i64 |
| 137 | func ch_frame_append(path: *u8, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8, note: *u8) -> i64 |
| 148 | func ch_frames(tpath: *u8, ws: *u8, outj: *u8, tcx: *i64) -> i64 called by 2: ch_selftestmain calls 8: sys_mmapch_readsys_openat_appendsj_lech_find_fromch_iso_epoch+2 |
| 208 | func ch_hwm_read(path: *u8) -> i64 |
| 220 | func ch_hwm_write(path: *u8, v: i64) -> i64 |
| 230 | func ch_delta(tpath: *u8, ws: *u8, outj: *u8, hwmpath: *u8, hcx: *i64) -> i64 called by 2: ch_selftestmain calls 10: sys_mmapch_readch_hwm_readsys_openat_appendsj_lech_find_from+4 |
| 302 | func ch_ingest(fpath: *u8, jpath: *u8, mcx: *i64) -> i64 |
| 355 | func ch_nishi_tool(q: *u8, s: i64, e: i64) -> i64 |
| 362 | func ch_key(d: *u8, o: i64, name: *u8) -> i64 |
| 377 | func ch_bg_intern(q: *u8, cs: i64, ce: i64, wss: *i64, wse: *i64, np: *i64) -> i64 called by 1: ch_bootgauge |
| 394 | func ch_bootgauge(journal: *u8, k: i64, d: *u8) -> i64 |
| 467 | func ch_gauge_calc(jpath: *u8, days: i64, g: *i64) -> i64 called by 3: ch_gauge_jsonch_pagech_propose calls 8: sys_mmapch_readsys_now_realtime_secsj_lesj_colch_digits+2 |
| 513 | func ch_gauge_json(jpath: *u8, days: i64, d: *u8) -> i64 |
| 554 | func ch_page(jpath: *u8, outp: *u8, days: i64) -> i64 |
| 599 | func ch_allow_path(name: *u8, outp: *u8) -> i64 { return sj_allow_path(name, outp) } |
| 600 | func ch_propose(jpath: *u8, ipath: *u8, thr: i64, filer: *u8, cout: *u8, colen: *i64) -> i64 |
| 638 | func ch_selftest(prefix: *u8) -> i64 |
| 917 | func ch_run_of(q: *u8, s: i64, e: i64, g: *u8) -> i64 |
| 946 | func ch_conf_load(path: *u8, cbuf: *u8, mk: *i64, sc: *i64) -> i64 |
| 993 | func ch_isalpha(c: u8) -> i64 called by 1: ch_rank_text |
| 1002 | func ch_rank_text(q: *u8, s: i64, e: i64, cbuf: *u8, mk: *i64, sc: *i64) -> i64 |
| 1032 | func ch_learn(tpath: *u8, ws: *u8, outp: *u8, confp: *u8, cx: *i64) -> i64 called by 2: ch_selftestmain calls 12: sys_mmapch_conf_loadch_readsys_openat_appendsj_lech_find_from+6 |
| 1141 | func main(argc: i64, argv: *i64) -> i64 |