code wiki / (root) / nx_chromatin.nx

nx_chromatin.nx

buildroot/runtime/nx_chromatin.nx

7781 B190 linesdepth 3pulls 3 transitivereach 8 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_chromatin.nx -- backup cell state (germline replication). Biology: chromatin is the packed DNA + histones inside a cell's nucleus -- the GERMLINE that survives cell death (when one cell dies via apoptosis, its chromatin can be inherited by daughter cells or read from spore form). In Nishi terms: chromatin holds the content-addressed snapshot of a cell's running state so a REPLICA cell can restore from it on failover (nx_promote). Per [[feedback-cell-immune-system-ransomware-judo-ddos-by-bit]]: "ephemeral content-addressed cells deny persistence by design. chromatin-replicated backups already running as peer cells (not "restore archives"), failover = manifest pointer flip = sub-second." Per [[feedback-naming-discipline-no-industry-competitor-overlap]]: chromatin replaces an earlier conflicting name (Project Nucleus + Nucleus RTOS); chromatin is unowned in software-infra space. Composes: nx_methyl -- methyl-marks the chromatin so a replica can distinguish authentic-self chromatin from a forged backup (decoy-invalid mark in fake backups, valid mark in real ones) nx_promote -- consumes chromatin to instantiate a replica as the new primary (failover) nx_abortive -- compromised cell's chromatin survives the abortive transition; daughter cells get a clean copy of pre-compromise state nx_pollinate -- chromatin can federate across hosts as XENO_OBSERVATION + RECLAIM_REPORT payload V1 ships: - struct NxChromatin with originator, content_hash, ts, snapshot bytes - snapshot operation (capture cell state into chromatin) - restore operation (apply chromatin to destination cell buffer) - is_valid predicate (signature + freshness check) Gap list (V1 honest perf verdict): - snapshot is byte-copy (V2 supports COW + delta encoding) - no automatic periodic capture (caller drives)

dependencies 3 imports · 8 importers

nx_syscalls.nx nx_tier.nx nx_methyl.nx nx_chromatin.nx nx_cell_anatomy_compose_test.nx nx_chromatin_test.nx nx_failover_compose_test.nx nx_game_runtime_compose_test.nx nx_promote.nx nx_promote_test.nx nx_save_slot.nx nx_save_slot_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_methyl.nx

imported by: nx_cell_anatomy_compose_test.nxnx_chromatin_test.nxnx_failover_compose_test.nxnx_game_runtime_compose_test.nxnx_promote.nxnx_promote_test.nxnx_save_slot.nxnx_save_slot_test.nx

structs

78struct NxChromatin

consts

64const NX_CH_OK: nx_int = 0
65const NX_CH_ERR_BAD_SIZE: nx_int = 1
66const NX_CH_ERR_BAD_MARK: nx_int = 2
67const NX_CH_ERR_STALE: nx_int = 3
68const NX_CH_ERR_DST_TOO_SMALL: nx_int = 4

functions

94func nx_chromatin_capture(originator_id: nx_int,
called by 6: mainmainmainmainmainmain calls 1: sys_mmap
121func nx_chromatin_restore(c: *NxChromatin,
151func nx_chromatin_is_fresher(a: *NxChromatin, b: *NxChromatin) -> nx_int
160func nx_chromatin_size(c: *NxChromatin) -> nx_size
called by 1: main
167func nx_chromatin_originator(c: *NxChromatin) -> nx_int
called by 1: main
179func nx_chromatin_verify_against_buf(c: *NxChromatin,
called by 1: main