code wiki / (root) / nx_privlog_lib.nx

nx_privlog_lib.nx

buildroot/runtime/nx_privlog_lib.nx

7002 B154 linesdepth 7pulls 12 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_privlog_lib.nx -- PRIVILEGE: the assertion test, the waiver test, and the FRCP 26(b)(5)(A) log. nx_ediscovery decides what may be PRODUCED (allow-list) and nx_redact decides what must be MASKED. Neither answers the question that actually loses privilege: for each document we WITHHOLD, is the claim sound, and have we described it well enough that opposing counsel can test it? Withholding without an adequate log is itself a route to waiver -- the document stays back, and the privilege goes anyway. ATTORNEY-CLIENT (all five, no exceptions): it must be a COMMUNICATION, between ATTORNEY AND CLIENT, made FOR LEGAL ADVICE, in CONFIDENCE, and NOT WAIVED. Business advice from a lawyer is not privileged; a lawyer merely copied on a business email is not privileged. Those two mistakes account for an enormous share of real privilege fights, so "for legal advice" is its own required element rather than being implied by the presence of an attorney. WORK PRODUCT (FRCP 26(b)(3)) is a DIFFERENT doctrine with a DIFFERENT strength, and merging the two is a classic error. FACT work product is discoverable on a showing of substantial need AND undue hardship. OPINION work product -- counsel's mental impressions, conclusions, legal theories -- is near-absolute and is NOT surrendered by that showing. Encoded as separate tiers so no combination of need and hardship can ever reach opinion work product. WAIVER + THE FRE 502(b) RESCUE: disclosure to a third party breaks confidentiality and waives -- unless a common-interest relationship covers it, or the disclosure was INADVERTENT and the holder took REASONABLE STEPS to prevent it AND PROMPTLY moved to rectify. All three 502(b) prongs are required; two of three is a waiver. STRUCTURE: PURE DECISION CORE (rules, zero I/O) so the doctrine gates independently of storage, per [[feedback-pure-core-not-hostage-to-storage-2026-07-31]]. license_tier: ORIGINAL LIB.

dependencies 1 imports · 2 importers

nx_matter_lib.nx nx_privlog_lib.nx nx_legal_svc.nx nx_privlog_gate.nx

imports: nx_matter_lib.nx

imported by: nx_legal_svc.nxnx_privlog_gate.nx

structs

none

consts

30const PL_NONE: i64 = 0
31const PL_FACT_WP: i64 = 1
32const PL_OPINION_WP: i64 = 2
34const PL_LOGBUF: i64 = 1024

functions

36func pl_is1(v: i64) -> i64
43func pl_ac_pure(is_comm: i64, atty_client: i64, legal_advice: i64, confidential: i64, waived: i64) -> i64
called by 2: leg_priv_assertmain calls 1: pl_is1
53func pl_ac_elements_pure(is_comm: i64, atty_client: i64, legal_advice: i64, confidential: i64, waived: i64) -> i64
called by 2: leg_priv_assertmain calls 1: pl_is1
65func pl_wp_tier_pure(anticipation: i64, opinion: i64) -> i64
called by 1: main calls 1: pl_is1
73func pl_wp_discoverable_pure(tier: i64, substantial_need: i64, undue_hardship: i64) -> i64
called by 2: mainpl_may_withhold_pure calls 1: pl_is1
83func pl_waived_pure(disclosed_3p: i64, common_interest: i64, inadvertent: i64, reasonable_steps: i64, prompt_rectify: i64) -> i64
called by 2: leg_priv_waivermain calls 1: pl_is1
96func pl_entry_missing_pure(date: i64, author: i64, recipients: i64, doctype: i64, privtype: i64, description: i64) -> i64
called by 1: main calls 1: pl_is1
109func pl_entry_adequate_pure(missing: i64, reveals_content: i64) -> i64
called by 1: main calls 1: pl_is1
119func pl_unlogged_pure(withheld: i64, logged: i64) -> i64
125func pl_log_adequate_pure(withheld: i64, logged: i64, inadequate_entries: i64) -> i64
called by 1: main calls 1: pl_unlogged_pure
133func pl_exposure_pure(withheld: i64, logged: i64, inadequate_entries: i64) -> i64
called by 1: main calls 1: pl_unlogged_pure
141func pl_may_withhold_pure(ac_privileged: i64, wp_tier: i64, substantial_need: i64, undue_hardship: i64) -> i64
called by 1: main calls 2: pl_is1pl_wp_discoverable_pure
148func pl_tier_label(t: i64, out: *u8) -> i64
called by 1: main calls 1: mt_catcopy