code wiki / (root) / nx_book.nx

nx_book.nx

buildroot/runtime/nx_book.nx

6740 B208 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic book
docsdependenciesstructsconstsfunctions

about

nx_book.nx -- family ledger / operator-visible log. Per [[feedback-captain-moroni-doctrine]]: "All bypass events logged in books. Audit trail accessible to family." THE canonical operator-visible append-only ledger. Distinct from internal-detail logs (nx_evict_journal / nx_provenance_chain) which are forensic; nx_book is the human-readable, family-facing audit trail. Per [[feedback-self-surfacing-intelligence-staged-autonomy]]: when the substrate takes any significant action (twin-key authorized, drone deployed, sanctuary opened, reclaim applied, failover executed), the BOOK records it loud + structured so the family reviewer can read what happened without grep'ing 47 JSONL files. Composes: nx_twin_key -- every twin-key authorization writes a book row nx_drone_doctrine -- every drone session deployment writes a row nx_transponder_quiescence -- every emergency_override writes a row nx_reclaim -- every reclamation safety envelope writes a row nx_promote -- every failover writes a row nx_xenocell -- xenocell intrusion events write a row nx_ai_audit -- every BLOCKED AI proposal writes a row nx_scam_detector -- every CONFIRMED_PATTERN scam writes a row

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_book.nx nx_audit_compose_test.nx nx_book_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_audit_compose_test.nxnx_book_test.nx

structs

58struct NxBookEntry
68struct NxBook

consts

30const NX_BK_TWIN_KEY_AUTHORIZED: nx_int = 0
31const NX_BK_DRONE_DEPLOYED: nx_int = 1
32const NX_BK_SANCTUARY_OPENED: nx_int = 2
33const NX_BK_RECLAIM_APPLIED: nx_int = 3
34const NX_BK_FAILOVER_EXECUTED: nx_int = 4
35const NX_BK_XENO_ALERT: nx_int = 5
36const NX_BK_SCAM_FLAGGED: nx_int = 6
37const NX_BK_AI_PROPOSAL_BLOCKED: nx_int = 7
38const NX_BK_TREATY_BREACHED: nx_int = 8
39const NX_BK_TRACE_SHARED: nx_int = 9
40const NX_BK_OPERATOR_OVERRIDE: nx_int = 10
41const NX_BK_HEALTH_RED_TRIGGERED: nx_int = 11
42const NX_BK_N_KINDS: nx_int = 12
46const NX_BS_INFO: nx_int = 0
47const NX_BS_NOTICE: nx_int = 1
48const NX_BS_WARNING: nx_int = 2
49const NX_BS_ALERT: nx_int = 3
50const NX_BS_N_SEVS: nx_int = 4
52const NX_BK_OK: nx_int = 0
53const NX_BK_ERR_FULL: nx_int = 1
54const NX_BK_ERR_BAD_KIND: nx_int = 2
74const NX_BK_ENTRY_BYTES: nx_size = 56

functions

76func nx_bk_kind_is_valid(k: nx_int) -> nx_int
called by 2: nx_book_recordmain
82func nx_bk_severity_is_valid(s: nx_int) -> nx_int
called by 2: nx_book_recordmain
88func nx_book_new(capacity: nx_size) -> *NxBook
called by 2: mainmain calls 1: sys_mmap
97func _bk_at(b: *NxBook, idx: nx_size) -> *NxBookEntry
107func nx_book_record(b: *NxBook,
129func _bk_find(b: *NxBook, entry_id: nx_int) -> nx_int
called by 1: nx_book_mark_seen calls 1: _bk_at
144func nx_book_mark_seen(b: *NxBook, entry_id: nx_int) -> nx_int
called by 2: mainmain calls 2: _bk_find_bk_at
154func nx_book_count_unseen(b: *NxBook) -> nx_int
called by 1: main calls 1: _bk_at
165func nx_book_count(b: *NxBook) -> nx_size
called by 1: main
169func nx_book_count_by_kind(b: *NxBook, kind: nx_int) -> nx_int
called by 2: mainmain calls 1: _bk_at
180func nx_book_count_by_severity(b: *NxBook, severity: nx_int) -> nx_int
called by 1: main calls 1: _bk_at
197func nx_book_count_alerts_unseen(b: *NxBook) -> nx_int
called by 2: mainmain calls 1: _bk_at