Enforce warrant conversion right references#247
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…-right-references' into codex/ocf-warrant-conversion-right-references
There was a problem hiding this comment.
Pull request overview
This PR adds CapTable batch-time validation to ensure warrant exercise-trigger conversion targets reference an existing stock class in the post-batch stock-class map, and introduces tests covering same-batch creation, missing targets, edit-time invalid targets, and preventing deletion of a referenced stock class.
Changes:
- Add
validateWarrantConversionRightReferencestoUpdateCapTablevalidation flow. - Add a new Daml Script test module covering warrant conversion-target reference scenarios.
- Refresh the packaged DAR and
dars.lockto reflect regenerated artifacts.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Test/daml/OpenCapTable/TestWarrantConversionRightReferences.daml | Adds script tests for warrant exercise-trigger conversion target reference validation. |
| scripts/codegen/templates/CapTable.daml.template | Adds warrant conversion-target reference validation during UpdateCapTable. |
| dars/OpenCapTable-v34/0.0.2/OpenCapTable-v34.dar | Updates DAR LFS pointer for regenerated package. |
| dars/dars.lock | Updates locked sha/size metadata for the regenerated DAR. |
| (\trigger -> case trigger.conversion_right of | ||
| OcfRightWarrant warrantRight -> | ||
| validateOptionalStockClassReference "Warrant conversion target" maps warrantRight.converts_to_stock_class_id | ||
| _ -> pure ()) |
| (\trigger -> case trigger.conversion_right of | ||
| OcfRightWarrant warrantRight -> | ||
| validateOptionalStockClassReference "Warrant conversion target" maps warrantRight.converts_to_stock_class_id | ||
| _ -> pure ()) |
|
Superseded by #251, which consolidates the reference-integrity work into one PR. Before closing this stack PR, I rechecked the live review comments and folded the actionable improvements into #251: StockPlan create-tier ordering, document related-object error messages, stock-class conversion source IDs, warrant conversion validation across all OcfAnyConversionRight variants, WarrantIssuance same-batch vesting-term edits, and immutable DAR backup versioning. |
Summary
OcfRightWarrant.converts_to_stock_class_idvalues insideWarrantIssuance.exercise_triggersagainst the final CapTable stock-class map.OCF documentation
WarrantIssuance.schema.jsondefines warrant issuanceexercise_triggers.WarrantConversionRight.schema.jsonspecializes conversion rights for warrants.ConversionRight.schema.jsondescribesconverts_to_stock_class_idas the identifier of an existing, known stock class.Validation
NODE_PATH=/Users/fairnick/Documents/code/fairmint/open-captable-protocol-daml/node_modules PATH="/Users/fairnick/Documents/code/fairmint/open-captable-protocol-daml/node_modules/.bin:$HOME/.dpm/bin:$PATH" npm run buildJAVA_HOME=/opt/homebrew/opt/openjdk@17 PATH="/opt/homebrew/opt/openjdk@17/bin:$HOME/.dpm/bin:$PATH" dpm test --show-coverage --color --coverage-ignore-choice 'splice-amulet:.*'Note
Medium Risk
Changes which cap-table batches succeed or fail for warrant data, but mirrors existing convertible reference checks and only affects declared conversion targets.
Overview
CapTable batch updates now validate warrant exercise trigger conversion rights: when an
OcfRightWarrantsetsconverts_to_stock_class_id, that ID must exist in the post-batch stock-class map (same optional-reference pattern as convertibles). Unset targets stay allowed.UpdateCapTableruns the new check alongside existing stock-class and convertible conversion reference validation. Daml script tests cover same-batch target creation, missing targets on create/edit, and blocking stock-class delete when a warrant still points at it. The packaged OpenCapTable-v34 DAR anddars.lockare refreshed for the regenerated contract.Reviewed by Cursor Bugbot for commit f937857. Bugbot is set up for automated code reviews on this repo. Configure here.