cla_review · git:20260927.84e1b67 · 2026-09-27 · sha256 fdd7e5112785e735
cla_review git:20260927.84e1b67A
Immutable. This exact content never changes and is served at /api/v1/blob/fdd7e5112785e735.
--- name: cla_review description: Review one convertible-loan term sheet from the lender's side, against the SECA CLA model term sheets and in the context of the startup's cap table, existing loans and SHA. Use before SICTIC members lend. --- # CLA term sheet review Identify the term sheet, extract its terms, judge them for a lender and show what they do in this company. ## Inputs and outputs The async `cla_review(dataset_name, *, document=None, ticket=None, fresh=False)` returns one Markdown report in `list[InsightFile]`, named `cla-review-<startup>-<document>-<model>.md`, one per reviewed document. JSON intermediates (`identification`, `extraction`, `assessment`, `conversion`, `loan-context`, `reference`) live under `insights/cla-review/`; the audits live under `insights/batch-audit/` because `batch_audit` owns them. Every intermediate carries the document identity in its identifier. `document` names the data-room path of the term sheet; omitted, the model selects the most recent CLA term sheet and executed loans are context, not candidates. `ticket` is the member's own amount and is part of the configuration key, so a new ticket replaces the generated result for that document. `fresh` bypasses generated reuse without deleting files or overriding manual inputs; the audits are reused by `batch_audit` on their own configuration key and are not regenerated by `fresh`. **Slices:** slice 0 (contract, rules, references, fixture), slice 1 (question 1: identify, extract, company- and lender-angle assessment), slice 2 (question 2, deterministic part: my conversion, the existing loans, 10/20 before and after) and slice 3 (audits against the selected SECA reference, executability against the SHA and articles, synthesis) are built. The lender-perspective checklists are seeded drafts marked `provisional` in `settings.json` until Enrico has reviewed them. The slices are defined in [docs/cla-review-design.md](../../docs/cla-review-design.md#7-slices). Artifact identity is the slugified full relative path of the document, so equal basenames in different folders stay distinct. The automatic identification is one dataset-level artifact (`identification-automatic`); an explicit `document` gets its own (`<document>-identification`), so the two never reuse each other. The report is `cla-review-<startup>-<document>-<model>.md` directly under `insights/`. ## Workflow and dependencies Prepare and synchronize the startup. Identify the term sheet: an explicit `document` is resolved through the shared document-path resolution at the configured minimum score; otherwise the model selects the most recent CLA term sheet or draft from three retrieval queries, executed loans being context and never candidates, and only the selected path is resolved. An existing `captable_build` classification, when present, seeds candidates and exclusions and is part of the identification key. Extract the selected document with the shared `captable_build` CLA checklist (`config/captable_build/cla_terms.md`, including its term-sheet provisions group); every value carries a verbatim quote and every absence a `missing_terms` entry. Assess it twice: `assess_cla` with the `captable_build` bands (company angle) and `lib.cla_review.assessment` with `config/cla_review/settings.json` (lender angle). Every lender rule carries value, source, status, effective date and an `active` flag; only `approved` rules may be active and judge, an inactive rule yields an open question with the observation, a rule whose input is unavailable is not evaluated and names the input. The term in months is measured from the run date, which is part of the assessment key. Each stage is a managed JSON artifact validated on read and write against `config/cla_review/artifact_schemas.json` or the `captable_build` CLA schema; a stage reuses its artifact when the configuration and the upstream artifact are unchanged. Manual files win, `fresh` bypasses generated reuse only, failures are never saved. `ticket` is part of the report key so a new ticket regenerates the report for the same document without regenerating the extraction. Question 2 reads the consolidated `captable_build` snapshot through `lib.captable.insights.select_consolidated`; it is never generated here and the registry declares no prerequisite. Its state is part of the conversion and loan-context keys: `reusable` (content keyed), `absent` or `stale`. `lib.cla_review.conversion` resolves and labels every input before any number (ticket: given, else the aggregate amount divided by the configured member count as a stated assumption; round size: the qualified-financing minimum; denominator, interest, currency, nominal value, valuation grid from the cap or `valuation_grid_absolute`), omits a calculation whose input is missing with the reason, and prices the ticket at every grid point and conversion date through `lib.captable.model` next to the existing loans (`lib.captable.notes`) and the other new lenders. `lib.cla_review.loans` puts the term sheet next to every executed loan, reads the MFN effect both ways, checks identical-terms membership and counts the 10/20 rules before and after N members through `aggregate_clas` on a synthetic executed copy. The SECA reference is the one the term sheet names through its extracted `documentation_form` (`settings.documentation_form_references`, an evidenced choice without a model call); a `bespoke` or `unstated` form ranks both references in one direct model call. The `reference` artifact records which path was taken. Every checklist in `config/cla_review/checklists/` is then audited through [batch audit](../standards_and_architecture/SKILL.md#checklist-audits) with the complete term sheet and the selected reference as the cacheable prefix, and every checklist in `executability_checklists/` with the term sheet and its extracted conversion assumptions (capital sources, consents, pre-emption, share class, accession) plus the SHA, articles and register documents a `captable_build` classification names, so retrieval reaches the company's own documents; the SECA drafting notes are evidence, never instructions. `skill_name` is `cla_review-<document>`, which puts the document identity into the audit identifier and the stored `skill` field. Each audit is validated complete before the report; a failed check is an error, not a finding. The synthesis is one Markdown generation over the audits, both assessments and question 2 under `config/cla_review/summary_instructions.md`, which forbids turning an `open_question` rule, a missing input or an insufficient snapshot into a verdict. The report renders every audit as a table and ends with the synthesis. ## Side effects and failure behavior Preparation may import, convert and index documents. The review calls models and saves intermediates and the report; it sends nothing. An absent or stale cap-table snapshot yields an insufficient-evidence paragraph for question 2 and the run completes; a malformed snapshot, failed path resolution and technical failures remain errors. No plausible term sheet, an unresolvable path, an extraction failure or a failed audit check stops the run without saving a partial report. A run costs one model call per check (41 with the seeded checklists), each carrying the term sheet and the reference in its prefix, plus at most one ranking and one synthesis. The report aids human review and is not legal advice. ## Usage ```bash conda run -n sictic-env python -m skills.harness '/cla_review "<STARTUP>"' conda run -n sictic-env python -m skills.harness -- /cla_review "<STARTUP>" --document "legal/cla-term-sheet.pdf" --ticket 25000 conda run -n sictic-env python -m skills.cla_review --startup "<STARTUP>" --document "legal/cla-term-sheet.pdf" --ticket 25000 --fresh ``` The direct CLI uses `--startup`; `--dataset` and `-d` remain compatibility aliases. ## References - [Implementation](cla_review.py) - [Design and slices](../../docs/cla-review-design.md) - [Configuration, rules, checklists and SECA reference term sheets](../../config/cla_review/) - [Shared CLA extraction checklist](../../config/captable_build/cla_terms.md) - [Shared audit contract](../standards_and_architecture/SKILL.md#checklist-audits)