Skip to content

refactor(Bowl): remove IPC dependency, simplify API, drop macOS#491

Merged
JusterZhu merged 1 commit into
masterfrom
refactor/bowl-remove-ipc-simplify-api
Jun 2, 2026
Merged

refactor(Bowl): remove IPC dependency, simplify API, drop macOS#491
JusterZhu merged 1 commit into
masterfrom
refactor/bowl-remove-ipc-simplify-api

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

Refactors the GeneralUpdate.Bowl component to remove internal IPC dependency, simplify the public API, and drop non-functional platform support.

Motivation

Bowl previously communicated with Core via AES-encrypted temp files (Environments / IpcEncryption) to:

  1. Read ProcessInfo to get its config — now replaced by developers passing BowlContext directly
  2. Write UpgradeFail to mark failed versions — now replaced by the OnCrash callback (developers handle failure marking themselves)

The IPC mechanism had a critical bug: DecryptFromFile auto-deleted the file after read, making the UpgradeFail mark ephemeral (one-read-only). The encrypted file classes were also duplicated verbatim in Core, creating a maintenance burden.

macOS strategy (MacBowlStrategy) was removed because lldb requires SIP-disabled / task_for_pid permissions unavailable in production environments, as the strategy itself documented.

Changes

Breaking

  • Bowl constructor simplified: 4 params → 1 paramless (internal DI constructor now 3 params)
  • Bowl.CreateParameter() and Bowl.MapToContext() removed (IPC-based entry points)
  • SetVariable("UpgradeFail") step removed from crash remediation pipeline
  • Crash report JSON: flat fields instead of nested MonitorParameter

Removed (18 files)

  • Ipc/Environments.cs, IpcEncryption.cs (duplicate of Core)
  • Configuration/ProcessContract.cs
  • Internal/EnvironmentProvider.cs (IEnvironmentProvider)
  • Internal/LinuxSystem.cs
  • Strategies/MacBowlStrategy.cs
  • Strategys/MonitorParameter, AbstractStrategy, IStrategy, WindowStrategy, LinuxStrategy (legacy [Obsolete] API)

Linux improvements

  • Check which procdump before attempting sudo install.sh
  • Auto-detect PID (-p) vs process name (-w) for procdump flag
  • Write bowl_linux_unsupported.txt in fail directory explaining why the distro is unsupported

API surface cleanup

  • TextTraceListener, WindowsOutputDebugListener: publicinternal
  • StorageHelper: publicinternal

Testing

  • Build: 0 errors
  • src/BowlTest: 116 tests pass
  • tests/BowlTest: 19 tests pass
  • Total: 135 tests pass, 0 failures

🤖 Generated with Claude Code

Breaking changes:
- Remove Bowl 4-param internal constructor; only 1 public paramless constructor
- Remove Bowl.CreateParameter() and Bowl.MapToContext() (IPC-based entry points)
- Remove SetVariable('UpgradeFail') step from crash pipeline (was auto-deleted on read)
- BowlContext no longer depends on MonitorParameter
- Crash report JSON uses flat fields instead of nested MonitorParameter

Removed modules:
- Ipc/ (Environments, IpcEncryption) — duplicate of Core's IPC
- Configuration/ProcessContract — Bowl-specific, unused without IPC
- Internal/EnvironmentProvider (IEnvironmentProvider) — no longer needed
- Internal/LinuxSystem — only used by deleted LinuxStrategy
- Strategies/MacBowlStrategy — lldb unusable in production (SIP/task_for_pid)
- Strategys/ (MonitorParameter, AbstractStrategy, IStrategy, WindowStrategy,
  LinuxStrategy) — legacy synchronous API, all [Obsolete]

Linux improvements:
- Check PATH for procdump before attempting sudo install
- Auto-detect PID (-p) vs process name (-w) for procdump flag
- Write bowl_linux_unsupported.txt in fail directory for unsupported distros

API surface cleanup:
- TextTraceListener, WindowsOutputDebugListener: public -> internal
- StorageHelper: public -> internal

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 2, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors GeneralUpdate.Bowl to remove the AES-encrypted IPC dependency between Bowl and Core, simplifies the public API by replacing MonitorParameter/IPC-based entry points with a BowlContext value type, drops the macOS strategy (since lldb/task_for_pid is unusable in production), and tightens the public surface to internal for several helper types. The Crash JSON now uses flat fields, and the Linux strategy gains a which procdump pre-check, PID/name auto-detection (-p vs -w), and an bowl_linux_unsupported.txt diagnostic hint.

Changes:

  • Remove IPC layer (Ipc/Environments.cs, Ipc/IpcEncryption.cs), IEnvironmentProvider/EnvironmentProvider, ProcessContract, LinuxSystem, the legacy Strategys/* (MonitorParameter, AbstractStrategy, IStrategy, WindowStrategy, LinuxStrategy), and MacBowlStrategy; remove Bowl.MapToContext / Bowl.CreateParameter and the UpgradeFail env-var step.
  • Flatten Crash (was { Parameter, ProcdumpOutPutLines }) to direct fields and update the JSON serialization context and CrashReporter.
  • Improve LinuxBowlStrategy: probe-once _probed flag, IsProcdumpInPath short-circuit, distro-detect path, -p/-w flag selection, and WriteUnsupportedHint. Remove obsolete xmldoc remarks.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/c#/GeneralUpdate.Bowl/Bowl.cs Drop IPC env DI, remove MapToContext/CreateParameter, drop UpgradeFail step, simplify OnCrash path.
src/c#/GeneralUpdate.Bowl/BowlContext.cs Remove obsolete reference to Strategys.MonitorParameter from xmldoc.
src/c#/GeneralUpdate.Bowl/Internal/Crash.cs Flatten fields and document each property.
src/c#/GeneralUpdate.Bowl/Internal/CrashReporter.cs Populate flat Crash fields.
src/c#/GeneralUpdate.Bowl/Internal/EnvironmentProvider.cs Removed (no longer needed).
src/c#/GeneralUpdate.Bowl/Internal/LinuxSystem.cs Removed.
src/c#/GeneralUpdate.Bowl/Internal/SystemInfoProviderFactory.cs Comment updated to drop macOS mention.
src/c#/GeneralUpdate.Bowl/Configuration/ProcessContract.cs Removed.
src/c#/GeneralUpdate.Bowl/Ipc/Environments.cs, IpcEncryption.cs Removed.
src/c#/GeneralUpdate.Bowl/Strategys/* Removed legacy obsolete strategies, interface, abstract base, and MonitorParameter.
src/c#/GeneralUpdate.Bowl/Strategies/StrategyFactory.cs Drop macOS branch.
src/c#/GeneralUpdate.Bowl/Strategies/MacBowlStrategy.cs Removed.
src/c#/GeneralUpdate.Bowl/Strategies/LinuxBowlStrategy.cs Probe procdump in PATH, -p/-w flag selection, write bowl_linux_unsupported.txt.
src/c#/GeneralUpdate.Bowl/Tracer/{TextTraceListener,WindowsOutputDebugListener}.cs Made internal; add namespace to TextTraceListener.
src/c#/GeneralUpdate.Bowl/FileSystem/StorageHelper.cs Made internal.
src/c#/BowlTest/* and tests/BowlTest/* Remove tests for removed types; add BowlContext and Linux-flag/PID tests; rename to English; update Crash flat-field tests; drop MockEnvironmentProvider.
src/c#/BowlTest/Strategies/WindowsBowlStrategyTests.cs Use StartsWith("-e ") instead of Contains(" -e ").

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JusterZhu JusterZhu merged commit 8c2f906 into master Jun 2, 2026
4 checks passed
@JusterZhu JusterZhu deleted the refactor/bowl-remove-ipc-simplify-api branch June 2, 2026 11:28
@JusterZhu JusterZhu linked an issue Jun 2, 2026 that may be closed by this pull request
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.

Bowl: IPC 架构缺陷、功能闭环断裂及平台可用性审查

2 participants