nx_legal_compliance.nx
buildroot/runtime/nx_legal_compliance.nx
about
nx_legal_compliance.nx -- LEGAL RUNG D0: the document-type -> legal-regime ->
validity-requirements engine. The s-class-exceed core that makes the whole
document/e-sign track produce LEGALLY VALID instruments BY CONSTRUCTION.
module: nishi-core.legal.compliance
depends: (none -- pure classifier + regime table + validity machine)
capability: LEGAL_COMPLIANCE
THE PROBLEM a naive DocuSign-clone gets wrong: ESIGN (15 U.S.C. 7003(a)(1))
and UETA (Section 3(b)(1)) EXCLUDE wills, codicils, and testamentary trusts
from electronic-signature coverage. A plain e-signature on a will is
LEGALLY VOID. A few states (Utah among the first, via the Uniform Electronic
Wills Act) permit electronic wills only under a STRICTER regime (testator's
e-signature + >=2 witnesses in electronic presence + notarization to be
self-proving). This engine routes every document to the correct regime and
NEVER returns VALID for an instrument that would be legally void --
the legal analog of the Rule 26 never-brick / never-poison / never-ignite
safety invariant: NEVER PRODUCE A LEGALLY VOID INSTRUMENT.
Grounded facts (verified against the banked corpus, not assumed):
UETA Section 2(8) : e-signature = symbol/process LOGICALLY ASSOCIATED with
the record, executed WITH INTENT TO SIGN.
UETA Section 5(b) : applies only where each party AGREED to transact
electronically (consent).
UETA Section 8 : record must be RETAINABLE by the recipient.
UETA Section 9 : ATTRIBUTION via a security procedure.
UETA Section 12 : retention must accurately reflect + remain accessible.
UETA Section 3(b) / ESIGN 7003(a) : wills/codicils/testamentary trusts EXCLUDED.
Uniform Electronic Wills Act : e-will needs testator e-sign + >=2 witnesses
(electronic presence) + notarization (self-proving).
NOTE: a LIVING (inter-vivos/revocable) trust and a LIVING WILL / advance
directive are NOT testamentary -> they are e-signable under UETA. This
distinction (testamentary vs inter-vivos) is the precision a generic
e-sign product lacks.
license_tier: ORIGINAL (statute is fact, not copyrightable; logic re-derived)
lineage_id: nishi_legal_compliance_d0
nx_safety_envelope:
intended_use: "Classify a document, select its legal e-signature regime,
dependencies 0 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: none
imported by: nx_doc_annotate_gate.nxnx_doc_envelope.nxnx_doc_envelope_gate.nxnx_doc_seal.nxnx_doc_seal_gate.nxnx_legal_compliance_gate.nxnx_legal_portal.nxnx_legal_portal_boot_gate.nxnx_legal_portal_daemon.nxnx_legal_portal_gate.nxnx_legal_portal_live_gate.nxnx_legal_portal_post_gate.nxnx_legal_serve.nx
structs
| none |
consts
| 49 | const DT_GENERAL: i64 = 0 // generic business/commercial record |
| 50 | const DT_CONTRACT: i64 = 1 |
| 51 | const DT_POA: i64 = 2 // power of attorney (e-signable; notary often advised) |
| 52 | const DT_DEED: i64 = 3 // deed (e-signable with notarization) |
| 53 | const DT_TRUST_LIVING: i64 = 4 // inter-vivos / revocable trust (e-signable) |
| 54 | const DT_ADVANCE_DIRECTIVE: i64 = 5 // living will / healthcare directive (e-signable) |
| 55 | const DT_WILL: i64 = 6 // last will & testament (EXCLUDED from UETA/ESIGN) |
| 56 | const DT_CODICIL: i64 = 7 // amendment to a will (EXCLUDED) |
| 57 | const DT_TESTAMENTARY_TRUST: i64 = 8 // testamentary trust (EXCLUDED) |
| 58 | const DT_UNKNOWN: i64 = 9 |
| 61 | const RG_UETA_GENERAL: i64 = 0 // general e-sign valid (UETA / ESIGN) |
| 62 | const RG_ELECTRONIC_WILLS: i64 = 1 // special e-wills regime (jurisdiction permits) |
| 63 | const RG_REQUIRES_WET: i64 = 2 // e-sign legally void; needs wet ink + witnesses |
| 64 | const RG_UNKNOWN: i64 = 3 |
| 67 | const LV_VALID: i64 = 0 // meets all legal requirements -> enforceable |
| 68 | const LV_NEEDS_MORE: i64 = 1 // in-scope but missing a required element |
| 69 | const LV_INVALID_VOID: i64 = 2 // e-signature cannot validly execute this instrument |
| 72 | const LR_OK_UETA: i64 = 0 |
| 73 | const LR_OK_EWILLS: i64 = 1 |
| 74 | const LR_NO_INTENT: i64 = 2 |
| 75 | const LR_NO_CONSENT: i64 = 3 |
| 76 | const LR_NO_ATTRIBUTION: i64 = 4 |
| 77 | const LR_NOT_RETAINABLE: i64 = 5 |
| 78 | const LR_NEED_2_WITNESS: i64 = 6 |
| 79 | const LR_NEED_NOTARY: i64 = 7 |
| 80 | const LR_EXCLUDED_WET: i64 = 8 // excluded doc; no e-wills statute -> wet required |
| 81 | const LR_UNKNOWN: i64 = 9 |
| 84 | const REQ_INTENT: i64 = 1 |
| 85 | const REQ_CONSENT: i64 = 2 |
| 86 | const REQ_ATTRIBUTION: i64 = 4 |
| 87 | const REQ_RETAINABLE: i64 = 8 |
| 88 | const REQ_WITNESS2: i64 = 16 |
| 89 | const REQ_NOTARY: i64 = 32 |
functions
| 91 | func nx_legal_verdict_name(v: i64) -> *u8 |
| 97 | func nx_legal_regime_name(r: i64) -> *u8 called by 1: lp_handle |
| 105 | func lc_lower(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: lc_ci_contains |
| 106 | func lc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: lc_ci_contains |
| 109 | func lc_ci_contains(hay: *u8, needle: *u8) -> i64 |
| 133 | func nx_legal_doc_classify(label: *u8) -> i64 |
| 149 | func nx_legal_is_excluded(doc_type: i64) -> i64 |
| 157 | func nx_legal_regime(doc_type: i64, e_wills_allowed: i64) -> i64 |
| 166 | func nx_legal_required_elements(regime: i64) -> i64 called by 1: main |
| 179 | func nx_legal_verdict(doc_type: i64, e_wills_allowed: i64, |