Enforce global security ID uniqueness#270
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@copilot please review |
Please point me to the specific file or concern you want reviewed. I checked the current PR branch workflows and they’re passing, so I don’t yet see an actionable issue to change. |
|
@copilot please review the global |
…y' into codex/ocf-security-id-uniqueness
…y' into codex/ocf-security-id-uniqueness
…y' into codex/ocf-security-id-uniqueness
…y' into codex/ocf-security-id-uniqueness
There was a problem hiding this comment.
Pull request overview
This PR enforces global security_id uniqueness across security issuance types (stock, warrant, convertible, equity compensation) by centralizing the uniqueness check into a shared CapTable helper and wiring it into the codegen create/edit loops. This aligns the ledger mutation rules with OCF’s definition of security_id as a cross-transaction identifier and adds DAML script tests to cover cross-type and same-batch collisions.
Changes:
- Add
securityIdExists/assertSecurityIdAvailablehelpers to the CapTable codegen template and use them from generated create/edit branches. - Update DAML script tests to cover cross-type duplicates, same-batch duplicates, and edits attempting to reuse another type’s
security_id. - Bump
OpenCapTable-v34package version and update DAR / lock metadata to match.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Test/daml/OpenCapTable/TestSecurityIdValidation.daml | Adds test coverage for global security_id uniqueness across issuance types, including same-batch collisions and edit-time reuse attempts. |
| Test/daml.yaml | Points the Test package data-dependency at the bumped OpenCapTable-v34 0.0.14 DAR. |
| scripts/codegen/templates/loops/edit-case.daml | Replaces per-type security_id uniqueness checks with the shared global helper during edits (when security_id changes). |
| scripts/codegen/templates/loops/create-case.daml | Replaces per-type security_id uniqueness checks with the shared global helper during creates. |
| scripts/codegen/templates/CapTable.daml.template | Introduces securityIdExists and assertSecurityIdAvailable used by create/edit paths to enforce global uniqueness. |
| OpenCapTable-v34/daml.yaml | Bumps OpenCapTable-v34 version from 0.0.13 to 0.0.14. |
| dars/OpenCapTable-v34/0.0.14/OpenCapTable-v34.dar | Adds the new packaged DAR artifact (LFS pointer). |
| dars/dars.lock | Registers the new 0.0.14 DAR (sha/size/sdk/uploadedAt metadata). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfa0f14194
ℹ️ 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".
…y' into codex/ocf-security-id-uniqueness
…y' into codex/ocf-security-id-uniqueness
|
@copilot review |
Reviewed those files in this branch:
Given current codegen/update ordering (deletes → edits → creates), this does prevent reuse of the same OCF
Completed review of the global |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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 pause |
✅ Action performedReviews paused. |
|
Restacked onto #254 at Local validation on |
|
This enforcement is now folded into #238 as part of the authorized/reserved share-ceiling category. Commit |
Summary
security_iduniqueness across stock, equity compensation, warrant, and convertible issuances.OCF requirement
OCF defines
security_idas the identifier by which an issued security is referenced by every future transaction:https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF/blob/dd84bdb6bafb63681c77166f315cea5a2078a4c8/schema/primitives/objects/transactions/SecurityTransaction.schema.json#L8-L13
OCF separately defines transfer results as identifiers for new securities and the optional balance ID as the security holding the remainder. Those distinct roles require unique identities within the cap-table lifecycle:
https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF/blob/dd84bdb6bafb63681c77166f315cea5a2078a4c8/schema/primitives/objects/transactions/transfer/Transfer.schema.json#L12-L24
The same new-security semantics are explicit for reissuances:
https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF/blob/dd84bdb6bafb63681c77166f315cea5a2078a4c8/schema/primitives/objects/transactions/reissuance/Reissuance.schema.json#L8-L14
Stack
Stacked on #254 /
codex/ocf-vesting-graph-integrity.Validation
npm run builddpm test --files daml/OpenCapTable/TestSecurityIdValidation.daml --colornpm testnpm run lintnpm run lint:damlnpm run formatnpm run check:schema-gaps -- --ocf-schema-dir /tmp/open-cap-format-ocf-schema-check/schemanpm run verify-darsnpm run check-upgrade-compat(0.0.13 -> 0.0.14)This PR remains draft until current-head CI is green.