code wiki / _hdl_build / nx_actlog.nx

nx_actlog.nx

buildroot/runtime/_hdl_build/nx_actlog.nx

59646 B1334 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_actlog.nx -- ACTION LOG + WORKFLOW SEQUENCE MINER (ws=ws-intel3, 2026-07-20). F217 completion (loop design-of-record R3): every cycle action journaled (ws/tool/verb/ outcome) + the nx_workflow_mine half = n-gram mining over per-workstream action sequences. Recurring tool:verb bigrams/trigrams with support >= minsup are the EMPIRICAL workflow candidates (executed patterns, not combinatorial proposals -- the complement of nx_atlas_discover). The loop: sessions/seats/plans LOG actions -> mine surfaces patterns -> proposals enter nx_pm_intake -> PM/LLM seat triages -> catalog verb. Sequences NEVER cross workstream boundaries (per-ws successor chains). State derived, append-only, conflict-free (O_APPEND; ws_sync lineage). Frame: <ts>\t<ws>\t<tool>\t<verb>\t<outcome>\t<note> SCALE LAW: windowed reads + declared envelope (window_bytes/truncated/bigrams_capped/ trigrams_capped); O(n^3) pair scan honest for journal-window scale, declared. license_tier: ORIGINAL No hw writes (Rule 26). log <journal> <ws> <tool> <verb> <outcome> <note> -> ACTLOG OK mine <journal> [minsup] -> JSON (default minsup 2) freq <journal> -> JSON per-tool:verb counts, ranked (the fallback-log ranking verb; F872 rung 2) harden <journal> [minsup] [filer] -> every tool:verb recurring >= minsup auto-files a hardening debt via the ALLOWLIST-RESOLVED filer (default nx_debt; count-free canonical desc => idempotent) selftest <scratch-journal> -> gate T1..T9 (caller pre-cleans)

dependencies 4 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_actlog.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 gv_puts sys_write sys_exit al_vlen sj_vlen al_lit_eq al_selftest gv_ctr sys_mmap gv_head gv_puts ↻ sys_openat_wr sys_close sys_mmap ↻ al_read sys_openat_rd sys_read sys_close ↻ gv_check gv_puts ↻ al_append sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_mmap ↻ al_catn sj_catn sys_mmap ↻ al_cat sj_cat sys_openat_append sys_write ↻ sys_close ↻ al_frames al_le sj_le al_succ sys_mmap ↻ al_le ↻

structs

none

consts

27const AL_MAGIC_5381: i64 = 5381
28const AL_MAGIC_1100: i64 = 1100
29const AL_MAGIC_1101: i64 = 1101
30const AL_MAGIC_1102: i64 = 1102
31const AL_MAGIC_1103: i64 = 1103
32const AL_MAGIC_1104: i64 = 1104
33const AL_MAGIC_1105: i64 = 1105
34const AL_MAGIC_1106: i64 = 1106
35const AL_MAGIC_1107: i64 = 1107
36const AL_MAGIC_1108: i64 = 1108
37const AL_MAGIC_1110: i64 = 1110
38const AL_MAGIC_1111: i64 = 1111
39const AL_MAGIC_1112: i64 = 1112
40const AL_MAGIC_1113: i64 = 1113
41const AL_MAGIC_1114: i64 = 1114
42const AL_MAGIC_1115: i64 = 1115
43const AL_MAGIC_4096: i64 = 4096
44const AL_MAGIC_1500: i64 = 1500
45const AL_MAGIC_1024: i64 = 1024
46const AL_MAGIC_4090: i64 = 4090
48const AL_WIN: i64 = 4194304
49const AL_OUT: i64 = 262144
50const AL_SOFT: i64 = 49152
51const AL_NAME_MAX: i64 = 120
52const AL_MINSUP_DEF: i64 = 2
53const AL_BIGRAM_CAP: i64 = 30
54const AL_TRIGRAM_CAP: i64 = 15
55const AL_FREQ_CAP: i64 = 30
56const AL_FREQ_SLOTS: i64 = 256
57const AL_HARDEN_SEV: i64 = 5
58const AL_HARDEN_CAP: i64 = 10
59const AL_ALLOW_BUF: i64 = 131072
60const AL_IX_TVMAX: i64 = 4096
61const AL_IX_HSLOTS: i64 = 8193
62const AL_IX_GMAX: i64 = 16384
63const AL_IX_GHSLOTS: i64 = 32771
64const AL_IX_ARENA: i64 = 1048576
65const AL_IX_HMOD: i64 = 1000003
66const AL_IX_KEYB: i64 = 8192
67const AL_IX_RING: i64 = 9
68const AL_IX_MAXGAP: i64 = 8

functions

71func al_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) }
72func al_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) }
73func al_vlen(s: *u8) -> i64 { return sj_vlen(s) }
74func al_atoi_z(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: main
75func al_read(path: *u8, buf: *u8, cap: i64) -> i64
84func al_append(journal: *u8, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8, note: *u8) -> i64
116func al_le(q: *u8, i: i64, n: i64) -> i64 { return sj_le(q, i, n) }
117func al_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 { return sj_col(q, ls, le, c, out) }
118func al_span_eq(q: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64
called by 2: al_succal_tv_eq
124func al_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 2: al_selftestmain
130func al_frames(q: *u8, n: i64) -> i64
138func al_succ(q: *u8, cx: *i64, ls: i64) -> i64
153func al_tv_eq(q: *u8, cx: *i64, l1: i64, l2: i64) -> i64
168func al_bg_eq(q: *u8, cx: *i64, i: i64, j: i64, i2: i64, j2: i64) -> i64
174func al_bg_first(q: *u8, cx: *i64, i: i64, j: i64) -> i64
called by 1: al_mine_json calls 3: al_leal_succal_bg_eq
185func al_bg_support(q: *u8, cx: *i64, i: i64, j: i64) -> i64
198func al_tg_first(q: *u8, cx: *i64, i: i64, j: i64, k2: i64) -> i64
212func al_tg_support(q: *u8, cx: *i64, i: i64, j: i64, k2: i64) -> i64
227func al_jesc(d: *u8, o: i64, q: *u8, s: i64, e: i64, maxb: i64) -> i64
241func al_key(d: *u8, o: i64, name: *u8) -> i64
251func al_qlit(d: *u8, o: i64, s: *u8) -> i64
259func al_emit_tv(d: *u8, o: i64, q: *u8, cx: *i64, l: i64) -> i64
271func al_mine_json(q: *u8, cx: *i64, minsup: i64, d: *u8) -> i64
387func al_find(d: *u8, dn: i64, lit: *u8) -> i64
called by 2: al_bench_caseal_selftest calls 1: al_vlen
405func al_tv_count(q: *u8, cx: *i64, l: i64) -> i64
416func al_tv_first(q: *u8, cx: *i64, l: i64) -> i64
425func al_freq_json(q: *u8, cx: *i64, d: *u8) -> i64
506func al_allow_path(name: *u8, outp: *u8) -> i64 { return sj_allow_path(name, outp) }
called by 1: al_harden_json calls 1: sj_allow_path
507func al_harden_json(q: *u8, cx: *i64, minsup: i64, sev: i64, filer: *u8, d: *u8) -> i64
613func al_z_eq(a: *u8, b: *u8) -> i64
called by 1: al_ix_sintern
619func al_z_hash(s: *u8) -> i64
called by 1: al_ix_sintern
626func al_ix_sintern(z: *u8, hash: *i64, off: *i64, hslots: i64, maxn: i64, ar: *u8, an: *i64, nn: *i64) -> i64
called by 1: al_ix_build calls 3: al_z_hashal_vlenal_z_eq
652func al_ix_kintern(key: i64, hash: *i64, keys: *i64, hslots: i64, maxn: i64, nn: *i64) -> i64
called by 1: al_ix_build
675func al_ix_build(q: *u8, cx: *i64, ix: *i64, maxgap: i64) -> i64
764func al_ix_tv_emit(d: *u8, o: i64, ar: *u8, off: i64) -> i64
772func al_freq_fast(q: *u8, cx: *i64, d: *u8) -> i64
843func al_bg_is_closed(a: i64, b: i64, sup: i64, tgkey: *i64, tgcnt: *i64, ntg: i64) -> i64
called by 1: al_mine_fast
857func al_mine_fast(q: *u8, cx: *i64, minsup: i64, maxgap: i64, closed: i64, d: *u8) -> i64
995func al_bench_path(dst: *u8, prefix: *u8, now: i64, sfx: *u8) -> i64
1006func al_bench_case(ctr: *i64, name: *u8, jr: *u8, minsup: i64, maxgap: i64, needle: *u8, want: i64) -> i64
1025func al_bench(prefix: *u8) -> i64
1097func al_selftest(journal: *u8) -> i64
1240func main(argc: i64, argv: *i64) -> i64