nx_deploy_leash.nx
buildroot/runtime/nx_deploy_leash.nx
about
nx_deploy_leash.nx -- DEPLOYMENTS ON A LEASH (operator 2026-07-16: "owners take accountability...
models loaded into resources and the owner walks away... someone should have our deployments on a
leash, not just let them wander loose -- part of the RACI"). Every long-lived deployment (model
seat, serve daemon, heavy holder) REGISTERS: accountable owner + purpose + pid + renewal TTL + its
own STOP-PATH (a declared graceful kill-switch -- reclaim is never a blind kill). The leash is
RENEWAL-BASED liveness of the OWNER'S USE (nx_watch beats on every use), NOT process liveness --
a seat daemon stays alive forever, so pid-checks can never catch walk-away. SOTA norm this matches:
K8s lease renewal / SLURM walltime / Ray actor liveness -- resources held AGAINST RENEWAL.
register <name> <owner> <purpose> <pid> <renew_ttl_ms> <stop_path> (also starts the leash clock)
beat = nx_watch beat leash <name> (consumers beat on every USE; no new plumbing)
walk supervisor's rounds: HEALTHY / ABANDONED(alive+stale-beat -> touch stop_path, mark
RECLAIMED) / DEAD(pid gone). Exit = worst seen (0 none/healthy, 2 dead, 3 abandoned).
status same scan, print-only (no reclaim actions).
Store: knowledge/store/leash key d:<name> = "name|owner|purpose|pid|ttl_ms|stop_path|reg_us"
(latest-wins), d:ids index under flock. Beat clock: knowledge/store/watch_leash via nx_watch.
RACI: supervisor R (walks the leash) · pm A (owns the box) · conductor C · every workstream I.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_watch.nxnx_model_lane_core.nx
imported by: nx_deploy_leash_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 20 | const DL_MAGIC_262144: i64 = 262144 |
| 21 | const DL_MAGIC_262143: i64 = 262143 |
| 22 | const DL_MAGIC_999999999: i64 = 999999999 |
| 24 | const DL_STORE: *u8 = "knowledge/store/leash" |
| 25 | const DL_LOCK: *u8 = "knowledge/status/leash.lock" |
| 26 | const DL_HEALTHY: i64 = 0 |
| 27 | const DL_DEAD: i64 = 2 |
| 28 | const DL_ABANDONED: i64 = 3 |
functions
| 31 | func dl_verdict(pid_alive: i64, beat_age_ms: i64, renew_ttl_ms: i64) -> i64 |
| 38 | func dl_key(name: *u8, out: *u8) -> i64 |
| 48 | func dl_add_id(name: *u8) -> i64 |
| 88 | func dl_register(name: *u8, owner: *u8, purpose: *u8, pid: i64, ttl_ms: i64, stop_path: *u8) -> i64 |
| 119 | func dl_field(row: *u8, n: i64, k: i64, out: *u8, cap: i64) -> i64 called by 1: dl_walk |
| 136 | func dl_walk(act: i64) -> i64 |
| 219 | func sq_field_int(row: *u8, n: i64, k: i64) -> i64 called by 1: dl_walk |
| 234 | func main(argc: i64, argv: *i64) -> i64 |