code wiki / (root) / nx_warden_lib.nx

nx_warden_lib.nx

buildroot/runtime/nx_warden_lib.nx

3494 B94 linesdepth 2pulls 2 transitivereach 9 importersview sourcekind librarytopic warden
docsdependenciesstructsconstsfunctions

about

nx_warden_lib.nx -- the Warden's reusable POLICY (no main). The single source of cardinal-truth for autonomous actions, so every role-program that must authorize an action (the Conductor/guardian self-heal, the demo cockpit) shares ONE policy -- no duplicated cardinals (the genealogist's reuse discipline). Law (inherited cardinals): #13 additive-only (never hard-delete, never overwrite source autonomously); additive-safe heal (swap-to-known-good only if a proven backup exists AND the target is a regenerable build artifact); DENY-by-default. license_tier: ORIGINAL

dependencies 1 imports · 7 importers

nx_syscalls.nx nx_warden_lib.nx nx_conductor_live.nx nx_council_gate.nx nx_crew_selfheal.nx nx_import_probe.nx nx_self_build.nx nx_unified_conductor.nx nx_warden.nx

imports: nx_syscalls.nx

imported by: nx_conductor_live.nxnx_council_gate.nxnx_crew_selfheal.nxnx_import_probe.nxnx_self_build.nxnx_unified_conductor.nxnx_warden.nx

structs

none

consts

13const W_HEAL_SWAP: i64 = 1 // restore a pinned known-good over a build artifact
14const W_DELETE: i64 = 2 // hard-delete a path
15const W_OVERWRITE_SRC: i64 = 3 // overwrite a source file
16const W_ADDITIVE: i64 = 4 // append / write a NEW file (additive)
18const W_ALLOW: i64 = 1
19const W_DENY: i64 = 0
21const W_AUDIT: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_warden_audit.log"
22const W_MODE_FILE: i64 = 420

functions

24func w_wstr(fd: i64, s: *u8) -> i64
called by 1: w_audit calls 1: sys_write
32func w_contains(hay: *u8, needle: *u8) -> i64
called by 1: w_is_build_artifact
48func w_kind_name(k: i64) -> *u8
58func w_is_build_artifact(path: *u8) -> i64
called by 1: warden_check calls 1: w_contains
65func warden_check(kind: i64, target: *u8, has_backup: i64) -> i64
77func w_audit(kind: i64, target: *u8, verdict: i64) -> i64
90func warden_authorize(kind: i64, target: *u8, has_backup: i64) -> i64