Repository navigation
A layer is admitted by its clone's working tree but planned from a HEAD snapshot: an emptied Home/ fails the tree build instead of contributing nothing #819
Description
Feature: #463 — writ command surface: layers, segments, adoption. Found: 2026-09-05 on DANOBLE-WD11-3, after
a workaround branch on the team repository removed every packages-manifest.yaml (the #818 detour).
Observed
Error: build tree: layer team: open C:\Users\david-noble\.cache\devlore\snapshots\team-1e6b7535106f\Home: The system cannot find the file specified.
The team clone's working tree still shows Home/ with five directories (noblefactor, .Darwin, .Linux, .Unix,
.Windows) — empty, because git leaves directories behind when their last tracked file is deleted. The commit at
HEAD tracks nothing under Home/. The base layer's clone has no Home/ at all and passes.
Mechanism
cmd/writ/writ/layer.goCollectLayerSourcesadmits a (layer, target) pair whendirExists(<clone>/Home)is
true — a check against the clone's working tree.cmd/writ/writ/snapshot/snapshot.goRewriteSourcesthen replaces each admitted source root with the snapshot
worktree of HEAD (<layer>-<short hash>). A fresh worktree of a commit with no files underHome/has no
Home/.cmd/writ/writ/segmentMatchDirectoriesdoesos.ReadDir(sourceRoot)on the missing directory and returns the
error; the tree build fails for the whole deploy.
Two trees decide one question: existence is judged on the working tree, content is read from HEAD. The .safe
rename in #813's workaround hit the same split from the other side (an edit that HEAD does not carry is invisible).
Base only passes because its working tree has no Home/ either.
Expected
A layer whose HEAD carries nothing under a target directory contributes nothing to that target — the same outcome
as a layer with no such directory — and the deploy proceeds. The existence check reads the same tree the planner
reads.
Acceptance
- admission of a (layer, target) pair is decided against the snapshot (or HEAD's tree), not the clone's working
tree; a target directory absent from HEAD is skipped with a note, never an error - a unit test: a layer whose commit has an empty
Home/(directories only in the working tree) builds a tree with
zero entries from that layer -
writ deploy noblefactoron DANOBLE-WD11-3 with the teamworkaroundbranch checked out gets past the tree build
Related
- pkg.Resource rejects the canonical purl form its doc promises: "pkg:winget/Vim/Vim?scope=machine" fails as unknown package manager "pkg" #813, packages-manifest.yaml files collide like deployed files: the most specific one shadows the rest, so a layer's general packages are never planned #814, The team layer's Windows packages-manifest.yaml names pwsh, a winget moniker, where the driver needs the id Microsoft.PowerShell #818: the other blockers found on the same machine; writ has no command to refresh a repository it cloned; a layer's manifests stay at the clone's checkout until the user runs git by hand #812: no way to refresh a clone.
Activity