code wiki / _hdl_build / nx_deadman.nx
nx_deadman.nx
buildroot/runtime/_hdl_build/nx_deadman.nx
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
imports: nx_syscalls.nx
imported by: nx_deadman_gate.nx
structs
| none |
consts
| 16 | const NX_DM_ALIVE: i64 = 0 |
| 17 | const NX_DM_PENDING: i64 = 1 |
| 18 | const NX_DM_EXPIRED: i64 = 2 |
functions
| 20 | func nx_dm_status(last_activity: i64, now: i64, silence_secs: i64, veto_secs: i64) -> i64 called by 1: main |
| 27 | func nx_dm_heartbeat(state_file: *u8, now: i64) -> i64 |
| 39 | func nx_dm_read_last(state_file: *u8) -> i64 |