nx_formatlaw.nx
buildroot/runtime/nx_formatlaw.nx
about
nx_formatlaw.nx -- the SOURCE-LAW CLI over nx_formatlaw_lib: scan sources for durable legacy-format literals
(F1/F1J), third-party executable paths (F2) and a missing license_tier (F3); print every finding NAMED and
LOCATED; optionally file each one into the REVIEW QUEUE plane. Never blocks, never refuses a build.
nx_formatlaw scan <file.nx>... findings per file + a FORMATLAW summary line per file, exit 0 clean / 1 flagged
nx_formatlaw tree <dir> [<dir>...] every .nx directly under each dir (the two source roots), same output
nx_formatlaw review <actor> <file.nx>... scan AND append one 7-col row per finding to knowledge/store/review-
(id=fl_<fnv>, dedupe by id so a re-run files nothing twice)
nx_formatlaw hook PreToolUse/Write pre-flight: reads the hook JSON on stdin, scans the
`content` about to be written when `file_path` ends .nx, prints the
findings as advisories, ALWAYS exits 0
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_formatlaw_lib.nxnx_json_lib.nxnx_store_seed_lib.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
| 18 | const FLC_OUT: i64 = 262144 |
| 19 | const FLC_IN: i64 = 4194304 // the hook payload (a whole source file inside JSON): sized from the largest emitter (~340 KB) x 12 headroom |
| 20 | const FLC_PATH: i64 = 4096 |
| 21 | const FLC_LIT_SHOW: i64 = 120 // a literal is shown to this many bytes; the count is never trimmed |
| 22 | const FLC_DENTS: i64 = 65536 |
| 23 | const FLC_ROW: i64 = 2048 |
| 24 | const FLC_CH_NL: i64 = 10 |
| 25 | const FLC_CH_TAB: i64 = 9 |
| 26 | const FLC_CH_DOT: i64 = 46 |
| 27 | const FLC_CH_SLASH: i64 = 47 |
| 28 | const FLC_REVIEW_STATUS: *u8 = "open" |
| 29 | const FLC_REVIEW_SCOPE_PFX: *u8 = "formatlaw/" |
functions
| 31 | func flc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func flc_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p } |
| 33 | func flc_catn(d: *u8, o: i64, s: *u8, a: i64, e: i64) -> i64 { var p: i64 = o; var i: i64 = a; while i < e { d[p] = s[i]; p = p + 1; i = i + 1 } return p } called by 1: flc_report |
| 34 | func flc_num(d: *u8, o: i64, v: i64) -> i64 |
| 47 | func flc_hex(d: *u8, o: i64, v: i64) -> i64 called by 1: flc_report |
| 53 | func flc_ends(s: *u8, lit: *u8) -> i64 |
| 63 | func flc_report(label: *u8, b: *u8, n: i64, out: *u8, hits: *i64, counts: *i64, plane: *u8, actor: *u8, filed: *i64) -> i64 |
| 146 | func flc_scan_path(path: *u8, out: *u8, hits: *i64, counts: *i64, plane: *u8, actor: *u8, filed: *i64) -> i64 |
| 157 | func main(argc: i64, argv: *i64) -> i64 |