nx_methyl.nx
buildroot/runtime/nx_methyl.nx
about
nx_methyl.nx -- cryptographic self-marking (Tier-1 immune).
Biology: DNA methylation marks host DNA so restriction enzymes
know NOT to cut self. Foreign viral DNA arrives unmethylated;
restriction enzymes cleave it. Same principle, software substrate:
every Nishi-emitted artifact carries a methyl-mark (originator id
+ chromatin hash + emission timestamp). Foreign bits lack the mark
or carry stale/invalid marks; nx_restriction (queued) refuses them
at the IO boundary.
THIS IS ALSO THE FOUNDATION FOR MIMICRY DEFENSE. nx_decoy plants
fake artifacts that LOOK like Nishi cells but carry NO methyl mark
(or a deliberately-invalid one). A scraper reading them gets data
that pattern-matches "Nishi cell" but the auth chain doesn't
validate against any real chromatin -- so the scrape is detectable
AS forgery if it ever shows up downstream.
Composes:
nx_chromatin -- the canonical originator-chain primitive
that methyl marks reference
nx_xenocell -- foreign artifacts found in the substrate
that lack valid methyl become evidence
nx_decoy -- decoy artifacts carry invalid methyl by
design so leaked decoys are detectable
nx_pamp + nx_crispr -- detection-and-memory primitives
nx_restriction (queued) -- IO-boundary check that consumes methyl
V1 ships:
- struct NxMethylMark with originator/chromatin_hash/ts
- mark/verify functions
- is_self predicate (returns 1 if mark validates)
- "deliberate-invalid" variant for decoy use
Gap list (V1 honest perf verdict):
- signature is externally supplied (V2 inlines nx_ml_dsa_65)
- no canonical bytes-to-mark function; caller supplies hash
- no propagation through nx_brane capability tokens (queued)
- no peer-mesh sharing of revoked originators (queued)
genealogy_id: cardinal_2026-05-19_tier_1_innate_immune_microbial +
dependencies 2 imports · 22 importers
diagram shows first 10 each side; +0 more imports, +12 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_cell.nxnx_cell_anatomy_compose_test.nxnx_cell_test.nxnx_chromatin.nxnx_chromatin_test.nxnx_failover_compose_test.nxnx_game_runtime_compose_test.nxnx_methyl_test.nxnx_microbiome_test.nxnx_mimicry_compose_test.nxnx_promote_test.nxnx_provenance_chain.nxnx_provenance_chain_test.nxnx_save_slot_test.nxnx_session_audit_compose_test.nxnx_tier1_immune_compose_test.nxnx_tier3_ecology_compose_test.nxnx_trace_log_test.nxnx_vacuole.nxnx_vacuole_test.nxnx_vesicle.nxnx_vesicle_test.nx
structs
| 74 | struct NxMethylMark |
consts
| 57 | const NX_METHYL_OK: nx_int = 0 |
| 58 | const NX_METHYL_ERR_NO_MARK: nx_int = 1 |
| 59 | const NX_METHYL_ERR_BAD_ORIG: nx_int = 2 |
| 60 | const NX_METHYL_ERR_BAD_CHAIN: nx_int = 3 |
| 61 | const NX_METHYL_ERR_STALE: nx_int = 4 |
| 62 | const NX_METHYL_ERR_DECOY: nx_int = 5 // deliberately-invalid |
functions
| 85 | func nx_methyl_new(originator_id: nx_int, |
| 108 | func nx_methyl_new_decoy(fake_originator_id: nx_int, |
| 136 | func nx_methyl_is_self(m: *NxMethylMark, |
| 156 | func nx_methyl_verdict(m: *NxMethylMark, called by 1: main |
| 172 | func nx_methyl_is_decoy(m: *NxMethylMark) -> nx_int |