Enforce OCF schema field constraints#269
Conversation
…nto codex/ocf-stock-plan-pool-ceiling-v2 # Conflicts: # scripts/codegen/templates/CapTable.daml.template
…nto codex/ocf-stock-plan-pool-ceiling-v2
…nto codex/ocf-stock-plan-pool-ceiling-v2
…nto codex/ocf-stock-plan-pool-ceiling-v2
…nto codex/ocf-stock-plan-pool-ceiling-v2
Also reject expires_at on ratio stock-class conversion rights and refresh fixtures for the stricter validator.
|
@copilot review Retrying the mandatory review gate for exact head |
Reviewed exact head |
|
@codex review current head @coderabbitai resume cursor review current head Copilot completed its exact-head review with no blocking findings. Please review the grouped OCF field-shape constraints and numbered-security lineage behavior on this same revision. |
|
✅ Action performedReviews resumed. Review finished.
|
|
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". |
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 66c1b9b. Configure here.
|
Added the remaining direct optional
OCF basis:
Validation is green locally: build, focused 28 behavioral + 2 setup scripts, full 536 behavioral + 2 setup scripts, codegen/package verification, format, ESLint (0 errors; 2 pre-existing warnings), DAML lint, 55/55 schema-gap check, 11 DARs, and The PR is back in draft pending exact-head CI. Downstream stack heads will be restacked only after this base is green. |
|
@copilot review exact head Please review the optional |
Reviewed exact head |
|
@codex review exact head Copilot has completed this exact revision with no blocking findings. Please review the optional |
|
@cursor review exact head Copilot has completed this exact revision with no blocking findings. Please review the optional |
|
@coderabbitai review Please perform the required substantive review of exact head |
|
✅ Action performedReview finished.
|
|
@coderabbitai Please explicitly confirm whether your completed review of exact head |
|
Tip For best results, initiate chat on the files or code changes.
|
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 e9c512b. Configure here.
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
Preliminary OCF validation-policy auditPolicy: OCF Validation Policy Appears supported
Needs line-by-line evidence or narrowing
Proposed next step |
Summary
Consolidates the schema/field-format OCF enforcement PRs into one category branch stacked on #268. Supersedes #257, #258, #259, #260, #261, #262, #263, #264, #265, #266, and #267.
Grouped requirements enforced here:
path/urimutual-exclusion schema rule.cost_basisand warrantexercise_pricepayloads enforce the OCFMonetaryamount/currency constraints on both create and edit.Review feedback carried forward from superseded PRs:
expires_at.OCF documentation
cost_basisisMonetaryexercise_priceisMonetaryMonetaryrequires amount and ISO currency fieldsThe exercise, release, reissuance, and conversion schemas require the field but do not declare
minItemsoruniqueItems. This PR preserves zero-cardinality input while rejecting repeated references to the same resulting OCF object as a contract-level consistency rule.Scope boundary
This PR strictly validates constraints representable by OpenCapTable-v34. It does not claim complete structural parity for StockClassConversionRight: the v34 record predates the current nested ratio mechanism and cannot represent required
rounding_typeor a targetless future-round right without changing the package model. This PR intentionally does not synthesize dummy target, trigger, or rounding values. The proper completion is a corrected next-version model plus an explicit v34-to-next-version migration.Validation
npm run buildnpm test(536 behavioral scripts plus 2 setup scripts)npm run lint(0 errors; 2 pre-existing warnings inscripts/remove-participant-dar.ts)npm run lint:damlnpm run formatnpm run check:schema-gaps -- --ocf-schema-dir /tmp/open-cap-format-ocf-schema-check/schemanpm run verify-darsnpm run verify-packagenpm run check-upgrade-compat(0.0.10 -> 0.0.11)git diff --checkOpenCapTable-v34-0.0.11.dar: SHA-25623fc9940acf68156ce2594da14b0783ce38c9195d9aaf15e113fb5124f05d8ee, 3,114,372 bytesNote
High Risk
Wide validation tightening on issuance, conversion, transfers, and share-number lineage can reject previously accepted cap-table payloads; stock-class conversion is narrowed to ratio-only in v34, which is a breaking behavioral change for importers.
Overview
Bumps OpenCapTable-v34 to 0.0.11 and tightens OCF-shaped validation across cap-table templates and shared types, with a large DAML test expansion.
Arrays and documents: Transfer/consolidation paths use shared non-empty + unique string-array helpers; other transaction types still allow empty
resulting_security_idsbut reject duplicates. Documents must have exactly one ofpathoruri, not both or neither.Formats: ISO currency (3 uppercase letters), phone (space-separated parts with optional
ext./extension), and country subdivision codes are validated centrally; issuer and address fields use the shared rules.Conversion: Shared trigger variant rules (
validateOcfConversionTriggerFields) gate which optional date/condition fields are allowed. Convertible mechanisms no longer accept PPS/valuation/ratio variants OCF disallows; warrant valuation usesCAP/FIXED/ACTUAL; share-price and valuation-based discount rules are stricter. Stock-class conversion rights in v34 are limited to ratio mechanics with requiredconversion_priceand no extra mechanism fields; non-ratio stock-class rights fail validation.Stock issuance: Optional
cost_basisand warrantexercise_pricego throughMonetaryvalidation. Share number ranges must sum to quantity, not overlap on the issuance, and cap-table logic (tests) enforces per-class final-state overlap and lineage rules on transfers, reissuance, and consolidation.Packaging: New 0.0.7–0.0.11 DAR artifacts and lockfile entries; tests depend on 0.0.11.
Reviewed by Cursor Bugbot for commit e9c512b. Bugbot is set up for automated code reviews on this repo. Configure here.