code wiki / (root) / nx_scaffolding_audit.nx

nx_scaffolding_audit.nx

buildroot/runtime/nx_scaffolding_audit.nx

20024 B389 linesdepth 6pulls 10 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_scaffolding_audit.nx -- REPO-FILE audit primitive that enforces the no-temporary-third-party-scaffolding-when-substrate-arc-exists cardinal. AUDIT-FIRST CORRECTION (2026-05-20, post-creation): user caught that I built this without checking for existing prior art. The substrate already ships an audit family: - nx_audit_dashboard.nx : substrate-STATE aggregation (hunter kills / gatherer yields / xenocell alerts / immune health / book unseen-alert / organism pressure / pollinate pending) - nx_audit_server_daemon.nx : exposes substrate state over HTTP - nx_audit_server_main.nx : daemon entry point - nx_audit_compose_test.nx : test harness - nx_ai_audit.nx : AI-output audit - nx_adversarial_pattern_audit.nx: adversarial input pattern detection THIS primitive (nx_scaffolding_audit) is a DIFFERENT DOMAIN: it audits REPO FILES against the SCAFFOLDING_REPLACED_BY cardinal. Distinct from the substrate-state-aggregation primitives above. However it could COMPOSE INTO the dashboard: future nx_audit_dashboard rows could include a "scaffolding violations" counter sourced from nx_saudit_run, surfacing the cardinal-compliance state alongside other substrate health metrics. Per feedback-no-temporary-third-party-scaffolding-when-substrate-arc-exists audit-first rule: ls nxc2/runtime/ before authoring new primitives. module: nishi-core.ops.scaffolding_audit depends: nishi-core.perception.profile + nishi-core.io.syscalls disk_kb: 9 capability: OPS wired_status: PARTIAL_WIRED (nx_saudit_check_one_file + nx_saudit_run both GRADUATED to basic-glue 2026-05-20: compose sys_read_file + nx_str_find + nx_dir_list; refuses self-exempt loophole at substrate level; aggregates per-file findings into NxSauditSummary; rest of entries still PARTIAL_WIRED)

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_perceptual_profile.nx nx_string_ops.nx nx_dir.nx nx_scaffolding_audit.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_string_ops.nxnx_dir.nx

imported by: nobody (leaf or entry point)

structs

138struct NxSauditFinding
154struct NxSauditSummary

consts

89const NX_SAUDIT_VIOLATION_MISSING_HEADER: i64 = 1 // no SCAFFOLDING_REPLACED_BY line
90const NX_SAUDIT_VIOLATION_BAD_REFERENCE: i64 = 2 // named primitive file missing
91const NX_SAUDIT_VIOLATION_SUNSET_OVERDUE: i64 = 4 // primitive FULLY_WIRED;
93const NX_SAUDIT_VIOLATION_AUDITOR_SELF_EXEMPT: i64 = 8 // ANY file claiming
110const NX_SAUDIT_SCOPE_OPS_DIR: i64 = 1 // bench/ops/*
111const NX_SAUDIT_SCOPE_OPERATIONAL_FILENAME: i64 = 2 // nishifamily_* etc
112const NX_SAUDIT_SCOPE_CONTENT_HEURISTIC: i64 = 3 // grep for nginx/sudo/etc
113const NX_SAUDIT_SCOPE_OUT_OF_SCOPE: i64 = 4 // substrate-test prefixes
125const NX_SAUDIT_VERDICT_CLEAN: i64 = 0
126const NX_SAUDIT_VERDICT_VIOLATIONS_PRESENT: i64 = 1 // any violation class
127const NX_SAUDIT_VERDICT_DEPENDENCY_MISSING: i64 = 2 // PARTIAL_WIRED default

functions

97func nx_saudit_violation_name(v: i64) -> *u8
115func nx_saudit_scope_name(s: i64) -> *u8
129func nx_saudit_verdict_name(v: i64) -> *u8
183func nx_saudit_run(repo_root_ptr: *u8, repo_root_len: i64,
300func nx_saudit_check_one_file(file_path_ptr: *u8, file_path_len: i64,
368func nx_saudit_in_scope(file_path_ptr: *u8, file_path_len: i64) -> i64
378func nx_saudit_refuse_self_exempt(file_path_ptr: *u8, file_path_len: i64) -> i64
387func nx_saudit_get_last_verdict() -> i64