Skip to content

docs(file-ipc): audit legacy file IPC surface and FileStorage consumption#16735

Draft
EurFelux wants to merge 2 commits into
mainfrom
eurfelux/refactor/file-ipc
Draft

docs(file-ipc): audit legacy file IPC surface and FileStorage consumption#16735
EurFelux wants to merge 2 commits into
mainfrom
eurfelux/refactor/file-ipc

Conversation

@EurFelux

@EurFelux EurFelux commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Before this PR:

  • The legacy file IPC surface (File_* / Fs_* / Open_Path) was undocumented — no single inventory of which channels exist, where they are registered, or who consumes them, and no assessment of which v1 consumption patterns should be re-routed vs abolished under the new IpcApi.

After this PR:

  • Adds two audits under v2-refactor-temp/docs/file-manager/ (documentation only — no runtime behavior change):
    • legacy-file-ipc-audit.md — current-state inventory of every legacy file IPC channel (FileManager.ts Group A + ipc.ts Group B), its registration point, backing implementation, and every renderer consumer (file:line). Distinguishes already-migrated IpcApi routes and flags renderer-dead channels.
    • filestorage-consumption-audit.md — for the 25 v1 FileStorage-backed channels, a per-consumer verdict (reroute / abolish / defer) against the target IpcApi (RFC §7.2), with rewrite sketches and a P1–P5 anti-pattern taxonomy.
  • Carries a small FileStorage.ts deprecation notice (9 lines) marking the service for v2 migration.
  • Records a BLOCKING prerequisite (filestorage-consumption-audit.md §7): the absolute-path type is not unified — FilePath is a type-only template literal, AbsolutePathSchema infers unbranded string, and the two are bridged by as casts (per the handle.ts:59-60 TODOs). This type refactor must land before the audited consumer migration proceeds — hence this PR is a draft.

Fixes # N/A

Why we need it and why it was done in this way

Groundwork for migrating the legacy file IPC surface onto IpcApi. The migration is not a pure transport swap: several v1 consumption patterns (synthesizing throwaway FileMetadata from a raw path, renderer-side temp-file orchestration, type-probe helpers) should be abolished, not re-implemented. Auditing and classifying consumers first prevents carrying v1 anti-patterns into v2.

The following tradeoffs were made:

  • Documentation-first + draft: the audit surfaced a blocking type-design issue (absolute-path type not unified). Rather than migrate on top of that debt, the migration is paused and the prerequisite recorded.

The following alternatives were considered:

  • A transport-only migration — rejected: it would propagate the existing as-cast path-typing debt from ~3 sites to dozens of consumers.

Links to places where the discussion took place: N/A

Breaking changes

None. Documentation-only, plus an inert deprecation notice on FileStorage.ts.

Special notes for your reviewer

  • Draft: blocked on a separate absolute-path type refactor (see filestorage-consumption-audit.md §7), handled separately.
  • Quickest scan: legacy-file-ipc-audit.md §1/§4 (inventory) and filestorage-consumption-audit.md §1 (verdict table) + §7 (blocker).

Checklist

  • Branch: This PR targets the correct branch — main for active development, v1 for v1 maintenance fixes
  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Documentation: A user-guide update was considered and is present (link) or not required. Check this only when the PR introduces or changes a user-facing feature or behavior.
  • Self-review: I have reviewed my own code (e.g., via /gh-pr-review, gh pr diff, or GitHub UI) before requesting review from others

Release note

NONE

EurFelux and others added 2 commits July 4, 2026 12:29
…tion

Add two audits under v2-refactor-temp/docs/file-manager/:

- legacy-file-ipc-audit.md: current-state inventory of all legacy File_*/Fs_*/Open_Path channels (FileManager.ts Group A + ipc.ts Group B) with registration points and every renderer consumer (file:line).

- filestorage-consumption-audit.md: per-consumer verdict (reroute / abolish / defer) for the 25 v1 FileStorage-backed channels against the target IpcApi (RFC §7.2), with rewrite sketches. Records a BLOCKING prerequisite (§7): unify the branded absolute-path type (FilePath / AbsolutePathSchema) before migrating consumers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: eurfelux <eurfelux@gmail.com>
@EurFelux EurFelux force-pushed the eurfelux/refactor/file-ipc branch from 58db625 to ae1326b Compare July 4, 2026 04:29
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