Skip to content

docs: plan phase 3, charter step 54, append phase 7 - #417

Merged
David-Noble-at-work merged 1 commit into
developfrom
plan-phase-3
Aug 15, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
plan-phase-3

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Summary

Plans phase 3 of windows-native-permissions.md
(#405). Planning it corrected two claims the
outline made and surfaced a blocker that must land first.

Correction 1 — "pkg/signing first" is not executable

DefaultSigner() derives its key path from configHome() and has one production caller
(internal/cli/store.go:197). Under the invariant, signing must receive a root — so internal/cli
must own a config root before signing can be handed one. The CLI plumbing comes first.

Correction 2 — the Windows failures do not clear in phase 3, and cannot

Ruling 5 already said why: Mode().Perm() reports 0666 on Windows whatever the DACL says, and
every one of those tests asserts mode bits. Enforcement makes the file genuinely private without
moving a single assertion.

Enumerated from the leg — 7 tests, 8 assertions. Six clear in phase 5, when IsRestricted
and Observe's restricted fact give them something true to assert on both platforms. The seventh,
TestWrite_WithPermOverridesPermission, asserts 0644 — which grants other, so ruling 4 leaves
it inheriting the parent DACL by design. It has no enforcement state to observe and becomes a
Unix-scoped assertion: the one case where scoping is correct rather than evasive.

The windows leg therefore stays at 28 through phases 3 and 4. An unmoved 28 after phase 3 is not
a failed migration, and the plan now says so where someone will read it.

Blocker — step 54

internal/cli/xdg.go resolves every anchor from os.Getenv("HOME"), which Windows does not define.
With XDG_* unset, StateHome() yields the relative .local\state, so state lands under the
process's working directory. Phase 3.1 would anchor writable roots there — authority over an
arbitrary directory while presenting as scoped, strictly worse than the os.WriteFile it replaces.

pkg/signing/configHome() already resolves correctly via os.UserHomeDir(), and its doc claims a
parity with internal/cli that does not hold
— so on Windows the signing key and the CLI's config
resolve to two different places. CI cannot see any of it: the scenario tests set HOME and
USERPROFILE, and 65 t.Setenv("XDG_*") sites skip the fallback branch.

The charter deliberately leaves the fix open — the failure mode when home cannot resolve, and
whether Windows should use XDG paths at all, are questions it states rather than settles.

Phase 7, appended and ruled final

Move internal/cli → cmd/internal/cli. Its importers enumerate to 38 files across four commands,
plus exactly two non-command importers, neither a library use: internal/model calls
cli.Note/cli.Error for interactive narration, and internal/config takes one path anchor and one
warning. The move turns that layering violation into a compile error, since cmd/internal is
importable only from within cmd/….

Documentation only.

Assisted-by: Claude

Planning phase 3 of the native-Windows-permissions campaign (#405)
corrected two claims the earlier outline made, and turned up a blocker
that has to land before any of it starts.

CORRECTION 1 -- "pkg/signing first" is not executable. DefaultSigner
derives its key path from configHome() and has exactly one production
caller, internal/cli/store.go:197. Under the invariant signing must
RECEIVE a root, so internal/cli must own a config root before signing
can be handed one. The CLI plumbing comes first; signing is the first
consumer of it, not the first change.

CORRECTION 2 -- the windows failures do NOT clear in phase 3, and
cannot. Ruling 5 already says why: Mode().Perm() reports 0666 on Windows
whatever the DACL says, and every one of those tests asserts mode bits.
Enforcement makes the file genuinely private without moving a single
assertion. Enumerated from the leg: 7 tests, 8 assertions, six of which
clear in phase 5 when IsRestricted and Observe's restricted fact give
them something true to assert. The seventh,
TestWrite_WithPermOverridesPermission, asserts 0644 -- which grants
other, so ruling 4 leaves it inheriting the parent DACL by design. It
has no enforcement state to observe and becomes a Unix-scoped
assertion: the one case where scoping is right rather than evasive.
So the windows leg stays at 28 through phases 3 and 4. An unmoved 28
after phase 3 is not a failed migration.

BLOCKER, chartered as step 54: internal/cli/xdg.go resolves every anchor
from os.Getenv("HOME"), which Windows does not define, so with XDG_*
unset StateHome() yields the RELATIVE .local\state and state lands under
the process's working directory. Phase 3.1 would anchor writable roots
there -- authority over an arbitrary directory while presenting as
scoped, strictly worse than the os.WriteFile it replaces.
pkg/signing/configHome() already resolves correctly via
os.UserHomeDir(), and its doc claims a parity with internal/cli that
does not hold, so the same logical location resolves to two different
places on Windows. CI cannot see it: the scenario tests set HOME and
USERPROFILE, and 65 t.Setenv("XDG_*") sites skip the fallback branch.
The charter leaves the fix open -- the failure mode when home cannot
resolve, and whether Windows should use XDG paths at all, are questions
it states rather than settles.

Phase 7 appended, and ruled final: move internal/cli into
cmd/internal/cli. Enumeration of its importers found 38 files across
four commands plus exactly two non-command importers, neither a library
use -- internal/model calls cli.Note/cli.Error for interactive narration
and internal/config takes one path anchor and one warning. The move
makes that layering violation a compile error, since cmd/internal is
importable only from cmd/... . Accepted residual of going last: phases
3-5 plumb internal/cli's roots at the old path and the move rewrites
those imports afterward.

Assisted-by: Claude
Signed-off-by: David Noble <[email protected]>
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 15, 2026
@David-Noble-at-work
David-Noble-at-work merged commit ae85c1c into develop Aug 15, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the plan-phase-3 branch August 15, 2026 01:16
David-Noble-at-work pushed a commit that referenced this pull request Aug 15, 2026
The conflicts are a squash-merge artifact, not disagreeing work. This
branch was cut from plan-phase-3, whose content reached develop as the
DIFFERENT squashed commit ae85c1c (#417), so git sees two independent
edits to the same lines and cannot tell they are the same text.

Resolved by taking this branch's version of all three files, verified
before resolving rather than assumed: every line present only on develop
is text this branch deliberately rewrote -- the pre-ruling charter
wording, the superseded open-questions list, and the old step-54 ledger
row. Nothing unique to develop exists in these files, so ours is
develop's content plus the ruling.

The merge is guarded: it aborts if any path outside those three
conflicts, since that would mean the verification no longer covers the
resolution.

Signed-off-by: David Noble <[email protected]>
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.

1 participant