code wiki / _hdl_build / nx_deadman.nx

nx_deadman.nx

buildroot/runtime/_hdl_build/nx_deadman.nx

2544 B47 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_deadman.nx -- PROOF-OF-LIFE dead-man's switch for succession (the "death nobody reports" gap). Normal activity (every login/validate) is a HEARTBEAT. After prolonged silence the account escalates toward succession -- but with a VETO WINDOW during which a single login (heartbeat) cancels it, so a living user on a long trip is never wrongly succeeded. State = a file holding the last-activity epoch (decimal text). nx_dm_heartbeat(state_file, now) -- record activity nx_dm_read_last(state_file) -- last-activity epoch, or -1 nx_dm_status(last, now, silence_secs, veto_secs): ALIVE = silent < silence_secs (active; nothing happens) PENDING = silence_secs <= silent < silence+veto (silent; ALERT the user, contacts may be notified, succession may START but NOT finalize -- vetoable) EXPIRED = silent >= silence_secs + veto_secs (silent through the veto window; succession PROCEEDS, i.e. nx_succession_recover / nx_social_auth_recover) Pure status (no real-world judgement); the actual notify/alert is a real-world side channel. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_deadman.nx nx_deadman_gate.nx

imports: nx_syscalls.nx

imported by: nx_deadman_gate.nx

structs

none

consts

16const NX_DM_ALIVE: i64 = 0
17const NX_DM_PENDING: i64 = 1
18const NX_DM_EXPIRED: i64 = 2

functions

20func nx_dm_status(last_activity: i64, now: i64, silence_secs: i64, veto_secs: i64) -> i64
called by 1: main
27func nx_dm_heartbeat(state_file: *u8, now: i64) -> i64
39func nx_dm_read_last(state_file: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file