Skip to content

Validate generated DAML reader payloads#427

Draft
HardlyDifficult wants to merge 26 commits into
codex/typed-ocf-manifestfrom
codex/decoder-backed-specific-readers
Draft

Validate generated DAML reader payloads#427
HardlyDifficult wants to merge 26 commits into
codex/typed-ocf-manifestfrom
codex/decoder-backed-specific-readers

Conversation

@HardlyDifficult

@HardlyDifficult HardlyDifficult commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a generated-decoder registry correlated across every OcfEntityType
  • route generic and concrete readers through exact generated DAML decoding instead of payload casts
  • reject unknown entity kinds before registry or ledger access
  • turn null or undefined stakeholder and valuation roots into structured OcpParseError results
  • validate converted stakeholder and valuation output with the shared semantic validators
  • preserve decoder field paths and keep generated DAML declarations out of the curated root API

Validation

  • npm run test:ci — 95 suites / 5,458 tests passed
  • npm run test:declarations
  • npm run test:package-consumer
  • npm run test:exact-public-config
  • npm run typecheck
  • npm run build
  • clean-checkout npm run lint
  • npm run format
  • CI and OCP QuickStart pass on exact head bad975bfa084786ff355112643b581fff9e23f84

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: a8c64888-e881-4ee7-a1fa-2b0c3767ad1b

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-specific-readers

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

…odex/decoder-backed-specific-readers

# Conflicts:
#	src/functions/OpenCapTable/document/getDocumentAsOcf.ts
@HardlyDifficult
HardlyDifficult marked this pull request as ready for review July 10, 2026 19:14
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Current head f6ddf01 is green, merge-clean, unassigned, and thread-free. Advancing to Stage 2 and queuing automated review. CodeRabbit is deferred to the org-wide cooldown and remains queued without a ping.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

cursor review

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown

@copilot review

Reviewed the current head and checked workflow runs on codex/typed-ocf-manifest; latest CI is green and there are no new actionable issues for this PR.

Comment thread src/functions/OpenCapTable/vestingTerms/getVestingTermsAsOcf.ts Outdated
@HardlyDifficult
HardlyDifficult marked this pull request as draft July 10, 2026 19:20
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Returned to draft because upstream schema-boundary branches #417#421 have new material fixes that still need to be propagated through this stacked PR. Exact-head CI and Copilot-first bot review will be refreshed after the ordered restack.

@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-specific-readers

# Conflicts:
#	src/functions/OpenCapTable/capTable/damlToOcf.ts
#	src/functions/OpenCapTable/document/getDocumentAsOcf.ts
#	src/functions/OpenCapTable/issuer/getIssuerAsOcf.ts
#	src/functions/OpenCapTable/stockClass/getStockClassAsOcf.ts
#	src/functions/OpenCapTable/stockPlan/getStockPlanAsOcf.ts
#	src/functions/OpenCapTable/vestingTerms/getVestingTermsAsOcf.ts
#	test/batch/damlToOcfDispatcher.test.ts
#	test/converters/valuationVestingConverters.test.ts
#	test/validation/damlToOcfValidation.test.ts
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Prepared and propagated the finalized parent stack into exact head 64ddcd6b9c1ee55e94c7fde878a7cb2473e73a9e using normal merge commits; no history rewrite. The decoder-reader slice retains stable patch ID 9bd3fc3f, preserves exact generated codec mapping, lossless re-encode validation, precise field-path taxonomy, safe wrapper extraction, deterministic sorting, and the centralized stock-class storage boundary. Full validation is green: 88 suites / 4,492 tests, 87.61% statements / 78.86% branches / 86.51% functions / 87.80% lines, build, declarations, exact config, lint, formatting, deterministic 49-object inventory, and diff checks. The PR remains draft/unassigned pending exact-head CI and Copilot-first review.

@HardlyDifficult
HardlyDifficult marked this pull request as ready for review July 11, 2026 18:26
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

Please perform a formal review of exact current head 64ddcd6b9c1ee55e94c7fde878a7cb2473e73a9e. The finalized parent review fix is propagated; independent validation confirms the decoder-reader slice; stable patch ID 9bd3fc3f; 88 suites / 4,492 tests; 8m19s QuickStart. Build-and-test, declarations, exact config, lint, formatting, deterministic inventory, mergeability, and all threads are clean. Copilot is being requested first for this material revision.

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown

@copilot review

Please perform a formal review of exact current head 64ddcd6b9c1ee55e94c7fde878a7cb2473e73a9e. The finalized parent review fix is propagated; independent validation confirms the dec...

Formal review completed on exact head 64ddcd6b9c1ee55e94c7fde878a7cb2473e73a9e.

  • Workflow checks are green for this head on codex/decoder-backed-specific-readers (CI and Test OCP CN-Quickstart Integration both succeeded).
  • Base branch codex/typed-ocf-manifest is also green at its latest propagated head.
  • I reviewed the current decoder-reader changes and found no new actionable issues.

No code changes are needed from my side.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

cursor review

Copilot completed a no-findings formal review of exact current head 64ddcd6b9c1ee55e94c7fde878a7cb2473e73a9e. Please perform the next exact-head automated review, including generated codec correlation, full lossless decoding, safe wrapper extraction, deterministic sorting, and exact error paths.

@HardlyDifficult
HardlyDifficult marked this pull request as ready for review July 11, 2026 22:18
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown

@copilot review

Formal review completed on exact current head 634104dcdb87576b893b0adb9a064dd6a036e00e.

  • Verified workflow status is green on both branches:
    • codex/typed-ocf-manifest: CI and Test OCP CN-Quickstart Integration succeeded at 6da7e1fc.
    • codex/decoder-backed-specific-readers: CI and Test OCP CN-Quickstart Integration succeeded at 634104dc.
  • Rechecked the decoder-backed specific-reader surface after the propagated parent merge.

No current-head actionable issues found.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@cursor review

Please review exact head 634104dcdb87576b893b0adb9a064dd6a036e00e. Copilot completed an exact-head no-actionable review: #427 (comment). Exact-head build-and-test and full QuickStart are green, the branch is CLEAN/MERGEABLE, and unresolved-thread count is zero.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 634104d. Configure here.

@HardlyDifficult
HardlyDifficult marked this pull request as draft July 11, 2026 22:35
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Material parent propagation complete at exact head 818053e, incorporating #426 at 44101eb. Source typecheck passed on canton-node-sdk 0.0.227, preserving decoder-backed reader architecture, the exact dependency-aware sorter delta, exhaustive relationships, and symmetric vesting-graph validation. The PR remains draft and unassigned while CI runs.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Fresh generated-reader audit hardening is pushed at exact head de48abd070138524629db17a9cb25651b313e784.

Two decoder-level gaps are closed:

  • readSingleContract now requires a safe nonempty created-event contract ID and exact equality with the requested ID before exposing data, returning structured missing/invalid/mismatch INVALID_RESPONSE diagnostics and a validated created-event type.
  • Stock issuance and valuation readers now decode trap-safe exact Monetary records and Numeric(10): 28/10 bounds, generated exponent/negative-zero canonicalization, positive issuance quantity/vesting/share ranges, nonnegative amounts, uppercase three-letter currency, exact fields, and ordered share ranges.

Coverage spans 9 representative readers, direct/dedicated/generic paths, missing/null/wrong/unknown fields, mismatch correlation, accessor/proxy zero-execution, exact paths, source+built declarations, and built-runtime probes. Corrected #414 generic-wrapper exactness is intentionally not duplicated and must be preserved during restacking.

Validation: focused contract/Numeric suites; full 90 suites / 4,622 tests; typecheck; lint; format; build; declarations and exact-public config; diff check; built-runtime adversarial probe. The PR remains draft/unassigned; no parent merge or reviews were requested.

…coder-backed-specific-readers

# Conflicts:
#	src/functions/OpenCapTable/capTable/damlToOcf.ts
#	src/functions/OpenCapTable/stockIssuance/getStockIssuanceAsOcf.ts
#	test/client/OcpClient.test.ts
#	test/converters/genericConversionReadBoundaries.test.ts
#	test/converters/valuationVestingConverters.test.ts
#	test/validation/generatedDamlBoundary.test.ts
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Corrected propagation is pushed at 97603e8b4d0c8ccc4f30d2dc7fad2b241828df58, incorporating fully green exact parent #426 e54dbe3d36e303e87dd6d18ebafeec4bedee9ef6.

Exact-head validation:

  • focused generated-reader/correlation matrix: 9 suites / 853 tests
  • full test:ci: 93 suites / 5,382 tests, coverage passing
  • generated decoder map preserves exact entity/template correlation and canonical one-field create wrappers; retired fallback aliases remain absent
  • readSingleContract requires a non-empty created-event contractId matching the requested ID and exact expected template identity
  • stock issuance and valuation retain exact Numeric10/Monetary validation; stock vestings are trap-safe and preserve exact indexed diagnostics
  • parent correlated map snapshots and deterministic 500-case sorter remain covered
  • clean build, hardened declarations/package consumer/built cardinality, exact public config, typecheck, ESLint, Prettier, and diff checks pass
  • source and built inventories agree: 55 variants, 0 aliases, fingerprint 39418162cb257fc316d7a15efc24d825223fac9a9d9d4d2d5104cc53ebb444c0

The PR remains draft and unassigned while fresh CI runs. No reviewer requests were made.

@HardlyDifficult
HardlyDifficult marked this pull request as ready for review July 12, 2026 07:29
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

Please review exact current head 97603e8b4d0c8ccc4f30d2dc7fad2b241828df58. Pre-review gate: both required checks are successful, GitHub is CLEAN/MERGEABLE, the PR is unassigned, and zero review threads are unresolved. Focus on decoder-backed specific readers, exact discriminator/field validation, trap safety, and public output typing. Report every actionable current-head issue before the other reviewers.

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown

@copilot review

Please review exact current head 97603e8b4d0c8ccc4f30d2dc7fad2b241828df58. Pre-review gate: both required checks are successful, GitHub is CLEAN/MERGEABLE, the PR is unassigned, and...

Formal review completed on exact head 97603e8b4d0c8ccc4f30d2dc7fad2b241828df58 against base codex/typed-ocf-manifest.

  • Verified branch/head alignment locally (HEAD is 97603e8).
  • Checked GitHub Actions status for both branches; CI and Test OCP CN-Quickstart Integration are successful for:
    • codex/typed-ocf-manifest at e54dbe3d
    • codex/decoder-backed-specific-readers at 97603e8b
  • Checked failed-job logs on the CI runs; no failed jobs reported.
  • Re-reviewed the decoder-backed specific-reader boundary changes (including discriminator/field validation and trap-safe reader paths).

No current-head actionable issues found.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@cursor review

Please review exact current head 97603e8b4d0c8ccc4f30d2dc7fad2b241828df58. Copilot completed its required exact-head pass with no actionable findings: #427 (comment). Both required checks are green, GitHub is CLEAN/MERGEABLE, and zero review threads are unresolved. Focus on decoder-backed specific readers, discriminator/field validation, trap-safe direct/dispatcher paths, and public output typing.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 97603e8. Configure here.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Upstream PR #426 advanced materially with final #425 guardrails and the nominal typed-manifest replication fix. Returning this stacked PR to draft while I propagate exact parent cd3e7dabe494b86b17a0ee1ded20456616650ab0, validate the integrated tree, and rerun exact-head reviewer gates.

@HardlyDifficult
HardlyDifficult marked this pull request as draft July 12, 2026 08:15
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Exact-head validation for c448a7e is complete: 93 suites / 5,387 tests pass, along with typecheck, lint, formatting, declaration tests, manifest/cardinality checks, and package-consumer tests. An independent audit confirmed the parent/child blobs and ancestry, decoder-backed direct/dispatcher/OcpClient paths, trap-safe validation, exact public output types, and inherited guardrails. Keeping this PR in draft until the fresh remote CI run is green.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Restacked onto the clean-checkout fixture correction from #426. Full validation passes: 95 suites / 5,458 tests, declarations, build, package-consumer, exact-public-config, lint, and formatting. Hosted CI is rerunning on exact head bad975bfa084786ff355112643b581fff9e23f84.

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.

2 participants