Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb72afd9c0
ℹ️ 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".
src/simlin-mcp/Dockerfile.cross
Outdated
|
|
||
| # Update RUST_VERSION to match the current stable Rust when building. | ||
| # Override at build time: docker build --build-arg RUST_VERSION=1.88.0 ... | ||
| ARG RUST_VERSION=1.87.0 |
There was a problem hiding this comment.
Align cross-build Rust version with repo toolchain
The cross-build image defaults to RUST_VERSION=1.87.0, while the repo is pinned to Rust 1.94.0 in rust-toolchain.toml; this means scripts/cross-build.sh compiles with an older compiler than normal project builds unless callers remember to override the build arg. As soon as simlin-mcp or a dependency needs a post-1.87 feature, local cross-build validation will fail even though standard builds succeed.
Useful? React with 👍 / 👎.
Delete the gitignored mcp-darwin-x64 platform package directory (local cleanup) and change the Windows target triple from x86_64-pc-windows-msvc to x86_64-pc-windows-gnu to match the cross-compilation toolchain.
Required for publishing scoped packages to the public npm registry. The publishConfig.access field enables `npm publish` without the --access=public flag, and the repository field links the package to the monorepo source.
The build-npm-packages.sh template now emits publishConfig.access and repository fields in each platform package.json, required for publishing scoped packages publicly to npm.
…ry, and linux-arm64 Rename test from AC5.2 to AC4 to match design plan numbering. Add missing linux-arm64 platform entry so all 4 platforms are verified. Add assertions for publishConfig.access and repository fields that were added to the build script template in the previous commit.
Shell script that builds all three cross-compilation targets (linux-x64, linux-arm64, win32-x64) via Docker + cargo-zigbuild. Source is mounted read-only; a named volume caches the Cargo target directory for incremental builds. Includes a smoke test that verifies the Linux x64 binary executes.
The previous smoke test used '|| true' which masked all failures: a segfault, missing binary (exit 127), or non-executable file (exit 126) would all print "Smoke test passed". Fix by capturing the exit code and rejecting fatal exit codes (>= 126, excluding 124 which is timeout killing a running process). Also capture the 'file' command output and grep for "ELF.*executable" so a truncated or wrong-arch binary fails the check rather than silently passing.
Three-job workflow triggered by mcp-v* tags: - validate: checks tag version matches Cargo.toml - build: matrix of 4 platform targets (zigbuild for Linux/Windows, native for macOS arm64) - publish-platform + publish-wrapper: sequential npm publish with OIDC trusted publishing and provenance attestation workflow_dispatch enabled for dry-run testing (publish jobs skip when ref is not a tag).
Add simlin-mcp to the root components table (was missing since the component was first created). Document the npm distribution structure, supported platforms, release trigger, and build scripts in the MCP domain CLAUDE.md. Teach check-docs.py to skip npm scoped package names (tokens starting with @) so backtick-quoted names like @simlin/mcp are not treated as broken file paths.
Add the tests specified in test-requirements.md that were flagged as missing in the final code review: - ac4_2_js_launcher_windows_triple: reads bin/simlin-mcp.js and asserts the Windows platform entry maps to x86_64-pc-windows-gnu (not msvc) - ac4_4_wrapper_package_json_has_publish_config: reads the committed src/simlin-mcp/package.json and verifies publishConfig.access and repository fields (the existing integration test only covered generated platform packages, not the committed wrapper manifest) - Directory count assertion in ac4_platform_packages_have_correct_fields: after iterating the 4 expected platforms, reads the @simlin directory and asserts exactly 4 subdirectories exist (AC4.3) - tests/mcp_release_workflow.rs: new static YAML validation test file covering AC1.1-AC1.6, AC2.1, AC2.3, AC2.5, AC5.1-AC5.3 by parsing .github/workflows/mcp-release.yml with serde_yaml; catches workflow regressions without requiring a live CI run Also add "Keep in sync" comments between Dockerfile.cross and mcp-release.yml to flag the Zig version as a value that must stay consistent across both files.
bb72afd to
0f1942c
Compare
Code Review[P3] Weak test assertions in
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #394 +/- ##
==========================================
+ Coverage 76.92% 77.01% +0.08%
==========================================
Files 143 144 +1
Lines 36549 36810 +261
==========================================
+ Hits 28115 28348 +233
- Misses 8434 8462 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace deprecated serde_yaml with serde_yml, bump Dockerfile.cross Rust version to match rust-toolchain.toml (1.94.0), add npm view existence checks so publish steps are rerunnable after partial failure, skip the execution smoke test on non-Linux hosts in cross-build.sh, and add an msvc-triple dev fallback in the JS launcher for Windows developers. Tests strengthened: chmod assertions now verify platform appears on the same line as chmod +x, new tests for Dockerfile version parity, publish idempotency, and cross-build platform detection.
Code Review[P2] Cargo.lock lists
|
Restrict publish job if-guards to refs/tags/mcp-v (not just refs/tags/) so workflow_dispatch on arbitrary tags cannot accidentally publish. Replace dtolnay/rust-toolchain@stable with @master reading the version from rust-toolchain.toml, ensuring release binaries use the same compiler as the rest of the project. Pin cargo-zigbuild version in Dockerfile.cross to match the CI workflow. Strengthen publish_steps_are_rerunnable test to verify the count of npm view checks matches the count of npm publish commands.
Code Review: mcp: npm release CI pipelineFindings[P2] Cargo.lock is inconsistent with Cargo.toml dev-dependency nameFile: The Overall Correctness VerdictCorrect with caveat. The Cargo.lock/Cargo.toml mismatch is the only substantive issue. The workflow structure, publish logic, security permissions, platform mappings, test coverage, and shell scripts are all well-designed. The |
The cross-build smoke test tried to execute the x86_64-linux-musl binary on any Linux host, which fails on arm64. Now checks both uname -s and uname -m before attempting execution. Simplified the Dockerfile.cross comment to reference the test that enforces version parity with rust-toolchain.toml, removing the stale example version.
Code Review[P2] Cargo.lock is out of sync with Cargo.toml —
|
Add test enforcing Zig version parity between Dockerfile.cross and mcp-release.yml, matching the existing Rust version parity test. Fix the JS launcher's error message for Windows dev fallback to suggest the MSVC vendor path, since cargo on Windows defaults to the MSVC toolchain.
Code Review: PR #394 — mcp: npm release CI pipelineFindings[P2] Cargo.lock is out of sync with Cargo.toml for the
|
A Rust toolchain bump without Cargo.lock changes would leave the cache key unchanged, potentially serving stale artifacts built with the old compiler. Including rust-toolchain.toml in the hashFiles call ensures toolchain version changes invalidate the build cache.
Code Review: PR #394 — mcp: npm release CI pipelineFindings[P1] Cargo.lock is inconsistent with Cargo.toml for
File: Overall CorrectnessNot correct. The Cargo.lock / Cargo.toml mismatch for the |
Docker runs as root by default, leaving root-owned files in the bind-mounted dist/ directory. On a subsequent run, rm -rf fails for non-root users. Clean up via a lightweight Alpine container before recreating the directory.
Code ReviewI reviewed all 20 changed files in this PR covering the MCP npm release CI pipeline (scaffolding cleanup, cross-build tooling, GitHub Actions workflow, and static validation tests). FindingsNo bugs found. Notes
Overall Correctness VerdictCorrect. The patch is well-structured, properly tested, and free of bugs. Existing code and tests will not break. |
Without --locked, cargo silently updates the lockfile if Cargo.toml changed but Cargo.lock was not refreshed, publishing binaries from a dependency graph not represented by the tagged commit. Adding --locked ensures the build fails in that scenario.
Code Review: mcp: npm release CI pipelineFindingsNo blocking bugs found. The PR is well-structured with thorough test coverage of the CI workflow, platform scaffolding, and cross-build tooling. Minor observations (non-blocking):
Verdict: CorrectThe patch does not break existing code or tests. The workflow, platform packages, launcher script, Dockerfile, and cross-build script are all consistent with each other. Security posture (least-privilege permissions, OIDC auth, provenance attestation, publish guards) is sound. The 11 new tests provide good static validation of workflow structure and build script output. |
The Docker cleanup command passed /dist/* as a literal argument to rm since Docker exec doesn't invoke a shell. Wrap in sh -c for proper glob expansion. The Zig version parity test now navigates the parsed YAML to find the setup-zig step's version field, instead of fragile text matching on the first version: '...' line in the file.
Code ReviewI reviewed all 19 changed files in this PR, focusing on the CI workflow, build scripts, Dockerfile, JS launcher, package.json configurations, and the test suite. FindingsNo bugs found. The implementation is well-structured:
Overall Correctness VerdictCorrect. The patch is free of bugs and blocking issues. Existing code and tests will not break. The CI pipeline, build tooling, and test suite are consistent and well-tested. |
Include .crates.toml and .crates2.json in the CI cache so that cargo install can detect already-installed tools on cache hits. Add --locked to cross-build.sh for parity with the CI workflow, catching lockfile drift during local builds.
Code Review: mcp: npm release CI pipelineI reviewed all changed files in this PR: the GitHub Actions workflow, cross-build tooling (Dockerfile, scripts), JS launcher updates, build script template, package.json changes, and all 11 new tests across 2 test files. FindingsNo blocking bugs found. The implementation is well-structured:
Minor observations (non-blocking)
Overall Correctness VerdictCorrect. The patch is free of bugs and blocking issues. Existing code and tests will not break. The workflow, build tooling, and tests are well-designed for a production npm release pipeline. |
Review Cycle SummaryThis PR went through 10 iterations of automated review (Codex + Claude), resulting in 8 improvement commits addressing substantive feedback. The final iteration had no actionable findings from either reviewer. Key improvements made during review:Security & correctness:
Robustness:
Code quality:
Test coverage grew from 11 to 20 tests across the two test files, covering workflow structure, version parity, publish idempotency, toolchain pinning, cache correctness, and cross-build script behavior. |
Summary
x86_64-pc-windows-gnu, addedpublishConfigandrepositoryfields to all package.json files (wrapper + generated platform packages), updated integration test to cover all 4 platforms and new fields.Dockerfile.crossandscripts/cross-build.shfor local Docker-based cross-compilation (Linux x64/arm64 musl, Windows x64 mingw). Includes ELF format validation and exit code smoke test..github/workflows/mcp-release.ymlwith 4 jobs: version validation, 4-platform build matrix (zigbuild for Linux/Windows, native for macOS), platform package publish, wrapper publish. Uses OIDC trusted publishing with provenance attestation and least-privilege permissions.build_npm_packages.rs,mcp_release_workflow.rs) covering all 21 acceptance criteria that can be statically verified.Test plan
cargo test -p simlin-mcppasses (76 tests, 0 failures)@simlinnpm org, bootstrap publish, configure Trusted Publisher, pushmcp-v*tag, verify end-to-end install (seedocs/test-plans/2026-03-12-mcp-npm-release.md)cross-build.shwith Docker available to verify binary output