Skip to content

feat(cli): add verified npm distribution candidate - #15

Open
integrate-your-mind wants to merge 11 commits into
codex/pr13-site-integration-prooffrom
codex/public-distribution
Open

feat(cli): add verified npm distribution candidate#15
integrate-your-mind wants to merge 11 commits into
codex/pr13-site-integration-prooffrom
codex/public-distribution

Conversation

@integrate-your-mind

Copy link
Copy Markdown
Owner

Summary

  • add lifecycle-free @ferrite/cli and macOS arm64 @ferrite/cli-darwin-arm64 package candidates
  • verify platform, exact version, executable mode, byte count, and SHA-256 before each launch
  • execute a private verified binary snapshot and forward termination signals through child cleanup
  • stage ferrite init output and publish through Rust OS-level NOREPLACE, rejecting symlink/non-empty/current-directory targets
  • prove optimized tarball installation and real CLI execution from an empty offline npm consumer

Exact source

  • head: afe2636fc401c786254f3505ed52b229ee4273f0
  • base: ae237df3327518475359b80dbb4810e1c397e4c2
  • platform proved: macOS arm64

Validation

  • pnpm lint - passed
  • pnpm typecheck - passed
  • pnpm build - passed
  • pnpm test - passed; Rust workspace, 162 script tests, 203 runtime tests, native and CLI tests, Chromium QA, production serve, examples, deep routes, 404s, and artifact tamper rejection
  • node --test --experimental-test-coverage packages/cli/test/*.test.mjs - 31/31; 84.34% lines, 78.81% branches, 88.00% functions
  • cargo llvm-cov --package ferrite-cli --all-targets --summary-only - 43/43; 74.07% lines, 80.67% functions
  • pnpm release:verify:cli - passed with optimized 3,625,328-byte binary, SHA-256 19934499f30213e40ff8a100508ab0e46b1ac6d1f13c56d9e4da0e75f4d467ad
  • pnpm release:verify:npm - passed clean starter install/check/build/serve for the existing portable/native package set
  • pnpm release:verify:cargo - all 11 crates packaged
  • gitleaks git --redact - 367 commits scanned, no leaks
  • cargo audit --deny warnings - no advisories

Normal / failure / odd paths

  • normal: offline tarball install, ferrite --version, project init including paths with spaces
  • failure: omitted platform package, binary tamper, invalid version, non-executable/symlink binary, staging write failure, synchronous spawn failure
  • odd/race: existing and concurrently appearing targets, publication rollback failure, backup cleanup failure, signal forwarding, child-process cleanup
  • physical runtime: symlink target exited 2 without modifying its victim; default init created ferrite-app and was cleaned after observation

Independent review

Independent exact-head review: ACCEPT WITH NONBLOCKING LIMITS after reproducing and closing symlink-target, binary TOCTOU, partial-init, and candidate no-replace findings.

Known limits

  • no npm package has been published; registry 404 does not prove ownership
  • npm authentication currently returns E401; provenance and registry-backed consumer install are unproven
  • only macOS arm64 is supported by this candidate
  • application dependencies are not installed by the two-package offline CLI proof
  • Buildkite hosted proof is not current: local bk authentication is unavailable and no exact-head check is reported
  • default Rust no-replace publication is exercised by the real package gate but lacks a dedicated injected-race harness
  • SIGKILL can leave a private temporary executable for OS temp cleanup

Rollback

Revert this PR before publication. After any future prerelease publication, npm versions remain immutable; deprecate the affected version and publish a corrected version rather than overwriting it.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@integrate-your-mind integrate-your-mind left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one deterministic cross-platform test failure plus two correctness issues in candidate publication and the default init flow. The host-specific release gate can remain macOS-arm64-only, but the root test suite and generated user instructions need to stay valid on their normal paths.

const { renameImpl, ...candidateOptions } = options;
return createCliCandidateImpl({
publishDirectoryImpl: renameImpl ?? rename,
...candidateOptions,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Pin the simulated target instead of using the live host defaults. The root pnpm test now runs this file on every host, but each positive fixture reaches createCliCandidateImpl without platform or arch; on Linux or Intel macOS it fails immediately because only darwin/arm64 is defined. Pass platform: "darwin", arch: "arm64" through this helper and through the direct verifyCliCandidate calls, or gate the host-only cases.

priorMoved = true;
await verifyCliCandidate(backup, { platform, arch });
}
await publishDirectoryImpl(staging, destination);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Verify the destination before treating publication as complete. The default publisher is the supplied candidate binary and this path trusts only its exit status. If that executable returns 0 without moving staging, an absent destination is reported as success and the staging tree is leaked; after a prior candidate was moved to backup, the later cleanup can also remove the last verified output. Run verifyCliCandidate(destination, { platform, arch }) and confirm the staging path disappeared before deleting the backup or clearing stagingLive.

#[arg(
default_value = "ferrite-app",
help = "New, absent directory to initialize"
)]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Update the follow-up command for the new default target. A bare ferrite init now creates ./ferrite-app, but the success path still prints next: npm install && npm run dev; following that runs npm in the parent directory instead of the generated app. Print a safely quoted cd <project> && ... command, or otherwise make the next step run inside the returned project path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants