From b5ee02611122bf1969662ecf19eefe1c429a502d Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 24 Oct 2026 00:47:31 -0700 Subject: [PATCH] refactor: group Parcel watcher child process ownership (#33079) --- .../process-host-direct-import-baseline.txt | 14 ++++---- config/reliability-gates.jsonc | 32 +++++++++++-------- config/scripts/ci-shard-timings.json | 8 ++--- .../runtime-file-watcher-resource-probe.mjs | 6 ++-- ...filesystem-watcher-lifecycle-model.test.ts | 2 +- .../ipc/filesystem-watcher-local-capacity.ts | 2 +- .../ipc/filesystem-watcher-local-install.ts | 2 +- ...filesystem-watcher-native-capacity.test.ts | 2 +- ...filesystem-watcher-removal-restore.test.ts | 2 +- src/main/ipc/filesystem-watcher-wsl.test.ts | 2 +- src/main/ipc/filesystem-watcher-wsl.ts | 6 ++-- src/main/ipc/filesystem-watcher.test.ts | 2 +- .../parcel-watcher-cancellation-restart.ts | 6 ++-- .../parcel-watcher-cancellation-tracker.ts | 2 +- .../parcel-watcher-child-launch.test.ts | 2 +- .../parcel-watcher-child-launch.ts | 4 +-- .../parcel-watcher-child-messaging.ts | 2 +- .../parcel-watcher-child-recovery.ts | 8 ++--- .../parcel-watcher-child-registry.test.ts | 0 .../parcel-watcher-child-registry.ts | 0 .../parcel-watcher-child-slot.ts | 2 +- .../parcel-watcher-child-termination.ts | 6 ++-- ...cel-watcher-disconnect-termination.test.ts | 4 +-- ...parcel-watcher-interrupted-cancellation.ts | 4 +-- .../parcel-watcher-owned-children.test.ts | 0 .../parcel-watcher-owned-children.ts | 0 .../parcel-watcher-pending-cancellation.ts | 4 +-- .../parcel-watcher-pending-subscribe.ts | 4 +-- .../ipc/parcel-watcher-host-subscriptions.ts | 2 +- ...el-watcher-native-error-retirement.test.ts | 2 +- .../ipc/parcel-watcher-process-supervisor.ts | 22 ++++++------- src/main/ipc/parcel-watcher-process.test.ts | 4 +-- ...l-watcher-supervisor-capacity-wait.test.ts | 2 +- ...parcel-watcher-supervisor-capacity-wait.ts | 2 +- ...parcel-watcher-supervisor-capacity.test.ts | 4 +-- ...parcel-watcher-supervisor-disposal.test.ts | 2 +- .../ipc/parcel-watcher-supervisor-disposal.ts | 6 ++-- .../ipc/parcel-watcher-supervisor-message.ts | 4 +-- .../parcel-watcher-supervisor-subscribe.ts | 4 +-- ...parcel-watcher-unsubscribe-timeout.test.ts | 2 +- 40 files changed, 96 insertions(+), 88 deletions(-) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-cancellation-restart.ts (92%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-cancellation-tracker.ts (95%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-launch.test.ts (97%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-launch.ts (95%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-messaging.ts (77%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-recovery.ts (90%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-registry.test.ts (100%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-registry.ts (100%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-slot.ts (83%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-child-termination.ts (95%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-disconnect-termination.test.ts (98%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-interrupted-cancellation.ts (84%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-owned-children.test.ts (100%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-owned-children.ts (100%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-pending-cancellation.ts (90%) rename src/main/ipc/{ => filesystem/watcher-process}/parcel-watcher-pending-subscribe.ts (95%) diff --git a/config/process-host-direct-import-baseline.txt b/config/process-host-direct-import-baseline.txt index 93004907c51..04855f7c278 100644 --- a/config/process-host-direct-import-baseline.txt +++ b/config/process-host-direct-import-baseline.txt @@ -57,18 +57,18 @@ src/main/ipc/developer-permissions.ts src/main/ipc/filesystem-list-files.ts src/main/ipc/filesystem-watcher-wsl.ts src/main/ipc/filesystem/filesystem-handler-context.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-restart.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-tracker.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-child-messaging.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-child-recovery.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-child-termination.ts +src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-cancellation.ts src/main/ipc/local-network-connection-test.ts src/main/ipc/macos-keyboard-input-source.ts src/main/ipc/macos-keyboard-layout-snapshot.ts src/main/ipc/notification-authorization-status.ts -src/main/ipc/parcel-watcher-cancellation-restart.ts -src/main/ipc/parcel-watcher-cancellation-tracker.ts -src/main/ipc/parcel-watcher-child-launch.ts -src/main/ipc/parcel-watcher-child-messaging.ts -src/main/ipc/parcel-watcher-child-recovery.ts -src/main/ipc/parcel-watcher-child-termination.ts src/main/ipc/parcel-watcher-host-subscriptions.ts -src/main/ipc/parcel-watcher-pending-cancellation.ts src/main/ipc/parcel-watcher-process-supervisor.ts src/main/ipc/parcel-watcher-supervisor-disposal.ts src/main/ipc/parcel-watcher-supervisor-message.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 6a2c868882a..72c86ce5ef9 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -18277,13 +18277,13 @@ "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/files-watch-cleanup.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts", "pnpm run build:electron-vite", "node config/scripts/runtime-file-watcher-resource-probe.mjs", "node config/scripts/runtime-file-watcher-fault-harness.mjs", @@ -18295,13 +18295,13 @@ "src/main/daemon/daemon-pty-adapter.test.ts", "src/main/ipc/filesystem-watcher.test.ts", "src/main/ipc/filesystem-watcher-native-capacity.test.ts", - "src/main/ipc/parcel-watcher-child-registry.test.ts", - "src/main/ipc/parcel-watcher-child-launch.test.ts", + "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts", + "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts", "src/main/ipc/parcel-watcher-process.test.ts", "src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts", "src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts", "src/main/ipc/parcel-watcher-supervisor-capacity.test.ts", - "src/main/ipc/parcel-watcher-disconnect-termination.test.ts", + "src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts", "src/main/ipc/runtime-watcher-pending-assignment.test.ts", "src/main/ipc/runtime-watcher-process-pool.test.ts", "src/main/ipc/parcel-watcher-process-entry.test.ts", @@ -18354,13 +18354,13 @@ ] }, { - "file": "src/main/ipc/parcel-watcher-child-registry.test.ts", + "file": "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts", "assertions": [ "capacity notification closes the release-before-listen race, supports cancellation, fires at most once, and serializes reserving waiters per released slot" ] }, { - "file": "src/main/ipc/parcel-watcher-child-launch.test.ts", + "file": "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts", "assertions": [ "native launcher reports typed transient capacity exhaustion without forking another child" ] @@ -18423,7 +18423,7 @@ ] }, { - "file": "src/main/ipc/parcel-watcher-disconnect-termination.test.ts", + "file": "src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts", "assertions": [ "pending-crawl cancellation after disconnect remains pending until the exact child exits", "ready and pending-crawl cancellation force disconnected-child exit even while a healthy sibling root remains", @@ -18690,6 +18690,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", "result": "passed", "durationSeconds": 11.98, "summary": "Thirty-nine watcher, cancellation, desktop/serve, paired-web, WSL, SSH/relay, removal, and PTY physical-exit files passed with 2,008 tests. Capacity, quarantine, runtime-root, relay, and SSH setup layers each prove that 10,000 aborted callers detach while one anchor remains and zero waiters remain after settlement." @@ -18699,6 +18700,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", "result": "passed", "durationSeconds": 11.59, "summary": "Thirty-four watcher, cancellation, desktop/serve, paired-web, WSL, removal, PTY physical-exit, provider, renderer, and path files passed with 1,999 tests; paired-web cancellation now owns a server token before ready and aborts pending setup without a late native install." @@ -18717,6 +18719,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot", "result": "passed", "durationSeconds": 10.01, "summary": "Twenty-seven watcher, WSL, desktop/serve removal, local/daemon/SSH PTY physical-exit, provider ownership, RPC, renderer, relay PTY admission, and cross-platform path files passed with 1,886 tests. The suite includes nested removal fencing, renderer/runtime cwd-only admission, legacy provider rows, rejected kill retries, transient WSL capacity, and synchronous-startup reservation cleanup." @@ -18771,6 +18774,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", "result": "passed", "durationSeconds": 9.12, "summary": "Twenty-five watcher, WSL, desktop/serve removal, local/daemon/SSH PTY physical-exit, provider ownership, RPC, renderer, relay PTY admission, and cross-platform path files passed with 1,762 tests. The suite covers operations joining in-flight termination, kill failures retaining ownership, bounded timeouts, atomic relay spawn/revive caps, and PTY-removal admission." @@ -18825,6 +18829,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts", "result": "passed", "durationSeconds": 9.03, "summary": "Twenty-three watcher, desktop/serve removal, terminal-spawn gate, daemon/SSH physical PTY exit, provider ownership, RPC, renderer, and cross-platform path files passed with 1,630 tests. The suite includes same-turn watcher replacement, authoritative SSH teardown before Git, bounded kill-without-exit failures that retain ownership, and local/SSH deletion fail-closed behavior." @@ -18852,6 +18857,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts", "result": "passed", "durationSeconds": 8.85, "summary": "18 focused supervisor, disconnect termination, pool, child-entry, delivery, desktop/WSL cleanup and IPC removal, removal-gate, runtime-host/commands and physical PTY teardown, RPC, SSH ownership, renderer/paired-web clients, and cross-platform path files passed with 1,193 tests." diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 3bb553e8f69..ed39242ba76 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -2650,16 +2650,16 @@ "src/main/ipc/runtime-environments/orcad-runtime-lifecycle-handlers.test.ts": 43, "src/main/ipc/runtime-environments/orcad-runtime-maintenance-handlers.test.ts": 856, "src/main/ipc/runtime-environments/orcad-ssh-provisioning-handlers.test.ts": 33, - "src/main/ipc/parcel-watcher-child-launch.test.ts": 51, - "src/main/ipc/parcel-watcher-child-registry.test.ts": 88, + "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts": 51, + "src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts": 88, "src/main/ipc/parcel-watcher-crash-fuse.test.ts": 37, - "src/main/ipc/parcel-watcher-disconnect-termination.test.ts": 146, + "src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts": 146, "src/main/ipc/parcel-watcher-entry-path.test.ts": 41, "src/main/ipc/parcel-watcher-event-cancellation.test.ts": 45, "src/main/ipc/parcel-watcher-event-delivery.test.ts": 112, "src/main/ipc/parcel-watcher-module-loader.test.ts": 32, "src/main/ipc/parcel-watcher-native-error-retirement.test.ts": 100, - "src/main/ipc/parcel-watcher-owned-children.test.ts": 50, + "src/main/ipc/filesystem/watcher-process/parcel-watcher-owned-children.test.ts": 50, "src/main/ipc/parcel-watcher-process-dispose.test.ts": 36, "src/main/ipc/parcel-watcher-process-entry.test.ts": 179, "src/main/ipc/parcel-watcher-process.test.ts": 558, diff --git a/config/scripts/runtime-file-watcher-resource-probe.mjs b/config/scripts/runtime-file-watcher-resource-probe.mjs index 67d2df02a63..88575e3f3af 100644 --- a/config/scripts/runtime-file-watcher-resource-probe.mjs +++ b/config/scripts/runtime-file-watcher-resource-probe.mjs @@ -10,7 +10,9 @@ import { build } from 'esbuild' const ENTRY_PATH = resolve('out/main/parcel-watcher-process-entry.js') const POOL_SOURCE = resolve('src/main/ipc/runtime-watcher-process-pool.ts') const FAILURE_SOURCE = resolve('src/main/ipc/parcel-watcher-process-failure.ts') -const REGISTRY_SOURCE = resolve('src/main/ipc/parcel-watcher-child-registry.ts') +const REGISTRY_SOURCE = resolve( + 'src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.ts' +) const MAX_CHILD_RSS_KIB = 128 * 1024 const MAX_CHILD_CPU_PERCENT = 50 const MAX_QUARANTINE_RSS_KIB = 512 * 1024 @@ -132,7 +134,7 @@ async function loadProbe(bundleDir) { function activeChildPids(pool) { return [...pool.activeSlots] - .map((slot) => slot.supervisor.child?.pid) + .map((slot) => (slot.supervisor.slot ?? slot.supervisor).child?.pid) .filter((pid) => Number.isInteger(pid)) } diff --git a/src/main/ipc/filesystem-watcher-lifecycle-model.test.ts b/src/main/ipc/filesystem-watcher-lifecycle-model.test.ts index dbc45a1629a..d95556db77d 100644 --- a/src/main/ipc/filesystem-watcher-lifecycle-model.test.ts +++ b/src/main/ipc/filesystem-watcher-lifecycle-model.test.ts @@ -24,7 +24,7 @@ import { getLocalWatcherRoot } from './filesystem-watcher-paths' import { resetWatcherChildRegistryForTest, WatcherChildCapacityError -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' type Handler = (event: unknown, args: unknown) => unknown type Sender = ReturnType & { destroyed: boolean } diff --git a/src/main/ipc/filesystem-watcher-local-capacity.ts b/src/main/ipc/filesystem-watcher-local-capacity.ts index 9860abe2767..aece817e965 100644 --- a/src/main/ipc/filesystem-watcher-local-capacity.ts +++ b/src/main/ipc/filesystem-watcher-local-capacity.ts @@ -1,5 +1,5 @@ import type { WebContents } from 'electron' -import { onWatcherChildCapacityAvailable } from './parcel-watcher-child-registry' +import { onWatcherChildCapacityAvailable } from './filesystem/watcher-process/parcel-watcher-child-registry' import type { LocalWatcherCapacityRetry } from './filesystem-watcher-lifecycle-state' import { watcherLifecycleState } from './filesystem-watcher-lifecycle-state' import { diff --git a/src/main/ipc/filesystem-watcher-local-install.ts b/src/main/ipc/filesystem-watcher-local-install.ts index b9ee94f9e85..b75717ae353 100644 --- a/src/main/ipc/filesystem-watcher-local-install.ts +++ b/src/main/ipc/filesystem-watcher-local-install.ts @@ -2,7 +2,7 @@ import { stat } from 'node:fs/promises' import { isWslPath } from '../wsl' import { WATCHER_IGNORE_DIRS } from './filesystem-watcher-ignore' import { createWslWatcher, type WatchedRoot } from './filesystem-watcher-wsl' -import { WatcherChildCapacityError } from './parcel-watcher-child-registry' +import { WatcherChildCapacityError } from './filesystem/watcher-process/parcel-watcher-child-registry' import { isWatcherProcessFailure } from './parcel-watcher-process-failure' import type { LocalWatcherInstallResult, diff --git a/src/main/ipc/filesystem-watcher-native-capacity.test.ts b/src/main/ipc/filesystem-watcher-native-capacity.test.ts index c9a7b198977..c9e2736935e 100644 --- a/src/main/ipc/filesystem-watcher-native-capacity.test.ts +++ b/src/main/ipc/filesystem-watcher-native-capacity.test.ts @@ -23,7 +23,7 @@ import { reserveWatcherChild, resetWatcherChildRegistryForTest, WatcherChildCapacityError -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' type HandlerMap = Record unknown> diff --git a/src/main/ipc/filesystem-watcher-removal-restore.test.ts b/src/main/ipc/filesystem-watcher-removal-restore.test.ts index 2b9152180c4..ee0ced50a5d 100644 --- a/src/main/ipc/filesystem-watcher-removal-restore.test.ts +++ b/src/main/ipc/filesystem-watcher-removal-restore.test.ts @@ -22,7 +22,7 @@ import { setWorktreeWatcherRemoval } from './worktree-watcher-removal' import { createRuntimeFileWatcherRemoval } from '../runtime/runtime-file-watcher-removal' import { watcherLifecycleState } from './filesystem-watcher-lifecycle-state' import { getLocalWatcherRoot } from './filesystem-watcher-paths' -import { resetWatcherChildRegistryForTest } from './parcel-watcher-child-registry' +import { resetWatcherChildRegistryForTest } from './filesystem/watcher-process/parcel-watcher-child-registry' type Handler = (event: unknown, args: unknown) => unknown diff --git a/src/main/ipc/filesystem-watcher-wsl.test.ts b/src/main/ipc/filesystem-watcher-wsl.test.ts index fb174a3d31e..7ef2dd9035b 100644 --- a/src/main/ipc/filesystem-watcher-wsl.test.ts +++ b/src/main/ipc/filesystem-watcher-wsl.test.ts @@ -16,7 +16,7 @@ import { MAX_PHYSICAL_WATCHER_CHILDREN, reserveWatcherChild, resetWatcherChildRegistryForTest -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' import type { WatchedRoot, WslWatcherDeps } from './filesystem-watcher-wsl' const SNAPSHOT_START = '\x1e' diff --git a/src/main/ipc/filesystem-watcher-wsl.ts b/src/main/ipc/filesystem-watcher-wsl.ts index 1bf3979147f..2c0362ebb0f 100644 --- a/src/main/ipc/filesystem-watcher-wsl.ts +++ b/src/main/ipc/filesystem-watcher-wsl.ts @@ -6,7 +6,7 @@ import type { Event as WatcherEvent } from '@parcel/watcher' import { queueWatcherEvents } from './filesystem-watcher-event-batch' import { parseWslUncPath } from '../../shared/wsl-paths' import { createWslWatcherProcessExit, createWslWatcherStartup } from './wsl-watcher-process-exit' -import { reserveWatcherChild, WatcherChildCapacityError } from './parcel-watcher-child-registry' +import * as watcherChildRegistry from './filesystem/watcher-process/parcel-watcher-child-registry' import { createDebouncedBatch, type DebouncedBatch } from './filesystem-watcher-batch-control' import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory' @@ -230,9 +230,9 @@ export async function createWslWatcher( } let child: ChildProcessWithoutNullStreams - const releaseChildReservation = reserveWatcherChild() + const releaseChildReservation = watcherChildRegistry.reserveWatcherChild() if (!releaseChildReservation) { - throw new WatcherChildCapacityError() + throw new watcherChildRegistry.WatcherChildCapacityError() } try { child = spawn('wsl.exe', ['-d', distro, '--exec', 'sh', '-s', '--', linuxPath], { diff --git a/src/main/ipc/filesystem-watcher.test.ts b/src/main/ipc/filesystem-watcher.test.ts index a2e5775cf95..2ed770dfd05 100644 --- a/src/main/ipc/filesystem-watcher.test.ts +++ b/src/main/ipc/filesystem-watcher.test.ts @@ -26,7 +26,7 @@ import { registerFilesystemWatcherHandlers } from './filesystem-watcher-handlers import { stat } from 'node:fs/promises' import { subscribe as subscribeParcelWatcher } from '@parcel/watcher' import { createWslWatcher } from './filesystem-watcher-wsl' -import { resetWatcherChildRegistryForTest } from './parcel-watcher-child-registry' +import { resetWatcherChildRegistryForTest } from './filesystem/watcher-process/parcel-watcher-child-registry' import { acquireWatcherRemovalGate } from './watcher-removal-gate' type HandlerMap = Record unknown> diff --git a/src/main/ipc/parcel-watcher-cancellation-restart.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-restart.ts similarity index 92% rename from src/main/ipc/parcel-watcher-cancellation-restart.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-restart.ts index 21f59d07f1d..1595be85292 100644 --- a/src/main/ipc/parcel-watcher-cancellation-restart.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-restart.ts @@ -3,15 +3,15 @@ import { failAllWatcherSubscriptions, type PendingWatcherUnsubscribe, resolvePendingWatcherUnsubscribes -} from './parcel-watcher-host-subscriptions' +} from '../../parcel-watcher-host-subscriptions' import type { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' import { createWatcherChildTerminationFailure, terminateWatcherChild } from './parcel-watcher-child-termination' import { resetPendingSubscribeAttempt } from './parcel-watcher-pending-subscribe' -import { WatcherProcessFailure } from './parcel-watcher-process-failure' -import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' +import { WatcherProcessFailure } from '../../parcel-watcher-process-failure' +import type { WatcherProcessSubscriptionRecord } from '../../parcel-watcher-process-subscription' export function restoreWatcherRecordsAfterCancellation( records: Map, diff --git a/src/main/ipc/parcel-watcher-cancellation-tracker.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-tracker.ts similarity index 95% rename from src/main/ipc/parcel-watcher-cancellation-tracker.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-tracker.ts index d7632c90943..a3f73fe5a04 100644 --- a/src/main/ipc/parcel-watcher-cancellation-tracker.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-cancellation-tracker.ts @@ -1,5 +1,5 @@ import type { ChildProcess } from 'node:child_process' -import { RUNTIME_FILE_WATCH_CANCEL_TIMEOUT_MS } from '../../shared/runtime-file-watch-limits' +import { RUNTIME_FILE_WATCH_CANCEL_TIMEOUT_MS } from '../../../../shared/runtime-file-watch-limits' type CancelledSubscribe = { child: ChildProcess diff --git a/src/main/ipc/parcel-watcher-child-launch.test.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts similarity index 97% rename from src/main/ipc/parcel-watcher-child-launch.test.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts index bc2e8635d72..c4530540d9e 100644 --- a/src/main/ipc/parcel-watcher-child-launch.test.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts @@ -13,7 +13,7 @@ const { forkMock, releaseReservationMock, signalPhysicalExitMock, writeFileSyncM vi.mock('node:child_process', () => ({ fork: forkMock })) vi.mock('node:fs', () => ({ writeFileSync: writeFileSyncMock })) -vi.mock('./parcel-watcher-canary-directory', () => ({ +vi.mock('../../parcel-watcher-canary-directory', () => ({ createWatcherCanaryDirectory: vi.fn(() => null), removeWatcherCanaryDirectory: vi.fn() })) diff --git a/src/main/ipc/parcel-watcher-child-launch.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.ts similarity index 95% rename from src/main/ipc/parcel-watcher-child-launch.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.ts index 8bb2dab9e3d..0e49e71ab57 100644 --- a/src/main/ipc/parcel-watcher-child-launch.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.ts @@ -3,10 +3,10 @@ import { writeFileSync } from 'node:fs' import { createWatcherCanaryDirectory, removeWatcherCanaryDirectory -} from './parcel-watcher-canary-directory' +} from '../../parcel-watcher-canary-directory' import { reserveWatcherChild, WatcherChildCapacityError } from './parcel-watcher-child-registry' import { registerWatcherChildPhysicalExit } from './parcel-watcher-child-termination' -import type { WatcherToHostMessage } from './parcel-watcher-process-protocol' +import type { WatcherToHostMessage } from '../../parcel-watcher-process-protocol' export type LaunchedWatcherChild = { child: ChildProcess diff --git a/src/main/ipc/parcel-watcher-child-messaging.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-messaging.ts similarity index 77% rename from src/main/ipc/parcel-watcher-child-messaging.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-messaging.ts index 73e429abed5..91d6a54310c 100644 --- a/src/main/ipc/parcel-watcher-child-messaging.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-messaging.ts @@ -1,5 +1,5 @@ import type { ChildProcess } from 'node:child_process' -import type { HostToWatcherMessage } from './parcel-watcher-process-protocol' +import type { HostToWatcherMessage } from '../../parcel-watcher-process-protocol' export function sendToWatcherChild(proc: ChildProcess, message: HostToWatcherMessage): void { try { diff --git a/src/main/ipc/parcel-watcher-child-recovery.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-recovery.ts similarity index 90% rename from src/main/ipc/parcel-watcher-child-recovery.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-recovery.ts index 124154eb563..15cc5c8fd04 100644 --- a/src/main/ipc/parcel-watcher-child-recovery.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-recovery.ts @@ -3,16 +3,16 @@ import { failAllWatcherSubscriptions, type PendingWatcherUnsubscribe, resolvePendingWatcherUnsubscribes -} from './parcel-watcher-host-subscriptions' +} from '../../parcel-watcher-host-subscriptions' import type { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' import { createWatcherChildTerminationFailure, terminateWatcherChild } from './parcel-watcher-child-termination' import { resetPendingSubscribeAttempt } from './parcel-watcher-pending-subscribe' -import type { WatcherProcessCrashFuse } from './parcel-watcher-crash-fuse' -import { WatcherProcessFailure } from './parcel-watcher-process-failure' -import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' +import type { WatcherProcessCrashFuse } from '../../parcel-watcher-crash-fuse' +import { WatcherProcessFailure } from '../../parcel-watcher-process-failure' +import type { WatcherProcessSubscriptionRecord } from '../../parcel-watcher-process-subscription' export function recoverWatcherRecordsAfterChildGone( records: Map, diff --git a/src/main/ipc/parcel-watcher-child-registry.test.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts similarity index 100% rename from src/main/ipc/parcel-watcher-child-registry.test.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts diff --git a/src/main/ipc/parcel-watcher-child-registry.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.ts similarity index 100% rename from src/main/ipc/parcel-watcher-child-registry.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.ts diff --git a/src/main/ipc/parcel-watcher-child-slot.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-slot.ts similarity index 83% rename from src/main/ipc/parcel-watcher-child-slot.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-slot.ts index c88c0797a94..fc14fad08a1 100644 --- a/src/main/ipc/parcel-watcher-child-slot.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-slot.ts @@ -1,5 +1,5 @@ import type { ChildProcessHandle } from '@orca/process-host/process-spec' -import { removeWatcherCanaryDirectory } from './parcel-watcher-canary-directory' +import { removeWatcherCanaryDirectory } from '../../parcel-watcher-canary-directory' export class WatcherChildSlot { child: ChildProcessHandle | null = null diff --git a/src/main/ipc/parcel-watcher-child-termination.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-termination.ts similarity index 95% rename from src/main/ipc/parcel-watcher-child-termination.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-child-termination.ts index 3e08ce02d39..b11a67431ff 100644 --- a/src/main/ipc/parcel-watcher-child-termination.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-child-termination.ts @@ -2,9 +2,9 @@ import type { ChildProcess } from 'node:child_process' import { type PendingWatcherUnsubscribe, resolvePendingWatcherUnsubscribes -} from './parcel-watcher-host-subscriptions' -import { WatcherProcessFailure } from './parcel-watcher-process-failure' -import { RUNTIME_FILE_WATCH_EXIT_DEADLINE_MS } from '../../shared/runtime-file-watch-limits' +} from '../../parcel-watcher-host-subscriptions' +import { WatcherProcessFailure } from '../../parcel-watcher-process-failure' +import { RUNTIME_FILE_WATCH_EXIT_DEADLINE_MS } from '../../../../shared/runtime-file-watch-limits' export const WATCHER_PROCESS_HARD_KILL_DELAY_MS = 5_000 export const WATCHER_PROCESS_EXIT_DEADLINE_MS = RUNTIME_FILE_WATCH_EXIT_DEADLINE_MS diff --git a/src/main/ipc/parcel-watcher-disconnect-termination.test.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts similarity index 98% rename from src/main/ipc/parcel-watcher-disconnect-termination.test.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts index b478775d1b7..62109fae257 100644 --- a/src/main/ipc/parcel-watcher-disconnect-termination.test.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts @@ -22,8 +22,8 @@ import { disposeWatcherProcess, resetWatcherProcessForTest, subscribeViaWatcherProcess -} from './parcel-watcher-process' -import type { WatcherProcessSubscription } from './parcel-watcher-process-subscription' +} from '../../parcel-watcher-process' +import type { WatcherProcessSubscription } from '../../parcel-watcher-process-subscription' type SentMessage = { op: string; id: number } diff --git a/src/main/ipc/parcel-watcher-interrupted-cancellation.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-interrupted-cancellation.ts similarity index 84% rename from src/main/ipc/parcel-watcher-interrupted-cancellation.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-interrupted-cancellation.ts index 05b6f28eb17..f9be7bc374d 100644 --- a/src/main/ipc/parcel-watcher-interrupted-cancellation.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-interrupted-cancellation.ts @@ -1,6 +1,6 @@ import { resetPendingSubscribeAttempt } from './parcel-watcher-pending-subscribe' -import type { WatcherProcessFailure } from './parcel-watcher-process-failure' -import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' +import type { WatcherProcessFailure } from '../../parcel-watcher-process-failure' +import type { WatcherProcessSubscriptionRecord } from '../../parcel-watcher-process-subscription' export function cancelInterruptedWatcherSubscribe(args: { record: WatcherProcessSubscriptionRecord diff --git a/src/main/ipc/parcel-watcher-owned-children.test.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-owned-children.test.ts similarity index 100% rename from src/main/ipc/parcel-watcher-owned-children.test.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-owned-children.test.ts diff --git a/src/main/ipc/parcel-watcher-owned-children.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-owned-children.ts similarity index 100% rename from src/main/ipc/parcel-watcher-owned-children.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-owned-children.ts diff --git a/src/main/ipc/parcel-watcher-pending-cancellation.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-cancellation.ts similarity index 90% rename from src/main/ipc/parcel-watcher-pending-cancellation.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-cancellation.ts index 877f85d275a..4fc67138540 100644 --- a/src/main/ipc/parcel-watcher-pending-cancellation.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-cancellation.ts @@ -1,8 +1,8 @@ import type { ChildProcess } from 'node:child_process' import type { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' import { takePendingSubscribe } from './parcel-watcher-pending-subscribe' -import type { WatcherProcessFailure } from './parcel-watcher-process-failure' -import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' +import type { WatcherProcessFailure } from '../../parcel-watcher-process-failure' +import type { WatcherProcessSubscriptionRecord } from '../../parcel-watcher-process-subscription' type CancelPendingWatcherSubscribeOptions = { record: WatcherProcessSubscriptionRecord diff --git a/src/main/ipc/parcel-watcher-pending-subscribe.ts b/src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-subscribe.ts similarity index 95% rename from src/main/ipc/parcel-watcher-pending-subscribe.ts rename to src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-subscribe.ts index f37c7b3dbf6..c0cb3a97611 100644 --- a/src/main/ipc/parcel-watcher-pending-subscribe.ts +++ b/src/main/ipc/filesystem/watcher-process/parcel-watcher-pending-subscribe.ts @@ -1,8 +1,8 @@ -import { WatcherProcessFailure } from './parcel-watcher-process-failure' +import { WatcherProcessFailure } from '../../parcel-watcher-process-failure' import type { PendingWatcherProcessSubscribe, WatcherProcessSubscriptionRecord -} from './parcel-watcher-process-subscription' +} from '../../parcel-watcher-process-subscription' export function installPendingSubscribeControls( record: WatcherProcessSubscriptionRecord, diff --git a/src/main/ipc/parcel-watcher-host-subscriptions.ts b/src/main/ipc/parcel-watcher-host-subscriptions.ts index acb9a0aa74a..67e2f4edce1 100644 --- a/src/main/ipc/parcel-watcher-host-subscriptions.ts +++ b/src/main/ipc/parcel-watcher-host-subscriptions.ts @@ -2,7 +2,7 @@ import type { ChildProcess } from 'node:child_process' import { resetPendingSubscribeAttempt, takePendingSubscribe -} from './parcel-watcher-pending-subscribe' +} from './filesystem/watcher-process/parcel-watcher-pending-subscribe' import { isWatcherProcessFailure, WatcherProcessFailure } from './parcel-watcher-process-failure' import type { HostToWatcherMessage, WatcherToHostMessage } from './parcel-watcher-process-protocol' import type { diff --git a/src/main/ipc/parcel-watcher-native-error-retirement.test.ts b/src/main/ipc/parcel-watcher-native-error-retirement.test.ts index eb75dc9a8ef..389436f1266 100644 --- a/src/main/ipc/parcel-watcher-native-error-retirement.test.ts +++ b/src/main/ipc/parcel-watcher-native-error-retirement.test.ts @@ -15,7 +15,7 @@ vi.mock('node:fs', () => ({ })) import { WatcherProcessSupervisor } from './parcel-watcher-process-supervisor' -import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './parcel-watcher-child-termination' +import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './filesystem/watcher-process/parcel-watcher-child-termination' describe('native watcher error retirement', () => { let supervisor: WatcherProcessSupervisor diff --git a/src/main/ipc/parcel-watcher-process-supervisor.ts b/src/main/ipc/parcel-watcher-process-supervisor.ts index 2da4fc37e95..7963c2c7289 100644 --- a/src/main/ipc/parcel-watcher-process-supervisor.ts +++ b/src/main/ipc/parcel-watcher-process-supervisor.ts @@ -1,26 +1,26 @@ import type { ChildProcess } from 'node:child_process' -import { restartCancelledWatcherChild } from './parcel-watcher-cancellation-restart' -import { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' +import { restartCancelledWatcherChild } from './filesystem/watcher-process/parcel-watcher-cancellation-restart' +import { WatcherCancellationTracker } from './filesystem/watcher-process/parcel-watcher-cancellation-tracker' import { getWatcherProcessEntryPath, watcherProcessEntryExists } from './parcel-watcher-entry-path' -import { WatcherChildSlot } from './parcel-watcher-child-slot' -import * as termination from './parcel-watcher-child-termination' -import { launchWatcherChild } from './parcel-watcher-child-launch' -import { sendToWatcherChild } from './parcel-watcher-child-messaging' +import { WatcherChildSlot } from './filesystem/watcher-process/parcel-watcher-child-slot' +import * as termination from './filesystem/watcher-process/parcel-watcher-child-termination' +import { launchWatcherChild } from './filesystem/watcher-process/parcel-watcher-child-launch' +import { sendToWatcherChild } from './filesystem/watcher-process/parcel-watcher-child-messaging' import { recoverWatcherRecordsAfterChildGone, terminateDisconnectedWatcherChild -} from './parcel-watcher-child-recovery' -import { resetWatcherChildRegistryForTest } from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-recovery' +import { resetWatcherChildRegistryForTest } from './filesystem/watcher-process/parcel-watcher-child-registry' import { WatcherSupervisorCapacityWait } from './parcel-watcher-supervisor-capacity-wait' import { WatcherProcessCrashFuse } from './parcel-watcher-crash-fuse' import { WatcherDeliveryHealthMonitor } from './parcel-watcher-delivery-health' -import { cancelInterruptedWatcherSubscribe } from './parcel-watcher-interrupted-cancellation' +import { cancelInterruptedWatcherSubscribe } from './filesystem/watcher-process/parcel-watcher-interrupted-cancellation' import { type PendingWatcherUnsubscribe, reportWatcherTerminalError, resolvePendingWatcherUnsubscribes } from './parcel-watcher-host-subscriptions' -import { cancelPendingWatcherSubscribe } from './parcel-watcher-pending-cancellation' +import { cancelPendingWatcherSubscribe } from './filesystem/watcher-process/parcel-watcher-pending-cancellation' import type { WatcherProcessFailure } from './parcel-watcher-process-failure' import type { WatcherProcessSubscribeOptions, @@ -39,7 +39,7 @@ import { } from './parcel-watcher-supervisor-subscribe' import { disposeWatcherSupervisor } from './parcel-watcher-supervisor-disposal' import { handleWatcherSupervisorMessage } from './parcel-watcher-supervisor-message' -import { WatcherOwnedChildren } from './parcel-watcher-owned-children' +import { WatcherOwnedChildren } from './filesystem/watcher-process/parcel-watcher-owned-children' export class WatcherProcessSupervisor { private nextSubscriptionId = 1 diff --git a/src/main/ipc/parcel-watcher-process.test.ts b/src/main/ipc/parcel-watcher-process.test.ts index 6c23440ff80..51c6b2fa7e3 100644 --- a/src/main/ipc/parcel-watcher-process.test.ts +++ b/src/main/ipc/parcel-watcher-process.test.ts @@ -1,10 +1,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { WATCHER_PROCESS_CANCEL_TIMEOUT_MS } from './parcel-watcher-cancellation-tracker' +import { WATCHER_PROCESS_CANCEL_TIMEOUT_MS } from './filesystem/watcher-process/parcel-watcher-cancellation-tracker' import { terminateWatcherChild, WATCHER_PROCESS_EXIT_DEADLINE_MS, WATCHER_PROCESS_HARD_KILL_DELAY_MS -} from './parcel-watcher-child-termination' +} from './filesystem/watcher-process/parcel-watcher-child-termination' import { acknowledgeWatcherSubscribe as ackSubscribe, currentWatcherChild, diff --git a/src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts b/src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts index 4f0845ebd26..c358d73734a 100644 --- a/src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts +++ b/src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts @@ -3,7 +3,7 @@ import { MAX_PHYSICAL_WATCHER_CHILDREN, reserveWatcherChild, resetWatcherChildRegistryForTest -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' import { WatcherSupervisorCapacityWait } from './parcel-watcher-supervisor-capacity-wait' describe('WatcherSupervisorCapacityWait', () => { diff --git a/src/main/ipc/parcel-watcher-supervisor-capacity-wait.ts b/src/main/ipc/parcel-watcher-supervisor-capacity-wait.ts index 3f4ea6292ed..aa338b39306 100644 --- a/src/main/ipc/parcel-watcher-supervisor-capacity-wait.ts +++ b/src/main/ipc/parcel-watcher-supervisor-capacity-wait.ts @@ -1,7 +1,7 @@ import { onWatcherChildCapacityAvailable, WatcherChildCapacityError -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' import { watcherHostFailure, WatcherProcessFailure } from './parcel-watcher-process-failure' import { PromiseSettlementWaiters } from '../../shared/promise-settlement-waiters' diff --git a/src/main/ipc/parcel-watcher-supervisor-capacity.test.ts b/src/main/ipc/parcel-watcher-supervisor-capacity.test.ts index e1a26c03b2a..0606c4e175f 100644 --- a/src/main/ipc/parcel-watcher-supervisor-capacity.test.ts +++ b/src/main/ipc/parcel-watcher-supervisor-capacity.test.ts @@ -1,9 +1,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './parcel-watcher-child-termination' +import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './filesystem/watcher-process/parcel-watcher-child-termination' import { MAX_PHYSICAL_WATCHER_CHILDREN, resetWatcherChildRegistryForTest -} from './parcel-watcher-child-registry' +} from './filesystem/watcher-process/parcel-watcher-child-registry' import { acknowledgeWatcherSubscribe, currentWatcherChild, diff --git a/src/main/ipc/parcel-watcher-supervisor-disposal.test.ts b/src/main/ipc/parcel-watcher-supervisor-disposal.test.ts index d3aaa15770c..d8b32d0bc39 100644 --- a/src/main/ipc/parcel-watcher-supervisor-disposal.test.ts +++ b/src/main/ipc/parcel-watcher-supervisor-disposal.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { acknowledgeWatcherSubscribe, FakeWatcherChild } from './parcel-watcher-process-test-child' -import { resetWatcherChildRegistryForTest } from './parcel-watcher-child-registry' +import { resetWatcherChildRegistryForTest } from './filesystem/watcher-process/parcel-watcher-child-registry' const { forkMock } = vi.hoisted(() => ({ forkMock: vi.fn() })) vi.mock('node:child_process', () => ({ fork: forkMock })) diff --git a/src/main/ipc/parcel-watcher-supervisor-disposal.ts b/src/main/ipc/parcel-watcher-supervisor-disposal.ts index 07bc73ef3ee..26d113e0f86 100644 --- a/src/main/ipc/parcel-watcher-supervisor-disposal.ts +++ b/src/main/ipc/parcel-watcher-supervisor-disposal.ts @@ -1,6 +1,6 @@ import type { ChildProcess } from 'node:child_process' import { removeWatcherCanaryDirectory } from './parcel-watcher-canary-directory' -import type { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' +import type { WatcherCancellationTracker } from './filesystem/watcher-process/parcel-watcher-cancellation-tracker' import { type PendingWatcherUnsubscribe, resolvePendingWatcherUnsubscribes @@ -8,8 +8,8 @@ import { import { resetPendingSubscribeAttempt, takePendingSubscribe -} from './parcel-watcher-pending-subscribe' -import { signalWatcherChild } from './parcel-watcher-child-termination' +} from './filesystem/watcher-process/parcel-watcher-pending-subscribe' +import { signalWatcherChild } from './filesystem/watcher-process/parcel-watcher-child-termination' import { watcherHostFailure } from './parcel-watcher-process-failure' import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' diff --git a/src/main/ipc/parcel-watcher-supervisor-message.ts b/src/main/ipc/parcel-watcher-supervisor-message.ts index 25ff7c92535..75e3f3e7c21 100644 --- a/src/main/ipc/parcel-watcher-supervisor-message.ts +++ b/src/main/ipc/parcel-watcher-supervisor-message.ts @@ -1,5 +1,5 @@ import type { ChildProcess } from 'node:child_process' -import type { WatcherCancellationTracker } from './parcel-watcher-cancellation-tracker' +import type { WatcherCancellationTracker } from './filesystem/watcher-process/parcel-watcher-cancellation-tracker' import { handleWatcherHostMessage, type PendingWatcherUnsubscribe, @@ -9,7 +9,7 @@ import { import { startInterruptedSubscribeTimeout, startPendingSubscribeTimeout -} from './parcel-watcher-pending-subscribe' +} from './filesystem/watcher-process/parcel-watcher-pending-subscribe' import { WatcherProcessFailure } from './parcel-watcher-process-failure' import type { WatcherToHostMessage } from './parcel-watcher-process-protocol' import type { WatcherProcessSubscriptionRecord } from './parcel-watcher-process-subscription' diff --git a/src/main/ipc/parcel-watcher-supervisor-subscribe.ts b/src/main/ipc/parcel-watcher-supervisor-subscribe.ts index dcc42e4b3a7..63a7085f9c6 100644 --- a/src/main/ipc/parcel-watcher-supervisor-subscribe.ts +++ b/src/main/ipc/parcel-watcher-supervisor-subscribe.ts @@ -1,13 +1,13 @@ import type { ChildProcess } from 'node:child_process' import { existsSync } from 'node:fs' -import { sendToWatcherChild } from './parcel-watcher-child-messaging' +import { sendToWatcherChild } from './filesystem/watcher-process/parcel-watcher-child-messaging' import { createHostWatcherSubscription } from './parcel-watcher-host-subscriptions' import type { PendingWatcherUnsubscribe } from './parcel-watcher-host-subscriptions' import { subscribeWithInProcessWatcher } from './parcel-watcher-in-process-fallback' import { installPendingSubscribeControls, resetPendingSubscribeAttempt -} from './parcel-watcher-pending-subscribe' +} from './filesystem/watcher-process/parcel-watcher-pending-subscribe' import { WatcherProcessFailure } from './parcel-watcher-process-failure' import { rewriteWatcherEvents, resolveWatcherRootPaths } from './watcher-event-root-path-rewrite' import type { diff --git a/src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts b/src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts index f49bc5717a9..6475df4be41 100644 --- a/src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts +++ b/src/main/ipc/parcel-watcher-unsubscribe-timeout.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './parcel-watcher-child-termination' +import { WATCHER_PROCESS_EXIT_DEADLINE_MS } from './filesystem/watcher-process/parcel-watcher-child-termination' import { WATCHER_PROCESS_UNSUBSCRIBE_TIMEOUT_MS } from './parcel-watcher-host-subscriptions' import { acknowledgeWatcherSubscribe as ackSubscribe,