com um clique
deep-review
Run a deep code review across the manifold-csg crates
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Run a deep code review across the manifold-csg crates
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Bump the manifold3d pin, add FFI + safe wrappers for new upstream C API functions, bump versions, open a PR
Publish crates to crates.io with pre-flight checks
Run a deep code review across the manifold-csg crates
Push a branch and open a PR with pre-flight checks
| name | deep-review |
| description | Run a deep code review across the manifold-csg crates |
| user-invocable | true |
Run a thorough code review of the manifold-csg workspace. Check all crates/ source files.
crates/manifold-csg/src/manifold.rs)since release: review only files changed since the last release tag (use git diff --name-only $(git describe --tags --abbrev=0)..HEAD -- '*.rs' to get the list)staged: review only staged files (git diff --cached --name-only -- '*.rs')branch: review only files changed on the current branch vs main (git diff --name-only main...HEAD -- '*.rs')Work through each category in order. For each finding, cite the file and line number.
Review as the pickiest expert Rust reviewer. Look for:
Result should replace bool/Option, enums should replace strings, named structs should replace tuplesThis is the highest-risk area for a bindings crate. Verify:
manifold_alloc_*) is paired with deallocation (manifold_delete_*) on ALL paths including error returns and panicsDrop implementations null-check before freeingunsafe impl Send on Manifold and CrossSection — justification still valid? Check upstream C++ for any new thread-local state or shared mutable stateSync is deliberately NOT implemented — verify this is still correct (check for mutable shared_ptr<CsgNode> pNode_ in upstream)manifold_meshgl*_vert_properties / manifold_meshgl*_tri_verts, verify buffer sizes match what the C API expectsManifoldManifoldPair — verify both returned pointers are always consumed (no leak if caller ignores one half of a split)Build script (build.rs) correctness for cross-compile:
cfg!(target_os = ...) / cfg!(target_arch = ...) / cfg!(target_env = ...) in build.rs is a footgun when used to detect the target — these macros evaluate at the build-script-host's compile time, NOT the target's. Coincidentally correct as long as we never cross-compile; fails silently the moment we do (e.g. wasm). Use env::var("CARGO_CFG_TARGET_OS") / ..._ARCH / ..._ENV instead. (cfg! is fine when you genuinely want host-side detection — e.g., picking a shell command for the build script's own use.)cargo:rustc-link-arg=FLAG from a sys crate's build.rs does NOT propagate to downstream link invocations — only rustc-link-lib and rustc-link-search do. The proper sys-crate idiom for forwarding link flags: emit cargo:KEY=VALUE (Cargo translates this into DEP_<UPPERCASE_LINKS>_<UPPERCASE_KEY> env var visible to dependents), and have the safe wrapper crate's build.rs read it and re-emit cargo:rustc-link-arg=.... End-user binaries then need a similar build.rs (or .cargo/config.toml). Flag any cargo:rustc-link-arg=... in a sys crate that isn't backed by this pattern.cargo:rustc-link-arg-bins=, -tests=, -cdylib=) are only legal from crates that declare those targets — a library-only sys crate can't use them (cargo rejects with "package does not have a bin target"). Flag any of these in a crate that doesn't have the matching target.CI cache key correctness (actions/cache + cmake builds):
CMakeCache.txt records absolute paths (toolchain file, source dir, -D options). If a cached target/ is restored on a run where any of those paths differ — including from a different OUT_DIR layout, a different emsdk install location, or a different CMakeLists.txt source dir — cmake refuses with "source does not match the source used to generate cache." We've been bitten by this twice: once on the Emscripten lane (emsdk path moved between runs), once on the wasm32-uu lane (source dir moved when adopting the shim's CMake helper).restore-keys being too permissive. restore-keys does prefix matching, so if the prefix is just ${runner.os}-cargo-<lane>-<cache-version>-, ANY old cache for that lane gets pulled in — even one built with an incompatible cmake source dir.key so layout-affecting inputs (env vars like EMSDK, files like build.rs and wasm32-uu/**) are part of the restore-keys PREFIX, while frequently-changing inputs (Cargo.lock, lower-level build.rs files) live in the suffix. That way changing a layout input shifts the prefix → no incompatible cache restored. Look for any cache stanza whose restore-keys doesn't include the same prefix-segments as the key for inputs that affect cmake's recorded paths.cache-version bump file is the manual escape hatch when caches go bad — it busts every lane's cache. Useful as a one-shot recovery, but not a substitute for fixing the key structure.Precision is our key differentiator (f64/MeshGL64). Verify:
from_mesh_f32 / to_mesh_f32 paths are clearly documented as lossyWe bind the complete manifold3d v3.4.1 C API (256 functions in manifold-csg-sys). The review focus is on maintaining completeness and ensuring the safe layer covers everything useful.
Sys crate vs upstream header:
manifoldc.h, built during compilation at target/*/build/manifold-csg-sys-*/out/build/_deps/manifold-src/bindings/c/include/manifold/manifoldc.h) and diff against manifold-csg-sys/src/lib.rsSafe wrapper coverage:
manifold-csg-sys, verify there is a corresponding safe method in manifold-csg. Flag sys-level functions that have no safe wrapper yet. Prioritize by usefulness.MeshGL/MeshGL64 types?set_min_circular_angle, set_circular_segments, etc.) exposed? If so, are they documented as affecting global state?Feature flag coverage:
nalgebra feature cover all methods that take/return geometric types (vectors, points, matrices)?glam, mint)?Review the safe API from a user's perspective:
Manifold::translate_z(), CrossSection::offset_round())impl Into<T> for flexibility?lib.rs give users a clean import experience?+, -, ^) discoverable and documented?Manifold::extrude be an associated function or a method on CrossSection?C/C++ API parity (critical — many users will transition from the C/C++ library):
manifoldc.h. Flag any reordering, renamed parameters, or hidden defaults that would surprise a C/C++ user.center, slices, twist), verify there's either a sensible default or a _with_options variant that exposes full control.cube, cylinder, and CrossSection::square should all handle center identically — not some hardcoded and some exposed)transform's column-major [f64; 12] should document the mapping to C's 12 individual params)JoinType::Round maps obviously to MANIFOLD_JOIN_TYPE_ROUND)normal: [f64; 3] instead of nx, ny, nz), verify this is documentedAssess the test suite:
#[ignore] tests — are they still relevant or should they be deleted/fixed?std::thread::spawn, filesystem, sockets, signals) should be gated with #[cfg_attr(target_os = "...", ignore = "explanation")] for targets that lack them. The ignore reason should explain why it's ignored on this target, not just that it is.CARGO_TARGET_<TRIPLE>_RUNNER is configured (.cargo/config.toml, CI workflow env). Without a runner, "build clean" doesn't tell us tests pass.Verify the documentation artifacts are consistent with the code:
Examples (crates/manifold-csg/examples/):
cargo run -p manifold-csg --example basics, etc.)unwrap() on fallible operations without explanation?API coverage table (API_COVERAGE.md):
manifold-csg-sys/src/lib.rs?README:
Review everything a crate maintainer needs for correct, user-friendly publishing:
Versioning scheme (see CLAUDE.md):
manifold-csg-sys version = {upstream_major}.{upstream_minor}.{100+our_release} (e.g., 3.4.100). Verify the version matches the manifold3d tag pinned in build.rs.manifold-csg version = standard semver (0.x.y), independent of upstream. Its dependency on manifold-csg-sys must pin the correct sys version.Cargo.toml correctness:
package.description — present, concise, accurate for both cratespackage.documentation — points to docs.rs (or will auto-generate)package.readme — set if README existspackage.keywords and package.categories — set and relevant (max 5 keywords). Good keywords for discoverability: csg, geometry, mesh, manifold, 3dpackage.exclude / package.include — exclude test fixtures, build artifacts, CI config from the published cratelinks key in sys crate — correctly set to prevent duplicate linkingDependency hygiene:
cargo update --dry-run)build-dependencies — cmake version current?parallel for TBB, nalgebra for convenience conversions)Publishing readiness:
cargo publish --dry-run for both crates — does it succeed?LICENSE-APACHE and LICENSE-MIT present and referenced in Cargo.tomllinks = "manifold" — will this conflict with other -sys crates linking the same library? Document how users should handle this.Ecosystem & Cargo evolution:
resolver = "2" setting still the recommended default, or has a newer resolver landed?dep:, lints table changes) that would improve the crate?unsafe extern syntax was stabilized in 2024 edition — are we using it?)rust-version (MSRV) — should we declare one? What's the minimum Rust version that compiles this?Documentation:
//! docs — present, has example code, links to upstream manifold3d#[doc(hidden)] on internal items that leak through pub(crate)rust,ignore — can they be made runnable?)This crate tracks manifold3d upstream. Verify:
build.rs — what version are we on? What's latest? What changed?target_os = "unknown" across the workspace. Each gated FFI declaration / safe wrapper / test is gated because that C API surface postdates the shim's tested manifold pin. When the shim's tested pin moves to (or past) our host pin, those gates can be removed. The OBJ I/O gates (manifold_*_obj) are gated for a different reason (iostream patches strip them) and stay regardless.cargo update --dry-run and flag anything that can be bumpedbuild.rs — the manifold3d tag is pinned there. Check github.com/elalish/manifold/releases for newer releases. Manifold also pulls Clipper2 and TBB via CMake FetchContent (versions controlled by manifold's CMakeLists.txt)Group findings by category. For each finding:
**[Category] file.rs:123** — Short description of the issue.
Suggested fix or explanation.
Assign each finding a severity:
At the end, provide a summary: total findings per category, severity breakdown (error/warning/note), and recommended priority order for fixes.
If a category has zero findings, say so explicitly — don't skip it silently.