Skip to content

Enforce canonical OCF schema property purity#423

Draft
HardlyDifficult wants to merge 46 commits into
codex/exact-conversion-triggersfrom
codex/canonical-schema-purity
Draft

Enforce canonical OCF schema property purity#423
HardlyDifficult wants to merge 46 commits into
codex/exact-conversion-triggersfrom
codex/canonical-schema-purity

Conversation

@HardlyDifficult

@HardlyDifficult HardlyDifficult commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make canonical public DTOs match the dereferenced pinned OCF schemas, including required-versus-optional property parity
  • derive enum, wrapper, and conditional-schema coverage from the schema registry instead of hand-maintained lists
  • preserve stakeholder relationship order and duplicates; remove obsolete, deprecated, and non-schema public fields
  • keep WarrantExercise quantity private to the DAML wire boundary and reject retired PlanSecurity inputs
  • exercise all 103 conditional witnesses through complete OCF objects and the public parser

Validation

  • npm run test:ci — 85 suites / 5,234 tests passed
  • npm run test:declarations
  • npm run typecheck
  • npm run build
  • npm run lint
  • npm run format
  • schema inventory/parity checks pass with zero unregistered differences
  • CI and OCP QuickStart pass on exact head 0c2e9b43cdf641db18f379b14b655838475affaf

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: 4722a527-b924-40ec-9c8c-952eb514a9d9

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/canonical-schema-purity

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

Base automatically changed from codex/exact-optional-tests to codex/exact-conversion-triggers July 10, 2026 16:15
@HardlyDifficult HardlyDifficult marked this pull request as ready for review July 10, 2026 16:32
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Current head 8d93d39 is green, merge-clean, and validates the canonical CE_STAKEHOLDER_STATUS production roundtrip without legacy normalization.

@copilot review
@coderabbitai review
@cursor review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@HardlyDifficult Thanks for the update — I'll review the current head now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Copilot review is still stale relative to current material head 8d93d39; CodeRabbit has completed its exact-head pass.

@copilot review

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown

Copilot review is still stale relative to current material head 8d93d39; CodeRabbit has completed its exact-head pass.

@copilot review

Reviewed current head 8d93d39 on the stacked base context; no additional code changes are needed from my side.

@HardlyDifficult HardlyDifficult marked this pull request as draft July 10, 2026 16:49
… into codex/canonical-schema-purity

# Conflicts:
#	src/utils/ocfZodSchemas.ts
#	src/utils/planSecurityAliases.ts
#	test/batch/CapTableBatch.test.ts
#	test/integration/production/productionDataRoundtrip.integration.test.ts
#	test/utils/ocfZodSchemas.test.ts
#	test/utils/planSecurityAliases.test.ts
@HardlyDifficult HardlyDifficult marked this pull request as ready for review July 10, 2026 18:55
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

cursor review

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Fresh canonical-boundary audit hardening is pushed at exact head c7d59ef9ab09f42b4d6e1a5c88eaf2a8007400d1.

The audit reproduced a special-key bypass: an own enumerable top-level __proto__ property was silently dropped by Zod before AJV enforced additionalProperties, allowing raw/typed parsers and generic writers to accept a noncanonical object. The original own-key graph is now validated by AJV before any record construction can strip or normalize keys, and additional-property errors retain the exact offending path.

Regressions cover ordinary and null-prototype defineProperty __proto__, nested name.__proto__, constructor/prototype/ordinary unknown controls, raw and typed parsers, generic convertToDaml, valid null-prototype canonical output, no prototype pollution, and zero accessor/proxy trap execution. No other blocker was found in #423’s own schema-purity delta.

Validation on this exact revision: focused 228 tests; full 83 suites / 4,477 tests; build; typecheck; declarations and exact public-config checks; lint; format; diff check; and manual source+built raw/typed/writer probes. The PR remains draft and unassigned; no parent merge or reviews were requested.

…nonical-schema-purity

# Conflicts:
#	test/schemaAlignment/canonicalOcfObjectInventory.json
#	test/schemaAlignment/schemaConformance.test.ts
#	test/schemaAlignment/schemaConformanceRegistry.ts
#	test/typeContracts/schemaIngestionAliases.ts
#	test/types/schemaIngestionAliases.types.ts
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Propagated corrected PR #421 head 3562f6986784b09c6df280d7cc419227193babe5 with a normal merge commit. The combined head is 650211c174ffeb490a61a81823526bad9cbaf6f8.

Preserved every parent type/schema/trigger guardrail together with this PR’s canonical schema-purity boundaries: AJV validates the original own-key graph before record reconstruction, special keys and unsupported extensions are rejected at exact paths, prototype-pollution inputs cannot disappear during parsing, retired PlanSecurity aliases stay out of the public surface, and deprecated current_relationship remains rejected. The source/dist structural fingerprint now explicitly records zero schema-ingestion aliases; its inventory was regenerated twice with identical SHA-256 678efda3e66c3991413646218ec279270368cf60db52696be9e56666b71f0e96.

Validation is green locally: 84 suites / 5,182 tests, build, global exact-optional typecheck, declaration and exact public-config tests, lint, Prettier, and diff checks. This PR remains draft and unassigned while downstream propagation and fresh exact-head reviews are pending.

…nonical-schema-purity

# Conflicts:
#	src/functions/OpenCapTable/planSecurityIssuance/planSecurityIssuanceDataToDaml.ts
#	test/converters/planSecurityConverters.test.ts
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Corrected stack propagation is now pushed at e7411b906cf7630a23200094cbcf1b1b74e04871, incorporating exact parent #421 93cbf41cd8f2fad66c7d717ab4dba1dada6c4ff9.

Validation on this exact head:

  • full test:ci: 84 suites / 5,188 tests, coverage gate passing
  • focused canonical/schema suite: 6 suites / 402 tests
  • clean build, typecheck, declaration checks, exact public-config checks, ESLint, Prettier, and diff checks passing
  • source and built public inventories agree: 55 canonical variants, 0 schema-ingestion aliases, fingerprint f57573c07ee735a062c88928ef93081db58fa5f7c47af3b3801fa4b2bb95e953
  • canonical EquityCompensation issuance writer delegates through the shared full-payload builder/pricing boundary; complete payload coverage spans all six compensation variants, with malformed/accessor/proxy exact-Monetary adversarial coverage preserved
  • retired PlanSecurity public aliases remain absent from source and built declarations

The PR remains draft and unassigned while fresh CI runs on this material revision. No reviewer requests were made during propagation.

@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 e7411b906cf7630a23200094cbcf1b1b74e04871. Pre-review gate: both required checks are successful, GitHub is CLEAN/MERGEABLE, the PR is unassigned, and zero review threads are unresolved. Focus on canonical schema purity, generated-codec losslessness, exact public types, and adversarial runtime boundaries. Report every actionable current-head issue before the other reviewers.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

Retrying the required exact-head gate for e7411b906cf7630a23200094cbcf1b1b74e04871; the first request received no explicit response. The PR remains green, CLEAN/MERGEABLE, unassigned, and has zero unresolved threads. Please provide actionable findings or an explicit no-findings response for this exact revision before Cursor and CodeRabbit.

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown

@copilot review

Retrying the required exact-head gate for e7411b906cf7630a23200094cbcf1b1b74e04871; the first request received no explicit response. The PR remains green, CLEAN/MERGEABLE, unassigne...

Reviewed exact current head e7411b9 in the stacked-base context. I don’t see any additional actionable issues to address from my side.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@cursor review

Please review exact current head e7411b906cf7630a23200094cbcf1b1b74e04871. Copilot completed its required exact-head pass with no actionable findings: #423 (comment). Both required checks are green, GitHub is CLEAN/MERGEABLE, and zero review threads are unresolved. Focus on canonical schema purity, generated-codec losslessness, exact public types, and adversarial runtime boundaries.

Comment thread src/utils/ocfNormalization.ts
@HardlyDifficult HardlyDifficult marked this pull request as draft July 12, 2026 07:45
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

Cursor’s exact-head comparison finding is addressed at 474e3214038214283e533bb36d47572830d3ed6f with the canonical, non-compatibility behavior: legacy stakeholder current_relationship is rejected explicitly, while plural current_relationships normalization remains unchanged. A replication-level regression proves this fails clearly instead of returning a phantom edit.

Independent audit and validation are green: targeted 5 suites / 547 tests; final replication suite 133 tests; full test:ci 84 suites / 5,191 tests; declarations/build/exact-public/cardinality/package-consumer; typecheck; lint; formatting; schema inventory; and diff checks. The review thread is resolved. This PR remains draft and unassigned while fresh remote CI runs; Copilot will be requested first on the new exact head.

@HardlyDifficult HardlyDifficult marked this pull request as ready for review July 12, 2026 08:05
@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@copilot review

Please review exact current head 474e3214038214283e533bb36d47572830d3ed6f against exact stacked base 93cbf41cd8f2fad66c7d717ab4dba1dada6c4ff9. This revision addresses Cursor’s comparison finding with the intentionally canonical, non-compatibility behavior: any own legacy stakeholder current_relationship is rejected explicitly; canonical plural normalization is unchanged; replication regression coverage proves no phantom edit. Pre-review gate: both required checks are green, GitHub is CLEAN/MERGEABLE, unassigned, and zero threads unresolved. Review every actionable current-head issue before Cursor and CodeRabbit.

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown

@copilot review

Please review exact current head 474e3214038214283e533bb36d47572830d3ed6f against exact stacked base 93cbf41cd8f2fad66c7d717ab4dba1dada6c4ff9. This revision addresses Cursor’s c...

Reviewed exact current head 474e321 in the stacked-base context. I don’t see any additional actionable issues to address from my side.

@HardlyDifficult

Copy link
Copy Markdown
Collaborator Author

@cursor review

Please review exact current head 474e3214038214283e533bb36d47572830d3ed6f. Copilot completed its required exact-head pass with no actionable findings: #423 (comment). Both required checks are green, GitHub is CLEAN/MERGEABLE, and zero threads are unresolved. Focus on canonical schema purity, explicit rejection of legacy stakeholder relationships, canonical plural normalization, replication behavior, generated-codec losslessness, and public 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 474e321. Configure here.

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

Copy link
Copy Markdown
Collaborator Author

Returned to draft because upstream #417 received a material exact-head corrective revision after full CodeRabbit review. This stacked PR will remain held until the audited #417 head and each intervening parent are propagated normally; fresh CI and Copilot-first reviewer gates are required afterward.

…nonical-schema-purity

# Conflicts:
#	src/utils/ocfZodSchemas.ts
#	test/declarations/schemaIngestionAliases.types.ts
#	test/schemaAlignment/canonicalOcfObjectInventory.json
#	test/schemaAlignment/schemaConformanceRegistry.ts
#	test/typeContracts/schemaIngestionAliases.ts
#	test/types/schemaIngestionAliases.types.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.

3 participants