Skip to content

feat(setup): add reviewed local stdio onboarding - #218

Merged
mohanagy merged 2 commits into
developmentfrom
feat/204-local-remote-setup
Jul 24, 2026
Merged

feat(setup): add reviewed local stdio onboarding#218
mohanagy merged 2 commits into
developmentfrom
feat/204-local-remote-setup

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • add the shared local-stdio setup path to miftah init, miftah setup, and the local Console
  • persist a reviewed literal executable plus bounded argv array only after explicit acknowledgement; setup never launches the generic command
  • default generated profiles to read-only and treat unknown tools as destructive
  • reject shell/wrapper, credential-shaped, environment-reference, URL/control, and unsafe working-directory inputs; require a direct absolute .exe or .com binary on Windows so argv execution cannot fall back to cmd.exe
  • document the complete first-use path and retain it with CLI/README/Console contract tests

Scope and follow-up

This implements the local-executable entry mode under #204. During security review, the broader existing Windows imported-stdio runtime boundary was split into #217 because it needs a larger dedicated design; this PR does not loosen that boundary.

Validation

  • npm test — 1,477 passed, 23 skipped
  • npm run test:core — 408 passed, 21 skipped
  • npm run test:coverage — 1,477 passed, 23 skipped; 95.42% statements
  • npm run lint
  • npm run typecheck
  • npm run build
  • npm run smoke:cli
  • npm run check:pack
  • npm run test:package

Refs #204

Summary by CodeRabbit

  • New Features

    • Added a reviewed local-stdio setup option for configuring local executables with literal arguments.
    • Added guided CLI and console onboarding with explicit acknowledgement before saving configurations.
    • Added safeguards against shell commands, unsafe arguments, embedded credentials, and accidental execution during setup.
    • Added Windows-specific requirements for direct absolute .exe or .com executables.
    • Added read-only defaults and safer handling for unknown tools.
  • Documentation

    • Updated setup guidance, CLI references, preset catalogs, API contracts, and changelog details for local executable configuration.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ecfe1c9e-dd22-4006-ab90-e3e990c013b3

📥 Commits

Reviewing files that changed from the base of the PR and between d13f332 and 970a739.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • README.md
  • docs/cli.md
  • docs/console-api.md
  • src/setup/client-entry-import.ts
  • tests/client-entry-import.test.ts
  • tests/console-application-service.test.ts
  • tests/console-dashboard-application-service.test.ts
  • tests/console-server.test.ts
  • tests/readme-product-contract.test.ts
  • tests/setup-command.test.ts
📝 Walkthrough

Walkthrough

Adds a reviewed local-stdio preset with literal executable arguments, explicit acknowledgement, strict validation, Windows binary rules, read-only defaults, CLI and console onboarding support, tests, and updated documentation.

Changes

Local STDIO onboarding

Layer / File(s) Summary
Preset contract and validation
src/config/presets.ts, tests/preset-catalog.test.ts
Adds the catalog version 3 local-stdio preset, validates executable, arguments, working directory, credentials, and platform-specific constraints, and generates read-only configurations with destructive unknown-tool risk.
CLI parsing and interactive setup
src/cli/parse.ts, src/cli/init.ts, src/cli/setup-client-entry-import.ts, tests/cli-parse.test.ts, tests/init-command.test.ts, tests/setup-command.test.ts
Adds local-stdio flags, repeated literal arguments, interactive collection and review, acknowledgement handling, and setup coverage without launching executables.
Console onboarding integration
src/console/console-server.ts, src/console/console-assets.ts, src/console/console-application-service.ts, tests/console-*.test.ts
Adds console fields and request validation, maps form values into onboarding requests, passes them to preset construction, and verifies persisted configurations.
Documentation and contract verification
README.md, docs/*.md, CHANGELOG.md, tests/*docs*test.ts, tests/readme-product-contract.test.ts
Documents local-stdio setup, literal argv behavior, acknowledgement, safety constraints, Windows requirements, and catalog version changes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • mohanagy/miftah#59 — Establishes the preset catalog and initialization plumbing extended here for local-stdio.
  • mohanagy/miftah#103 — Shares README product-contract coverage, extended here for local executable setup.
  • mohanagy/miftah#215 — Adds the client-entry import flow whose incompatibility checks now include local-stdio options.

Poem

A rabbit reviews each argv line,
No shell, no secrets, all kept fine.
The local path gets checked twice,
Windows binaries must be precise.
With consent and readonly glow,
Safe little configs hop and grow.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description follows the template mostly, but it is missing the required Security impact section and its credential/subprocess/failure-behavior details. Add a Security impact section covering credential handling, subprocess execution, policy/redaction, audit data, dependencies, and failure behavior, even if the answer is 'none'.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding reviewed local stdio onboarding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/204-local-remote-setup

Comment @coderabbitai help to get the list of available commands.

@mohanagy

Copy link
Copy Markdown
Owner Author

Security follow-up in 970a739: client-entry import on Windows now accepts only a direct absolute .exe or .com executable. Bare npx/node runners and .cmd/.bat shims fail closed before the SDK transport can reach a command processor. The regression suite covers the shared importer plus platform-aware CLI, Console service, dashboard, and HTTP flows. #217 remains the tracked design work for a reviewed direct-runner model that can safely restore ergonomic package-runner imports on Windows.

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.

1 participant