034 — tp release query under trunk flow reports a story or a release, never both (#206)

Status: in progress Roadmap: #198

Why

tp release query is what an agent reads before it acts. Under maturity.flow: trunk it still reports the batch: it tells a story branch to run tp release, which refuses there (story 032), and on the base branch it looks for a release branch that trunk flow never has (story 033). The answers are wrong exactly where the new process is meant to be simpler.

Trunk flow has two independent acts (ADR 0008), so the report is one of two small tables, picked by the branch checked out. A story's next step never depends on what else is being released, and the release's never depends on a story still open.

What changes

  • tp release query under trunk flow, on a story branch: reports the story and its pull request; the next step is from the story table.
  • tp release query under trunk flow, on the base branch: reports what has landed since the last tag, the next version and the stories not yet landed; the next step is from the release table, read by the same code tp release gathers with.
  • Batch flow and code level 0: unchanged.
  • docs/release-workflow.md: both tables.

Acceptance

On a story branch. The first matching row wins.

State Next step Who
not named story/<n>-<slug> rename the branch agent
in the base branch, released in vX tidy: switch to the base, delete the branch agent
in the base branch, untagged the same: it has landed; its release is not the story's step agent
its CHANGELOG names an untagged version revert the release commits: a story that lands takes none agent
no changes/<n>.<kind>.md add the fragment agent
its pull request open into another branch retarget or close it human
not on the remote, commits not pushed, or no pull request tp story land agent
its pull request open; the base has moved and conflicts with it tp story land: merges the base in and stops at the conflicts agent
its pull request open review and merge it human
pushed, the forge not asked (-offline) review and merge its pull request; tp story land opens it if missing human

On the base branch.

CHANGELOG Landed fragments Release pull request Next step Who
any any open tp release: merges it and tags human
untagged X none none tp release: tags and publishes X human
untagged X some none tp release: redoes X with them as vY human
latest version tagged some none tp release: releases them as vY human
latest version tagged none none none: nothing to release —

Not ready, either branch: a dirty tree; release on the remote (a batch in flight); CHANGELOG [Unreleased] entries; a .tp-release-comment. On a story branch also: no fragment, commits not pushed.

Out of scope

  • Any change to what tp story land or tp release do.
  • The story steps before a branch exists (tp story new, issue).

Decisions

None: the tables follow from stories 032 and 033.

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