Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions guidelines/version-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,38 @@ For the bump procedure — version-number selection, the commit-message
convention, the rebuild, dependency-report updates, and conflict
resolution — use the [`bump-version`](../skills/bump-version/SKILL.md) skill.

## Commit messages for `version.gradle.kts`

Every commit that touches the root `version.gradle.kts` uses the subject

```text
Bump version -> `<version>`
```

where `<version>` is the value the file declares after the commit. This
applies **even when the edit is syntax-only** and does not change the
version number — for example, migrating a deprecated `by extra(...)`
declaration to `extra.set(...)`. Such a commit repeats the current
version in its subject.

The rationale: GitHub's repository tree view shows, next to each file,
the subject of the last commit that touched it. Keeping the bump-style
subject "afloat" beside `version.gradle.kts` lets anyone read the current
version of `master` straight from the file listing, without opening the
file.

Reviewers — human and agent alike — must **not** report the following as
findings for this file; both are the convention working as intended:

- repeated `Bump version ->` subjects on one branch, when only one of
those commits actually advances the version;
- a subject that "claims" a bump which already happened earlier on the
branch (a syntax-only commit repeating the current version).

An actual over-bump — more than one commit on a branch each *advancing*
the version — remains governed by the one-bump-per-branch rule of the
[`bump-version`](../skills/bump-version/SKILL.md) skill.

## Publishing

The CI server is configured to publish new artifacts from the `master`
Expand Down
43 changes: 32 additions & 11 deletions skills/bump-version/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ Bump progress:

## Commit authorization

**One bump per branch.** A branch carries **at most one** `Bump version ->`
commit relative to base. Do not add another bump just because the branch grew —
even a large commit does not warrant a second bump. The only exceptions are the
sanctioned re-bumps (a published-version collision or reclassification to a
breaking PR) listed under the Idempotency gate below.
**One bump per branch.** A branch carries **at most one** commit that
*advances* the version relative to base. Do not add another bump just because
the branch grew — even a large commit does not warrant a second bump. The only
exceptions are the sanctioned re-bumps (a published-version collision or
reclassification to a breaking PR) listed under the Idempotency gate below.
Note that the `Bump version ->` *subject* is not unique to bump commits: per
the [policy][version-policy], every commit touching `version.gradle.kts` uses
it, including syntax-only edits that leave the version value unchanged.

This skill is authorized to run `git commit` **exactly once** per invocation,
under these constraints:
Expand Down Expand Up @@ -234,6 +237,15 @@ version. No other reason — including a large commit — justifies a second bum
`by extra(...)` → `extra.set(...)` migration from step 2 — both are changes
to `version.gradle.kts` only.

The subject format is not specific to this skill's bump commits: per the
[version policy][version-policy] (§ *Commit messages for
`version.gradle.kts`*), **every** commit touching the root
`version.gradle.kts` uses it — even a syntax-only edit, such as the
`by extra(...)` migration performed alone, which repeats the *unchanged*
current version in the subject. GitHub's tree view shows the last-touching
commit's subject next to each file, so the convention keeps the current
version of `master` readable straight from the file listing.

5. Run the build to verify the bump and regenerate reports:

```bash
Expand Down Expand Up @@ -278,21 +290,30 @@ version. No other reason — including a large commit — justifies a second bum
# branch commits since base — so neither needs a separate `git merge-base`.
git diff --name-only "origin/$BASE...HEAD" -- version.gradle.kts | grep '^version.gradle.kts$'

# Count bump commits on the branch. `|| true` keeps the zero-match case
# Count commits using the bump subject. `|| true` keeps the zero-match case
# (grep exits 1) from aborting under `set -e`.
count="$(git log --format=%s "origin/$BASE..HEAD" | grep -c '^Bump version ->' || true)"
echo "bump commits on branch: $count (expected 1)"
echo "commits using the bump subject: $count"
```

Interpret `count`:

- **1** — expected. The branch carries exactly one bump.
- **0** — the bump commit is missing: this step ran but the Checklist did not
produce a commit. Investigate and report; do not silently proceed.
Comment on lines 299 to 303
- **>1** — over-bumped. Legitimate only after a deliberate sanctioned re-bump
(a published-version collision or a breaking-scope reclassification — see
"Sanctioned re-bumps"); otherwise the idempotency gate was bypassed on an
earlier run. Report it rather than adding yet another bump.
- **>1** — more than one commit uses the bump subject. This alone is *not*
over-bumping: per the [policy][version-policy], a syntax-only edit to
`version.gradle.kts` (e.g. the `by extra(...)` migration on its own) also
uses the `Bump version ->` subject while repeating the current version —
never flag such subject reuse as a finding. Check how many of the counted
Comment on lines +304 to +308

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify advancement when the subject count is one

When a branch's only matching subject belongs to a syntax-only migration—which the new policy explicitly permits—and no commit actually advances the version, count is 1, so the preceding case declares the validation successful; inspection of the version changes occurs only in this >1 branch. This defeats step 7's missing-bump backstop and lets the skill report success until Version Guard fails. Check for an actual versionToPublish advancement whenever the count is nonzero, not only when it exceeds one.

AGENTS.md reference: AGENTS.md:L3-L7

Useful? React with 👍 / 👎.

commits actually *advance* the version value —
`git log -p "origin/$BASE..HEAD" -- version.gradle.kts` shows each
commit's change to the file. Exactly one advancing commit is expected.
More than one advancing commit is over-bumped: legitimate only after a
deliberate sanctioned re-bump (a published-version collision or a
breaking-scope reclassification — see "Sanctioned re-bumps"); otherwise
the idempotency gate was bypassed on an earlier run. Report it rather
than adding yet another bump.

Use the actual merge target for `BASE` when it is not `master`. Also confirm
`git status --short` has no
Expand Down