Add Python Hypothesis emit kit#1632
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
WalkthroughThis PR introduces a complete Python Hypothesis emitter plugin for Provekit. It converts neutral predicate specifications into Hypothesis-based property tests, handling binary comparisons and option checks. The implementation includes plugin registration, core transformation logic with strategy-backed variable binding, plugin metadata/capabilities, a JSON-RPC server interface, and comprehensive tests validating both the emitter and RPC dispatch behavior. ChangesPython Hypothesis Emitter Plugin
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98be04f8fd
ℹ️ 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".
| const_eval: Callable[[Any, Any], bool], | ||
| ) -> bool: | ||
| if left.has_const and right.has_const: | ||
| return bool(const_eval(left.const_value, right.const_value)) |
There was a problem hiding this comment.
Return a gap for invalid constant comparisons
When both operands are literal constants, this eagerly calls the Python comparison operator; for otherwise accepted literals whose ordering is undefined in Python, such as concept:lt with None and 1 or a string and an integer, operator.lt raises TypeError. That escapes emit() and becomes a JSON-RPC internal error instead of the unsupported-predicate gap this emitter uses for unrenderable predicate slices, so a single mixed-type constant predicate can abort the whole emit request.
Useful? React with 👍 / 👎.
98be04f to
b90ea50
Compare
Summary
provekit-emit-python-hypothesisas a separate Python emitter artifactpython-hypothesisemit surface through project config and manifest@given(data=st.data())for supported normalized predicatesVerification
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=implementations/python/provekit-emit-python-hypothesis/src python3 -m pytest -p no:cacheprovider implementations/python/provekit-emit-python-hypothesis/tests implementations/python/provekit-emit-python-pytest/tests -qimplementations/python/.provekit/config.toml,implementations/python/.provekit/emit/python-hypothesis/manifest.toml, andimplementations/python/provekit-emit-python-hypothesis/pyproject.tomlgit diff --checkKnown Gap
Summary by CodeRabbit