Skip to content

Harden startup enumeration and native recovery#129

Merged
wiresock merged 3 commits into
mainfrom
codex/production-readiness-round-129
Jul 17, 2026
Merged

Harden startup enumeration and native recovery#129
wiresock merged 3 commits into
mainfrom
codex/production-readiness-round-129

Conversation

@wiresock

Copy link
Copy Markdown
Owner

Summary

  • restore the previous UI/runtime state after settings compensation verifies native rollback
  • clear recovery state after successful preserved network-lock retries without deleting newer marker records
  • bound application payload, SDK companion, secured data-tree, and legacy catalog enumeration
  • make legacy migration cleanup case-correct, content-verified, and resistant to source replacement races
  • document the new operational limits and recovery behavior

Production-readiness findings addressed

  • Medium: successful settings compensation could leave tunnel operations latched in recovery until restart
  • Medium: preserved network-lock retry success could leave the UI indeterminate
  • Medium: legacy and secured-data startup scans could consume unbounded time or memory
  • Low: application and SDK payload validation could materialize or traverse unbounded directories
  • Medium: migration cleanup reconstructed lowercase source paths and could delete a path reopened after comparison

Verification

  • full WireSockUI.Tests harness passed (exit 0); the existing file-symlink case skipped because this host cannot create that link
  • Release x64 solution build: 0 warnings, 0 errors
  • Release UWP x64 solution build: 0 warnings, 0 errors
  • dotnet format ... --verify-no-changes: passed
  • pinned SDK contract: 24 exports compatible
  • current local WireSock SDK contract: 24 exports compatible
  • live NuGet transitive vulnerability audit: no vulnerable packages
  • refreshed origin/main: branch was 1 ahead / 0 behind before push

Migration notes

Startup now fails closed above 4,096 application or secured-tree entries, 1,024 SDK-directory entries, or 1,024 entries in either legacy profile catalog. Diagnostics identify the affected location/limit so unexpected files can be removed before retrying.

Remaining risk

Real driver/DLL lifecycle behavior still depends on the trusted elevated SDK integration runners; this PR does not replace those smoke checks.

Copilot AI review requested due to automatic review settings July 17, 2026 06:47

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces safety bounds on directory and file enumerations across the application (including application payloads, secured data trees, SDK companions, and legacy profile catalogs) to prevent unbounded resource consumption at startup. It also refactors legacy profile migration and improves runtime state restoration during settings compensation. The reviewer feedback recommends exposing several private helper methods as internal to avoid brittle reflection in tests, calling .ToArray() on the legacy profile enumeration to prevent concurrent modification issues during file deletion, and using DirectoryInfo.EnumerateFileSystemInfos to avoid redundant system calls when retrieving file attributes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread WireSockUI.Tests/Program.cs Outdated
Comment thread WireSockUI.Tests/Program.cs Outdated
Comment thread WireSockUI/Config/LegacyProfileMigrationService.cs Outdated
Comment thread WireSockUI/Global.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens WireSockUI’s elevated startup and recovery paths by bounding filesystem enumeration work (to prevent unbounded time/memory on malformed installs/config trees) and by ensuring verified native recovery clears recovery latches/markers and restores the prior UI/runtime state without requiring a restart.

Changes:

  • Add entry-count limits to application payload traversal, WireSock SDK companion directory scanning, secured data-tree hardening, and legacy profile catalog enumeration.
  • Clear verified native recovery state after successful settings compensation and preserved network-lock retries, restoring the prior connection/UI state.
  • Strengthen legacy migration completion by content-verifying staged vs source profiles before deletion; add tests and document new operational limits/behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
WireSockUI/Program.cs Adds bounded enumeration for application payload and SDK companion directory validation.
WireSockUI/Global.cs Bounds secured data-tree traversal during ACL hardening via a shared entry counter across recursion.
WireSockUI/Forms/frmMain.cs Centralizes “verified native recovery” completion to clear latches/markers and restore UI state.
WireSockUI/Config/LegacyProfileMigrationService.cs Bounds legacy catalog enumeration; makes migration cleanup case-correct and content-verified before deleting sources.
WireSockUI.Tests/Program.cs Adds targeted regression tests for the new enumeration bounds and migration behaviors.
README.md Documents the new startup enumeration limits and recovery behavior changes.

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

Comment thread WireSockUI/Program.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread WireSockUI/Program.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

@wiresock
wiresock merged commit 84b5bf0 into main Jul 17, 2026
11 checks passed
@wiresock
wiresock deleted the codex/production-readiness-round-129 branch July 17, 2026 07:59
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.

2 participants