Skip to content

feat(generator)!: emit unknown for unresolvable return types; honest bytes/set mappings#300

Merged
bbopen merged 1 commit into
mainfrom
feat/0.9-267-unknown-returns
Jul 11, 2026
Merged

feat(generator)!: emit unknown for unresolvable return types; honest bytes/set mappings#300
bbopen merged 1 commit into
mainfrom
feat/0.9-267-unknown-returns

Conversation

@bbopen

@bbopen bbopen commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Preserve qualified Python class paths in IR so generation can distinguish local declarations from imports.
  • Emit unknown for generated annotation leaves that lack a local declaration, including NewType, Decimal, complex, and external classes.
  • Report each degradation through the existing unknown-type warning path and make the menagerie fixtures typecheck.

Local plain classes and dataclasses such as Point remain typed to document intent, while their loud serializer failure remains the catalogued Class-C residual for #268 or future serialization work.

The accepted numpy preset is explicitly a no-op in 0.9: ndarray returns honestly degrade to unknown until #268 can validate a faithful static shape.

BREAKING CHANGE

Generated output now contains more unknown types where tywrap cannot honestly emit a declared TypeScript type. --fail-on-warn may newly fail because these generated-type degradations are reported; that is intentional.

Closes #267

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bbopen, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4f1a94e0-20c0-4728-8adf-30641cdc1bd9

📥 Commits

Reviewing files that changed from the base of the PR and between 360f2e7 and 10a597f.

⛔ Files ignored due to path filters (1)
  • test/menagerie/__snapshots__/gen.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (16)
  • src/config/index.ts
  • src/core/annotation-parser.ts
  • src/core/generator.ts
  • src/core/mapper.ts
  • src/types/index.ts
  • src/tywrap.ts
  • test/annotation-parser.test.ts
  • test/e2e_smoke.test.ts
  • test/generator.test.ts
  • test/menagerie/gen.test.ts
  • test/menagerie/manifest.ts
  • test/menagerie/roundtrip.test.ts
  • test/type_mapping_advanced.test.ts
  • test/type_mapping_property.test.ts
  • tywrap_ir/tests/test_ir_return_honesty.py
  • tywrap_ir/tywrap_ir/ir.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/0.9-267-unknown-returns

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.

@bbopen bbopen force-pushed the feat/0.9-267-unknown-returns branch from e15a42a to 10a597f Compare July 11, 2026 21:33
@bbopen bbopen merged commit 4c313d5 into main Jul 11, 2026
23 checks passed
@bbopen bbopen deleted the feat/0.9-267-unknown-returns branch July 11, 2026 21:36
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.

PR7: [breaking] emit unknown for return types tywrap can't resolve

1 participant