Skip to content

fix(DEN-1616,DEN-1634): harden Windows zed develop -c - #100

Merged
ORESoftware merged 31 commits into
mainfrom
agent/den-1616-powershell-no-profile
Aug 4, 2026
Merged

fix(DEN-1616,DEN-1634): harden Windows zed develop -c#100
ORESoftware merged 31 commits into
mainfrom
agent/den-1616-powershell-no-profile

Conversation

@ORESoftware

@ORESoftwareORESoftware commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Linear

  • DEN-1616 — suppress implicit PowerShell profiles
  • DEN-1634 — normalize Windows child-process current directories
  • Parent external certification: DEN-1614

Problem

Two Windows process-boundary defects were exposed by native clean-room testing:

  1. PowerShell command mode used -NoLogo -Command and could therefore execute user profile code implicitly.
  2. Project discovery correctly retained canonical Windows paths such as \\?\C:\..., but those identity paths are not accepted consistently as a child-process current directory. A child shell could inherit the nested caller directory while ZED_DEV_PROJECT_ROOT identified the owning project.

Semantic correction

  • PowerShell command mode now uses -NoLogo -NoProfile -NonInteractive -Command <script> for pwsh, pwsh.exe, powershell, and powershell.exe.
  • Explicit interactive PowerShell startup remains untouched.
  • cmd.exe remains /D /S /C <script> so AutoRun stays disabled.
  • ZED_DEV_PROJECT_ROOT, cache paths, and evidence retain canonical filesystem identity.
  • Only the Windows child-process cwd is converted from:
    • \\?\C:\path to C:\path;
    • \\?\UNC\server\share\path to \\server\share\path.
  • The conversion works on UTF-16 code units, preserving Unicode paths without lossy string conversion.
  • Ordinary drive, UNC, and device paths remain unchanged.

This preserves both sides of the design: canonical path identity for Zed state and a process-compatible equivalent path for native child launch.

Tests and documentation

  • typed PowerShell, cmd.exe, generic-shell, and interactive argument-vector tests;
  • both shared cross-platform shell matrices synchronized to one PowerShell contract;
  • Unicode disk, verbatim UNC, ordinary drive/UNC, and device-path normalization tests;
  • native Windows profile canary using real PowerShell profile locations;
  • native child-cwd assertion proving the shell starts at the project owning the fixture manifest;
  • read-only Windows Server 2022 workflow with formatting, focused unit/integration tests, real binary execution, source-cleanliness proof, and Clippy with warnings denied;
  • durable trust-boundary documentation in docs/powershell-command-mode.md.

Validation evidence

The complete repository matrix passed on reviewed head 815edd140e5cceb21983c60ff7e03bb99466567b except for one Windows Clippy needless_return diagnostic:

  • CI 30887528618 — passed;
  • develop-shell 30887528562 — passed;
  • Nix 30887528774 — passed;
  • mise 30887528625 — passed;
  • polyglot 30887528626 — passed;
  • OCI 30887528656 — passed;
  • repository hardening 30887528682 — passed;
  • formal review 30887528596 — passed;
  • agents policy 30887528970 — passed.

The only source delta after that matrix is the equivalent tail-expression form in the Windows cwd helper. The exact correction was validated against:

  • all three Windows cwd normalization tests;
  • PowerShell command arguments;
  • both shared shell matrices;
  • rustfmt; and
  • Clippy with -D warnings.

The validation job completed every check successfully; its final push was rejected only because a concurrent evidence commit had already advanced the branch. The checked-in source at final head 3523e577493ce3403ca75f19653f55f6de6ab81c contains that validated tail expression. Normal protected workflows were then triggered from a connector-authored evidence commit.

No credential, registry, cloud service, or production account is used.

@linear-code

linear-codeBot commented Aug 4, 2026

Copy link
Copy Markdown

@ORESoftwareORESoftware changed the title fix(DEN-1616): suppress PowerShell profiles in zed develop -cfix(DEN-1616,DEN-1634): harden Windows zed develop -cAug 4, 2026
@ORESoftware
ORESoftware marked this pull request as ready for review August 4, 2026 10:48
@ORESoftware
ORESoftware merged commit fd3b3e4 into mainAug 4, 2026
23 checks passed
Sign up for freeto 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

@ORESoftware