feat: derive the release bump from conventional commit subjects

The bump was decided by `[major]` / `[minor]` markers alone, so a range of
ordinary `fix:` commits and a range of `feat:` commits released the same way,
and the version number said nothing about what changed.

Read the intent from the subject instead, keeping the explicit markers as
overrides for the cases a subject cannot carry:

  `feat` as its own word   minor   0.1.0 -> 0.2.0
  `!:` or BREAKING         major   0.1.0 -> 1.0.0
  anything else            patch   0.1.0 -> 0.1.1

`feat` has to be a word, so "Fix the feature flag leak" is a patch rather than
a minor. Only the subject line is read; the body is not.

Adds `npm run release:notes`, which prints the notes a push would publish, and
AGENTS.md, which states the rules where an agent will read them.
This commit is contained in:
dsh-slopo agent committed 2026-09-26 06:38:08 +01:00
1 parent e0813bcbea
commit ffefc42e01
4 files changed
+160 -24

No files matched your search

+35
View File
@@ -100,6 +100,41 @@ commit "Rewrite everything [major]"
check "major outranks minor" "major" "$(bash "$RELEASE" bump "v0.1.3..HEAD")"
cd /;
echo
echo "the subject decides the bump"
new_repo 0.1.0 >/dev/null
tag v0.1.0
check "prose is a patch" "patch" "$(bash "$RELEASE" bump "v0.1.0..HEAD")"
commit "feat: add the recall index"
check "feat is a minor" "minor" "$(bash "$RELEASE" bump "v0.1.0..HEAD")"
check "so 0.1 -> 0.2" "0.2.0" "$(bash "$RELEASE" next-version "$(bash "$RELEASE" bump "v0.1.0..HEAD")")"
cd /;
new_repo 0.1.0 >/dev/null
tag v0.1.0
commit "feat(scope): add the scope filter"
check "a scoped feat counts" "minor" "$(bash "$RELEASE" bump "v0.1.0..HEAD")"
cd /;
new_repo 0.1.0 >/dev/null
tag v0.1.0
commit "Fix the feature flag leak"
check "feat inside a word is not a feature" "no" "$(bash "$RELEASE" is-feature "Fix the feature flag leak")"
check "so it stays a patch" "patch" "$(bash "$RELEASE" bump "v0.1.0..HEAD")"
cd /;
new_repo 0.1.0 >/dev/null
tag v0.1.0
commit "feat!: move the index to sqlite"
check "a bang is breaking" "yes" "$(bash "$RELEASE" is-breaking "feat!: move the index to sqlite")"
check "so it is a major" "major" "$(bash "$RELEASE" bump "v0.1.0..HEAD")"
check "and 0.1 -> 1.0" "1.0.0" "$(bash "$RELEASE" next-version "$(bash "$RELEASE" bump "v0.1.0..HEAD")")"
NOTES="$(bash "$RELEASE" notes "v0.1.0..HEAD")"
check_contains "breaking gets a section" "### Breaking" "$NOTES"
check_contains "and is listed there" "- move the index to sqlite" "$NOTES"
check_absent "not under Added" "### Added" "$NOTES"
cd /;
echo
echo "skip release"
new_repo 0.1.0 >/dev/null