Repository navigation
Consolidate Rust guard FFI serialization and output handling - #15776
Merged
Merged
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract serialize and write helper for FFI exports
Consolidate Rust guard FFI serialization and output handling
Oct 30, 2026
lpcox
marked this pull request as ready for review
October 30, 2026 20:54
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The Rust guard FFI serialization and output-handling refactor has no active review issues.
No open issues 🎉
What changed in this PR
Consolidates Rust guard FFI serialization and output handling into a shared helper, addressing #15743 while preserving each export’s failure behavior.
Changes:
- Routes all four output paths through
serialize_and_write. - Preserves
-1errors for agent/resource labeling,0skip results for response labeling, and existing buffer validation. - Adds helper regression tests for serialization and undersized-buffer failures across all four caller configurations.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/lib.rs |
Adds the shared helper, replaces duplicated output handling, and tests failure-code preservation. |
Review effort: Balanced (auto)
Collaborator
|
@copilot merge main and resolve conflicts |
…nsolidate-serialize # Conflicts: # guards/github-guard/rust-guard/src/lib.rs Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Contributor
Author
Merged |
This was referenced Oct 30, 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.
Four FFI output paths duplicate serialization and buffer-write handling while requiring distinct failure semantics:
-1for agent/resource labeling,0to skip response labeling.serialize_and_write, with an explicit caller-selected error code.