code wiki / (root) / nx_ledes_lib.nx

nx_ledes_lib.nx

buildroot/runtime/nx_ledes_lib.nx

5364 B124 linesdepth 7pulls 12 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ledes_lib.nx -- LEGAL SPEND: UTBMS coding + LEDES 1998B validation + outside-counsel guidelines. The legal-ops category we had at zero. An invoice is not a document to read, it is a contract to enforce: outside counsel guidelines say what may be billed, at what rate, in what increments, by whom. u2605BLOCK BILLING is the single largest source of disputed legal spend: several distinct tasks lumped into one narrative with one time figure, so no line can be assessed on its own. It is detectable structurally -- more than one UTBMS task code implicated by a single entry -- and it is rejected here rather than merely flagged, because a flagged-but-payable line gets paid. u2605THE INCREMENT TOOTH: guidelines almost universally require tenth-of-an-hour billing. An entry in quarter hours (0.25) silently inflates every short task by up to 50%. Encoded as an exact divisibility check in HUNDREDTHS of an hour, so 0.1 is 10 and anything not a multiple of 10 fails. u2605FAIL-CLOSED: an entry with an UNRECOGNISED task or activity code is INVALID, never "assume billable". A code nobody recognises is a line nobody reviewed. UTBMS ranges encoded as data-driven bounds (rule 11): litigation task codes L100-L700, counselling C100-C500, activity codes A101-A114, expense codes E101-E124. STRUCTURE: pure decision core, zero I/O. license_tier: ORIGINAL LIB.

dependencies 1 imports · 2 importers

nx_matter_lib.nx nx_ledes_lib.nx nx_ledes_gate.nx nx_legal_svc.nx

imports: nx_matter_lib.nx

imported by: nx_ledes_gate.nxnx_legal_svc.nx

structs

none

consts

23const LED_OK: i64 = 0
24const LED_BAD_TASK: i64 = 1
25const LED_BAD_ACTIVITY: i64 = 2
26const LED_BLOCK_BILLED: i64 = 3
27const LED_BAD_INCREMENT: i64 = 4
28const LED_RATE_EXCEEDED: i64 = 5
29const LED_NOT_BILLABLE: i64 = 6
31const LED_TASK_LIT_LO: i64 = 100
32const LED_TASK_LIT_HI: i64 = 700
33const LED_ACT_LO: i64 = 101
34const LED_ACT_HI: i64 = 114
35const LED_EXP_LO: i64 = 101
36const LED_EXP_HI: i64 = 124
37const LED_INCREMENT_HUNDREDTHS: i64 = 10

functions

39func led_is1(v: i64) -> i64
45func led_task_ok_pure(task: i64) -> i64
51func led_activity_ok_pure(act: i64) -> i64
57func led_expense_ok_pure(exp: i64) -> i64
called by 1: main
64func led_block_billed_pure(task_count: i64) -> i64
70func led_increment_ok_pure(hours_hundredths: i64) -> i64
78func led_rate_ok_pure(rate_cents: i64, cap_cents: i64) -> i64
86func led_entry_check_pure(task: i64, act: i64, task_count: i64, hours_hundredths: i64, rate_cents: i64, cap_cents: i64, billable: i64) -> i64
96func led_entry_payable_pure(verdict: i64) -> i64
102func led_line_amount_pure(verdict: i64, hours_hundredths: i64, rate_cents: i64) -> i64
108func led_invoice_clean_pure(total_lines: i64, rejected_lines: i64) -> i64
called by 1: main
114func led_verdict_label(v: i64, out: *u8) -> i64
called by 2: mainleg_ledes_check calls 1: mt_catcopy