nx_debt_recurrence_lib.nx
buildroot/runtime/nx_debt_recurrence_lib.nx
about
nx_debt_recurrence_lib.nx -- CE3 (codeeffectiveness ce_recurrence): RECURRENCE PER DEFECT CLASS over the debt plane.
Resolution effectiveness is not a close count: the estate's own record has one defect filed five times in three
weeks. This is the ONE ruler for that class, composed by nx_debtmine (the incumbent bugs-class miner, which already
held per-scope eat-rate and aging) and driven in-process by its gate. Over the plane rows
(id TAB sev TAB scope TAB status TAB desc) it interns scopes and, per scope, records the FIRST EATEN filing as the
prior and counts every row filed AFTER it as a recurrence of the class: recur_total (history, non-decreasing by
construction) and recur_open (the live re-filings, which FALL when they are eaten). The ids are named -- the prior
id and a bounded prefix of the recurring ids beside their total -- because a bare number is not the measure the
rung asked for. CLOSE TIME IS UNRECORDED ON THIS PLANE (ids are file-time), so a row filed after a prior that was
eaten later still counts: the count is an UPPER BOUND and says so in the document. A run with no rows writes no
spine row; the spine path is derived from the source (the production spine iff the source is the live plane,
else a <source>.recurrence.spine sidecar), so a fixture can never forge the production trajectory.
The scope table has NO PICKED BOUND: its capacity is drc_capacity(q, n), derived from the rows, so scopes_capped is
0 by construction and stays in the document as an invariant the gate asserts (the first live beat, 2026-09-06, hit a
256-slot bound on a 4,353-row plane and published a floor wearing a total). Ids are epoch-seconds, so an autofile
burst shares one id across several rows: those are distinct filings and count as such, and the adjacent-burst count
is published beside the ids (adjacent only, a declared floor) so a reader knows why an id can repeat.
The row walk mirrors nx_debtmine's inline loop (sj_le / sj_col / comment skip); extraction of that walk into a
shared reader is the declared follow-up, not a second parser by intent.
license_tier: ORIGINAL No hw writes.
dependencies 2 imports · 2 importers
imports: nx_sovjson_lib.nxnx_syscalls.nx
imported by: nx_debt_recurrence_gate.nxnx_debtmine.nx
structs
| none |
consts
| 26 | const DRC_IDS_PER_SCOPE: i64 = 8 // the PRINTED prefix of recurring ids; the count beside it is the total |
| 27 | const DRC_WORD: i64 = 8 |
| 28 | const DRC_LINE: i64 = 512 |
| 29 | const DRC_PATH: i64 = 1024 |
| 30 | const DRC_MODE644: i64 = 420 |
| 31 | const DRC_NL: i64 = 10 |
| 32 | const DRC_COMMENT: i64 = 35 |
| 33 | const DRC_QUOTE: i64 = 34 |
| 34 | const DRC_COLON: i64 = 58 |
| 35 | const DRC_COMMA: i64 = 44 |
| 36 | const DRC_LBRACE: i64 = 123 |
| 37 | const DRC_RBRACE: i64 = 125 |
| 38 | const DRC_LBRACK: i64 = 91 |
| 39 | const DRC_RBRACK: i64 = 93 |
| 40 | const DRC_NAME_MAX: i64 = 120 |
| 41 | const DRC_PROD_PREFIX: *u8 = "knowledge/store/debt-" |
| 42 | const DRC_SPINE_PROD: *u8 = "knowledge/status/debt_recurrence.spine" |
| 43 | const DRC_SPINE_SIDECAR: *u8 = ".recurrence.spine" |
| 44 | const DRC_COL_ID: i64 = 0 |
| 45 | const DRC_COL_SCOPE: i64 = 2 |
| 46 | const DRC_COL_STATUS: i64 = 3 |
| 48 | const DRC_S_OFF: i64 = 0 |
| 49 | const DRC_S_LEN: i64 = 1 |
| 50 | const DRC_S_FILED: i64 = 2 |
| 51 | const DRC_S_EATEN: i64 = 3 |
| 52 | const DRC_S_PRIOR: i64 = 4 |
| 53 | const DRC_S_RTOTAL: i64 = 5 |
| 54 | const DRC_S_ROPEN: i64 = 6 |
| 55 | const DRC_S_NIDS: i64 = 7 |
| 56 | const DRC_S_SLOTS: i64 = 8 |
| 58 | const DRC_R_ROWS: i64 = 0 |
| 59 | const DRC_R_SCOPES: i64 = 1 |
| 60 | const DRC_R_SCOPES_RECUR: i64 = 2 |
| 61 | const DRC_R_ROPEN: i64 = 3 |
| 62 | const DRC_R_RTOTAL: i64 = 4 |
| 63 | const DRC_R_CAPPED: i64 = 5 |
| 64 | const DRC_R_MALFORMED: i64 = 6 |
| 65 | const DRC_R_IDBURST: i64 = 7 // rows whose id equals the previous row's id (an autofile burst shares an epoch-second): adjacent only, a declared floor |
| 66 | const DRC_R_SLOTS: i64 = 8 |
functions
| 68 | func drc_key(d: *u8, o: i64, name: *u8) -> i64 { d[o] = DRC_QUOTE as u8; var p: i64 = sj_cat(d, o + 1, name); d[p] = DRC_QUOTE as u8; d[p + 1] = DRC_COLON as u8; return p + 2 } |
| 69 | func drc_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 } called by 1: drc_spine_path |
| 70 | func drc_str(d: *u8, o: i64, s: *u8) -> i64 { d[o] = DRC_QUOTE as u8; var p: i64 = sj_cat(d, o + 1, s); d[p] = DRC_QUOTE as u8; return p + 1 } |
| 76 | func drc_capacity(q: *u8, n: i64) -> i64 |
| 83 | func drc_scan(q: *u8, n: i64, cap: i64, st: *i64, ids: *i64, r: *i64) -> i64 |
| 157 | func drc_emit_json(d: *u8, p0: i64, q: *u8, st: *i64, ids: *i64, nsc: i64, r: *i64, topn: i64) -> i64 |
| 226 | func drc_spine_path(src: *u8, out: *u8) -> i64 |
| 232 | func drc_spine_json(d: *u8, p0: i64, src: *u8, now: i64, r: *i64) -> i64 |