Repository navigation
docs(agents): a binding's native type stands in only where converting it to Rust can never fail - #935
Merged
Merged
Conversation
… it to Rust can never fail Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 21, 2026 00:47
kixelated
enabled auto-merge
November 21, 2026 00:47
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — the rule now names a testable criterion (can the conversion to Rust fail?) instead of the loose "exact".
Reviewed changes
Reviewed the single-line AGENTS.md edit in full.
- Lossless-types rule: a native type stands in only where converting it to Rust can never fail. Otherwise a runtime type crosses, with conversion helpers, and the check happens once at the conversion rather than in each call.
claude-sonnet-5-5 | 𝕏
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Sharpens the lossless-types rule in
AGENTS.md. A binding's native type now stands in only where converting it to the Rust type can never fail, such asbool, or a byte array forVec<u8>in most languages. Anything else crosses as the runtime's own type, such asrs.NonZeroU16, with helpers converting it to and from the native type. A value is checked once, at that conversion, instead of in every call that takes it, and a value Rust cannot hold fails there rather than mid-call.The rule already said a native type stands in "only where it is exact". The Kotlin binding read "exact" loosely:
NonZeroU16is aUShort,charis anInt, andusizeis aULong. Each of those holds values Rust cannot, so the binding checks them in the call. In a closure's return value, that failure lands mid-Rust, which is what kixel-ai/rust2#922 unwinds through. The new wording names the test (can the conversion fail?), so the case is no longer a judgment call.Decisions
Decided with the maintainer on 2026-11-20:
boolneeds no runtime type, though it may be an alias;Vec<u8>needs none where the language's byte array converts infallibly.Bringing the bindings in line is a follow-up, planned separately by this run's
/quest-plan.Public API
None. It is an instruction for agents. The generated bindings change only when that follow-up lands.
Validation
No behavior to exercise.
just cipasses.Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 068b280
Base: origin/main at 74f5652
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1fb91-dd8f-7c60-bbee-0b0ced0e67fc, round 2Score: 10/10,
The incremental change clarifies that binding conversions validate values once, introduces no identifiable defect, and is ready to land.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1fb91-dd8f-7821-84bd-e7c78b624645Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Summary by CodeRabbit