Skip to content

Validate conversion and exercise reader payloads#436

Draft
HardlyDifficult wants to merge 7 commits into
codex/decoder-backed-issuance-readersfrom
codex/decoder-backed-conversion-exercise-readers
Draft

Validate conversion and exercise reader payloads#436
HardlyDifficult wants to merge 7 commits into
codex/decoder-backed-issuance-readersfrom
codex/decoder-backed-conversion-exercise-readers

Conversation

@HardlyDifficult

@HardlyDifficult HardlyDifficult commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route convertible/stock conversion and equity-compensation/warrant exercise readers through their generated DAML codecs
  • require exact template identity before interpreting same-wrapper contract families
  • expose correlated native types, including non-empty result IDs where DAML requires them and deeply readonly read results
  • enforce exact runtime semantics for required text, positive and signed Numeric(10), capitalization, and bounded plain-data inputs
  • keep direct, generic, operation, batch, and OcpClient APIs type- and behavior-consistent
  • add adversarial runtime, declaration, package-consumer, immutability, and composition coverage

Why

These boundaries previously relied on partial structural checks and mutable, weakly correlated inputs. Malformed numerics, missing required lists, same-wrapper cross-family contracts, and hostile object shapes could reach conversion code, while public types did not fully express the DAML invariants.

The stricter rejection behavior and stronger public types are intentionally backwards-incompatible.

Validation

  • npm run format
  • npm run lint
  • npm run typecheck
  • npm run test:declarations
  • npm run test:ci — 115 suites, 7,695 tests; 90.62% statement coverage
  • npm pack --dry-run --json — 1,262 files; 588,762-byte package
  • focused integrated coverage — 10 suites, 858 tests
  • canonical schema inventory — 56 objects / 160 resources; fingerprint e1ac1de3030914e4d1c25872bb43f2dd4af2d0794a1d78180ad446cb2b941a56

Stack

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77411f8c-5ec8-486a-8681-08fd0ef3c2ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/decoder-backed-conversion-exercise-readers

Comment @coderabbitai help to get the list of available commands.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

…coder-backed-conversion-exercise-readers

# Conflicts:
#	src/functions/OpenCapTable/convertibleConversion/damlToOcf.ts
#	src/functions/OpenCapTable/convertibleConversion/getConvertibleConversionAsOcf.ts
#	src/functions/OpenCapTable/equityCompensationExercise/getEquityCompensationExerciseAsOcf.ts
#	src/functions/OpenCapTable/stockConversion/getStockConversionAsOcf.ts
#	test/converters/exerciseConversionConverters.test.ts
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Completed decoder-backed conversion/exercise boundaries are pushed at independently audited exact head ade5452d260ff795a78774c360a1c79a5d45f2e1, including final corrected #435 integration.

The SDK now has exact generated-codec readers and strict writers for convertible/stock conversion plus equity/warrant exercise; valid empty and duplicate result IDs and empty Text are preserved; Numeric(10) and calendar dates are exact; proxy/accessor/hostile-thenable traps are not invoked; direct, generic, operation, batch, OcpClient, source/dist/package types remain correlated; no Int assumptions were introduced.

Final audit and validation are green: targeted 11 suites / 963 tests; full 112 suites / 7,359 tests; build/declarations/exact-public/cardinality/package-consumer; typecheck; lint; formatting; schema inventory fingerprint; ancestry/remerge/diff checks. This PR remains draft and unassigned while fresh remote CI runs; Copilot will be requested first on the exact remote head.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

QuickStart regression correction is pushed at exact head a801319. The stale integration test used id: empty string while expecting omission failure, but the pinned OCF schema requires the property without imposing minLength, so empty Text is valid. The test now truly omits id in all three LocalNet cases; a four-entity unit matrix separately proves omitted IDs fail with REQUIRED_FIELD_MISSING across direct, operation, generated, and batch paths while empty IDs remain lossless. Independent audit found no production cast or ancestry issue. Exact validation passes: 7 focused suites / 515 tests, full 112 suites / 7,363 tests, typecheck, lint, formatting, build, declarations, exact-public/cardinality, and package-consumer gates. Keeping the PR draft/unassigned while fresh remote CI reruns.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Hardening/restack update is pushed at exact head 755c56b51fc33931c49ca83244d0573b088536e3. It includes the hosted-stable #435 head e661867e6762386181df0b9ec505d9d4d646db48 through a normal merge commit; there was no amend or force-push.

The independently audited implementation now enforces the pinned DAML/OCF semantics across direct, generic, operation, batch, and OcpClient paths, including non-empty result-array types where required, exact positive/signed Numeric(10) behavior, exponent canonicalization on generated reads with strict OCF writer rejection, deeply readonly/frozen read results, bounded hostile-input handling, and source/built/package declaration parity.

Exact-head local validation is green: focused 10 suites / 858 tests; full and coverage 115 suites / 7,695 tests; typecheck; declarations/source+built/package consumer; lint; formatting; diff checks; canonical inventory; and package dry-run (1,262 files, 588,762 bytes).

The PR remains draft and unassigned while hosted build-and-test and QuickStart checks run. CodeRabbit's status check is green but it has not submitted a review while the PR is draft. No Copilot review exists on this material revision; Copilot must be requested first after exact-head CI is green and the PR advances to the automated-review stage.

HardlyDifficult added a commit that referenced this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant