Skip to content

feat(contracts): prototype exact-integer revision 3 - #359

Closed
bbopen wants to merge 4 commits into
codex/tywrap-callable-compiler-20260919from
codex/tywrap-exact-integer-source-20260920
Closed

bbopen wants to merge 4 commits into
codex/tywrap-callable-compiler-20260919from
codex/tywrap-exact-integer-source-20260920

Conversation

@bbopen

@bbopen bbopen commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Scope

This draft prototypes semantic value-contract revision 3 on top of the frozen callable compiler. Revision 2 stays the default safe-number policy. The v3 manifest pins the LF-normalized revision-2 source hash and adds one integer-exact leaf. Contract revision 3, integer envelope codec version 2, per-call policy bigint-v2, and RPC protocol tywrap/1 remain separate labels.

EXACT_INTEGER_VALUE_CONVERSION maps opted Python int values to bigint. The generator uses the resolved contract for parameters and returns, including nested composites, overloads, static and class methods, and simple variadic forms. Generated validators require primitive bigint at each exact node. The compiler refuses to emit an exact wrapper under revision 2 or without the explicit exact-integer-adapter capability. That capability is unavailable by default. A mixed named keyword-only plus exact **kwargs shape fails closed because TypeScript cannot state its index rule precisely.

The default bridge, protocol, and Arrow int64 path are unchanged. This PR does not add a public per-callable mode or production bigint support.

Relates to #337. The PR targets the compiler branch to keep the v3 diff separate.

Evidence

  • Exact-head CI on 1862f3e passed the full matrix, including Windows.
  • A local TypeScript typecheck passed after the method and variadic correction. Tests cover v2 compatibility, nested bigint declarations and validators, capability refusal, method receiver alignment, variadic consumer type errors, the depth limit, and the pinned base hash.
  • The companion generated Python roundtrip proof is owned in a separate branch and is not part of this source PR.

Open gates

  • The separate revision-2 union correction in draft PR fix(compiler): reject ambiguous union wire values #360 needs independent acceptance before it is merged into this branch.
  • The companion bound-provider proof must verify live meta.valueCapabilities before any tagged request, then rerun against the integrated source.
  • Independent review and final exact-head CI remain open after integration. No merge, release, or issue closure is requested.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added the area:docs Area: documentation label Sep 20, 2026
@bbopen

bbopen commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Integrated through reviewed implementation PR #362, merged as 43f111b43fbb0ce31dcb59f8fb489e8dadf3f191. This branch head is an ancestor of that merged commit. Final combined release candidate aa5497f867b36a76670afedbe9b34a6712a322e3 passed full CI 35508107651. Closing this component PR because its work is already on main; release publication is tracked by #354.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant