Skip to content

Split filesystem watcher responsibilities - #17274

Merged
nwparker merged 74 commits into
mainfrom
ra/max-lines-bottom-33-filesystem-watcher
Aug 30, 2026
Merged

nwparker merged 74 commits into
mainfrom
ra/max-lines-bottom-33-filesystem-watcher

Conversation

@nwparker

@nwparker nwparker commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2312 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1959 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​353

Summary

  • split the 1,975-line desktop filesystem watcher into a 35-line public facade plus focused lifecycle state, sender cleanup, path, local event/install/capacity/subscription/removal, remote desired/install/resync/retry/dormant/provider-rearm/removal, IPC registration, and shutdown modules
  • preserve the single local/remote lifecycle state owner, IPC channels and payloads, native and WSL path handling, watcher-process interruption behavior, removal drain deadlines, sender cleanup, capacity retries, SSH-provider execution boundary, desired-watch recovery, retry/resync/backoff ordering, provider re-registration, and shutdown fencing
  • reduce the max-lines baseline from 54 entries to 53; every new TypeScript module is at most 272 lines

Stacked on #17271.

Validation

  • pnpm tc
  • direct filesystem-watcher suite: 16 files, 118 passed, one skipped
  • broader watcher, removal binding/gate, and core-handler set: 19 files, 133 passed, one skipped
  • focused Oxlint
  • pnpm run check:code-quality:changed — zero findings
  • pnpm run check:max-lines-ratchet — 53 grandfathered suppressions
  • pnpm run check:runtime-electron-ratchet
  • pnpm run check:reliability-gates
  • changed-file formatting and git diff --check
  • exact nine-symbol public facade, 34 module-state owners, seven state types, 168 runtime literals, 146 non-suppression comments, and eight critical watcher/provider/removal call counts
  • 19-module acyclic split graph, real-commit move audit, and fresh semantic pass across local cancellation/capacity, physical unsubscribe failure retention, removal drains, remote desired/retry/dormant recovery, provider replacement, lifecycle generations, and shutdown

Visual proof is N/A because this is an internal main-process watcher decomposition with no intended rendered UI change. The focused suite includes the real @parcel/watcher integration case.

…lines-bottom-20-cdp-bridge

# Conflicts:
#	src/main/browser/cdp-bridge.ts
…ax-lines-bottom-25-remote-terminal-multiplexer
…ottom-32-settings

# Conflicts:
#	src/renderer/src/components/settings/Settings.tsx
…3-filesystem-watcher

# Conflicts:
#	src/renderer/src/hooks/automation-dispatch-completion.ts
@nwparker
nwparker changed the base branch from ra/max-lines-bottom-32-settings to main August 30, 2026 03:23
@nwparker
nwparker merged commit d140e56 into main Aug 30, 2026
4 of 20 checks passed
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a9146351-6a43-4b65-b0c1-e91f8b5d336c

📥 Commits

Reviewing files that changed from the base of the PR and between 0e6d42b and ee9c67e.

📒 Files selected for processing (20)
  • config/max-lines-baseline.txt
  • src/main/ipc/filesystem-watcher-handlers.ts
  • src/main/ipc/filesystem-watcher-lifecycle-state.ts
  • src/main/ipc/filesystem-watcher-listener-lifecycle.ts
  • src/main/ipc/filesystem-watcher-local-capacity.ts
  • src/main/ipc/filesystem-watcher-local-events.ts
  • src/main/ipc/filesystem-watcher-local-install.ts
  • src/main/ipc/filesystem-watcher-local-removal.ts
  • src/main/ipc/filesystem-watcher-local-subscription.ts
  • src/main/ipc/filesystem-watcher-paths.ts
  • src/main/ipc/filesystem-watcher-remote-controller.ts
  • src/main/ipc/filesystem-watcher-remote-desired.ts
  • src/main/ipc/filesystem-watcher-remote-dormant.ts
  • src/main/ipc/filesystem-watcher-remote-install.ts
  • src/main/ipc/filesystem-watcher-remote-provider-rearm.ts
  • src/main/ipc/filesystem-watcher-remote-removal.ts
  • src/main/ipc/filesystem-watcher-remote-resync.ts
  • src/main/ipc/filesystem-watcher-remote-retry.ts
  • src/main/ipc/filesystem-watcher-shutdown.ts
  • src/main/ipc/filesystem-watcher.ts

📝 Walkthrough

Walkthrough

The filesystem watcher implementation was split into dedicated modules for shared lifecycle state, path normalization, listener cleanup, local watching, remote watching, IPC registration, and shutdown. Local watching now handles event batching, capacity retries, installation, subscription, teardown, removal, and restoration. Remote watching now tracks desired listeners, provider reinstallation, retries, dormant rearming, resynchronization, and removal. The original module now serves as a barrel module.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Split speech session lifecycle

* Split terminal output scheduler pipeline

* Split mobile browser pane modules

* Prune resolved max-lines suppressions

* Split pane tree equalization logic

* Extract mobile troubleshoot screen styles

* Split external automation manager

* Split main window service attachments

* Split hosted review creation checks

* Split automation dispatch event handling

* Split settings navigation metadata

* Split daemon initialization lifecycle

* Split GitLab item dialog

* Split relay dispatcher layers

* Split mobile host screen

* Retarget mobile view settings source test

* Split runtime file client layers

* Split ports panel layers

* Split runtime environments pane layers

* Split local PTY provider responsibilities

* Split CDP bridge responsibilities

* Split relay Git handler responsibilities

* Track moved relay Git fetch audit

* Split Linear item drawer responsibilities

* Split telemetry event schema responsibilities

* Split resource usage status responsibilities

* Split remote terminal multiplexer responsibilities

* Split Git worktree responsibilities

* Split Codex hook service responsibilities

* Keep mirrored hook trust type private

* Split web runtime session responsibilities

* Split GitHub project view read path

* Split Claude runtime auth responsibilities

* Split runtime RPC server responsibilities

* Split Settings page responsibilities

* Split filesystem watcher responsibilities

* Fix F3-speech for stablyai#17123

* Fix F1-cycle for stablyai#17131

* Fix F4-navtest for stablyai#17157

* Fix F2-allowlist for stablyai#17161
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