Skip to content

feat: ask where a first release starts instead of rendering all history - #198

Merged
goldbarth merged 2 commits into
mainfrom
feat/first-release-range
Sep 21, 2026
Merged

goldbarth merged 2 commits into
mainfrom
feat/first-release-range

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Closes #138

  • Decision (recorded on A first release renders the whole history, superseded changes included #138): where a release starts is a fact decision, so the operator makes it. A range that spans all history stops the run; --since <ref> names the start, --whole-history renders everything on purpose. Not chosen: an automatic cut-off, which would silently decide which changes belong to the release, and detecting superseded changes, which beyond exact reverts means reading meaning - a fact decision in the model.
  • The check sits in ReleasePipeline right after the commits are read, before the first GitHub request and before the model, so asking costs neither API budget nor tokens. It holds for every mode.
  • Core throws WholeHistoryException with the tag and the commit count and knows no flags; ReleaseCommand turns it into the message with both options. It goes to stdout as Error: ..., like every other failure after the pipeline started (docs/cli.md, "Exit status").
  • --since works on any tag and overrides the previous tag. GitCliCommitReader verifies the ref resolves to a commit and is an ancestor of the release tag (git merge-base --is-ancestor), otherwise the range would hold commits that are not in the release.
  • CommitRange.FromTag becomes From and IsFirstRelease becomes IsWholeHistory: the start can now be a commit, and a first tag with --since is not a whole-history range. Neither is serialized, so changelog.json is unchanged.
  • Passing both options, or --since without a value, is refused before configuration is read.
  • docs/cli.md gets "Where a release starts", including the remaining limitation that a change replaced later in the same range is still its own entry; the README usage shows both options. The README's known-limitations line goes in with README does not show what Chartula produces, what it costs, or where it stops #182 (noted there).

Repro and verification on this repository, whose first tag is v0.1.0-preview.1: before, chartula preview --tag v0.1.0-preview.1 rendered 48 entries from 69 commits (the #95 run). After:

Error: v0.1.0-preview.1 is the first tag, so its range is the whole history (69 commits).
  Rendered as it is, that reads as a development log rather than a release.
  --since <ref>     start the release after a tag or commit (e.g. the last state you shipped)
  --whole-history   render all of it, e.g. for a project whose history is the release

exit 1, no request made. An unresolvable --since and passing both options fail with their own messages. A full run with --since was not made, since it costs tokens; the range it reads is covered by the reader tests.

Tests: WholeHistoryTests (a first tag without a start throws before GitHub and the model, enforced by stand-ins that throw if reached; WholeHistory renders; Since reaches the reader); GitCliCommitReaderTests (a named start bounds a first tag, overrides the previous tag and accepts a commit expression, an unresolvable or non-ancestor start is refused); ReleaseStartTests (parsing, both refused, missing value refused, help names both, the refusal names cause and both ways out); FirstTagTests runs the built CLI in a checkout whose only tag is its first. CliProcess now returns stdout as well.

goldbarth added 2 commits September 21, 2026 12:37
A first tag's range was the whole history, rendered as a development log:
intermediate states next to the changes that replaced them, and on a late
adoption the first thing a new user saw.

A range that spans all history now stops the run after the commits are
read, before any GitHub request or model call, and names both ways out:
--since <ref> starts the release after a tag or commit, and
--whole-history renders all of it on purpose. Where a release starts is a
fact decision, so it is the operator's, not a heuristic's or the model's.

Closes #138
On Windows git writes its objects read-only, and Directory.Delete
refuses a read-only file, so the first-tag test failed in cleanup.
@goldbarth goldbarth self-assigned this Sep 21, 2026
@goldbarth
goldbarth merged commit f093f84 into main Sep 21, 2026
4 checks passed
@goldbarth
goldbarth deleted the feat/first-release-range branch September 21, 2026 10:42
goldbarth added a commit that referenced this pull request Oct 1, 2026
…320)

Follows #319 (ADR 0004); this branch builds on it for the index row and
is rebased onto `main` once #319 is merged.

- **Why:** seven changes since September made Chartula stop where it
used to choose silently, each with its own reasoning in its pull
request, but the rule they share was written down nowhere. A contributor
adding an option or a setting could not tell whether to refuse an
ambiguous value or take the likelier reading, nor when refusing goes too
far.
- **Context** lists the seven cases in one table, each with what the
silent choice did and the change that ended it: a first tag (#198 for
#138, #282), a key sent to the other provider's host (#235), an unknown
or misindented key (#238), a shallow clone read as a first release
(#244), review mode approving unseen text (#247), two configuration
files (#287 for #278), and options a command does not take (#301).
Decided is #198, the first of them.
- **Decision:** stop and say so instead of choosing; before anything is
spent; with a message that names the cause and the fix, shown with two
real messages; ask at a terminal where the answer is the user's, and
stop naming the option without one; refuse only what Chartula can tell
for certain (an empty list, an unknown host and an unknown model id are
taken as written); refuse a setting that would have no effect. The rule
is about what the user meant, not about what the release says, which is
what flags are for.
- **Consequences** name the cost: a run that could have produced
something stops, and a CI job fails until the input says what it means.
The ADR weighs that rerun against what a silent choice cost in the seven
cases. For a new case, four questions in order, so a contributor can
apply the rule rather than match it against the examples.
- The index in `adr/README.md` lists 0005.

**Verified:**
- Each case was checked against its pull request's description and the
issue it closes (#237, #243, #233, #278, #300, #138); the dates are the
merge dates.
- Both messages are the ones `docs/cli.md` and `docs/configuration.md`
show from the built binary.
- The counter-cases were checked in the code: `ProviderHost` accepts
every host but two, `ClaudeThinkingSupport` passes an unknown model id,
#289 reads an empty list as written, and #244 still runs `--since` in a
shallow clone when the range holds.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none, documentation only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A first release renders the whole history, superseded changes included

1 participant