Trust canonical stakeholder relationship schema#439
Conversation
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai pause |
✅ Action performedReviews paused. |
|
Canonical stakeholder relationship hardening and exact #438 parent integration are pushed at audited head 3e469b8. The SDK now exposes one frozen pinned 13-value tuple/union; preserves relationship order and duplicates end-to-end; treats reordering as a meaningful comparison and one replication edit; and removes legacy discriminators, new_relationships/singular aliases, coercion, trimming, sorting, deduplication, and invented uniqueness. Lowercase, padded, unknown, proxy, accessor, and sparse inputs are rejected across public paths. Source, built, package, and built-runtime proofs are exact and any-resistant. Normal merge ancestry is original #439 plus audited #438 db093d7. Independent audit found no issue. Exact validation passes: full 118 suites / 7,732 tests, typecheck, lint, formatting, build, declarations, exact-public/cardinality, package-consumer, and built-runtime gates. Keeping this PR draft/unassigned while remote CI runs and until the finalized upstream #417-derived chain is propagated. |
# 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
|
Restacked normally onto hosted-green #438 at exact merge head The resolution preserves the inherited lossless generated-DAML and immutable replication architecture plus #439 canonical relationship exactness and recursively frozen stakeholder outputs. Local validation is green: focused 10 suites / 802 tests; full 121 suites / 8,135 tests; declarations/build/exact-public/cardinality/package-consumer; typecheck; lint; formatting; generated inventories; package dry-run with 1,278 files; and clean ancestry/diff audits. Exact-head hosted |
6cb2f58
into
codex/decoder-backed-stakeholder-event-readers
Summary
Behavior
anyrelationship_startedandrelationship_endedcompare exactly; null, omission, numeric lookalikes, padding, and lowercase values are not silently equatedcurrent_relationshipspreserves ordering and duplicates; reordering produces exactly one replication editcurrent_relationshipandnew_relationshipsinputs are rejected before normalization can discard informationValidation
npm run typechecknpm run test:ci: 121 suites, 8,135 testsnpm run test:declarations, including build, exact-public config, built cardinality, and installed-package consumernpm run lintnpm run formatnpm pack --dry-run: 1,278 files, 597,589 bytes packed, 3,328,914 bytes unpackedbuild-and-testand QuickStart: successStack
6daceb36c5777a0b52d1d11205bd71a82ad810e0a3a1953314f889474e9eec4be60b9dac31b4e801and hosted-green Validate stakeholder event payloads #4384373e834b070bf7b2c92f1475b91e2f3feec2576Status
Exact-head local and hosted gates are green, and GitHub reports CLEAN/MERGEABLE with no actionable feedback. This PR remains draft and unassigned for stack-level reviewer coordination. No reviewers were requested in this phase.
Note
Medium Risk
Changes stakeholder read types to deep readonly snapshots and alters replication/comparison rules for relationship arrays—high touch for sync and round-trip—but behavior is heavily gated by tests and bounded decode preflight.
Overview
Introduces
STAKEHOLDER_RELATIONSHIP_TYPESas the single frozen canonical tuple (exported from the package root) and derives the public union and frozenSTAKEHOLDER_RELATIONSHIP_TYPE_TO_DAMLmapping from it.Stakeholder reads now route through
decodeDamlEntityDatawithassertSafeGeneratedDamlJson(stakeholder is dispatched before the generic JSON graph walk), anddamlStakeholderDataToNativereturnsOcfStakeholderOutputas a detached, recursivelyObject.freeze’d snapshot withcurrent_relationshipsorder and duplicates preserved.stakeholderis listed among immutable read entity types.Write and parse boundaries tighten canonical semantics: Zod refinements validate
current_relationshipsand relationship-changerelationship_started/relationship_ended, reject legacycurrent_relationship/new_relationships, and batch/client paths reject padded, lowercase, or unknown relationship values.ocfCompare/diffOcfObjectstreat relationship fields strictly (no trim/coerce, ordered array semantics, omitted vs[]equivalence only where defined) and stop ignoringnew_relationshipsin deprecated-field lists.Built
check-built-cardinality, declaration tests, and a large test expansion lock in the behavior across batch, replication, and integration surfaces.Reviewed by Cursor Bugbot for commit 6daceb3. Bugbot is set up for automated code reviews on this repo. Configure here.