Repository navigation
Description
There is no mechanism. Each site decides for itself whether it is in the neutral world or the native
one, usually with a comment explaining the local reasoning, and the decisions are made on heuristics like
"this is planning, so use slash separators because the path might be used on any operating system."
That framing is wrong-headed. Whether separators are neutral is not a function of when the code runs.
It is a function of what the value is: identity, or access. Planning-versus-execution is a proxy that
happens to correlate, and proxies drift — which is why this defect keeps being rediscovered one site at a
time rather than fixed once.
The evidence: the same bug, found five separate times
| Found as | Site | Disposition |
|---|---|---|
| #377 | fsroot.Path.Rel() returned OS-native separators, making serialized documents and checksums platform-dependent |
fixed |
| #395 | file.Find's matcher was not slash-native |
fixed |
| 2026-08-18 | Provider.Name / Parent / Join used filepath, so Name("/") answered \ on Windows |
fixed |
| 2026-08-18 | commonAncestor split on filepath.Separator, answering \home\user for two /home/user inputs |
fixed |
| 2026-08-18 | the file resource's identity was "file://" + Abs(), putting backslashes inside a URI |
fixed |
Five discoveries, five local fixes, no shared rule. The sixth is waiting.
What the shape of a fix looks like (not a design — a constraint on one)
- Identity is neutral by construction, not by remembering. A URI carrying a backslash should be
impossible to build, not merely discouraged — the same argument as Slice accessors alias the graph's internal storage #532 and Pointers to mutable containers escape the package boundary #533 for graph mutation. - Normalization happens on fetch, for use. A provider method performing an action asks for the path and
gets it native. Nothing else converts. fsroot.Pathalready holds both forms —Rel()canonical slash,Abs()native — so the type is the
natural place for the distinction to become enforceable rather than conventional. NoteString()returns
abs, so any%sof a Path is native, including inside anything that later gets serialized.
Not being designed here. This records the defect and the rule so the next instance is recognized as the
same bug rather than filed as a new one.
Activity
David-Noble-at-work commentedon Aug 18, 2026
Where the transform belongs (ruled 2026-08-18)
At resource construction, not along the way. The resource owns the transform.
Passing an absolute path — say from
fsroot.Path.String()— to build a file resource is the moment ofnormalization. From then on the resource answers two questions with two forms, and no caller has to know
which world it is in:
fsroot.Path.String()returned — platform-native, ready for the filesystemThat is strictly better than the framing I filed, and #548 proved it the expensive way.
Demonstrated 2026-08-18
I normalized identity at one site —
"file://" + ToSlash(Abs())inbuildCandidateAs— and fourconsumers broke, because they key on the native form:
TestBuildReport_Classifications,TestWalkTree_ReducerError_StackHoldsCompletedReceipts,TestExecute_RedeployFlowsUnderDefault, andTestExecute_StaleSourceRegeneratesFreely. The last is the instructive one: drift detection stoppedseeing a stale file, so a partial normalization did not merely fail a comparison — it silently changed
behavior.
Reverted, with the reason recorded at the site. It is the "along the way" fix this bug exists to prevent,
and it cannot work until the resource owns both forms.
fix(windows): revert three over-reaches; slash form is for values, no…
test(file): take the base name with filepath, not the Starlark surface
David-Noble-at-work commentedon Aug 19, 2026
The sixth, and the first that is a security defect rather than a correctness one.
containedLinkTargetin the archive provider asksfilepath.IsAbswhether an archive entry's symlinktarget is absolute. On Windows a POSIX-absolute target is rooted but not absolute, so the guard returns
nil and the link is materialized verbatim, pointing outside the extraction root.
It belongs in this issue's table because it is the same defect, not a relative of it: a string carrying
archive-format syntax evaluated under the extracting host's rules, with no resource owning the transform
between the two worlds.
Worth noting for the argument this issue already makes -- that local fixes keep rediscovering it -- the
previous five were wrong answers. This one is an unenforced containment boundary, found only because a test
happened to run on windows.
Filed separately with the construction rule as its scope.
docs: plan — resource construction: the catalog mediates everything (#…
test(file): the own-specific round trip asks the resource, not a spel…
David-Noble-at-work commentedon Aug 21, 2026
The sixth discovery, found and fixed (2026-08-21). The rel-identity mint (#584 PR 1, #596) put rels
inside identity, and its foreign-scheme pin immediately caught the next instance on Windows:
fsroot.makePath's rel half was not platform-neutral. Windowsfilepath.Cleanguards a first segmentcontaining a colon with a leading
./(the CVE-2022-41722 drive-relative disambiguation), so the sameinput produced rel
./https:/example.com/xon Windows andhttps:/example.com/xelsewhere — an OS guardriding into identity.
fsroot.makePathrel half used OS-formClean, so Windows'./colon guard entered the relFixed per this issue's own rule — in the type, not at a call site:
fsroot.canonicalRel(slash-path Cleanafter separator normalization) now renders every rel in both
makePathbranches andfsroot.NewPath, witha platform-neutrality pin (
TestRoot_NewPath_ColonSegmentRelIsPlatformNeutral) that runs on all three CIplatforms.
fix(fsroot): the rel half is slash-canonical on every platform
feat(file): identity is the rel — the mint flips, and the trace recor…
test: the catalog pin authors rels; the star integration test closes …
feat(file): the plan-space path grammar, and every authoring surface …
feat(op): pre-flight binds pending resources to the run's root -- pha…