code wiki / _hdl_build / nx_cms_comments.nx

nx_cms_comments.nx

buildroot/runtime/_hdl_build/nx_cms_comments.nx

3744 B70 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic cms
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_cms_comments.nx nx_aw_devserver.nx nx_cms_comments_gate.nx nx_cms_forum.nx nx_cms_forum_gate.nx

imports: nx_syscalls.nx

imported by: nx_aw_devserver.nxnx_cms_comments_gate.nxnx_cms_forum.nxnx_cms_forum_gate.nx

structs

none

consts

13const NX_CMT_PENDING: i64 = 0
14const NX_CMT_APPROVED: i64 = 1
15const NX_CMT_SPAM: i64 = 2
16const NX_CMT_TRASH: i64 = 3
19const NX_CMT_W_LINK: i64 = 3 // per embedded link (http / https token)
20const NX_CMT_W_BANNED: i64 = 5 // per banned-token hit
21const NX_CMT_SPAM_THRESHOLD: i64 = 6 // score >= threshold -> auto-spam (needs 2+ signals; one weak hit stays PENDING)

functions

23func 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
26func cmt_count(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: cmt_score calls 1: cmt_slen
42func cmt_score(buf: *u8, n: i64) -> i64
called by 2: mainforum_post_reply calls 1: cmt_count
53func cmt_classify(score: i64) -> i64
60func cmt_can_moderate(from: i64, to: i64) -> i64
called by 1: main
70func cmt_visible_public(status: i64) -> i64 { if status == NX_CMT_APPROVED { return 1 } return 0 }