050 — tp release fast-forwards a base branch behind its remote before it reads the tree (#257)

Why

A trunk release on the base branch reads the fragments and CHANGELOG.md from the remote's copy of the branch and cuts the release branch from it, but reads task-plus.yml, the story files and ROADMAP.md from the working tree. A local base branch that is only behind its remote is let through, to be fast-forwarded when the release is tagged. So the release gathers what the remote holds and decides about it by a tree that predates it.

v0.55.0 did this. Story 047, which declares maturity.code: 3, merged on the forge at 12:29:16; tp release made its commits at 12:29:42 with local main still at the commit before; main was fast-forwarded at 12:29:49. The release ran by level 1 rules, found no story with a status line saying ready, and left #236 unticked and its finished epic in ROADMAP.md. At level 3 this is the ordinary case, not a race: agents merge on the forge and the human then runs tp release in a checkout nobody pulled.

What changes

  • tp release on the base branch: a base branch behind its remote and not ahead of it is fast-forwarded before anything is read from the tree, and the run says so. The release then reads the config, the stories and the roadmap of the commit it releases.
  • tp release -dry-run and tp release query change nothing, so they do not fast-forward: behind, they say by how much and that the pull comes first, in place of an answer from the stale tree.
  • docs/release-workflow.md: the rows below.

Acceptance

On the base branch, tree clean, the remote fetched as today. "Reads the remote's tree" is seen in a release whose remote base declares maturity.code: 3 and carries a story's fragment and file while the local base declares level 1 and has neither.

Command Local base against its remote Outcome
tp release level as today
tp release behind by n, not ahead prints Fast-forwarding <base> to <remote>/<base>, moves the base, then gathers: the release runs by the remote's task-plus.yml, stories and ROADMAP.md (the level 3 story's roadmap item is ticked)
tp release behind, and the release then stops (nothing landed, a check failing, the human answering no) the base stays fast-forwarded; the stop is reported as today
tp release behind, the fast-forward failing error naming the base and the remote; nothing gathered
tp release ahead only as today
tp release ahead and behind the diverged error, as today; nothing moved
tp release -dry-run behind by n, not ahead error: <base> is n behind <remote>/<base>, pull it first; nothing moved
tp release query behind by n, not ahead Not ready carries <base> is n behind <remote>/<base>; Next step (agent) is the pull; no release table from the stale tree
tp release query -offline any as today: the remote is not compared
tp release or tp story land on a story branch as today

Out of scope

  • Reading the config, stories and roadmap from the remote ref without moving the base: every reader would have to change, and one missed is this bug again.
  • A base branch ahead of its remote, or diverged from it.
  • A release that tags an already merged release pull request: it fast-forwards before it tags, as today, and reads no story or roadmap.
  • #195, the batch walk that gathered before pulling: the batch is gone.
  • Putting right what v0.55.0 left: v0.55.1 did.

Decisions

None.

Done when

  • tests express the acceptance table and pass
  • spec updated
  • changelog entry
  • issue closed with a link to the release