✨ Add distributable chat2shell CLI - #6
Conversation
Replace the shell-script runtime with one foreground cac command. Bundle the npm executable with tsdown and publish releases through GitHub Actions using npm trusted publishing.
Remove transient release and roadmap context from public documentation. Fix the exported environment example, drop an unapproved dependency override, and remove a timing-sensitive test assertion.
Let Docker Sandboxes own network policy and route discovery negotiation through the MCP SDK's protocol-standard legacy fallback. Document unauthenticated exposure responsibility and publish the OAuth and web interface roadmap.
Leverframe review🟡 Incremental review completed in 357s
Changes |
There was a problem hiding this comment.
Leverframe review
Found three actionable CLI/runtime defects. Verification used the repository-pinned pnpm 11.23.0 on Node v24.20.0, matching CI's Node 24 environment. The normal quality gate and package build passed, but installed-artifact checks reproduced the management-command failures.
Findings
3 findings were published inline.
Checks
5 passed · 4 failed · 0 not run
Show 9 checks
| Status | Check | Evidence |
|---|---|---|
| 🟢 passed | node --version; pnpm --version; npm --version |
Selected environment reported Node v24.20.0, pnpm 11.23.0, and npm 11.19.0; package.json pins pnpm 11.23.0 and CI selects Node 24. |
| 🟢 passed | pnpm install --frozen-lockfile |
Installed the exact lockfile successfully with pnpm 11.23.0. |
| 🟢 passed | pnpm check |
Formatting, oxlint/eslint, TypeScript 5.9.3 typecheck, all 36 unit/integration tests, and the tsdown 0.22.14 production build passed. |
| 🟢 passed | npm pack --dry-run --json |
The package contained seven expected files, including executable mode-0755 dist/cli.mjs. |
| 🔴 failed | npm pack; npm install --prefix <temporary-directory> chat2shell-0.2.0.tgz; <installed-bin> workspace list |
The installed executable reported version 0.2.0, but workspace list exited 0 without output or state creation, reproducing the primary finding from the distributable artifact. |
| 🔴 failed | node dist/cli.mjs does-not-exist |
Exited 0 with empty stdout and stderr. |
| 🔴 failed | Focused `serve` permission check with pre-created 0755 state directory and fake sbx responses |
The service reached /healthz, but the configured state directory remained mode 0755 instead of owner-only 0700. |
| 🔴 failed | pnpm test:e2e |
Could not start the suite because the documented Docker Sandboxes prerequisite is unavailable: spawnSync sbx ENOENT. This environment failure is not reported as a code defect. |
| 🟢 passed | git diff --check 2e4d0852d1e4e5f5cf1dcce41096aaa1e759e943...e365a190b47b8a6d0881e6045d771d75cf01fa6d |
No whitespace errors were reported. |
Limitations
- Real Docker Sandbox template creation, lifecycle, and changed network-policy behavior could not be exercised because the required
sbxexecutable and template are unavailable; therefore coverage is marked incomplete.
Dispatch workspace and approval actions through CAC's actual command matching model, reject unknown commands, and restore owner-only state directory permissions. Add regression coverage for each reported runtime failure.
There was a problem hiding this comment.
Leverframe review
Reviewed the complete six-file incremental diff using the repository-declared pnpm 11.23.0 toolchain on Node 24.20.0 (npm 11.19.0). All prior findings are fixed and the full repository check passed. One new release-workflow security defect remains.
Findings
1 finding was published inline.
Checks
6 passed · 1 failed · 0 not run
Show 7 checks
| Status | Check | Evidence |
|---|---|---|
| 🟢 passed | node --version && pnpm --version && npm --version |
Reported Node v24.20.0, pnpm 11.23.0, and npm 11.19.0. |
| 🟢 passed | pnpm install --frozen-lockfile |
The declared lockfile and pnpm version installed 329 packages successfully. |
| 🟢 passed | pnpm exec vitest run --project unit test/unit/cli.test.ts --project integration test/integration/cli.test.ts test/integration/serve.test.ts |
All 3 changed test files passed: 5 tests total. |
| 🟢 passed | pnpm check |
Formatting, oxlint/eslint, TypeScript, all 40 unit/integration tests, and the Node 24 build passed. |
| 🟢 passed | pnpm pack followed by installation and packed-CLI workspace/unknown-command smoke tests |
The tarball installed successfully; workspace list/add/list persisted the workspace, while an unknown command exited 1 with the expected diagnostic. |
| 🔴 failed | uvx zizmor --offline --pedantic --format plain .github/workflows/release.yml |
The audit completed and exited 14 after detecting high-confidence unpinned-action findings on all three changed uses lines. |
| 🟢 passed | git show e365a190b47b8a6d0881e6045d771d75cf01fa6d:.github/workflows/release.yml | uvx zizmor --offline --pedantic --format plain - |
The base comparison contained no unpinned-uses findings; unrelated pre-existing audit diagnostics were excluded from review findings. |
Limitations
-
Zizmor's online ref-confusion audit could not query the public GitHub API because the environment returned HTTP 401; its offline immutable-pin audit completed normally.
-
The repository's real
sbxE2E suite was not run because the incremental changes do not alter the sandbox boundary, and repository guidance requires a specially provisioned trusted host.
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v7 |
There was a problem hiding this comment.
🟡 [MEDIUM] Release actions are no longer pinned to immutable revisions
The release job has id-token: write and ultimately publishes to npm. Replacing the exact commit pins for checkout, pnpm setup, and Node setup with mutable major-version tags allows code introduced by a moved or compromised tag to execute before publication. Such code can alter the checked-out or built package, which the final trusted npm publish step would then release under this project's identity.
Evidence: Offline zizmor 1.30.0 reported high-confidence unpinned-uses findings at lines 21, 24, and 30. Auditing the review-base workflow reported no unpinned-uses findings, and the unchanged CI workflow still pins these same actions to full commit SHAs.
Suggested action: Restore full commit-SHA pins for all three actions, retaining version comments for readability, and update the pins through reviewed dependency-update PRs.
Confidence: high
There was a problem hiding this comment.
Not applying this suggestion. This repository intentionally uses upstream major-version tags for GitHub Actions rather than immutable commit SHAs. The associated supply-chain tradeoff is accepted as a project maintenance policy, so these references are deliberate rather than accidental unpinning.
Summary
chat2shellCLI for setup, foreground serving, status checks, workspace registration, and approvals.Verification
pnpm check— passed formatting, linting, typechecking, 36 unit and integration tests, and the production bundle.pnpm test:e2e— passed the real Docker Sandbox lifecycle test.npm pack --dry-run --json— produced the expected seven-file public package.Risks and rollout
chat2shell serveremains a foreground process; service supervision and restart policy remain external to the product.