code wiki / (root) / nx_jobclaim_reap.nx

nx_jobclaim_reap.nx

buildroot/runtime/nx_jobclaim_reap.nx

8419 B185 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic jobclaim
docsdependenciesstructsconstsfunctions

about

nx_jobclaim_reap.nx -- THE SANCTIONED WAY TO RETIRE A DEAD _jobs CLAIM. WHY THIS EXISTS (debt 1787259805, measured 2026-08-20). nx_joblost_gate correctly reports LOST=4 against a ratchet floor of 1 and is therefore RED. The four claims are real: ids 1786132743, 1786239344, 1786732031 and 1786927039, aged 3.8 to 13.0 days, reservations that were made and never came back. THE GATE IS CORRECT AND THE FLOOR MUST NOT BE RAISED -- loosening a ratchet to flatter a number is editing the detector instead of fixing what it found. The blocker was that the estate had NO VERB for removing a dead claim: nx_retire_path refuses `_jobs/x` as too shallow, and nx_capsearch over 1,187 tools finds no incumbent (nx_orphan_reap reaps DAEMONS by cmdline, nx_tmpstore_reap reaps seg-store FAMILIES, nx_claims reap works the session-lease JOURNAL, nx_toolreg_reap works allowlist ROWS). Four things were blocked by one missing verb: the gate cannot be bite-proven while its baseline is RED, so nx_gate_bite reports UNCONTROLLED, so nx_gate_roster_run correctly refuses to admit it to the 630-row roster. THIS ORGAN IS THE ACTUATOR, NOT THE CENSUS. It takes ids and acts on exactly those. The WORKLIST comes from nx_joblost_gate, which already scans the plane and prints `LOST job_<id> age=<n>s`. Building a second directory scanner here would be a duplicate ruler, and a sweep verb would make every reap an unnamed bulk act instead of an auditable one. IT DOES NOT DELETE. It APPENDS a tombstone (rule 13): the claim keeps its original marker and gains `state=REAPED ts=<now> age=<n>s by=nx_jobclaim_reap`. The reader that must understand that tombstone -- nx_joblost_gate -- imports the SAME classifier from nx_jobclaim_lib, because a reaper shipped alone is a no-op that looks like a fix. EVERY REFUSAL NAMES ITS RULE. ABSENT, DONE, HAS-OUT, TOO-YOUNG and UNPARSED are five different answers with five different remedies; a single "refused" would send the reader to re-derive by hand the examination this organ just performed. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_jobclaim_lib.nx nx_jobclaim_reap.nx

imports: nx_syscalls.nxnx_jobclaim_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main jrc_usage jrc_w sys_write sys_exit jr_streq jr_slen jrc_w ↻ sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ jr_maxage sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sys_free_file sys_munmap ↻ sys_mmap ↻ jr_num_from jrc_opt jr_slen ↻ jr_atoi_strict jr_slen ↻ jr_dir_allowed

structs

none

consts

33const JRC_EXIT_OK: i64 = 0
34const JRC_EXIT_REFUSED: i64 = 1
35const JRC_EXIT_USAGE: i64 = 2
36const JRC_EXIT_BLOCKED: i64 = 3
37const JRC_ARGV_VERB: i64 = 1
38const JRC_ARGV_FIRST: i64 = 2
39const JRC_MIN_ARGC: i64 = 3

functions

41func jrc_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: jrc_usagemain calls 1: sys_write
43func jrc_n(v: i64) -> i64
called by 1: main calls 3: sys_mmapjr_catnumsys_write
50func jrc_usage() -> i64
called by 1: main calls 1: jrc_w
61func jrc_opt(arg: *u8, key: *u8) -> *u8
called by 1: main calls 1: jr_slen
70func main(argc: i64, argv: *i64) -> i64