code wiki / (root) / nx_antipattern_catalog.nx

nx_antipattern_catalog.nx

buildroot/runtime/nx_antipattern_catalog.nx

36526 B518 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_antipattern_catalog.nx -- THE SOVEREIGN ANTI-PATTERN CATALOG + LIVE MECHANICAL SCANNER. Operator: "grab a FULL and I mean full comprehensive list of anti-patterns, dark patterns, bad shapes, wrong shapes ... these are well documented if you use nishi researcher + census + auditor ... AND our OWN anti-patterns like 3rd-party formats/tools/license/patent/legal issues -- truly independent, our own hardware sensors..supercomputers." This is the REPORT-step VOCABULARY of the autonomy loop, made sovereign. GROUNDED (Rule 4): the researcher (nx_research_fetch) banked 20 authoritative sources into knowledge/fetched/ap_*.raw; a census/synth pass distilled 162 patterns -> durably banked at knowledge/registry/antipattern_catalog_synth_2026-07-03.json. THIS organ is the LIVE tier: (1) the canonical registry (data-driven rows, expandable -- Cardinal 11), and (2) a MECHANICAL SCANNER that PROVES anti-patterns in a real target file (open it + detect fingerprints) -- the prove-not-assert discipline, the same as nx_rung_eval. Two tiers: MECHANICAL (here, always-on, grep/scan-detectable) vs SEMANTIC (the deep LLM-auditor tier; those rows are reference vocabulary only -- flagged mechanically_detectable=NO). COMPOSES not duplicates (Cardinal 15): magic-number detection reuses the proven nx_magicnum_benchmark algorithm; god-function/complexity thresholds live in nx_quality_grade; circular-dep is nx_dep_graph SCC; sovereignty (patent/license/3rd-party) composes nx_license_wall_audit + nx_patent_check + nx_self_audit. license_tier: ORIGINAL genealogy_id: international-research-sources/{anti-pattern,code-smell,dark-pattern,owasp,solid} + operator-2026-07-03 lineage_id: nishi_antipattern_catalog_v1 expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_dir.nx nx_antipattern_catalog.nx

imports: nx_syscalls.nxnx_dir.nx

imported by: nobody (leaf or entry point)

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

main ap_streq ap_puts sys_write ap_scan_file sys_mmap ap_read sys_openat_rd sys_read sys_close ap_puts ↻ ap_count_marker ap_slen ap_count_code ap_slen ↻ ap_is_digit ap_is_alnum_us ap_putn sys_write ↻ sys_mmap ↻ ap_putn ↻ ap_sovereign_scan sys_mmap ↻ ap_read ↻ ap_puts ↻ ap_count_code ↻ ap_putn ↻ sys_mmap ↻ nx_dir_list nx_openat nx_dirent_read nx_dirent_iter nx_dir_is_dotlike nx_dir_name_strlen nx_dir_arena_copy_name ap_read ↻ ap_row ap_puts ↻ AP_CAT_CODE_SMELL AP_CAT_ARCH

structs

none

consts

23const AP_MAGIC_2026: i64 = 2026
25const AP_BUF: i64 = 1048576
26const AP_SWEEP_CAP: i64 = 16384 // max dir entries enumerated per sweep (runtime/ is large)

functions

29func AP_CAT_CODE_SMELL() -> *u8 { return "CODE_SMELL\x00" as *u8 }
called by 1: main
30func AP_CAT_ARCH() -> *u8 { return "ARCHITECTURAL\x00" as *u8 }
called by 1: main
31func AP_CAT_DARK() -> *u8 { return "DARK_PATTERN\x00" as *u8 }
called by 1: main
32func AP_CAT_SECURITY() -> *u8 { return "SECURITY\x00" as *u8 }
33func AP_CAT_CONCURRENCY() -> *u8 { return "CONCURRENCY\x00" as *u8 }
34func AP_CAT_DESIGN() -> *u8 { return "DESIGN_PRINCIPLE_VIOLATION\x00" as *u8 }
35func AP_CAT_SOVEREIGNTY() -> *u8 { return "NISHI_SOVEREIGNTY\x00" as *u8 } // OUR OWN category (operator ask)
called by 1: main
36func AP_CAT_INCOMPLETE() -> *u8 { return "INCOMPLETE_WORK\x00" as *u8 } // orphan/stub -> route to queue
called by 1: main
37func AP_CAT_RESOURCE() -> *u8 { return "RESOURCE_WASTE\x00" as *u8 } // Cardinal 21: the GC-free leak-by-construction class (AP_MAGIC_2026-07-05 OOM arc)
called by 1: main
39func ap_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
40func ap_putn(v: i64) -> i64
47func ap_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
48func ap_is_digit(c: u8) -> i64 { if c >= (48 as u8) { if c <= (57 as u8) { return 1 } } return 0 }
called by 1: ap_count_code
49func ap_is_alnum_us(c: u8) -> i64
called by 1: ap_count_code
61func ap_count_marker(buf: *u8, total: i64, needle: *u8) -> i64
called by 1: ap_scan_file calls 1: ap_slen
83func ap_count_code(buf: *u8, total: i64, needle: *u8) -> i64
111func ap_count_mmap_in_loop(buf: *u8, total: i64) -> i64
163func ap_count(buf: *u8, total: i64, needle: *u8) -> i64
177func ap_match_at(buf: *u8, i: i64, total: i64, lit: *u8) -> i64
183func ap_count_magic(buf: *u8, total: i64) -> i64
210func ap_read(path: *u8, buf: *u8) -> i64
219func ap_row(name: *u8, cat: *u8, detectable: *u8, cardinal: *u8) -> i64
227func ap_scan_file(path: *u8) -> i64
269func ap_sovereign_scan(path: *u8, verbose: i64) -> i64
314func ap_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 }
316func main(argc: i64, argv: *i64) -> i64