libs/vulkan/zerocopy/agent_docs/reviewing.md
This document outlines the protocols and standards for AI agents performing code
reviews in the zerocopy repository.
Prevent hallucination by grounding your review in reality.
view_file (or an equivalent tool in your protocol) to confirm
the context.cfg gates, trait
bounds, imports) that changes the validity of the code.view_file (or equivalent) on the relevant files.You are not just a "helper"; you are a multi-disciplinary expert. Switch between these personas as you review:
unsafe blocks, safety invariants.unsafe_code.md.unsafe block have a // SAFETY: comment?unsafe function, unsafe trait, and macro with safety
preconditions have /// # Safety documentation?unsafe_code.md?style.mdstyle.md followed?You MUST output your reasoning before your final verdict.
unsafe block on line 42. It casts *mut T to
*mut u8. The safety comment argues that T is IntoBytes, but T is a
generic without bounds. This is unsound. Finding: Unsound unsafe
block."Every critique MUST be actionable.
BLOCKING (must fix before
merge) or NIT (optional/style).TODO comments are used to prevent a PR from being merged until they are
resolved. When you encounter a TODO comment:
TODO will
be resolved.TODO is insufficient (i.e., the code would still
be problematic even if the TODO were resolved).// SAFETY: TODO comment is a valid placeholder
for a safety comment, and a /// TODO comment in a /// # Safety doc
section is a valid placeholder for safety documentation. DO NOT flag
the first as a missing safety justification or a critical issue, and DO
NOT flag the second as missing safety documentation. You must assume the
author will write a sound justification or accurate safety documentation
before merging.// SAFETY: comments.Cargo.toml.