The signalA new sibling succeeds, the watched existing target fails, and the same replacement works after the Host stops.

Separate watcher conflict from ACL denial.

Watcher-shapedExisting watched file only

ReplaceFileW EACCES disappears after clean Host shutdown.

Permission-shapedPersists without HMR

New files or stopped-process replacement also fail; attributes or ACLs disagree.

Use one reversible change loop.

  1. StopCtrl+C and wait for the owning Host to release HMR.
  2. InspectRecord the command line, attrib, and icacls.
  3. Back upCopy the exact patch and compare both hashes.
  4. EditChange the owned patch only while the Host is stopped.
  5. ValidateRun dsh --profile web --dump-config.
  6. RestartRun one smoke test before the next change.

Know the publication path.

Private stagesibling directory
Copy DACLexisting target
Write + syncclosed temp
ReplaceFileWEACCES while watched

Do not trade one failure for partial YAML.

No live Set-Content

A non-atomic overwrite can expose a partial file to HMR.

No blanket process kill

Inspect the command line; other Node applications are unrelated.

No ACL weakening first

Prove whether shutdown changes the result before changing permissions.

Rollback uses the same lifecycle.

Copy-Item -LiteralPath $Backup -Destination $Patch -Force
dsh --profile web --dump-config
dsh web

Stop the Host before restoring. Keep the failed patch and the first boot error as separate evidence.

Primary evidence.

Keep the complete Windows runbook.

The canonical guide includes PowerShell evidence capture, backup hashes, offline validation, rollback, and a minimal incident bundle.

Read and star on GitHub