Snow Compliance DemoBoard review · v1

Proof of concept

POC & CUAD findings

We extracted a 30-document CUAD sample, examined its real shape against the original plan, and built a Python + SQLite proof of concept that maps directly to Snowflake.

Open the interactive demo →

What we built

Footwork in place

ArtifactPathPurpose
CUAD extractorpoc/extract_cuad.pyDownloads CUAD, normalizes the first N docs, emits the shape report
SQLite schemapoc/schema.sqlMirrors the Snowflake model: dims, fact, bridge, authorization, audit
Seederpoc/seed.pyLoads 30 contracts + synthetic users/matters; exports the static demo data
Risk enginepoc/risk.pyShared, rule-based rubric (real CUAD categories); mirrors sql/04
Access layerpoc/access.pyThe enforcement point — authorization check + audit logging
POC web serverpoc/server.pyStandard-library HTTP server; real login, real denials, real audit
Simulated Snowflakepoc/snowflake_sim.pyEmulates role context, row access policy, masking, query history, and a risk register offline (see Snowflake options)
Offline SQL harness + CIscripts/run_sql_offline.py, .github/workflows/ci.ymlRuns sql/01…05 through fakesnow (DuckDB) in CI; reports supported vs. governance statements
Static demodemo/index.htmlBoard-clickable login/audit demo + Snowflake console + risk register, hosted on Pages
Shape reportpoc/analysis/cuad_shape_report.mdFull statistics over the 30-document sample
Evidence packpoc/analysis/evidence_pack.mdRole × matter verification matrix (expected vs observed) with reproduction steps
python3 poc/extract_cuad.py --limit 30   # fetch + normalize the sample
python3 poc/seed.py                      # build SQLite DB + demo data
python3 poc/build_demo.py                # regenerate the static Pages demo
python3 poc/server.py                    # functional POC at http://localhost:8000
python3 scripts/run_sql_offline.py       # run sql/01…05 offline via fakesnow (CI)
Analysis

How the real data aligns with the plan

30
documents extracted
1,230
annotations (30×41)
41
clause categories
1–175k
chars per contract
Original plan assumedCUAD actually providesChange required
510 contracts, 41 annotated categoriesConfirmed (aok_v1.0)None
A contract_type fieldNo such field; type is embedded in the title with EX-10.x noiseAdd title normalization
A structured parties fieldNo parties field; parties are the "Parties" clause annotationModel as annotation, not a column
Clauses carry Yes/No answersExtractive spans: answers[{text, answer_start}] + is_impossibleDerive presence from is_impossible
Clause text with start/end offsetsOnly answer_start; end must be derived from the text lengthDerive end; store snippet
Categories like Indemnification, Limitation of Liability, Confidentiality, WarrantiesNone of these exist; liability is Uncapped Liability / Cap On LiabilityRemap the rubric
Multiple paragraphs per documentOne paragraph (the full contract) per documentSimplifies ingestion
The headline finding Four clause categories named in the original brainstorm don't exist in CUAD. The risk rubric was remapped to real categories (Uncapped Liability, Cap On Liability, Termination For Convenience, Anti-Assignment, Change Of Control, Minimum Commitment, Governing Law, Non-Compete, Exclusivity).
Path to Snowflake

How the POC maps to the warehouse

POC (SQLite / Python)Snowflake target
dim_*, fact_clause, bridge_matter_contractSame tables under CORE (sql/02_data_model.sql)
access.py authorization checkRow access policy over matter_authorization (sql/03)
PII masking in the query pathMasking policies + classification tags
audit_log tableAppend-only audit table and QUERY_HISTORY / ACCESS_HISTORY
Risk scoring in seed.pyCORE.ref_risk_rule + MARTS.mart_matter_risk (sql/04)
POC web serverNot needed — enforcement moves into the warehouse; any BI/UI reads governed tables
Interactive

Try the access-control demo

Sign in as alice, bob, or carol (attorneys/paralegal) to see only your matters, request a document outside your matters to watch the denial get recorded, then sign in as admin to read the audit log of who accessed which files.

Open the interactive demo →

Simulated vs. functional The hosted demo simulates the model in the browser so it runs on static Pages. The SQLite POC enforces it for real server-side; both share the same authorization map and denial semantics.