Skip to content

Fix contract leaf type checking and policy dispatch - #49

Merged
vim89 merged 13 commits into
mainfrom
fix/contract-leaf-types-and-policy-dispatch
Oct 7, 2026
Merged

vim89 merged 13 commits into
mainfrom
fix/contract-leaf-types-and-policy-dispatch

Conversation

@vim89

@vim89 vim89 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

The contract macros read any unknown type as an opaque primitive, so a type no sink can encode passed the check and failed at write time, and a policy written as the case object type was compared under default rules instead of the requested ones. A policy is now resolved to one field matching, one name casing and one tolerance, positional drift is reported as the fields that are missing or extra rather than only a field count, a mismatch between an optional and a required type reports what the producer actually has, and a Scala 2 field type keeps its type arguments and its optionality.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T06:15:43.470011Z a66d265 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a66d2651b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +81 to +83
else if (isCaseClass(tpe)) StructShape(fieldsOf(tpe))
else if (isSupportedLeaf(tpe)) PrimitiveShape(TypeShape.simpleName(tpe.show))
else unsupportedLeaf(tpe)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Respect custom encoders when checking leaf types

When a model contains a UUID, domain enum, or another non-whitelisted leaf but has a valid implicit DataEncoder[A], materializing SchemaConforms now aborts here (and in the Scala 2 counterpart) before the typed sink can be built. Encoding is extensible through DataEncoder.instance and sinks require an encoder for the whole A, so membership in this fixed leaf list neither proves nor disproves that a sink can encode the model; this rejects otherwise valid pipelines. Preserve unknown leaves as opaque shapes or base this validation on actual encoder evidence instead.

Useful? React with 👍 / 👎.

@vim89
vim89 merged commit d2cc189 into main Oct 7, 2026
15 checks passed
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