# JUJU 0.8.1 — Windows Administrators-owned state ACL fix

Date: 2026-09-10. Reported environment: Windows Server, Node v24.21.0,
built-in Administrator. Native retest on that server: **OWNER_PENDING**.

## Fix

The old Windows private-state check rejected Administrators-owned directories
before its protect branch could set the current user's ownership. Windows can
assign that group as the default owner for an administrator-created object.

In `src/platform/privateFs.ts`, protect now accepts exactly the current user's
SID, or S-1-5-32-544 when `WindowsPrincipal.IsInRole` confirms Administrators in
the effective token. It sets the user SID as owner, establishes the private DACL,
then reads the real owner and DACL back. Other owners still fail closed; SYSTEM
is an allowed DACL trustee, not an additional accepted initial owner.

Verify applies the same restricted owner repair to files and directories,
including newly created IPC credential descriptors. It checks the existing
DACL before mutation; an Everyone ACE or another foreign Allow trustee is an
error, not an invitation to rewrite the ACL. An admitted owner repair must
preserve the access SDDL exactly, and both modes recheck owner, private DACL
and reparse-point rejection after the operation. Failed ACL operations remain
hard errors. Paths remain data in the child's environment, never interpolated
PowerShell source. No UAC elevation or silent permission downgrade is added.

## Actual local evidence

`release-evidence/0.8.1/verification.json` records the full gate on
**darwin arm64 / Node v22.23.2**, completed 2026-09-10T14:48:18.063Z:

- Build, typecheck, lint, test:all, test:windows and separate packaging: exit 0.
- Core: 452 passed, 30 skipped, zero failed. Packaging: 13 passed, zero failed.
- Combined unique gate coverage: **465 passed, 30 skipped, zero failed**.
- Focused test:windows rerun: 50 passed, 30 skipped; not added again to totals.
- 188 guarded source/test/script/config inputs retained identical hashes and
  mtimes during the gate. Documentation and generated outputs are outside that
  source fingerprint; the packed artifact has a separate checksum receipt.

The nine new native ACL tests are skipped on POSIX. They require native Windows
and an enabled Administrators token, covering protect, verify for directories
and files, real IPC, three foreign-owner cases, permissive DACL and junction
refusal. Six additional source-structure tests are not Windows emulation or
proof of real Windows behavior. No native Windows pass is claimed by this run.

## Package and publication evidence

The npm-installable artifact and release receipts are stored under
`release-evidence/0.8.1/`. `artifact.json` identifies the exact tarball bytes;
publish logs and the registry-install receipt record the actual publication
outcome. Publication was explicitly authorized by the owner after the local
gate; this document alone is not proof of registry availability.

After publication, retest on the original Windows Server account:

```powershell
npm install -g juju-mcp@0.8.1
juju --version
juju doctor
```

Expected: version 0.8.1 and no FAIL config-dir. Continue the owner's usual
init/trust/stdio/start setup in a project directory. Other doctor findings,
such as an unconfigured public URL, are separate from this ACL regression.
Do not delete OAuth state or grant Everyone permissions to work around errors.
The broader Windows-native support status and prior limitations are unchanged.

No Git commit, push, reset or clean, global installation replacement, or
restart of the connected server is part of this task. Registry fresh-install
verification uses an isolated temporary prefix and disposable state.

## Primary platform reference

Microsoft WindowsPrincipal.IsInRole (effective token and UAC behavior):
https://learn.microsoft.com/en-us/dotnet/api/system.security.principal.windowsprincipal.isinrole

Microsoft icacls (native test fixture owner changes):
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/icacls
