nx_damages_gate.nx
buildroot/runtime/nx_damages_gate.nx
about
nx_damages_gate.nx -- PREJUDGMENT INTEREST GATE.
Proves the exact day count (via composed nx_sol), simple and annually-compounded interest, that compound
exceeds simple for the same period, the total-award composition, a full real scenario ($50k loss over an
exact 3-year interval at 8pct simple = $12k interest), and the fail-closed refusals (judgment before
accrual, negative principal/rate/days, sentinel propagation). license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
D001-MIGRATED 2026-08-26: the verdict now comes from the shared nx_gate_verdict base class, so the outcome
is readable FROM OUTSIDE via the exit code (/api/gate_run) and a harness frame is recorded. The hand-rolled
cnt[] survives ONLY to feed the legacy `pass=/fail=` line, which is this gate's public signature; gv_ctr is
the canonical count, so a tooth that silently stops running can no longer read GREEN.
The fail-closed teeth are named `neg-control-` so the gate-law census can SEE them: a control nobody can
find is a control nobody maintains.
dependencies 3 imports · 0 importers
imports: nx_damages_lib.nxnx_matter_lib.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 23 | const ACCRUAL_YEAR: i64 = 2020 // date of loss, both scenarios |
| 24 | const JUDGMENT_YEAR_2YR: i64 = 2022 // exactly two years after accrual (the span contains a leap day) |
| 25 | const JUDGMENT_YEAR_3YR: i64 = 2023 // judgment year for the $50k scenario |
| 26 | const DAYS_2YR_LEAP_SPAN: i64 = 731 // 2020-01-01 -> 2022-01-01, leap-aware |
| 27 | const DAYS_3YR_SPAN: i64 = 1095 // 2020-03-15 -> 2023-03-15 |
| 28 | const PRINCIPAL_1K_CENTS: i64 = 100000 // $1,000.00 |
| 29 | const PRINCIPAL_50K_CENTS: i64 = 5000000 // $50,000.00 |
| 30 | const RATE_10PCT_BP: i64 = 1000 // 10.00% in basis points |
| 31 | const RATE_8PCT_BP: i64 = 800 // 8.00% in basis points |
| 32 | const DAYS_1YR: i64 = 365 |
| 33 | const DAYS_2YR: i64 = 730 |
| 34 | const YEARS_2: i64 = 2 |
| 35 | const INTEREST_1YR_SIMPLE_CENTS: i64 = 10000 // $100.00 |
| 36 | const INTEREST_2YR_SIMPLE_CENTS: i64 = 20000 // $200.00 |
| 37 | const INTEREST_2YR_COMPOUND_CENTS: i64 = 21000 // $210.00 -- compounding beats simple by $10 over the same 2 years |
| 38 | const AWARD_1K_PLUS_2YR_CENTS: i64 = 120000 // $1,200.00 = principal + 2yr simple interest |
| 39 | const INTEREST_50K_3YR_CENTS: i64 = 1200000 // $12,000.00 = 8pct x 3yr x $50k |
| 40 | const AWARD_50K_TOTAL_CENTS: i64 = 6200000 // $62,000.00 = principal + prejudgment interest |
functions
| 42 | func dm_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 43 | func dm_putn(v: i64) -> i64 |
| 58 | func dm_ck(cnt: *i64, ctr: *i64, name: *u8, got: i64, want: i64) -> i64 |
| 73 | func main(argc: i64, argv: *i64) -> i64 |