Skip to content

chore: migrate remaining CLI process callers to the Effect v4 core - #1069

Merged
zxch3n merged 4 commits into
mainfrom
feat/effect-process-callers
Oct 10, 2026
Merged

zxch3n merged 4 commits into
mainfrom
feat/effect-process-callers

Conversation

@zxch3n

@zxch3n zxch3n commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Problem / pressure

The remaining CLI callers could bypass the ACP foundation and keep a second process implementation alive.

Summary

  • Migrate CLI git, daemon, worktree, MCP, preview, scanning, monitor and PTY termination callers to the inherited shared core.
  • Legacy callers import shared compatibility APIs directly; CLI process-options supplies logging and injected dependencies without executing Effects.
  • Permit the official Effect handle's yield* handle.kill() while rejecting direct Node child signals.
  • Include current main's Simulator workers/commands and memory-provider commands; preserve upgrade-installation verification, global Git identity and tunnel protocol.
  • Introduce the shared login-shell probe with its CLI consumer; remove CLI's shell-env dependency.
  • Add the CLI process-boundary guard to pnpm check, catching process libraries, dynamic imports and direct kill forms.
  • Keep standalone generated scripts and node-pty spawning as documented exceptions; PTY termination uses the core.

The inherited v4 runtime and process core are not changes introduced by this PR.
Electron, supervisor, shared helpers and review helper migrate in the next PR.

Visual explanation

remaining CLI process callers
  → shared compatibility entry points + CLI composition options
    → inherited shared v4 core

CLI guard rejects bypasses

Before / after

Before After
CLI callers use raw spawn/exec/kill or shell-env CLI callers use the inherited process core and shared shell probe
New bypasses can slip in pnpm check enforces the CLI boundary

Test plan

  • After restacking onto current main, this layer passed local frozen installation, pnpm format, pnpm check, pnpm format:check, and pnpm run docs check.
  • Test execution clears only the authoring session's injected Git wrapper variables (GIT_CONFIG_*, GIT_EXEC_PATH, LODY_GIT_*).
  • Remote CI is separate from these local results. No real Windows host, live cgroup hierarchy or signed installer validation is claimed.

Stack

The Effect v4 baseline (#1070) and lifecycle plans (#1355) are merged into main.

main → #1065 (process foundation) → #1069 (CLI consumers) → #1348 (cross-runtime consumers)

Use GitHub's native stack merge workflow, bottom to top. Each PR describes only
its own increment; all implementation layers use Effect 4.0.2.

Ablation-based simplification

Removed the literal command-builder test and its test-only export. Shell and daemon timeout coverage now uses explicit startup and virtual time. Disabling command grouping fails the retained shell timeout case.

Legacy execution boundary

The shared execution facades now carry a Legacy suffix and @deprecated: runCommandTextLegacy, runCommandTextSyncLegacy, startProcessLegacy, terminateChildTreeLegacy, signalChildTreeNowLegacy, isPidAliveSyncLegacy, probePidSyncLegacy, makeProcessRunnerLegacy and runPromiseSquashedLegacy. The Promise runner and manually owned handle types are ProcessRunnerLegacy and ProcessHandleLegacy. Old exports are removed and callers use full names; core Effect APIs, Layer builders and pure helpers keep their names. New Effect workflows compose core APIs and execute at their owning application entry point. The guard rejects retired imports/exports and aliases hiding Legacy. Cancellation and cleanup behavior are unchanged. The API and CLI migration belong here; cross-runtime consumers are updated in #1348.

@zxch3n
zxch3n force-pushed the feat/effect-process-callers branch 3 times, most recently from b7b9fd0 to ad4cfaf Compare October 9, 2026 14:40
Base automatically changed from feat/effect-process-service to main October 9, 2026 15:35
zxch3n added 3 commits October 9, 2026 23:35
Consolidate this layer for cascading rebases; retain its reviewed file contents.

Model: gpt-6
@zxch3n
zxch3n force-pushed the feat/effect-process-callers branch from a726e9d to 196fcb5 Compare October 9, 2026 15:35
@zxch3n
zxch3n marked this pull request as ready for review October 9, 2026 15:35
@zxch3n
zxch3n merged commit 32bca92 into main Oct 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant