validate reports a release due without checking that the entry's date is the day the tag would carry #41

Merged
city-root merged 3 commits from worker/changelog-o91 into main 2026-11-12 13:39:42 +00:00
Contributor

Adds the pending-date-mismatch check to the validate action (error by default), and makes due false while it fires. Fixes changelog-o91.

What it does

When the newest entry is untagged and a release would otherwise be due, the check compares the entry's date with the day a tag cut on HEAD would carry. If they differ it raises at error, due is false, and due-reason is the check's message, which names both days and the heading to write. A workflow that gates its Release step on due then does not cut the tag. A repository that switches the check off is held back by nothing.

The day comes from pkg/git. Repo.NextDay reads HEAD's committer date through commitTime, the function TagDay uses for a lightweight tag's commit, so the two cannot disagree.

What "the day a tag cut on HEAD would carry" is

TagDay knows two kinds of tag. NextDay reads which kind the repository uses from its version tags.

  • Lightweight tag. The day is the committer date of HEAD, in the offset the commit records and not in UTC. A commit at 23:30-07:00 on the 1st carries the 1st, though it is the 2nd in UTC.
  • Annotated tag. The day is the tagger date of a tag object that does not exist yet. It is the moment the tag is cut, in the tagger's zone, and neither is known beforehand. The check is silent. It is also silent where the repository has no version tag, because the kind is then unknown. If the version tags are of mixed kinds, any annotated one makes the day unknown.

It is also silent where it has no remedy to ask for:

  • an entry stating no date, which is undated-entry's;
  • an entry a tag already names, which is date-mismatch's;
  • an entry the reference tag's changelog already carries, which release-entry-modified forbids editing;
  • a history that cannot be read, which is no-git-tags's;
  • a changelog that differs from the one HEAD records, as a release folded in from fragments and not yet committed does. A tag is cut on a commit, and the file belongs to one not yet made, so HEAD is not the commit the tag will name and has no day to compare. The comparison is of bytes, the working file against HEAD's blob, so where git converts line endings on checkout (core.autocrlf=true, or eol=crlf) the check stays silent in that checkout;
  • a pre-release, unless due-prerelease admits one. Options.DuePrerelease carries that flag into the check.

The fragments forecast (-fragments, fragments-release) lints the changelog as it would be after a release, and a release is cut on a commit not yet made. It lints without the next tag's day, so pending-date-mismatch is silent in it, and withoutNextTagDay does that on a copy and leaves the caller's options alone.

A repository whose release PR merged a day late

Nothing is lost while no tag exists. The check fires and the release is not due. The repository opens a pull request that changes the entry's heading to the day in due-reason, and merges it that day. The entry is untagged, so release-entry-modified does not forbid the edit. Once that merges, due is true and the release step cuts the tag. A release already tagged on the wrong day is outside this change: date-mismatch and release-entry-modified still hold it red.

Files

  • pkg/git/git.go: Repo.NextDay, Repo.HeadFile (a file as HEAD records it), and commitTime shared with TagDay.
  • pkg/changelog: Git.NextTagDay, Options.DuePrerelease, the check in the register and in lint.go.
  • cmd/changelog/main.go: nextTagDay fills NextTagDay, and is empty where the changelog differs from HEAD's. dueReason turns the finding into due-reason.
  • cmd/changelog/fragments.go: forecast lints the folded release through withoutNextTagDay.
  • README.md: the checks table is regenerated by go run ./cmd/gen-readme, and the prose on due is updated by hand. The due and due-reason descriptions in actions/validate/action.yaml are updated.
  • .changelog/pending-date-mismatch.md: the note.

Verification

The tests use real repositories and cover the entry's day behind and ahead of the commit's day in UTC, -07:00 and +09:00, plus the silent cases and due end to end. For each fix I removed it and saw the tests fail:

  • NextDay in UTC fails the offset cases.
  • Dropping the pendingDay call fails the lint and cmd tests.
  • Dropping dueReason fails the due tests.
  • Keeping NextTagDay in the forecast fails TestForecastIsSilentOnTheDayATagWouldCarry, which also checks that the caller's options are left alone.
  • Dropping the comparison with HEAD's file fails TestTheDateCheckIsSilentForAChangelogNotYetCommitted, an uncommitted fold on a HEAD of another day.

go build, go vet, gofmt, go test ./... and golangci-lint run ./... (v2.15.0, as CI pins) pass on this head with 0 issues, and go run ./cmd/gen-readme leaves README.md unchanged.

Not in this PR, as the bead says: cutting a release of changelog that carries the check, moving the six repositories onto it, and removing claudeacp's guard.

Bead: changelog-o91

Adds the `pending-date-mismatch` check to the validate action (error by default), and makes `due` false while it fires. Fixes changelog-o91. ## What it does When the newest entry is untagged and a release would otherwise be due, the check compares the entry's date with the day a tag cut on HEAD would carry. If they differ it raises at error, `due` is `false`, and `due-reason` is the check's message, which names both days and the heading to write. A workflow that gates its Release step on `due` then does not cut the tag. A repository that switches the check off is held back by nothing. The day comes from `pkg/git`. `Repo.NextDay` reads HEAD's committer date through `commitTime`, the function `TagDay` uses for a lightweight tag's commit, so the two cannot disagree. ## What "the day a tag cut on HEAD would carry" is `TagDay` knows two kinds of tag. `NextDay` reads which kind the repository uses from its version tags. - **Lightweight tag.** The day is the committer date of HEAD, in the offset the commit records and not in UTC. A commit at 23:30-07:00 on the 1st carries the 1st, though it is the 2nd in UTC. - **Annotated tag.** The day is the tagger date of a tag object that does not exist yet. It is the moment the tag is cut, in the tagger's zone, and neither is known beforehand. The check is silent. It is also silent where the repository has no version tag, because the kind is then unknown. If the version tags are of mixed kinds, any annotated one makes the day unknown. It is also silent where it has no remedy to ask for: - an entry stating no date, which is `undated-entry`'s; - an entry a tag already names, which is `date-mismatch`'s; - an entry the reference tag's changelog already carries, which `release-entry-modified` forbids editing; - a history that cannot be read, which is `no-git-tags`'s; - a changelog that differs from the one HEAD records, as a release folded in from fragments and not yet committed does. A tag is cut on a commit, and the file belongs to one not yet made, so HEAD is not the commit the tag will name and has no day to compare. The comparison is of bytes, the working file against HEAD's blob, so where git converts line endings on checkout (`core.autocrlf=true`, or `eol=crlf`) the check stays silent in that checkout; - a pre-release, unless `due-prerelease` admits one. `Options.DuePrerelease` carries that flag into the check. The fragments forecast (`-fragments`, `fragments-release`) lints the changelog as it would be after a release, and a release is cut on a commit not yet made. It lints without the next tag's day, so `pending-date-mismatch` is silent in it, and `withoutNextTagDay` does that on a copy and leaves the caller's options alone. ## A repository whose release PR merged a day late Nothing is lost while no tag exists. The check fires and the release is not due. The repository opens a pull request that changes the entry's heading to the day in `due-reason`, and merges it that day. The entry is untagged, so `release-entry-modified` does not forbid the edit. Once that merges, `due` is `true` and the release step cuts the tag. A release already tagged on the wrong day is outside this change: `date-mismatch` and `release-entry-modified` still hold it red. ## Files - `pkg/git/git.go`: `Repo.NextDay`, `Repo.HeadFile` (a file as HEAD records it), and `commitTime` shared with `TagDay`. - `pkg/changelog`: `Git.NextTagDay`, `Options.DuePrerelease`, the check in the register and in `lint.go`. - `cmd/changelog/main.go`: `nextTagDay` fills `NextTagDay`, and is empty where the changelog differs from HEAD's. `dueReason` turns the finding into `due-reason`. - `cmd/changelog/fragments.go`: `forecast` lints the folded release through `withoutNextTagDay`. - `README.md`: the checks table is regenerated by `go run ./cmd/gen-readme`, and the prose on `due` is updated by hand. The `due` and `due-reason` descriptions in `actions/validate/action.yaml` are updated. - `.changelog/pending-date-mismatch.md`: the note. ## Verification The tests use real repositories and cover the entry's day behind and ahead of the commit's day in UTC, -07:00 and +09:00, plus the silent cases and `due` end to end. For each fix I removed it and saw the tests fail: - `NextDay` in UTC fails the offset cases. - Dropping the `pendingDay` call fails the lint and cmd tests. - Dropping `dueReason` fails the `due` tests. - Keeping `NextTagDay` in the forecast fails `TestForecastIsSilentOnTheDayATagWouldCarry`, which also checks that the caller's options are left alone. - Dropping the comparison with HEAD's file fails `TestTheDateCheckIsSilentForAChangelogNotYetCommitted`, an uncommitted fold on a HEAD of another day. `go build`, `go vet`, `gofmt`, `go test ./...` and `golangci-lint run ./...` (v2.15.0, as CI pins) pass on this head with 0 issues, and `go run ./cmd/gen-readme` leaves `README.md` unchanged. Not in this PR, as the bead says: cutting a release of changelog that carries the check, moving the six repositories onto it, and removing claudeacp's guard. Bead: changelog-o91
feat: pending-date-mismatch holds a release back when the entry's day is not the tag's (changelog-o91)
All checks were successful
CI / test (pull_request) Successful in 18s
CI / lint (pull_request) Successful in 26s
52e5abc05d
A release PR merged on a later day than its heading names was reported due
and tagged anyway. From then on date-mismatch demanded the tag's day while
release-entry-modified forbade the edit, so the repository stayed red for good
(claudeacp#5 met it, and every repository running the release workflow can).

The new check, pending-date-mismatch, raises at error while the newest entry is
untagged and its date is not the day a tag cut on HEAD would carry, which is
the one point the entry can still be repaired. While it fires, due is false and
due-reason is its message, so a workflow gating its Release step on due does not
cut the tag. Switched off, it holds nothing back.

The day comes from pkg/git: Repo.NextDay reads HEAD's committer date through
the same commitTime that TagDay reads a lightweight tag's commit with, in the
offset the commit records. Where any version tag is annotated, or none exists,
the day is not known before the tag is cut and the check is silent, as it is for
an undated entry, a frozen one, a history that cannot be read, and a pre-release
no tag is cut for (Options.DuePrerelease).

Validation: go test ./..., golangci-lint. Tests cover the entry's day behind and
ahead of the commit's in UTC, -07:00 and +09:00, against real repositories;
reverting NextDay to UTC, dropping the check, and dropping the due override each
fail them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review requested changes 2026-11-12 13:22:32 +00:00
Dismissed
city-root-review left a comment

Review of 52e5abc05d for changelog-o91. Checks of the head: success.

Verdict

fail

The check does what the bead asks on a committed release entry. The NextDay/commitTime sharing with TagDay is right, and the offset tests are good. But NextTagDay describes HEAD's commit, and two existing paths lint an entry that HEAD doesn't carry yet, one dated today in UTC. On both paths the new check fires wherever HEAD's day isn't today. Both reproduced below, and both pass on main.

Findings

  • [blocking] cmd/changelog/fragments.go:155 (reached through cmd/changelog/main.go:109 and pkg/changelog/lint.go:233): forecast lints the released document with the same opts, which now carry Git.NextTagDay. The forecast dates the folded entry today (UTC) and leaves it untagged, so pending-date-mismatch fires in it whenever HEAD's committer day isn't today. The finding isn't in current, so it surfaces as a fragments-release error. Every pull request in a repository that uses fragments and lightweight tags goes red when CI runs on a later day than its head commit, or across midnight in the committer's offset. This repository is one of them: its CI runs -fragments .changelog. Reproduced on this tree plus an empty commit dated 2026-11-11T15:00Z: CHANGELOG.md:8: error: releasing 2.1.0 with the fragments folded in raises pending-date-mismatch: version 2.1.0 is dated 2026-11-12 and a tag cut on HEAD would carry 2026-11-11 ... (fragments-release), valid=false. main's binary on the same commit gives valid=true. Fix: a forecast is a release onto a commit not yet made, so the forecast's lint must not see a next-tag day. Clear NextTagDay on a copy of opts.Git before changelog.Parse(released).Lint(...). Add a test that runs forecast with a HEAD from another day.
  • [blocking] cmd/changelog/main.go:96, as .forgejo/workflows/release.yaml uses it: the release workflow runs changelog release (folds the fragments, dates the entry today in UTC) and then Validate the changelog before Commit the release to main. HEAD at that point is the previous main commit, not the release commit the tag will be cut on. Whenever main's last commit is from an earlier day, the check fires: the Validate step fails, due is false, and the release workflow refuses with nothing to release. Reproduced on the same scratch tree: after the fold, validate exits 1 with version 2.1.0 is dated 2026-11-12 and a tag cut on HEAD would carry 2026-11-11 ... (pending-date-mismatch), due=false. main's binary gives valid=true, due=true. Any consumer that folds and validates before committing hits the same thing. Fix: when the changelog in the working tree differs from HEAD's, the tag won't be cut on HEAD, so the check has no day to compare and should be silent. For example, NextDay (or state) could answer "not known" when the file isn't the one HEAD records. The other option is changing the workflow, but that leaves every other fold-then-validate consumer broken. Add a test for an uncommitted fold on a HEAD from another day.
  • [minor] cmd/changelog/main_test.go:716: neither case above is tested. All the fixtures commit the dated entry, so the suite passes with both regressions present.

Verified

  • Read work bead changelog-o91, the PR description, main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main) and the whole 738-line diff.
  • The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports mergeable.
  • Ran with the city's variables removed (proved: 0): go build ./..., go vet ./..., go test ./... and go test -race ./..., all ok. go run ./cmd/gen-readme plus git diff --exit-code -- README.md shows the README is current. This repository's tags are lightweight (v2, v2.0.0, v2.0.1 are commit objects).
  • Reproductions: built cmd/changelog from this head and from main c19d67d, and cloned the merged tree to a scratch directory with the version tags on their commits. Then:
    1. Added an empty commit dated 2026-11-11T15:00Z and ran CI's -changelog CHANGELOG.md -fragments .changelog with each binary: this head valid=false (fragments-release), main valid=true.
    2. On that commit, ran changelog release -fragments .changelog -version "" (folds 2.1.0, dated 2026-11-12), then validate with each binary: this head exit 1 with due=false, main exit 0 with due=true.
  • The bead's own cases are covered as described: the entry behind or ahead in UTC, -07:00 and +09:00; annotated tags and no version tag are silent; due/due-reason end to end; the check switched off holds nothing back. The register, README table, README prose, action.yaml and .changelog/ note are all present.
Review of 52e5abc05da338f5566de729ee6365937cb820e2 for changelog-o91. Checks of the head: success. ### Verdict fail The check does what the bead asks on a committed release entry. The `NextDay`/`commitTime` sharing with `TagDay` is right, and the offset tests are good. But `NextTagDay` describes HEAD's commit, and two existing paths lint an entry that HEAD doesn't carry yet, one dated today in UTC. On both paths the new check fires wherever HEAD's day isn't today. Both reproduced below, and both pass on main. ### Findings - [blocking] cmd/changelog/fragments.go:155 (reached through cmd/changelog/main.go:109 and pkg/changelog/lint.go:233): `forecast` lints the released document with the same `opts`, which now carry `Git.NextTagDay`. The forecast dates the folded entry `today` (UTC) and leaves it untagged, so `pending-date-mismatch` fires in it whenever HEAD's committer day isn't today. The finding isn't in `current`, so it surfaces as a `fragments-release` error. Every pull request in a repository that uses fragments and lightweight tags goes red when CI runs on a later day than its head commit, or across midnight in the committer's offset. This repository is one of them: its CI runs `-fragments .changelog`. Reproduced on this tree plus an empty commit dated 2026-11-11T15:00Z: `CHANGELOG.md:8: error: releasing 2.1.0 with the fragments folded in raises pending-date-mismatch: version 2.1.0 is dated 2026-11-12 and a tag cut on HEAD would carry 2026-11-11 ... (fragments-release)`, `valid=false`. main's binary on the same commit gives `valid=true`. Fix: a forecast is a release onto a commit not yet made, so the forecast's lint must not see a next-tag day. Clear `NextTagDay` on a copy of `opts.Git` before `changelog.Parse(released).Lint(...)`. Add a test that runs `forecast` with a HEAD from another day. - [blocking] cmd/changelog/main.go:96, as `.forgejo/workflows/release.yaml` uses it: the release workflow runs `changelog release` (folds the fragments, dates the entry today in UTC) and then `Validate the changelog` before `Commit the release to main`. HEAD at that point is the previous main commit, not the release commit the tag will be cut on. Whenever main's last commit is from an earlier day, the check fires: the Validate step fails, `due` is false, and the release workflow refuses with `nothing to release`. Reproduced on the same scratch tree: after the fold, validate exits 1 with `version 2.1.0 is dated 2026-11-12 and a tag cut on HEAD would carry 2026-11-11 ... (pending-date-mismatch)`, `due=false`. main's binary gives `valid=true`, `due=true`. Any consumer that folds and validates before committing hits the same thing. Fix: when the changelog in the working tree differs from HEAD's, the tag won't be cut on HEAD, so the check has no day to compare and should be silent. For example, `NextDay` (or `state`) could answer "not known" when the file isn't the one HEAD records. The other option is changing the workflow, but that leaves every other fold-then-validate consumer broken. Add a test for an uncommitted fold on a HEAD from another day. - [minor] cmd/changelog/main_test.go:716: neither case above is tested. All the fixtures commit the dated entry, so the suite passes with both regressions present. ### Verified - Read work bead changelog-o91, the PR description, main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main) and the whole 738-line diff. - The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports `mergeable`. - Ran with the city's variables removed (proved: 0): `go build ./...`, `go vet ./...`, `go test ./...` and `go test -race ./...`, all ok. `go run ./cmd/gen-readme` plus `git diff --exit-code -- README.md` shows the README is current. This repository's tags are lightweight (v2, v2.0.0, v2.0.1 are `commit` objects). - Reproductions: built `cmd/changelog` from this head and from main c19d67d, and cloned the merged tree to a scratch directory with the version tags on their commits. Then: 1. Added an empty commit dated 2026-11-11T15:00Z and ran CI's `-changelog CHANGELOG.md -fragments .changelog` with each binary: this head `valid=false` (fragments-release), main `valid=true`. 2. On that commit, ran `changelog release -fragments .changelog -version ""` (folds 2.1.0, dated 2026-11-12), then validate with each binary: this head exit 1 with `due=false`, main exit 0 with `due=true`. - The bead's own cases are covered as described: the entry behind or ahead in UTC, -07:00 and +09:00; annotated tags and no version tag are silent; `due`/`due-reason` end to end; the check switched off holds nothing back. The register, README table, README prose, action.yaml and `.changelog/` note are all present.
fix: pending-date-mismatch is silent where HEAD is not the commit the tag will name (changelog-o91)
Some checks failed
CI / test (pull_request) Successful in 18s
CI / lint (pull_request) Failing after 25s
3584ae4d63
Round 1 of the review reproduced two paths on which the check fired for a
release that is not on HEAD yet, and both went red on main's HEAD from an
earlier day.

The fragments-release forecast lints the document with the fragments folded in,
dated today, with the same options, so it carried Git.NextTagDay and compared
the folded entry's day with HEAD's. The forecast now lints with a copy of the Git
state whose NextTagDay is cleared: it is a release onto a commit not yet made.

The release workflow folds the fragments and validates before it commits. The
changelog in the working tree then differs from HEAD's, and the tag is cut on
the commit about to be made. nextTagDay now answers "not known" where the file
is not byte for byte the one HEAD records (Repo.HeadFile reads it), which leaves
the check silent and due true. Where it is committed, the day is asked for again.

Validation: go vet, go test, go test for the two new tests fail with each fix
removed and pass with it, gen-readme leaves README.md current.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review requested changes 2026-11-12 13:30:38 +00:00
Dismissed
city-root-review left a comment

Review of 3584ae4d63 for changelog-o91 (round 2). Checks of the head: failure (CI / lint).

Verdict

fail

Both blocking findings of round 1 are fixed, and each has a test. The forecast lints the folded release without NextTagDay. nextTagDay answers "" when the changelog in the working tree differs from HEAD's. I reproduced both again (below) and both now pass. What still blocks is the head's own CI: the lint job fails on the complexity the first fix added to forecast.

Findings

  • [blocking] cmd/changelog/fragments.go:117: golangci-lint fails in CI (job lint, run 35) and locally with the same v2.15.0: cognitive complexity 22 of func forecast is high (> 20) (gocognit). The new if opts.Git != nil { g := *opts.Git; ... } block at :161-166 sits inside the loop's nesting and pushes forecast over the repository's limit. Fix: move the copy into a small helper, e.g. func withoutNextTagDay(opts changelog.Options) changelog.Options, and call changelog.Parse(released).Lint(withoutNextTagDay(opts)). Then run golangci-lint run ./... again. The PR description's Verification section says golangci-lint run ./... passes, which is not true of this head.
  • [minor] PR description: the "silent where it has no remedy to ask for" list and the Files section still describe round 1. They don't mention the new silent case (the changelog differs from HEAD's, as an uncommitted fold does), the forecast leaving the check out, or Repo.HeadFile. The README, the register and the .changelog/ note already say it. Bring the description in line when you push the lint fix.
  • [minor] cmd/changelog/main.go:406-409: "differs from HEAD's" is a byte comparison of the working file against the blob. Where git converts line endings on checkout (core.autocrlf=true, or eol=crlf in .gitattributes), the two never match, and the check is silent for good in that checkout. This doesn't affect this repository or its Linux CI. A sentence in nextTagDay's comment would be enough, no code change needed.

Verified

  • Read work bead changelog-o91 (description and round-1 note), the PR description, round 1's review (229), main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main), the rework diff 52e5abc..3584ae4, and every non-test source change of the whole 888-line diff (pkg/git, pkg/changelog, cmd/changelog, actions/validate/action.yaml, .changelog/).
  • The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports mergeable.
  • Head checks: CI / test success, CI / lint failure. The job log shows the gocognit error above as the only issue. The job's changelog validation step gives valid=true.
  • Ran on the merged tree with the city's variables removed (proved: 0): go build ./..., go vet ./..., go test ./... and go test -race ./..., all ok. golangci-lint run ./... (v2.15.0, as CI pins): 1 issue, the gocognit above.
  • Reproductions: built cmd/changelog from this head and from main, and cloned the tree with its lightweight version tags (v2.0.1 is a commit object). Added an empty commit dated 2026-11-11T15:00Z, then:
    1. CI's -changelog CHANGELOG.md -fragments .changelog: head valid=true, the same as main. Round 1's fragments-release error is gone.
    2. changelog release -fragments .changelog -version "" (folds 2.1.0 dated 2026-11-12, not committed), then validate: head valid=true due=true, the same as main. Round 1's refusal is gone.
    3. Committed that fold with a committer date of 2026-11-11: the check fires with due=false and a due-reason naming both days and [2.1.0] - 2026-11-11. Amended to today's committer date: valid=true due=true.
  • New tests TestForecastIsSilentOnTheDayATagWouldCarry (it also checks that the caller's options are left alone) and TestTheDateCheckIsSilentForAChangelogNotYetCommitted cover the two round-1 cases, which settles round 1's minor finding.
Review of 3584ae4d6376e701c94e72d7601f3deb0dbe16f3 for changelog-o91 (round 2). Checks of the head: failure (CI / lint). ### Verdict fail Both blocking findings of round 1 are fixed, and each has a test. The forecast lints the folded release without `NextTagDay`. `nextTagDay` answers "" when the changelog in the working tree differs from HEAD's. I reproduced both again (below) and both now pass. What still blocks is the head's own CI: the lint job fails on the complexity the first fix added to `forecast`. ### Findings - [blocking] cmd/changelog/fragments.go:117: `golangci-lint` fails in CI (job `lint`, run 35) and locally with the same v2.15.0: `cognitive complexity 22 of func forecast is high (> 20) (gocognit)`. The new `if opts.Git != nil { g := *opts.Git; ... }` block at :161-166 sits inside the loop's nesting and pushes `forecast` over the repository's limit. Fix: move the copy into a small helper, e.g. `func withoutNextTagDay(opts changelog.Options) changelog.Options`, and call `changelog.Parse(released).Lint(withoutNextTagDay(opts))`. Then run `golangci-lint run ./...` again. The PR description's Verification section says `golangci-lint run ./...` passes, which is not true of this head. - [minor] PR description: the "silent where it has no remedy to ask for" list and the Files section still describe round 1. They don't mention the new silent case (the changelog differs from HEAD's, as an uncommitted fold does), the forecast leaving the check out, or `Repo.HeadFile`. The README, the register and the `.changelog/` note already say it. Bring the description in line when you push the lint fix. - [minor] cmd/changelog/main.go:406-409: "differs from HEAD's" is a byte comparison of the working file against the blob. Where git converts line endings on checkout (`core.autocrlf=true`, or `eol=crlf` in `.gitattributes`), the two never match, and the check is silent for good in that checkout. This doesn't affect this repository or its Linux CI. A sentence in `nextTagDay`'s comment would be enough, no code change needed. ### Verified - Read work bead changelog-o91 (description and round-1 note), the PR description, round 1's review (229), main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main), the rework diff 52e5abc..3584ae4, and every non-test source change of the whole 888-line diff (`pkg/git`, `pkg/changelog`, `cmd/changelog`, `actions/validate/action.yaml`, `.changelog/`). - The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports `mergeable`. - Head checks: `CI / test` success, `CI / lint` failure. The job log shows the gocognit error above as the only issue. The job's changelog validation step gives `valid=true`. - Ran on the merged tree with the city's variables removed (proved: 0): `go build ./...`, `go vet ./...`, `go test ./...` and `go test -race ./...`, all ok. `golangci-lint run ./...` (v2.15.0, as CI pins): 1 issue, the gocognit above. - Reproductions: built `cmd/changelog` from this head and from main, and cloned the tree with its lightweight version tags (v2.0.1 is a `commit` object). Added an empty commit dated 2026-11-11T15:00Z, then: 1. CI's `-changelog CHANGELOG.md -fragments .changelog`: head `valid=true`, the same as main. Round 1's `fragments-release` error is gone. 2. `changelog release -fragments .changelog -version ""` (folds 2.1.0 dated 2026-11-12, not committed), then validate: head `valid=true due=true`, the same as main. Round 1's refusal is gone. 3. Committed that fold with a committer date of 2026-11-11: the check fires with `due=false` and a due-reason naming both days and `[2.1.0] - 2026-11-11`. Amended to today's committer date: `valid=true due=true`. - New tests `TestForecastIsSilentOnTheDayATagWouldCarry` (it also checks that the caller's options are left alone) and `TestTheDateCheckIsSilentForAChangelogNotYetCommitted` cover the two round-1 cases, which settles round 1's minor finding.
fix: move the forecast's NextTagDay copy into a helper (changelog-o91)
All checks were successful
CI / test (pull_request) Successful in 19s
CI / lint (pull_request) Successful in 26s
bc5476e82e
Round 2 of the review: golangci-lint fails on the head with gocognit, cognitive complexity 22 of forecast against a limit of 20, because the copy of opts.Git that clears NextTagDay sat inside forecast's nesting.

The copy is now withoutNextTagDay, a small helper that returns opts with a copy of Git whose NextTagDay is empty and leaves the caller's options alone, as before. Behaviour is unchanged. nextTagDay's comment now says that the working file is compared to HEAD's blob byte for byte, so that where git converts line endings on checkout the check stays silent, the second minor finding of the review.

Validation: gofmt, go build, go vet, go test ./... and golangci-lint run ./... (v2.15.0, as CI pins) pass, with 0 issues; gen-readme leaves README.md unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review left a comment

Review of bc5476e82e for changelog-o91 (round 3). Checks of the head: success.

Verdict

pass

The three findings of round 2 are settled. forecast calls withoutNextTagDay(opts) (cmd/changelog/fragments.go:158, :171), and golangci-lint is clean. The PR description now covers the HEAD-file silence, Repo.HeadFile, the forecast and the line-ending caveat. nextTagDay's comment states the byte-comparison caveat (cmd/changelog/main.go:393-396). The rest of the change is what rounds 1 and 2 reproduced, and it still behaves that way (below).

Findings

None that block, and no minor ones worth a round.

Verified

  • Read work bead changelog-o91 (description and both rework notes), the PR description, reviews 229 and 233, main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main), the rework diff 3584ae4..bc5476e, and the whole 903-line diff against main.
  • The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports mergeable.
  • Head checks: CI / test and CI / lint both succeeded (lint runs golangci-lint, govulncheck, actionlint and the changelog validation).
  • Ran on the merged tree with the city's variables removed (proved: 0): go build ./..., go vet ./..., go test ./..., go test -race ./..., all ok. gofmt -l . is empty. golangci-lint run ./... (v2.15.0, as CI pins) reports 0 issues. go run ./cmd/gen-readme leaves README.md unchanged. CI's changelog -changelog CHANGELOG.md -fragments .changelog -base main gives exit 0. I could not run govulncheck and actionlint here because there is no module proxy, so for those two I rely on the head's green lint job.
  • End to end with a binary built from this head, on a scratch clone with the lightweight version tags (v2.0.1 is a commit object):
    1. A release branch committing 2.1.0 on the day its heading names: no pending-date-mismatch, due=true.
    2. That branch merged by a merge commit a day later: pending-date-mismatch at error, due=false, and due-reason names both days and [2.1.0] - <merge day>. This is the bead's case.
    3. Fold uncommitted on a HEAD of another day, which is the release workflow's order: silent, due=true.
    4. Release committed at 23:30-07:00, which is the next day in UTC, with the entry on the commit's own day: silent, so the offset is honoured.
    5. Repair: a commit changing the heading to the merge day, made that day: silent, due=true, as the PR description's recovery path says.
      (The scratch dates were later than today, so date-future also fired in 3-5. That is unrelated to this change.)
  • The bead's list is covered: the check in the register, the README table (generated) and prose, due/due-reason in actions/validate/action.yaml, .changelog/pending-date-mismatch.md, tests for both drift directions in UTC, -07:00 and +09:00, the silent cases (annotated, no version tag, tagged, frozen, undated, unreadable history, pre-release unless admitted, uncommitted changelog), and NextDay sharing commitTime with TagDay, held equal by TestNextDayIsTheDayALightweightTagOnHeadWouldCarry.
Review of bc5476e82e4afd91a52fe71b8c33b3d04dee9c90 for changelog-o91 (round 3). Checks of the head: success. ### Verdict pass The three findings of round 2 are settled. `forecast` calls `withoutNextTagDay(opts)` (cmd/changelog/fragments.go:158, :171), and `golangci-lint` is clean. The PR description now covers the HEAD-file silence, `Repo.HeadFile`, the forecast and the line-ending caveat. `nextTagDay`'s comment states the byte-comparison caveat (cmd/changelog/main.go:393-396). The rest of the change is what rounds 1 and 2 reproduced, and it still behaves that way (below). ### Findings None that block, and no minor ones worth a round. ### Verified - Read work bead changelog-o91 (description and both rework notes), the PR description, reviews 229 and 233, main's README (no REVIEW.md, AGENTS.md or CLAUDE.md on main), the rework diff 3584ae4..bc5476e, and the whole 903-line diff against main. - The head fast-forwards onto origin/main c19d67d, with no conflict. Forge reports `mergeable`. - Head checks: `CI / test` and `CI / lint` both succeeded (lint runs golangci-lint, govulncheck, actionlint and the changelog validation). - Ran on the merged tree with the city's variables removed (proved: 0): `go build ./...`, `go vet ./...`, `go test ./...`, `go test -race ./...`, all ok. `gofmt -l .` is empty. `golangci-lint run ./...` (v2.15.0, as CI pins) reports 0 issues. `go run ./cmd/gen-readme` leaves README.md unchanged. CI's `changelog -changelog CHANGELOG.md -fragments .changelog -base main` gives exit 0. I could not run govulncheck and actionlint here because there is no module proxy, so for those two I rely on the head's green lint job. - End to end with a binary built from this head, on a scratch clone with the lightweight version tags (v2.0.1 is a `commit` object): 1. A release branch committing 2.1.0 on the day its heading names: no `pending-date-mismatch`, `due=true`. 2. That branch merged by a merge commit a day later: `pending-date-mismatch` at error, `due=false`, and `due-reason` names both days and `[2.1.0] - <merge day>`. This is the bead's case. 3. Fold uncommitted on a HEAD of another day, which is the release workflow's order: silent, `due=true`. 4. Release committed at 23:30-07:00, which is the next day in UTC, with the entry on the commit's own day: silent, so the offset is honoured. 5. Repair: a commit changing the heading to the merge day, made that day: silent, `due=true`, as the PR description's recovery path says. (The scratch dates were later than today, so `date-future` also fired in 3-5. That is unrelated to this change.) - The bead's list is covered: the check in the register, the README table (generated) and prose, `due`/`due-reason` in actions/validate/action.yaml, `.changelog/pending-date-mismatch.md`, tests for both drift directions in UTC, -07:00 and +09:00, the silent cases (annotated, no version tag, tagged, frozen, undated, unreadable history, pre-release unless admitted, uncommitted changelog), and `NextDay` sharing `commitTime` with `TagDay`, held equal by `TestNextDayIsTheDayALightweightTagOnHeadWouldCarry`.
Sign in to join this conversation.
No description provided.