nx_chromatin.nx
buildroot/runtime/nx_chromatin.nx
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
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
| 78 | struct NxChromatin |
consts
| 64 | const NX_CH_OK: nx_int = 0 |
| 65 | const NX_CH_ERR_BAD_SIZE: nx_int = 1 |
| 66 | const NX_CH_ERR_BAD_MARK: nx_int = 2 |
| 67 | const NX_CH_ERR_STALE: nx_int = 3 |
| 68 | const NX_CH_ERR_DST_TOO_SMALL: nx_int = 4 |
functions
| 94 | func nx_chromatin_capture(originator_id: nx_int, |
| 121 | func nx_chromatin_restore(c: *NxChromatin, |
| 151 | func nx_chromatin_is_fresher(a: *NxChromatin, b: *NxChromatin) -> nx_int |
| 160 | func nx_chromatin_size(c: *NxChromatin) -> nx_size called by 1: main |
| 167 | func nx_chromatin_originator(c: *NxChromatin) -> nx_int called by 1: main |
| 179 | func nx_chromatin_verify_against_buf(c: *NxChromatin, called by 1: main |