Skip to content

OCF Validation Policy

HardlyDifficult edited this page Jul 17, 2026 · 5 revisions

OCF validation policy

Official Open Cap Format schemas and explicit protocol rules determine data validity. The DAML package must not add product-specific requirements merely because one application's data follows them.

Layers

  1. OCF record validators enforce their own schema and semantic constraints.
  2. The generated CapTable checks configured references against current aggregate maps.
  3. DAML Script tests exercise records, lifecycle, batch ordering, and reference failures.

Creates and edits reject missing referenced IDs where a configured authoritative target map exists. Deletes generally archive the target and remove its map entry without a reverse-reference scan; Financing has an explicit post-batch aggregate check. Do not assume every delete prevents dangling references.

Alignment rules

  • Match schema required/optional, array, enum, and scalar constraints.
  • Numeric zero is valid unless the schema or an explicit protocol rule says otherwise. Current examples of positive rules include StockTransfer quantity and ConvertibleTransfer amount.
  • Optional text follows the shared non-empty rule when present.
  • Cross-object checks must use the semantically correct target map.
  • Fix schema/contract disagreement with a focused regression test and compatibility review.

The schema-gap checker finds structural gaps but does not replace semantic review. Tests under Test/daml/OpenCapTable are executable evidence of current guarantees.

Clone this wiki locally