code wiki / _hdl_build / nx_cms_comments.nx
nx_cms_comments.nx
buildroot/runtime/_hdl_build/nx_cms_comments.nx
about
nx_cms_comments.nx -- CMS COMMENT MODERATION (sovereign, offline, integer-deterministic).
The WordPress comments+Akismet class, made Nishi-native: spam scoring is a REPRODUCIBLE integer
heuristic computed ON-BOX (comments NEVER leave the machine for a cloud anti-spam service =
privacy-native, the exceed angle over Akismet), and the moderation state machine is EXACT. A
comment is innocent until a real moderation transition; public render shows ONLY approved comments
(pending/spam/trash are withheld) so spam NEVER auto-publishes. Legit comments are not stripped
(rule 25): a single weak signal stays below threshold and lands in the queue, not the spam bin.
Weights/threshold are the data-driven seam (production reads svc-config; rule 11). Composes the
nx_cms_store record format. license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_aw_devserver.nxnx_cms_comments_gate.nxnx_cms_forum.nxnx_cms_forum_gate.nx
structs
| none |
consts
| 13 | const NX_CMT_PENDING: i64 = 0 |
| 14 | const NX_CMT_APPROVED: i64 = 1 |
| 15 | const NX_CMT_SPAM: i64 = 2 |
| 16 | const NX_CMT_TRASH: i64 = 3 |
| 19 | const NX_CMT_W_LINK: i64 = 3 // per embedded link (http / https token) |
| 20 | const NX_CMT_W_BANNED: i64 = 5 // per banned-token hit |
| 21 | const NX_CMT_SPAM_THRESHOLD: i64 = 6 // score >= threshold -> auto-spam (needs 2+ signals; one weak hit stays PENDING) |
functions
| 23 | func cmt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: cmt_count |
| 26 | func cmt_count(buf: *u8, n: i64, pat: *u8) -> i64 |
| 42 | func cmt_score(buf: *u8, n: i64) -> i64 |
| 53 | func cmt_classify(score: i64) -> i64 |
| 60 | func cmt_can_moderate(from: i64, to: i64) -> i64 called by 1: main |
| 70 | func cmt_visible_public(status: i64) -> i64 { if status == NX_CMT_APPROVED { return 1 } return 0 } |