Skip to content

Validate stakeholder event payloads#438

Draft
HardlyDifficult wants to merge 7 commits into
codex/decoder-backed-corporate-action-readersfrom
codex/decoder-backed-stakeholder-event-readers
Draft

Validate stakeholder event payloads#438
HardlyDifficult wants to merge 7 commits into
codex/decoder-backed-corporate-action-readersfrom
codex/decoder-backed-stakeholder-event-readers

Conversation

@HardlyDifficult

@HardlyDifficult HardlyDifficult commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make the generated OpenCapTable-v34 event_data wrapper the only accepted stakeholder event contract shape
  • decode stakeholder relationship and status events through the shared lossless generated-DAML boundary with exact template identity
  • return owned, deeply readonly, recursively frozen stakeholder event snapshots across direct, generic, batch, and OcpClient reads
  • keep direct entity writers exact while generic and operation writers expose the inherited ReadonlyDamlDataTypeFor contract
  • enforce non-empty IDs, canonical dates and comments, all nine status mappings, and the relationship at-least-one invariant
  • preserve field-specific enum and generated-decoder diagnostics without accepting malformed optionals as absence

Intentional breaking changes

  • relationship_change_data and status_change_data are no longer accepted as legacy wrapper aliases
  • malformed or unknown relationship optionals that generated DAML decoders default to null are rejected losslessly
  • stakeholder event writer and reader surfaces now use exact generated/canonical types instead of Record<string, unknown>
  • generic and operation DAML writer outputs are deeply readonly snapshots

Stack

  • base: Validate stock corporate action reader payloads #437 exact 206539f66ad6ec21e53ddabebb5c3e6ba6f4df74
  • current head: 4373e834b070bf7b2c92f1475b91e2f3feec2576
  • integrated through a normal two-parent merge; no amend, rebase, force-push, or history rewrite
  • this is the final specific reader-family slice in the decoder-backed reader stack

Validation

  • focused stakeholder/global/corporate matrix: 9 suites / 534 tests
  • full npm run test:ci: 121 suites / 8,021 tests
  • npm run typecheck
  • npm run test:declarations including build, exact-public, built-cardinality, and package-consumer checks
  • npm run lint
  • npm run format
  • deterministic schema inventories: reachable fingerprint e1ac1de3030914e4d1c25872bb43f2dd4af2d0794a1d78180ad446cb2b941a56
  • npm pack --dry-run: 1,278 files, 595,534 bytes
  • clean diff checks, exact parent/ancestry verification, and reviewed remerge diff
  • hosted build-and-test: SUCCESS in 4m52s
  • hosted QuickStart: SUCCESS in 8m53s
  • CodeRabbit status: SUCCESS
  • fresh exact-head sweep: no reviews, unresolved threads, reviewer requests, assignees, or external actionable comments

The PR remains draft and unassigned. Reviewer requests are intentionally deferred to the owning automation stage.

@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: fab0785d-15e6-4602-bf2d-8e381bd9f882

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-stakeholder-event-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.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Stakeholder-event hardening and exact #437 parent integration are pushed at audited head db093d7. The implementation validates full generated wrappers/context/template identity and losslessness across direct, generic, dispatcher, batch, and OcpClient paths; relationship started, ended, both, and same-value transitions are valid while neither is rejected; all nine statuses map to CE_STAKEHOLDER_STATUS; exact Text/date/comment order and duplicates are preserved; hostile proxy/accessor/sparse-array boundaries are trap-safe. Source, built, and package tests include any-resistant proofs for event types and fields. Independent audits found no issue. Exact validation passes: full 118 suites / 7,628 tests, typecheck, lint, formatting, build, declarations, exact-public/cardinality, and package-consumer gates. Keeping this PR draft/unassigned while remote CI runs and until the finalized upstream #417-derived chain is propagated.

@HardlyDifficult

HardlyDifficult commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the hosted clean-checkout lint failure at exact head 9bf06f927686ba8dcb1b8f60a090847e6c126300: the declaration probes now express nullable and multi-assertion contracts without unions/intersections that ESLint misclassifies while dist is intentionally absent. Clean-checkout lint, formatting, and the full declaration/build/package-consumer gate pass locally. This PR remains draft while its semantic reader audit and parent restack are still pending.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Restacked onto hosted-green #437 exact 206539f66ad6ec21e53ddabebb5c3e6ba6f4df74 through normal merge commit 4373e834b070bf7b2c92f1475b91e2f3feec2576.

Conflict resolution preserved #437s detached/frozen global decoder architecture and #438s stakeholder-specific wrapper extraction, semantic validation, exact diagnostics, immutable outputs, and package-facing type proofs. Generic and operation DAML writer proofs now assert the stronger inherited ReadonlyDamlDataTypeFor contract.

Local validation is green: focused 9 suites / 534 tests; full coverage 121 suites / 8,021 tests; declarations/build/exact-public/cardinality/package-consumer; typecheck; lint; formatting; deterministic inventories; package dry-run (1,278 files, 595,534 bytes); clean diff, ancestry, and remerge audits.

The PR remains draft and unassigned while exact-head hosted build-and-test and QuickStart checks run. No reviewer requests will be made in this phase.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Exact head 4373e834b070bf7b2c92f1475b91e2f3feec2576 has cleared the complete hosted gate:

  • build-and-test: SUCCESS in 4m52s
  • LocalNet QuickStart: SUCCESS in 8m53s
  • CodeRabbit status: SUCCESS
  • GitHub: CLEAN / MERGEABLE
  • fresh GraphQL sweep: zero reviews, zero unresolved threads, zero external actionable comments, zero reviewer requests, and zero assignees
  • local tree matches the pushed remote head exactly

The PR remains draft and unassigned as requested. No reviewers were requested.

HardlyDifficult added a commit that referenced this pull request Jul 12, 2026
# Conflicts:
#	src/functions/OpenCapTable/capTable/batchTypes.ts
#	src/functions/OpenCapTable/capTable/damlEntityData.ts
#	src/functions/OpenCapTable/capTable/damlToOcf.ts
#	src/functions/OpenCapTable/capTable/entityTypes.ts
#	src/functions/OpenCapTable/stakeholder/getStakeholderAsOcf.ts
#	src/utils/ocfNormalization.ts
#	src/utils/ocfZodSchemas.ts
#	src/utils/replicationHelpers.ts
#	test/declarations/damlReadDispatch.types.ts
#	test/declarations/replicationHelpers.types.ts
#	test/functions/stakeholderEventReaders.test.ts
#	test/package-consumer/publicEntrypoint.types.ts
#	test/schemaAlignment/canonicalOcfObjectInventory.json
#	test/types/capTableBatch.types.ts
#	test/types/damlReadDispatch.types.ts
#	test/types/replicationHelpers.types.ts
#	test/utils/ocfNormalization.test.ts
#	test/utils/replicationHelpers.test.ts
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