Enforce instrument temporal eligibility#278
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 55 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 selected for processing (2)
📝 WalkthroughWalkthroughThe change adds temporal eligibility, trigger uniqueness, interest-rate schedule, and successor-expiration validation for OpenCapTable instruments. It wires these checks into ChangesInstrument temporal validation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant UpdateCapTable
participant validateInstrumentTemporalEligibility
participant ConversionValidation
participant SuccessorValidation
UpdateCapTable->>validateInstrumentTemporalEligibility: validate finalMaps
validateInstrumentTemporalEligibility->>ConversionValidation: validate triggers and interest-rate schedules
validateInstrumentTemporalEligibility->>SuccessorValidation: validate successor expiration and trigger continuity
validateInstrumentTemporalEligibility-->>UpdateCapTable: validation result
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@copilot review |
|
@codex review |
|
@coderabbitai review |
|
@cursor review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4bd233d. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bd233d315
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Enforces OCF-aligned temporal eligibility rules for conversions/exercises and validates convertible-note interest schedules, with checks executed against the final cap-table state to prevent retroactive invalidation from later edits.
Changes:
- Adds final-state validations for conversion trigger eligibility, warrant/equity-comp expiration constraints, and exercise/conversion date validity.
- Tightens OCF shape validation for elective date-range triggers and interest-rate schedules (sorted, no duplicate starts, no inclusive overlaps).
- Introduces a new DAML script test suite covering boundary conditions and invalidating-edit scenarios; bumps OpenCapTable-v34 to 0.0.16.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Test/daml/OpenCapTable/TestInstrumentTemporalEligibility.daml | Adds script-based behavioral coverage for trigger eligibility, expirations, interest schedules, and invalidating edits. |
| Test/daml.yaml | Updates test package data-dependency to the new OpenCapTable-v34 0.0.16 DAR. |
| scripts/codegen/templates/CapTable.daml.template | Adds final-state temporal eligibility validation across issuance terms and exercise/conversion events. |
| OpenCapTable-v34/daml/Fairmint/OpenCapTable/Types/Conversion.daml | Strengthens interest rate and trigger field validations (range ordering, schedule consistency). |
| OpenCapTable-v34/daml.yaml | Bumps package version to 0.0.16. |
| dars/OpenCapTable-v34/0.0.16/OpenCapTable-v34.dar | Adds the new versioned DAR artifact (Git LFS pointer). |
| dars/dars.lock | Registers the new DAR in the lockfile. |
|
@copilot review Please review exact head |
|
@codex review Please re-review exact head |
|
@coderabbitai review Please review exact head |
|
@cursor review Please review exact head |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 91daec0. Configure here.
|
@copilot The review session for exact head |
|
@coderabbitai Your 2026-07-11T23:42Z response said the exact-head review for |
Reviewed exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="Fairmint/open-captable-protocol-daml"
PR=278
echo "=== PR head sha now ==="
gh pr view $PR --repo $REPO --json headRefOid,mergeable,state -q .
echo "=== All reviews with commit_id ==="
gh api repos/$REPO/pulls/$PR/reviews --paginate | jq -r '.[] | "\(.id) | \(.user.login) | \(.commit_id) | \(.state) | \(.submitted_at)"'
echo "=== coderabbitai reviews full bodies for commit 0401ec2 ==="
gh api repos/$REPO/pulls/$PR/reviews --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | "id=\(.id) commit=\(.commit_id) state=\(.state) time=\(.submitted_at)\nBODY:\n\(.body)\n===END==="'
echo "=== inline review comments by coderabbitai on commit 0401ec2 ==="
gh api repos/$REPO/pulls/$PR/comments --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | select(.commit_id=="0401ec232616b83664c4e2906eb55969c093777e" or .original_commit_id=="0401ec232616b83664c4e2906eb55969c093777e") | "id=\(.id) path=\(.path)\n\(.body)\n---"'
echo "=== all issue comments by coderabbitai after 2026-07-11T23:42Z ==="
gh api repos/$REPO/issues/$PR/comments --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | select(.created_at > "2026-07-11T23:42:00Z") | "\(.created_at)\n\(.body)\n---"'Length of output: 12620
Specifics:
I'm triggering the review again below. Once it completes and posts (either as a review with actionable comments, or a review with an empty body indicating no findings), I will report back here with the explicit verdict tied specifically to commit ✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. You're currently rate limited under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. Your next review will be available in 39 minutes. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Test/daml/OpenCapTable/TestHelpers.daml`:
- Around line 346-351: Update the three conversion test cases in
TestConvertibleSecurityBalances, including
testConvertibleSecurityBalance_ConversionWithBalanceRetiresSource,
testConvertibleSecurityBalance_ConversionWithoutBalanceRetiresSource, and
testConvertibleSecurityBalance_ConversionCannotCreateZeroBalance, so their
explicit convertibleConversion trigger-id arguments use
"TRIGGER-CONVERTIBLE-SUCCESSOR" instead of the obsolete issuance-derived id.
Keep the submitMustFail assertions and balance/retirement scenarios unchanged.
In `@Test/daml/OpenCapTable/TestInstrumentTemporalEligibility.daml`:
- Around line 413-430: The test
testInstrumentTemporalEligibility_FinalStateTriggerIdChecksRejectDuplicates only
validates duplicate-detection predicates directly; add an end-to-end final-state
validation scenario that constructs a corrupted CapTable via direct createCmd
with duplicate convertible and/or warrant trigger IDs, then asserts the actual
final-state check rejects it, following the pattern of
testSecurityIssuance_FinalStateDuplicateSecurityIdsFail.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9cf7a762-dcc1-4b13-879c-21ed8bb689b0
⛔ Files ignored due to path filters (1)
dars/dars.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
OpenCapTable-v34/daml.yamlOpenCapTable-v34/daml/Fairmint/OpenCapTable/OCF/ConvertibleIssuance.damlOpenCapTable-v34/daml/Fairmint/OpenCapTable/OCF/WarrantIssuance.damlOpenCapTable-v34/daml/Fairmint/OpenCapTable/Types/Conversion.damlTest/daml.yamlTest/daml/OpenCapTable/TestConvertibleSecurityBalances.damlTest/daml/OpenCapTable/TestConvertibleTransfer.damlTest/daml/OpenCapTable/TestEquityCompensationTransfer.damlTest/daml/OpenCapTable/TestHelpers.damlTest/daml/OpenCapTable/TestInstrumentTemporalEligibility.damlTest/daml/OpenCapTable/TestNonStockSecurityBalances.damlTest/daml/OpenCapTable/TestSecurityIdValidation.damldars/OpenCapTable-v34/0.0.16/OpenCapTable-v34.darscripts/codegen/templates/CapTable.daml.template
|
Addressed the exact-head CodeRabbit review in |
|
@copilot review exact head |
|
@codex review exact head |
|
@cursor review exact head |
|
@coderabbitai review\n\nPlease review exact head |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f4eb371. Configure here.
Reviewed exact head |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@coderabbitai full review Please perform a substantive full review of exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="Fairmint/open-captable-protocol-daml"
PR=278
echo "=== PR head sha now ==="
gh pr view $PR --repo $REPO --json headRefOid,mergeable,state -q .
echo "=== All reviews with commit_id ==="
gh api repos/$REPO/pulls/$PR/reviews --paginate | jq -r '.[] | "\(.id) | \(.user.login) | \(.commit_id) | \(.state) | \(.submitted_at)"'
echo "=== coderabbitai reviews full bodies for commit f4eb3714 ==="
gh api repos/$REPO/pulls/$PR/reviews --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | select(.commit_id=="f4eb3714dbf8de2a5de49102db4149fedb874aae") | "id=\(.id) state=\(.state) time=\(.submitted_at)\nBODY:\n\(.body)\n===END==="'
echo "=== recent issue comments by coderabbitai ==="
gh api repos/$REPO/issues/$PR/comments --paginate | jq -r '.[] | select(.user.login=="coderabbitai[bot]") | "\(.created_at)\n\(.body[0:400])\n---"' | tail -60Length of output: 6757
Two CodeRabbit reviews are recorded against the exact head So: No actionable findings for exact head For completeness: the later ✅ Action performedReview finished.
|
Preliminary OCF validation-policy auditPolicy: OCF Validation Policy Appears supported
Needs line-by-line evidence or narrowing
Proposed next step |
Summary
OCF requirement references
Validated against Open Cap Format commit
dd84bdb6bafb63681c77166f315cea5a2078a4c8:trigger_date.trigger_idis unique within the parent trigger list.Coverage
The new behavioral suite covers valid boundaries, duplicate trigger identifiers, unusable root trigger sets, root-valid trigger continuity across convertible and warrant successors, mixed historical/live trigger sets, invalid/overlapping note-rate intervals, OCF-valid implicit next-rate boundaries, input-order independence, edits that would retroactively invalidate historical activity, equity-compensation transfer/cancellation successors that omit or extend the source expiration, and convertible successors that rename inherited trigger IDs. It preserves inherited economic terms and trigger identity across successor securities.
This bumps
OpenCapTable-v34from0.0.15to0.0.16and includes the versioned DAR plus upgrade verification.Validation
Exact head:
f4eb3714dbf8de2a5de49102db4149fedb874aaenpm run buildnpm test(720 DAML scripts passed against Enforce successor security continuity #276 exact head6925fe65aaee448a1844dd87cc9c9a879447a9f3)npm run lint(0 errors; 2 pre-existing warnings)npm run lint:daml(no hints)npm run formatnpm run check:schema-gaps -- --ocf-schema-dir /tmp/open-cap-format-ocf-schema-check/schema(55/55 clean)npm run codegennpm run verify-packagenpm run verify-dars(16 verified;0.0.16SHA-2562556607ba1f16b0df0ed91ef2bbc0877c4250563b8fde0cdc9cb2e99ffbe9928, 3,331,338 bytes; SDK3.4.10)npm run check-upgrade-compat(0.0.15 -> 0.0.16)git diff --checkStack
Targets
codex/ocf-balance-security-continuityso this PR contains only temporal-consistency enforcement. Retarget tomainafter the base PR lands.Note
Medium Risk
Changes cap-table acceptance rules for conversions, exercises, transfers, and edits across multiple instrument types; incorrect edge cases could block valid OCF cap tables or allow bad state until final validation runs.
Overview
Adds temporal eligibility rules across convertibles, warrants, and equity compensation, wired into final cap-table validation so later edits cannot retroactively bless invalid conversions or exercises.
Schema-level validation now rejects duplicate
trigger_idvalues on convertible and warrant issuances, requires elective date ranges to be ordered (start <= end), and validates note interest-rate schedules (sorted non-overlapping intervals, inclusive end before next start, per-rate end ≥ start). Convertible successor continuity compares full trigger lists including IDs (no more strippingtrigger_idfor equality).Cap table gains
validateInstrumentTemporalEligibility: root convertibles/warrants must keep at least one trigger reachable on or after issuance; trigger terms must respect warrant expiration; conversions/exercises must occur on the correct automatic date or within inclusive elective ranges; equity-compensation successors must preserve sourceexpiration_date. Package bumps to 0.0.16 with tests and versioned DAR.Reviewed by Cursor Bugbot for commit f4eb371. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes
Tests