036 — A check that changes tracked files fails (#215)

Status: in progress Roadmap: #212

Why

The checks answer one question: is the tree at this commit sound? A check that rewrites a tracked file (a lock file relocked, a page regenerated, a formatter fixing what it found) has passed on a tree that no commit holds, so the commit that is then pushed or tagged is not the one that was tested. It also leaves the checkout dirty, which the next tp release or tp story land refuses with no hint of the cause: lofigui's uv sync did this after every release (lofigui#19).

The manual states the rule (method: "if it leaves a tracked file modified, the build has failed"); this story makes tp hold it.

What changes

  • The checks (check: in task-plus.yml, run by tp story land and by every tp release path) fail when a tracked file's state differs after them from before them. The error names the files.
  • tp story land leaves the changes in the working tree: they are usually what the story should have committed.
  • tp release under trunk flow discards them with the release branch it made, and ends on the base branch as it does after any failed check.
  • docs/release-workflow.md, docs/story.md: the rule.

Acceptance

Command The checks Outcome
tp story land pass, tracked files unchanged as today
tp story land pass, a tracked file modified error naming the file; nothing pushed, no pull request; the change left in the working tree
tp story land pass, only untracked or ignored files written as today
tp release on the base, trunk flow pass, a tracked file modified on the release branch error naming the file; nothing pushed, no pull request; on the base branch, working tree clean, no local release branch
either -dry-run checks not run, so nothing to compare

Out of scope

  • Refreshing derived files as part of the release (release_prepare:, #213), and what runs after the release (#213).
  • The deploy validation's docs build: generated pages are gitignored by convention.
  • Narrowing the checks to the changed parts.

Decisions

none

Done when

  • tests express the acceptance table and pass
  • spec updated
  • ADR written if a fork was resolved
  • roadmap ticked and stamped; changelog entry
  • issue closed with a link to the release