Repository navigation
Description
Summary
scripts/carry.py's worktree-registration check compares git's forward-slash path against Python's native path string. On Windows those never match, so carry.py check and carry.py apply always fail with target is not a registered git worktree even when the target is a correctly registered worktree. The tool is unusable on a Windows host.
Found while running RESYNC.md section 3 item 3 against ptr727/Financial-Modeling, which needed the .github/skills verbatim-tree carried.
Where
scripts/carry.py:346-348:
worktree_rows = git(target, "worktree", "list", "--porcelain").splitlines()
if sum(row == f"worktree {target.resolve()}" for row in worktree_rows) != 1:
raise CarryError("target is not a registered git worktree")git worktree list --porcelain emits POSIX-style separators on Windows, while pathlib.WindowsPath.__str__ emits backslashes. The equality can never hold.
Evidence
Host: Windows 11, git 2.55.0, Python 3.13.15 (scripts/host_gate.py --repo <target> reports [ok] host-tools 0 issue(s)).
Observed, from the target worktree:
$ git worktree list --porcelain | head -6
worktree C:/Users/piete/repos/Financial-Modeling
HEAD 52dfe4b06341ba0d44da3949a430c875aad019ba
branch refs/heads/develop
worktree C:/Users/piete/repos/worktrees/Financial-Modeling-hub-carried-files
HEAD 52dfe4b06341ba0d44da3949a430c875aad019ba
$ python -c "import pathlib; print('worktree', pathlib.Path('.').resolve())"
worktree C:\Users\piete\repos\worktrees\Financial-Modeling-hub-carried-files
And the resulting failure, run from a clean hub worktree at f3b4cc9:
$ python scripts/carry.py check Financial-Modeling --target /c/Users/piete/repos/worktrees/Financial-Modeling-hub-carried-files
ERROR: target is not a registered git worktree
The target was a genuine registered worktree on its own feature branch, as the git worktree list output above shows.
Expected and actual
- Expected: the check passes for a registered worktree on every supported host, and
carry.py check/applyproceed to compare the manifest-owned trees. - Actual: on Windows it raises
target is not a registered git worktreeunconditionally, so the manifest-driven tree carry cannot run at all and the tree has to be mirrored by hand.
Suggested fix
Compare resolved paths rather than strings, for example parsing each worktree row into a pathlib.Path and comparing Path(row).resolve() == target.resolve(), or normalizing with as_posix() on both sides. scripts/carry.py:334 (if top != target.resolve()) compares Path objects and is not affected, which is why only this one site fails.
Workaround used
Mirrored .github/skills by hand from the hub checkout and verified byte-identical with diff -rq. That loses the prune authority the tree declaration is supposed to supply, so an extra downstream path would not have been reported.
Context
- Hub:
f3b4cc9(2.0.526), read atmain. - Downstream:
ptr727/Financial-Modeling, audit run2026-08-30T14:37:34Z | hub f3b4cc9. - Downstream PR that hit it: ptr727/Financial-Modeling#204.
Activity
ptr727 commentedon Sep 9, 2026
Still reproducing, unchanged, at hub
8195c43(2.0.587), 190-odd commits after this was filed.Hit again driving
RESYNC.mdagainstptr727/Financial-Modeling, this time on both halves of section 3:check-sections/apply-sectionsfor theAGENTS.mdandGOVERNANCE.mdverbatim regions, andcheck/applyfor the.github/skillstree. All four subcommands fail identically atverify_target, before any manifest work starts.Audit run stamp:
audit run 2026-09-09T20:19:39Z | hub 8195c43.Host is unchanged from the report above except for the git version: Windows 11, git 2.55.0, Python 3.13.15,
scripts/host_gate.py --repo <target>reports[ok] host-tools 0 issue(s) over 8 declared tool(s).The comparison at
scripts/carry.py:352-354is still:Confirmed on this host that the two sides differ only in separator:
Worth noting what the workaround costs, since it bears on priority.
carry.pyis not a convenience here: its post-apply assertion, that the preamble, the heading sequence, and every non-declared region came through byte-identical, is the mechanical layer thatcarried-instruction-file-guardleans on to make a downstream re-vendor safe. A resync that routes around this bug by hand-copying regions loses exactly that assertion, on the file class where the AGENTS.md-overwrite incident happened. This resync kept the assertion by wrapping the onegit worktree list --porcelaincall in a shim rather than by hand-copying, but that is not something the procedure should need.Suggested fix, comparing resolved paths rather than strings:
That also drops the
!= 1count, which was only ever guarding against a duplicate row git does not emit.ptr727 commentedon Sep 21, 2026
ptr727/Financial-Modelingis waiting on this. Recorded there as ptr727/Financial-Modeling#416, which states what that repository cannot do in its own terms and carries theblockedlabel, perGOVERNANCE.md"Durable Knowledge and Self-Improvement". Filed from the hub resync that merged as ptr727/Financial-Modeling#413, measured ataudit run 2026-09-21T00:48:09Z | hub 90161ce.ptr727 commentedon Sep 27, 2026
Still reproducing, unchanged, at hub
f431a02(scripts/carry.pylast changed at09a82e6). The comparison is now atscripts/carry.py:363-365.Hit again driving
RESYNC.mdagainstptr727/Vantage-Configon Windows 11 (git 2.55.0, Python 3.13.15,host_gate.py --repoclean).check-sectionsfails withtarget is not a registered git worktreeagainst a correctly registered worktree atC:/Users/piete/repos/worktrees/Vantage-Config-resync-instructions. The workaround was the one this issue already implies: carry by hand fromgit ls-filesin the hub checkout, then byte-compare each declared##region after CRLF normalization. That also meant the tool's post-apply assertion (preamble and non-declared regions byte-identical) was not available, so the manual comparison had to stand in for it. The resulting convergence PRs are ptr727/Vantage-Config#16 (sections) and ptr727/Vantage-Config#18 (.github/skillstree).Compare Worktree Paths, Not Strings, in carry.py's Registration Check (…