Data Model
Current core entities, parser draft tables, review boundary, and durable boundaries.
Core entities
| Table | Purpose | Key relationships |
funds |
Fund-level settings, status, and sponsor/export configuration |
Parent of commitments, fund closings, side-letter uploads, and export tasks |
investors / lps / commitments |
Investor orgs, legal vehicles, and fund-specific participation rows |
commitments links LPs to funds and owns current-side-letter context |
commitment_clause_assignments |
Live clause applicability by commitment |
Links reviewed clauses to side-letter commitments; review flow sets and supersedes these rows |
clauses / clause_categories / clause_groups |
Canonical side-letter clause library and category structure |
clause_categories classifies each clause and supports grouping/recommendations |
side_letter_versions / master_side_letters |
Source uploads with parse/review state and R2 pointer |
Both map to parser/queue flows; side letters are commitment-scoped, MSL rows are fund-scoped |
Upload + parser tables
| Table / column | Purpose |
side_letter_versions.parse_state, master_side_letters.parse_state |
Queue states: uploaded, queued, parsing, parsed, parse_failed, dead_lettered. |
document_parse_attempts |
Append-like parse-attempt log keyed by (source_kind, document_id, attempt_no) with terminal outcome and usage/error metadata. |
document_clause_occurrences |
Live clause provenance links from confirmed clauses back to parsed source spans and confidence. |
document_extracted_paragraphs |
Normalized paragraph corpus used for gap calculations and review boundary editing. |
clause_intake_drafts / clause_intake_sources / clause_intake_reuse_suggestions / clause_intake_draft_grants |
Parser draft rows and source offsets, with optional reuse hints and MSL grant targeting. |
Review boundary / status
| Table / column | Purpose |
side_letter_versions.review_state |
Review-visible values are pending, reviewed, and flagged. UI inbox tabs still map reviewed to a historical complete label. |
side_letter_versions.gap_reviewed_at / uncovered_paragraph_count |
Gap summary and acknowledgment metadata for parse coverage; not a hard stop if the user continues. |
commitment_clause_assignments / is_current on source rows |
Human confirmation creates/updates operative clause assignments; previous side-letter versions become non-current. |
clause_corrections |
Reviewer edits and rejections logged by action type for model-feedback analytics. |
Signals and support tables
| Table | Purpose |
fund_signals, activity_log, review_events |
Event and behavior stream used for audit/replay and operations visibility. |
lp_tasks, lp_task_comments, lp_task_history |
Per-commitment tasking, manual follow-up notes, and history transitions. |
mfn_basic_rules plus explicit investor-category, commitment, and clause-exclusion MFN tables |
MFN rule engine inputs split by target scope and clause scope. |
Append-like invariants
These rows are effectively append-first in practice.
document_parse_attempts and clause_corrections are added per run/action rather than overwritten in the common path.
activity_log is append-only event output with no delete/upsert replacement.
- Side-letter source uploads are mutable on status; they are not immutable historical snapshots.