Skip to content

writ deploy judges dirtiness at the repository root: a modified Inventory file forces --allow-dirty though only Home/ is planned or served #852

Open

Description

@David-Noble-at-work

deploying #147 Phase 1; restated by the user the same day: "we have bugs on this command line nonsense."

Observed

$ writ deploy common
Error: layers have uncommitted changes: [personal]
Commit your changes or use --allow-dirty to plan against HEAD

$ git -C ~/Workspace/Personal status --short
 M Inventory/Danoble-MBP-A.brews-installed
 M Inventory/Danoble-MBP-A.ports-installed

Two machine-inventory files outside Home/ are modified, as they are on every machine most of the time,
and every deploy of the personal layer needs --allow-dirty. Nothing under Home/ is dirty.

Mechanism

  1. cmd/writ/writ/snapshot/snapshot.go IsDirty runs git status --porcelain at the repository root
    and returns true on any output: staged, unstaged or untracked, anywhere in the repository.
  2. CheckClean refuses the deploy unless --allow-dirty, naming the layer but not the files.
  3. The plan is built from a HEAD snapshot (RewriteSources), so no uncommitted change — under
    Home/ or outside it — can reach the plan at all. What the flag actually guards is the serving side:
    deployed links point into the working tree (Stability between upgrades: a per-layer policy, pinned or live -- deployed links point at the kept snapshot or the working tree #847), so an uncommitted edit under Home/ is what a
    linked file shows.

So the check asks a broader question than the one that matters. A modified Inventory/ file, a stray
AGENTS.md, a plan document in progress: none can affect what deploy plans or what a link serves,
and each of them forces the flag.

Wanted

Evidence of completion

  • a repository with modifications only outside its admitted Home/ directories deploys without --allow-dirty
  • a modification under an admitted Home/ directory still refuses, and the refusal lists the file
  • the dirty_layers origin annotation (Record the deployed commit for each layer source #473) records the same, narrower judgement
  • an integration test with a fixture layer dirty in Inventory/ and clean in Home/

Related

#843 (the zero-project refusal on the same command line), #850 (the implicit projects), #847 (pinned or
live links — which decides whether the check has anything to guard), #819 (admitted by working tree,
planned from HEAD: the same two-trees split from the other side), #473 (origin records dirty layers).

Activity

  1. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rule it breaks:

    • severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions