nx_cuad_lib.nx
buildroot/runtime/nx_cuad_lib.nx
about
nx_cuad_lib.nx -- THE CUAD CLAUSE TAXONOMY (41 types) as a typed, benchmark-aligned playbook.
WHY (July 2026 SOTA, researched): CUAD -- 13,000+ expert labels over 510 commercial contracts from
EDGAR, covering 41 clause types -- is the benchmark essentially every contract-AI product trains or
evaluates against. Our clause layer had a TWO-clause playbook, so "retrieval works" was true and
meaningless. This enumerates the real target so coverage becomes a number with a denominator.
u2605u2605THE HONESTY MECHANISM, BUILT INTO THE ORGAN: declaring 41 constants would let us claim 41 types of
coverage while only a handful can actually be detected -- exactly the coverage-gaming this house has
been burned by. So the taxonomy is split in two and the split is enforced in code:
DECLARED -- all 41 types exist as named constants (the complete, greppable denominator)
CUED -- the subset with real discriminative detection cues
cuad_coverage_permille scores against CUED types ONLY. A type that is merely declared can NEVER
contribute to a coverage number. The organ literally cannot flatter itself; adding a constant does
nothing until you add cues to go with it.
u2605THE CONTRADICTION TOOTH: "Uncapped Liability" and "Cap On Liability" are SEPARATE CUAD types, and a
contract asserting BOTH is internally inconsistent -- one clause caps exposure while another blows the
cap open. Reviewers miss it because the two live pages apart and each looks fine alone. Detected here
as a first-class contradiction rather than as two independent findings.
u2605FAIL-CLOSED: unrecognised text is CUAD_UNKNOWN, never the nearest type. In diligence, "I could not
classify this" is actionable and "probably a notices clause" is how a change-of-control provision
gets skipped.
license_tier: ORIGINAL LIB.
dependencies 1 imports · 1 importers
imports: nx_clause_lib.nx
imported by: nx_cuad_gate.nx
structs
| none |
consts
| 30 | const CUAD_UNKNOWN: i64 = 0 - 1 |
| 31 | const CUAD_DECLARED: i64 = 41 |
| 34 | const CU_DOCUMENT_NAME: i64 = 0 |
| 35 | const CU_PARTIES: i64 = 1 |
| 36 | const CU_AGREEMENT_DATE: i64 = 2 |
| 37 | const CU_EFFECTIVE_DATE: i64 = 3 |
| 38 | const CU_EXPIRATION_DATE: i64 = 4 |
| 39 | const CU_RENEWAL_TERM: i64 = 5 |
| 40 | const CU_NOTICE_TO_TERMINATE_RENEWAL: i64 = 6 |
| 41 | const CU_GOVERNING_LAW: i64 = 7 |
| 42 | const CU_MOST_FAVORED_NATION: i64 = 8 |
| 43 | const CU_NON_COMPETE: i64 = 9 |
| 44 | const CU_EXCLUSIVITY: i64 = 10 |
| 45 | const CU_NO_SOLICIT_CUSTOMERS: i64 = 11 |
| 46 | const CU_COMPETITIVE_RESTRICTION_EXCEPTION: i64 = 12 |
| 47 | const CU_NO_SOLICIT_EMPLOYEES: i64 = 13 |
| 48 | const CU_NON_DISPARAGEMENT: i64 = 14 |
| 49 | const CU_TERMINATION_FOR_CONVENIENCE: i64 = 15 |
| 50 | const CU_ROFR: i64 = 16 |
| 51 | const CU_CHANGE_OF_CONTROL: i64 = 17 |
| 52 | const CU_ANTI_ASSIGNMENT: i64 = 18 |
| 53 | const CU_REVENUE_PROFIT_SHARING: i64 = 19 |
| 54 | const CU_PRICE_RESTRICTIONS: i64 = 20 |
| 55 | const CU_MINIMUM_COMMITMENT: i64 = 21 |
| 56 | const CU_VOLUME_RESTRICTION: i64 = 22 |
| 57 | const CU_IP_OWNERSHIP_ASSIGNMENT: i64 = 23 |
| 58 | const CU_JOINT_IP_OWNERSHIP: i64 = 24 |
| 59 | const CU_LICENSE_GRANT: i64 = 25 |
| 60 | const CU_NON_TRANSFERABLE_LICENSE: i64 = 26 |
| 61 | const CU_AFFILIATE_LICENSE_LICENSOR: i64 = 27 |
| 62 | const CU_AFFILIATE_LICENSE_LICENSEE: i64 = 28 |
| 63 | const CU_UNLIMITED_LICENSE: i64 = 29 |
| 64 | const CU_PERPETUAL_LICENSE: i64 = 30 |
| 65 | const CU_SOURCE_CODE_ESCROW: i64 = 31 |
| 66 | const CU_POST_TERMINATION_SERVICES: i64 = 32 |
| 67 | const CU_AUDIT_RIGHTS: i64 = 33 |
| 68 | const CU_UNCAPPED_LIABILITY: i64 = 34 |
| 69 | const CU_CAP_ON_LIABILITY: i64 = 35 |
| 70 | const CU_LIQUIDATED_DAMAGES: i64 = 36 |
| 71 | const CU_WARRANTY_DURATION: i64 = 37 |
| 72 | const CU_INSURANCE: i64 = 38 |
| 73 | const CU_COVENANT_NOT_TO_SUE: i64 = 39 |
| 74 | const CU_THIRD_PARTY_BENEFICIARY: i64 = 40 |
functions
| 78 | func cuad_is_cued(t: i64) -> i64 |
| 102 | func cuad_cued_count() -> i64 |
| 114 | func cuad_cue_hit(text: *u8, t: i64) -> i64 |
| 211 | func cuad_classify(text: *u8) -> i64 |
| 223 | func cuad_types_present(text: *u8) -> i64 |
| 236 | func cuad_coverage_permille(text: *u8) -> i64 |
| 243 | func cuad_liability_contradiction(text: *u8) -> i64 |
| 250 | func cuad_is_high_risk(t: i64) -> i64 |
| 261 | func cuad_high_risk_present(text: *u8) -> i64 |
| 274 | func cuad_declared_count() -> i64 { return CUAD_DECLARED } called by 1: main |
| 275 | func cuad_uncued_count() -> i64 { return CUAD_DECLARED - cuad_cued_count() } |