nx_evict_journal.nx
buildroot/runtime/nx_evict_journal.nx
about
nx_evict_journal.nx -- append-only eviction visibility log.
Per cardinal: cooperative-resource-arbitration. Every eviction,
demote, throttle, and migration is logged so the user can audit
after the fact. This is the structural EXCEED-axis vs Docker's
silent kernel OOM-killer: there, a container disappears and you
dig through dmesg hoping to find the reason. Here, every event is
in ~/.nishi/evict.jsonl with the displacing cell named.
Composes:
nx_budget -- denied-allocation events log here
nx_yield -- DEMOTED / THROTTLED outcomes log here
nx_homeostasis -- migration decisions log here
nx_attention_class -- the class of both displaced + displacing
cells is preserved for forensics
V1 ships in-memory ring buffer. The on-disk JSONL append is queued
once nx_jsonl_writer lands; for now the journal is queryable via
nx_evict_dump pointer access.
Gap list (V1 honest perf verdict):
- no disk persistence (in-memory only this phase)
- no time-windowed query (caller walks full buffer)
- ring-buffer wraps silently at capacity (older entries lost)
- no peer-mesh propagation for distributed evictions
genealogy_id: nishi_cardinal_2026-05-17_cooperative_resource_arbitration
lineage_id: substrate_evict_journal_v1
nx_safety_envelope:
intended_use: "Append-only eviction/demote/throttle log for
forensic audit; never silent eviction"
sil_target: SIL2
evidence: [append_only_invariant, every_event_logged,
displacing_cell_named]
verdict: NOT_YET_EVALUATED
dependencies 2 imports · 28 importers
diagram shows first 10 each side; +0 more imports, +18 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_ecosystem_compose_test.nxnx_evict_journal_test.nxnx_failover_compose_test.nxnx_homeostasis.nxnx_homeostasis_test.nxnx_immune.nxnx_immune_test.nxnx_lysis.nxnx_lysis_test.nxnx_mimicry_compose_test.nxnx_organism.nxnx_organism_test.nxnx_pollinate.nxnx_pollinate_test.nxnx_promote.nxnx_promote_test.nxnx_reclaim.nxnx_reclaim_test.nxnx_sovereign_compose_test.nxnx_substrate_compose_test.nxnx_symbiote.nxnx_symbiote_test.nxnx_tier1_immune_compose_test.nxnx_tier2_immune_compose_test.nxnx_treaty.nxnx_treaty_test.nxnx_xenocell.nxnx_xenocell_test.nx
structs
| 62 | struct NxEvictEntry |
| 77 | struct NxEvictJournal |
consts
| 43 | const NX_EVR_BUDGET_DENIED: nx_int = 0 |
| 44 | const NX_EVR_YIELD_DEMOTED: nx_int = 1 |
| 45 | const NX_EVR_YIELD_THROTTLED: nx_int = 2 |
| 46 | const NX_EVR_MIGRATED: nx_int = 3 |
| 47 | const NX_EVR_TERMINATED: nx_int = 4 // immune layer killed the cell |
| 48 | const NX_EVR_N_REASONS: nx_int = 5 |
| 86 | const NX_EVICT_DEFAULT_CAPACITY: nx_size = 1024 |
functions
| 50 | func nx_evr_is_valid(r: nx_int) -> nx_int |
| 90 | func nx_evict_journal_new(capacity: nx_size) -> *NxEvictJournal |
| 105 | func nx_evict_log(j: *NxEvictJournal, called by 10: mainmainmainnx_lysis_lognx_pollinate_consentnx_promote_execute+4 calls 1: nx_evr_is_valid |
| 132 | func nx_evict_at(j: *NxEvictJournal, idx: nx_size) -> *NxEvictEntry |
| 143 | func nx_evict_count_for_cell(j: *NxEvictJournal, cell_id: nx_int) -> nx_int |