Skip to content

writ repo list reports every layer registered on a fresh install: self install creates empty layer directories #1030

Closed

Description

@David-Noble-at-work

On a machine where no layer has ever been registered, writ repo list reports all three layers as registered, each at writ's own empty layer directory:

{ "layer": "base", "owner": "user", "root": "~/.local/share/devlore/writ/layers/base", "state": "registered" }

At f30c2092, self install creates base, team and personal as empty directories under WritLayersDir() (initWritLayers, cmd/internal/cli/selfinstall.go:1153-1172, called at :519). repoRegistration (cmd/writ/writ/repo_cmd.go:645-666) reports any path there that exists and resolves as registered. A directory there is a real registration when writ migrate moved a layer's content into it, so an empty one, made by the installer, can't be told from one apart from being empty.

Found 2026-10-04 while fixing #1029: the installers' new check asks writ whether a layer is registered, and on every fresh account writ says yes.

Resolution

Ruled 2026-10-04: "Fix writ in this pull request", with #1029, then "(a) with adopt's message corrected":

  • A layer is registered only when it resolves to a git working tree, the same rule writ repo set enforces. One check decides it, and every reader of the layers directory uses it: repo list, reconcile, deploy's layer lookup, adopt, and the secrets code. An empty directory is unregistered.
  • self install stops creating empty layer directories.
  • writ adopt into an unregistered layer refuses, and names writ repo set <layer> ..., not writ self install.

Plan and design documents

Kind Document
Plan docs/plans/fix/1029-installers-tell-the-user-to.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions