Match Windows worktree notice accounting to macOS semantics - #503
Merged
Merged
Conversation
coneilen
force-pushed
the
coneilen-microsoft-worktree-count-semantics
branch
from
September 28, 2026 21:48
981041e to
c194063
Compare
Exclude the opened checkout from notice counts and sizes, count prunable worktrees without sizing them, and measure allocated file usage with per-worktree KiB rounding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Document that macOS counts prunable assessments while excluding their bytes, and distinguish Windows AllocationSize as an approximation to du -sk accounting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
coneilen
force-pushed
the
coneilen-microsoft-worktree-count-semantics
branch
from
September 28, 2026 23:11
c194063 to
c2ff32c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows computed the worktree notice from different semantics than macOS. The
previous parity-ledger wording was also inaccurate: macOS excludes the canonical
checkout by path, not by branch. It counts every remaining assessment,
including prunable rows, and excludes only prunable rows from the size loop.
This aligns the Windows computation and states those exact semantics in the
ledger.
Changes
branch, so the first row is no longer misclassified.
worktree count; sum only non-prunable rows toward size.
macOS
du -skallocated-usage reporting.residual limits. The row remains
Partial.macOS reference evidence
macOS runtime evidence is added by PR #500 at commit
10173c9f(that PR isstill open, so these paths are not present at this PR's merge-base):
GraphCode 0.1.76 (299), built from
717240cd, macOS 26.7. In that reportRmeans direct observation of the running app; the seven/eight boundary and both
screenshots are
Revidence.Those macOS captures establish the target behavior only. They are not
Windows validation.
Test plan
RED:
& $env:GRAPHCODE_ZIG0152 test src\WorktreeStatus.zig-> behavioral failures: 4 of 27 tests failed, covering first-row/opened-checkout identity, prunable count/size, threshold boundaries, and logical-versus-allocated size; output preserved inworktree-notice-red-test.log.GREEN:
& $env:GRAPHCODE_ZIG0152 test src\WorktreeStatus.zig-> 29 tests passed.REGRESSION:
pwsh -NoProfile -File Tools\windows\Tests\WindowsShell.Tests.ps1 -ZigExecutable $zig-> 654 tests passed; scaffold contract passed.& $env:GRAPHCODE_ZIG0152 build -Doptimize=ReleaseSafe "-Dwinghostty-dir=$env:GRAPHCODE_WINGHOSTTY_ROOT"-> passed.Limits of this test plan
The GREEN result is unit-level only. No live Windows toolbar/chip boundary
walkthrough was performed, so the ledger row stays
Partial.The initial shell-suite attempt stopped early because the pinned Winghostty test
library was missing. That is not a green result and is not counted as one;
the successful retry above is the run that stands, and it has a positive test
count. Filtered Zig tests are deliberately not used as suite evidence, because a
zero-match
--test-filterstill exits successfully.Windows reads
FILE_STANDARD_INFORMATION.AllocationSizeand rounds eachcomplete worktree to KiB. This is a deliberate approximation of macOS
du -skallocated-usage reporting; identical byte accounting across filesystemshas not been demonstrated.
Checklist
git commit -s) per the DCOmake test): macOS/Xcode is unavailable on this Windows host; the Windows shell suite and build pass.make check): macOS/Xcode lint is unavailable on this Windows host.