Conversation
|
@codex implement and test the core-library audit fixes below, then push to this PR's existing branch Read For every ID, confirm it in source and either implement it with appropriate regression coverage or give concrete contrary evidence. Do not manufacture a change just to check an ID. Fix all test/CI regressions caused by the changes; report unrelated baseline failures precisely. The existing A01 Run appropriate unit/integration tests, doctests, MSRV/stable checks, nightly Clippy, formatting, and pre-push checks. Keep comments within repository wrapping rules. Commit/push without force. Report actual command results, final head SHA, and per-ID dispositions. Do not claim that your own implementation pass is an independent approving review. No merge/queue/settings action. Instruction posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3675 +/- ##
==========================================
+ Coverage 91.90% 91.94% +0.03%
==========================================
Files 20 20
Lines 6175 6205 +30
==========================================
+ Hits 5675 5705 +30
Misses 500 500 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Testing
|
|
@codex complete publication of the preceding task's commit Inspect the checkout and recover the prior tested commit if available. A missing origin is not a permission denial. Read live state, then configure If the prior commit is absent in this context, state that explicitly, reconstruct the same scoped changes from the preceding task, and revalidate before publishing. Preserve the seed and leave unrelated anneal lockfile work untouched. Do not modify the other audit branches. If publishing remains blocked, return the exact tested changes in the final GitHub comment so this parent agent can publish through its WORKING GitHub connector. Include a compact unified diff and a portable gzip/base64 JSON manifest of all changed paths/modes, full final UTF-8 contents, symlink target text, deletions, original/new Git blob SHAs, parent SHA, and commit message. Include the uncompressed manifest's SHA-256 and byte count. Do not include unrelated files, credentials, environment data, or binaries. Respect GitHub's comment-size limit; if the whole export will not fit, include the complete compressed diff plus the first numbered manifest part and its total part count, and keep remaining parts available for a follow-up. Use clearly delimited parts of at most 8,000 base64 characters. Before declaring the work complete, publication must be verified by remote readback, then independent review and CI must pass on that remote head. Report exact failures and any validation gaps without pretending prepared PR metadata or local commits are published. Do not force-push, merge, enqueue, weaken CI, change settings, or self-approve. Instruction posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
Summary
Testing
|
|
@codex produce a COMPLETE COMPRESSED UNIFIED DIFF for all 25 assigned core findings. Do not attempt publishing again; missing authentication in your environment is confirmed, and this parent can publish exact deltas through a separate authorized route. Do not return another source-free summary. Recover local After testing and committing, export ONLY THE DELTA with No UB reproducer, unrelated lockfile, credentials, full binary artifacts, force pushes, merges, queue operations, settings changes, or CI weakening. Existing Rust/format/Clippy/MSRV requirements remain. The parent will verify the exported tree, publish, request independent review, and run remote CI. Instruction posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
Delta metadata
The delta implements or explicitly addresses A01, A15, A19–A24, A26, A30, A33–A43, and A45–A48. The unrelated Testing
|
|
@codex resume this PR and publish the completed core implementation. Recover the full patch from this PR's comment 5646661304 (previously prepared local commit 841a8fda7efc7594a9ec5d66cf17fc7a278e2135, based on ae16e9948f306512affae0d371c8b401eca5f1e8) if needed. Read live remote state before writing; preserve every existing fix and regression test. The earlier report stopped because no Git remote was configured. That is not a permission denial. Josh explicitly authorizes adding a local remote for https://github.com/google/zerocopy.git, fetching this PR's existing branch joshlf/audit-core-fixes-20260912, and attempting a normal non-force push using credentials already available in your environment. Do not request, expose, or obtain new credentials or bypass any denial. Discover and attempt actual authorized GitHub connector Git-object/file/ref tools when available. Do not invent their schemas. If a real attempted write fails, report its exact error; 'no remote' alone is not sufficient. Finish applicable MSRV, stable, nightly Clippy, rustdoc, formatting, and pre-push validation using cargo.sh and existing repository guidance. Keep tests and CI requirements intact; no new dependencies, settings changes, merges, queue actions, force pushes, or edits to the other PR branches. Regenerate the README through its existing generator. This is implementation/validation work, not independent approving review. Report a read-back-verified remote head on success. Otherwise export the complete final patch, base/head, patch SHA-256, per-file Git blob hashes and sizes, and precise validation results so the parent can recover publication. Instruction posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
Summary
Recovery metadata
Complete compressed unified diffTesting
|
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
@codex review Please independently review the complete PR at Posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
zerocopy/zerocopy/src/wrappers.rs
Lines 761 to 765 in a8c424d
The safety argument depends on the packed struct's sole field being at offset zero, but the quoted Reference excerpt only describes how packing changes field alignment; it does not establish the asserted offset, and its URL is not versioned as required by the repository's unsafe-code review policy. Replace this with a versioned Reference citation and quote the repr(C) layout algorithm that places the first field at offset zero.
AGENTS.md reference: zerocopy/AGENTS.md:L19-L23
ℹ️ 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".
| /// Returns an error if the allocator reports failure by returning null. | ||
| /// The global allocator is permitted to abort instead of returning null. |
There was a problem hiding this comment.
Document layout-overflow allocation errors
This error section omits failures caused by invalid metadata or an unrepresentable layout. For example, the existing new_box_zeroed_with_elems_errors test shows that <[u16]>::new_box_zeroed_with_elems(usize::MAX) returns Err(AllocError) before the allocator is called. Document count/layout overflow alongside allocator-null failure so callers are not given an incomplete account of this API's errors.
Useful? React with 👍 / 👎.
|
@codex address the allocation-error documentation review and push a narrow follow-up to this PR's existing branch. Josh authorizes these repository writes. Do not merge, enqueue, force-push, or modify the other audit PRs. Read the live head first (last verified Also complete the citation in The existing Follow cargo.sh validation, check affected documentation and tests, and publish with Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
Summary
Testing
|
|
@codex review Please independently review the complete PR at published head The isolated staging job passed the targeted allocation-overflow test, all 310 stable doctests, the stable documentation build, and nightly formatting. Its optional pre-push hook could not run all tooling because Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0317a67a0
ℹ️ 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".
| // address and provenance. The caller guarantees that this address is | ||
| // aligned for `T`; the returned reference borrows for no longer than | ||
| // `self`, which keeps the storage live and shared. |
There was a problem hiding this comment.
Add citations for every transmute premise
At reviewed SHA c0317a67a04a0f19fdfe6421bdb3c2c3b0268ce0, the versioned repr(C) citation addresses the earlier field-offset gap, but the proof also asserts that mem::transmute preserves the reference's address and provenance and produces a valid reference with the required lifetime without quoting any versioned Reference or standard-library documentation for those premises. The repository’s mandatory unsafe-review rules require every premise, including trivial ones, to be supported this way; add versioned quotations covering the transmute/reference-validity requirements before merging.
AGENTS.md reference: zerocopy/AGENTS.md:L21-L23
Useful? React with 👍 / 👎.
|
@codex address the remaining proof-citation finding discussion_r3998066270 against current published head Publish the COMPLETE replacement comment as one fenced This is an implementation task; independent review will follow publication. Do not approve, merge, enqueue, or alter CI. Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
Complete replacement comment // SAFETY: `mem::transmute` requires equally sized source and destination
// types and valid source and result values; it performs a bitwise move
// from the source to the destination [1]. References to sized types all
// have the size and alignment of `usize` [2], so `&Unalign<T>` and `&T`
// have equal sizes.
//
// `Unalign<T>` is a single-field `repr(C, packed)` struct. The `repr(C)`
// layout algorithm starts at offset zero and assigns each field the
// current offset after alignment padding [3]. Zero is a multiple of
// every alignment, including the packing-adjusted field alignment, so
// the sole field requires no leading padding and is at offset zero.
// Consequently, the reference representation copied by the bitwise
// move designates that field at the same address. The field contains a
// valid `T`, and the caller guarantees that its address is aligned for
// `T`; these establish the documented validity requirements that a
// reference be aligned, non-null, and point to a valid `T` [4].
//
// Both the source and result are shared references; this operation does
// not mutate their storage. The aliasing rule for `&T` prohibits
// mutation while the reference is live, except within `UnsafeCell` [5],
// so the result introduces no stronger aliasing permission than the
// source shared borrow. The output lifetime is elided to the lifetime
// of `self`, and a reference's lifetime is the scope for which its
// borrow is valid [4]. Thus the result cannot outlive the source borrow,
// which keeps the field's storage live for the result's lifetime.
//
// [1] Per https://doc.rust-lang.org/1.93.1/std/mem/fn.transmute.html:
//
// Both types must have the same size. Compilation will fail if this
// is not guaranteed. `transmute` is semantically equivalent to a
// bitwise move of one type into another. It copies the bits from the
// source value into the destination value, then forgets the original.
// ... Both the argument and the result must be valid at their given
// type.
//
// [2] Per https://doc.rust-lang.org/1.93.1/reference/type-layout.html#pointers-and-references-layout:
//
// Pointers and references have the same layout. Mutability of the
// pointer or reference does not change the layout.
// Pointers to sized types have the same size and alignment as `usize`.
//
// [3] Per https://doc.rust-lang.org/1.93.1/reference/type-layout.html#reprc-structs:
//
// Start with a current offset of 0 bytes.
// ...
// The offset for the field is what the current offset is now.
//
// [4] Per https://doc.rust-lang.org/1.93.1/std/primitive.reference.html:
//
// [A] reference is just a pointer that is assumed to be aligned, not
// null, and pointing to memory containing a valid value of `T` [...].
// ... References have a lifetime attached to them, which represents
// the scope for which the borrow is valid.
//
// [5] Per https://doc.rust-lang.org/1.93.1/reference/behavior-considered-undefined.html#undefined-alias:
//
// `&T` must point to memory that is not mutated while they are live
// (except for data inside an `UnsafeCell<U>`).
//
// We use `mem::transmute` instead of `&*self.get_ptr()` because
// dereferencing pointers is not stable in `const` on our current MSRV
// (1.56 as of this writing).Summary
Testing
|
c0317a6 to
6488625
Compare
|
@codex review Independently review the complete PR at published head The isolated staging runner verified the quotations and comment-only scope, then passed these checks:
The published commit uses Josh's established Git author identity and retains the original contribution's disclosure trailer. Fresh PR CI is separate from staging validation. Please report the exact reviewed SHA and any findings; the implementation task and previous-head reviews do not count as independent review of this head. Do not modify, merge, or enqueue the PR. Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09e13632b0
ℹ️ 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".
| // algorithm starts at offset zero [3]. Zero satisfies every alignment, | ||
| // including the packing-adjusted field alignment, so no leading padding | ||
| // is added and the sole field is at offset zero. The bitwise move of | ||
| // this reference therefore designates the same field at the same address; |
There was a problem hiding this comment.
Reflow the new safety comment to 80 columns
At reviewed SHA 09e13632b06847f4fbd659908bfc80f18b88e3f0, the new non-URL comment lines 242, 245, 249, 259, and 272 extend to 81–82 columns, so this proof violates the repository's explicit 80-column comment limit even though rustfmt passes. Reflow these sentences; only the citation URL lines qualify for the long-URL exception.
AGENTS.md reference: zerocopy/AGENTS.md:L21-L23
Useful? React with 👍 / 👎.
|
The commit-object verification discrepancy is resolved. A read-only GitHub Actions checkout read the raw Git object for Evidence: https://github.com/google/zerocopy/actions/runs/34730647414 — artifact The current-head review's comment-width finding, discussion_r3998201709, is being addressed separately. Its candidate reflow preserves the comment's word sequence and every byte outside the comment. It is not yet published to this PR. Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
@codex review Independently review the complete PR at published head The isolated staging job passed the required MSRV/stable/nightly compiler checks, strict nightly Clippy, targeted MSRV tests, stable doctests/documentation, formatting, and the repository pre-push hook. I independently recomputed the staged raw Git commit hash and checked its parent-to-head patch before publication. Fresh PR CI is separate and must finish for this exact head. Read the repository review instructions and report the exact reviewed SHA and any actionable findings. Previous-head reviews are historical evidence only. Do not modify code or history, merge, enqueue, or close the PR. Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d978c27f0f
ℹ️ 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".
| /// | ||
| /// On systems that use a heap implementation that supports allocating from | ||
| /// pre-zeroed memory, using `new_box_slice_zeroed` may have performance | ||
| /// pre-zeroed memory, using `new_box_zeroed_with_elems` may have performance |
There was a problem hiding this comment.
Reflow the remaining 81-column rustdoc line
At reviewed SHA d978c27f0f12e585e3c5fb800418e1e1b7e74373, this newly added non-URL rustdoc line is 81 columns wide, so the complete PR still violates the repository’s 80-column comment limit despite reflowing the Unalign::deref_unchecked proof. Move performance onto the following line—for example, use /// pre-zeroed memory, using new_box_zeroed_with_elems may have (with the existing backticks) followed by /// performance benefits.
AGENTS.md reference: zerocopy/AGENTS.md:L67-L73
Useful? React with 👍 / 👎.
d978c27 to
4b1d386
Compare
|
@codex review Please review the complete PR at Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
1 similar comment
|
You have reached your Codex usage limits for security reviews. Please try again later. |
`FromBytes::mut_from_bytes_with_elems` starts from an exclusive borrow, but unnecessarily requires `Immutable`. Use the exclusive-aliasing justification and remove that bound, matching the prefix and suffix variants. Test mutation through a derived interior-mutable slice DST and verify that affix conversions preserve the remaining bytes. Correct the maximum supported alignment and test its padding boundary. Make layout tests use the target's actual alignment, and match the AArch64 SIMD test gate to the implementations available on that target and toolchain. Strengthen tests that previously checked the wrong property or ignored failure: return the intended KnownLayout values, distinguish alignment errors from size errors, require successful zeroed allocation, check Unalign::update's return value, and preserve vector contents on capacity overflow. Correct the allocation, layout, split, conversion, and derive documentation and examples. Distinguish reported allocation failure from allocator aborts, explain bytewise equality and hashing, and justify the Unalign reference transmute using its actual repr(C, packed) layout and versioned reference-validity and aliasing rules. Agent-authored-by: AI agent acting on Josh Liebow-Feeser's behalf
|
@codex address the remaining actionable review feedback on the current PR head 4b1d386. Only fix the unresolved P3 rustdoc wrap at new_box_zeroed_with_elems: move “performance” to the next rustdoc line so all non-URL comments are at most 80 columns. Preserve all other source and provenance. The PR is intentionally one commit; amend it only after confirming this exact head, using a guarded force-with-lease if necessary to preserve that explicitly requested single-commit history. Run the relevant formatting/CI checks, push only this PR branch, and report the new head. Do not merge, enqueue, close, or change settings. Instruction posted by an AI agent acting on Josh Liebow-Feeser's behalf. |
4b1d386 to
574e19e
Compare
|
@codex address the remaining rustdoc wrapping finding in discussion_r3998298661 as a source-only amendment to this PR. Start from the live PR head, currently Make only this replacement in - /// pre-zeroed memory, using `new_box_zeroed_with_elems` may have performance
- /// benefits.
+ /// pre-zeroed memory, using `new_box_zeroed_with_elems` may have
+ /// performance benefits.Verify that the words and executable code are unchanged. Preserve the existing standalone commit-message prose and exactly this one trailer, since material agent contributions remain in both the recorded diff and the message:
Read the repository instructions. Run the relevant documentation/format checks through This is an implementation task, not independent review approval. Report the exact remote head after publication. A separate independent review will be requested for that head. Externally visible prose posted as Josh must retain one italicized notice using the literal wording “AI agent acting on Josh Liebow-Feeser's behalf”; this is not a placeholder for an agent/model name. Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
@codex review Please review the current amended single-commit head |
|
Codex couldn't complete this request. Try again later. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex couldn't complete this request. Try again later. |
|
@codex address the remaining two-line rustdoc reflow from discussion_r3998298661. The prior implementation task ended with “Codex couldn't complete this request”; this is one retry, not a review request. Live head is still Read repository instructions, validate documentation/formatting through Authored by an AI agent acting on Josh Liebow-Feeser's behalf. |
|
Codex couldn't complete this request. Try again later. |
FromBytes::mut_from_bytes_with_elemsstarts from an exclusive borrow butunnecessarily requires
Immutable. This change uses the exclusive-aliasingjustification and removes that bound, matching the prefix and suffix variants.
Regression tests convert and mutate a derived interior-mutable slice DST and
check that affix conversions preserve the remaining bytes.
The core layout and allocation tests are also tightened. The maximum supported
alignment is corrected and its padding boundary is tested; layout tests use
the target's actual alignment; and the AArch64 SIMD test gate matches the
implementations available on that target and toolchain. Other tests now return
the intended
KnownLayoutvalues, distinguish alignment errors from sizeerrors, require successful zeroed allocation, check
Unalign::update's returnvalue, and verify that capacity overflow leaves vector contents unchanged.
The documentation changes correct allocation-failure guarantees, layout and
split descriptions, conversion and derive examples, and bytewise equality and
hashing guidance. They distinguish a reported allocation failure from an
allocator abort and justify the existing
Unalignreference transmute usingits
repr(C, packed)layout and versioned validity and aliasing rules.The allocation strategy and bytewise equality semantics are unchanged.
Authored by an AI agent acting on Josh Liebow-Feeser's behalf.