code wiki / (root) / nx_legal_compliance.nx

nx_legal_compliance.nx

buildroot/runtime/nx_legal_compliance.nx

10296 B209 linesdepth 0pulls 0 transitivereach 14 importersview sourcekind librarytopic legal
docsdependenciesstructsconstsfunctions

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

nx_legal_compliance.nx nx_doc_annotate_gate.nx nx_doc_envelope.nx nx_doc_envelope_gate.nx nx_doc_seal.nx nx_doc_seal_gate.nx nx_legal_compliance_gate.nx nx_legal_portal.nx nx_legal_portal_boot_gate.nx nx_legal_portal_daemon.nx nx_legal_portal_gate.nx

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

49const DT_GENERAL: i64 = 0 // generic business/commercial record
50const DT_CONTRACT: i64 = 1
51const DT_POA: i64 = 2 // power of attorney (e-signable; notary often advised)
52const DT_DEED: i64 = 3 // deed (e-signable with notarization)
53const DT_TRUST_LIVING: i64 = 4 // inter-vivos / revocable trust (e-signable)
54const DT_ADVANCE_DIRECTIVE: i64 = 5 // living will / healthcare directive (e-signable)
55const DT_WILL: i64 = 6 // last will & testament (EXCLUDED from UETA/ESIGN)
56const DT_CODICIL: i64 = 7 // amendment to a will (EXCLUDED)
57const DT_TESTAMENTARY_TRUST: i64 = 8 // testamentary trust (EXCLUDED)
58const DT_UNKNOWN: i64 = 9
61const RG_UETA_GENERAL: i64 = 0 // general e-sign valid (UETA / ESIGN)
62const RG_ELECTRONIC_WILLS: i64 = 1 // special e-wills regime (jurisdiction permits)
63const RG_REQUIRES_WET: i64 = 2 // e-sign legally void; needs wet ink + witnesses
64const RG_UNKNOWN: i64 = 3
67const LV_VALID: i64 = 0 // meets all legal requirements -> enforceable
68const LV_NEEDS_MORE: i64 = 1 // in-scope but missing a required element
69const LV_INVALID_VOID: i64 = 2 // e-signature cannot validly execute this instrument
72const LR_OK_UETA: i64 = 0
73const LR_OK_EWILLS: i64 = 1
74const LR_NO_INTENT: i64 = 2
75const LR_NO_CONSENT: i64 = 3
76const LR_NO_ATTRIBUTION: i64 = 4
77const LR_NOT_RETAINABLE: i64 = 5
78const LR_NEED_2_WITNESS: i64 = 6
79const LR_NEED_NOTARY: i64 = 7
80const LR_EXCLUDED_WET: i64 = 8 // excluded doc; no e-wills statute -> wet required
81const LR_UNKNOWN: i64 = 9
84const REQ_INTENT: i64 = 1
85const REQ_CONSENT: i64 = 2
86const REQ_ATTRIBUTION: i64 = 4
87const REQ_RETAINABLE: i64 = 8
88const REQ_WITNESS2: i64 = 16
89const REQ_NOTARY: i64 = 32

functions

105func lc_lower(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: lc_ci_contains
106func 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
109func lc_ci_contains(hay: *u8, needle: *u8) -> i64