diff --git a/.github/scripts/integration-governance.cjs b/.github/scripts/integration-governance.cjs index 8cb60d4461..f1521dbb76 100644 --- a/.github/scripts/integration-governance.cjs +++ b/.github/scripts/integration-governance.cjs @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000; const MAX_AUTHOR_BATCH = 50; // This literal is inside the enrolled .github closure. A caller-supplied // preparedBy.sourceSHA must never choose a new executable verifier tree. -const TRUSTED_SCRIPTS_TREE = '630082873462479b5777ebc7d5dc255bae6f8df2'; +const TRUSTED_SCRIPTS_TREE = 'b60380f8d0040628eba73ad17c108b1be87c7fdd'; const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4'; const sha = value => crypto.createHash('sha256').update(value).digest('hex'); const git = (args, cwd = process.cwd()) => diff --git a/AGENTS.md b/AGENTS.md index d779d8f607..ea14d18778 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ These rules apply to every AI agent (hive agents, Copilot CLI, Claude Code, Code - Keep changes surgical and PR-sized; one concern per PR. - Sign commits (`git commit -s`); PR titles start with an emoji (`✨` feature, `🐛` fix, `📖` docs or proposal, `🌱` chore, `⚠️` breaking); `📝` fails the PR Type gate. -- Every PR with a user-visible `src/` code change needs a `changelog.d/-.md` fragment at the repository root whose body is a single `- ` bullet. +- Every PR with a user-visible `src/` code change needs a `changelog.d/-.md` fragment at the repository root whose body is a single `- ` bullet. From inside `src/` (the Go module) that path is `../changelog.d/`; anything written to `src/changelog.d/` is never compiled into `CHANGELOG.md`, fails the guard, and fails the release (#18264). - Do not hand-edit `src/docs` file:line citations; when CI's citation guard reports drift, run `python3 src/scripts/check-docs-citations.py --fix`. ## Project knowledge is scoped, not global diff --git a/changelog.d/README.md b/changelog.d/README.md index 01e1f28adf..1a91e00bbe 100644 --- a/changelog.d/README.md +++ b/changelog.d/README.md @@ -12,7 +12,9 @@ deleting the fragments in the same release commit. - **Location:** this directory, at the repository root. Never `src/changelog.d/`: the compiler does not read it, and the guard rejects fragments there with - the `git mv` that fixes it (#11919). + the `git mv` that fixes it (#11919). When working from `src/`, write + `../changelog.d/.md`. If a stray ever slips past the guard, the release + compile fails until it is moved here (#18264). - **Filename:** `-.md`, where `` is one of `added`, `changed`, `deprecated`, `fixed`, `security` — it picks the `###` diff --git a/src/changelog.d/added-activity-monitor-accept-triage.md b/changelog.d/added-activity-monitor-accept-triage.md similarity index 100% rename from src/changelog.d/added-activity-monitor-accept-triage.md rename to changelog.d/added-activity-monitor-accept-triage.md diff --git a/src/changelog.d/added-live-run-line.md b/changelog.d/added-live-run-line.md similarity index 100% rename from src/changelog.d/added-live-run-line.md rename to changelog.d/added-live-run-line.md diff --git a/src/changelog.d/added-merge-issue-author-credit.md b/changelog.d/added-merge-issue-author-credit.md similarity index 100% rename from src/changelog.d/added-merge-issue-author-credit.md rename to changelog.d/added-merge-issue-author-credit.md diff --git a/src/changelog.d/added-tracker-sentinel-lane-text.md b/changelog.d/added-tracker-sentinel-lane-text.md similarity index 100% rename from src/changelog.d/added-tracker-sentinel-lane-text.md rename to changelog.d/added-tracker-sentinel-lane-text.md diff --git a/src/changelog.d/changed-crux-cmd-hive-runtime-seam.md b/changelog.d/changed-crux-cmd-hive-runtime-seam.md similarity index 100% rename from src/changelog.d/changed-crux-cmd-hive-runtime-seam.md rename to changelog.d/changed-crux-cmd-hive-runtime-seam.md diff --git a/src/changelog.d/changed-crux-runtime-seam.md b/changelog.d/changed-crux-runtime-seam.md similarity index 100% rename from src/changelog.d/changed-crux-runtime-seam.md rename to changelog.d/changed-crux-runtime-seam.md diff --git a/src/changelog.d/changed-reviewer-l3-l4-packs.md b/changelog.d/changed-reviewer-l3-l4-packs.md similarity index 100% rename from src/changelog.d/changed-reviewer-l3-l4-packs.md rename to changelog.d/changed-reviewer-l3-l4-packs.md diff --git a/src/changelog.d/fixed-13817-watchdog-producing-cadence.md b/changelog.d/fixed-13817-watchdog-producing-cadence.md similarity index 100% rename from src/changelog.d/fixed-13817-watchdog-producing-cadence.md rename to changelog.d/fixed-13817-watchdog-producing-cadence.md diff --git a/src/changelog.d/fixed-13818-ci-gate-held-twin-runs.md b/changelog.d/fixed-13818-ci-gate-held-twin-runs.md similarity index 100% rename from src/changelog.d/fixed-13818-ci-gate-held-twin-runs.md rename to changelog.d/fixed-13818-ci-gate-held-twin-runs.md diff --git a/changelog.d/fixed-18264-stranded-fragments.md b/changelog.d/fixed-18264-stranded-fragments.md new file mode 100644 index 0000000000..18fb3a16e0 --- /dev/null +++ b/changelog.d/fixed-18264-stranded-fragments.md @@ -0,0 +1 @@ +- Release: 14 changelog entries from late-October PRs (#13280, #13486, #13609, #13758, #13760, #13805, #13807, #13821, #13822, #14208, #14220, #14322, #14580, #14585) were written to `src/changelog.d/`, which the release compiler never reads, so they shipped without release notes; they are moved to the repo-root `changelog.d/` and land in this release. The release compile now fails loudly while any fragment sits under `src/changelog.d/`, so a stray can no longer disappear silently ([#18264](https://github.com/hivecommons/hive/issues/18264)). diff --git a/src/changelog.d/fixed-adopted-pr-rebase.md b/changelog.d/fixed-adopted-pr-rebase.md similarity index 100% rename from src/changelog.d/fixed-adopted-pr-rebase.md rename to changelog.d/fixed-adopted-pr-rebase.md diff --git a/src/changelog.d/fixed-contributor-claim-starvation.md b/changelog.d/fixed-contributor-claim-starvation.md similarity index 100% rename from src/changelog.d/fixed-contributor-claim-starvation.md rename to changelog.d/fixed-contributor-claim-starvation.md diff --git a/src/changelog.d/fixed-cost-per-agent-copilot-sessions.md b/changelog.d/fixed-cost-per-agent-copilot-sessions.md similarity index 100% rename from src/changelog.d/fixed-cost-per-agent-copilot-sessions.md rename to changelog.d/fixed-cost-per-agent-copilot-sessions.md diff --git a/changelog.d/fixed-supersession-sweep-stage-machine.md b/changelog.d/fixed-supersession-sweep-stage-machine.md new file mode 100644 index 0000000000..2a823f2fc6 --- /dev/null +++ b/changelog.d/fixed-supersession-sweep-stage-machine.md @@ -0,0 +1 @@ +- Supersession sweep: escalation now goes through the stage engine (`needs-human` + `Parked` fact → `stage/085-needs-decision` in the same pass) instead of a bare `needs-human` beside an active lane stage, and a hive-authored PR at L6 whose claimed issue another merged PR closed but which touches files that PR did not is resolved by the hive itself — update-branch onto base, re-measure, rewrite `Closes #N` to `Refs #N (closed by #M; …)` and continue, or self-close when nothing meaningful remains — rather than handed to a person. diff --git a/src/changelog.d/fixed-upgrade-drain-visible-to-hub.md b/changelog.d/fixed-upgrade-drain-visible-to-hub.md similarity index 100% rename from src/changelog.d/fixed-upgrade-drain-visible-to-hub.md rename to changelog.d/fixed-upgrade-drain-visible-to-hub.md diff --git a/src/changelog.d/README.md b/src/changelog.d/README.md index 7e78f4616d..dd881a83ef 100644 --- a/src/changelog.d/README.md +++ b/src/changelog.d/README.md @@ -3,7 +3,9 @@ Changelog fragments go in [`changelog.d/`](../../changelog.d/README.md) at the **repository root**, not here under `src/`. `src/scripts/compile-changelog.sh` only reads the root directory, so a fragment placed here is never compiled into -`CHANGELOG.md`, and the `changelog-fragment-guard` check rejects it (#11919). +`CHANGELOG.md`, the `changelog-fragment-guard` check rejects it (#11919), and +`compile-changelog.sh` refuses to cut a release while one sits here (#18264). +From inside `src/`, the right path is `../changelog.d/`. Name the file `changelog.d/-.md` and make its content a single `- ` bullet. If you already added one here, move it: diff --git a/src/changelog.d/fixed-supersession-sweep-stage-machine.md b/src/changelog.d/fixed-supersession-sweep-stage-machine.md deleted file mode 100644 index d65c1a538a..0000000000 --- a/src/changelog.d/fixed-supersession-sweep-stage-machine.md +++ /dev/null @@ -1 +0,0 @@ -Supersession sweep: escalation now goes through the stage engine (`needs-human` + `Parked` fact → `stage/085-needs-decision` in the same pass) instead of a bare `needs-human` beside an active lane stage, and a hive-authored PR at L6 whose claimed issue another merged PR closed but which touches files that PR did not is resolved by the hive itself — update-branch onto base, re-measure, rewrite `Closes #N` to `Refs #N (closed by #M; …)` and continue, or self-close when nothing meaningful remains — rather than handed to a person. diff --git a/src/docs/knowledge/changelog-fragment-exemptions.md b/src/docs/knowledge/changelog-fragment-exemptions.md index 0ee32a6335..1a1e4f7845 100644 --- a/src/docs/knowledge/changelog-fragment-exemptions.md +++ b/src/docs/knowledge/changelog-fragment-exemptions.md @@ -24,4 +24,4 @@ Exempt automatically — no fragment and no label needed: Other test-adjacent changes (`testdata/` fixtures, non-`_test.go` test helpers) and non-user-visible `src/` code changes (refactors, dependency bumps) need the `no-changelog` label instead of a fragment. -`changelog.d/` is at the repository root, not under `src/` — `src/changelog.d/` is never compiled and the guard rejects it. +`changelog.d/` is at the repository root, not under `src/` — `src/changelog.d/` is never compiled, the guard rejects it, and the release compile fails while any fragment sits there (#18264). From inside `src/`, write `../changelog.d/`. diff --git a/src/scripts/compile-changelog.sh b/src/scripts/compile-changelog.sh index da089b4a46..58097de06b 100755 --- a/src/scripts/compile-changelog.sh +++ b/src/scripts/compile-changelog.sh @@ -43,6 +43,10 @@ # release, so one such fragment silently freezes every later merge. # - Each fragment is deleted after a successful compile, so `git add -A # changelog.d` in the release commit records the consumption. +# - Any fragment (other than README.md) under src/changelog.d/ next to the +# changelog is a LOUD failure before anything else runs: that directory +# is never compiled, so its entries would otherwise be lost (#18264). +# Override the checked path with STRANDED_FRAGDIR. # # Usage: src/scripts/compile-changelog.sh [changelog-path] [fragments-dir] # changelog-path default CHANGELOG.md @@ -76,6 +80,30 @@ if [[ ! -f "$CHANGELOG" ]]; then exit 1 fi +# Release-time backstop for misplaced fragments (#11919, #18264). Only the +# repo-root changelog.d/ is compiled; a fragment under src/changelog.d/ is +# never read, so its entry silently never reaches CHANGELOG.md. The PR guard +# rejects such fragments, but twice PRs merged with it red (161 strays cleaned +# by #11928, 14 more on v5 and 81 on v6 by #18264). Fail loudly here, before +# the no-op exits below, so a stray shows up as a red release job on the very +# next merge instead of disappearing for weeks. The directory is resolved next +# to the changelog so fixture runs in a temp dir never see the real repo. +STRANDED_FRAGDIR="${STRANDED_FRAGDIR:-$(dirname -- "$CHANGELOG")/src/changelog.d}" +if [[ -d "$STRANDED_FRAGDIR" ]]; then + stranded=0 + shopt -s nullglob + for f in "$STRANDED_FRAGDIR"/*.md; do + [[ "$(basename "$f")" == "README.md" ]] && continue + echo "::error file=${f}::fragment is under src/changelog.d/, which is never compiled — run: git mv ${f} ${FRAGDIR}/$(basename "$f")" >&2 + stranded=1 + done + shopt -u nullglob + if [[ "$stranded" -ne 0 ]]; then + echo "::error::refusing to compile while fragments sit in ${STRANDED_FRAGDIR}/ — move them to ${FRAGDIR}/ (see ${FRAGDIR}/README.md)." >&2 + exit 1 + fi +fi + if [[ ! -d "$FRAGDIR" ]]; then echo "No ${FRAGDIR}/ directory — nothing to compile." exit 0 diff --git a/src/scripts/test-compile-changelog.sh b/src/scripts/test-compile-changelog.sh index 80ac652ffb..28205e8e10 100755 --- a/src/scripts/test-compile-changelog.sh +++ b/src/scripts/test-compile-changelog.sh @@ -19,6 +19,8 @@ # would change the derived semver bump); # - the compiled result is exactly what derive-release-version.sh needs: # an added- fragment flips an empty Unreleased to a minor release. +# - a fragment stranded under src/changelog.d/ (never compiled) fails the +# compile loudly, and the repository itself carries none (#18264); # - the release move targets the real `## Unreleased` heading line, not a # prose/backtick mention that appears before it. # @@ -206,6 +208,52 @@ else fi fi +# --------------------------------------------------------------------------- +# Case 5d: a fragment stranded under src/changelog.d/ fails the compile +# (#18264). That directory is never compiled, so 14 v5 and 81 v6 entries sat +# there unreleased; the release job must go red instead of shipping without +# them. This holds even with no root fragments at all (the stray alone must +# not look like a no-op), and README.md there is the pointer, not a fragment. +# --------------------------------------------------------------------------- +dir=$(new_case 5d) +mkdir -p "$dir/src/changelog.d" +printf -- 'pointer to the real directory\n' > "$dir/src/changelog.d/README.md" +cp "$dir/CHANGELOG.md" "$tmp/case5d.before" +if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d-readme.out" 2>&1; then + note_ok "a README.md alone under src/changelog.d/ is not a stranded fragment" +else + note_fail "README.md under src/changelog.d/ must not fail the compile: $(cat "$tmp/case5d-readme.out")" +fi +printf -- '- a stranded fix ([#14](https://example.invalid/14)).\n' > "$dir/src/changelog.d/fixed-14-stranded.md" +if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d.out" 2>&1; then + note_fail "a fragment under src/changelog.d/ must fail the compile even with no root fragments" +else + if grep -q 'src/changelog.d/fixed-14-stranded.md' "$tmp/case5d.out" \ + && cmp -s "$dir/CHANGELOG.md" "$tmp/case5d.before" \ + && [[ -f "$dir/src/changelog.d/fixed-14-stranded.md" ]]; then + note_ok "a stranded src/changelog.d/ fragment fails loudly, naming the file, with CHANGELOG.md untouched" + else + note_fail "stranded-fragment failure must name the file and leave everything untouched: $(cat "$tmp/case5d.out")" + fi +fi +printf -- '- a real fix ([#15](https://example.invalid/15)).\n' > "$dir/changelog.d/fixed-15-real.md" +if ( cd "$dir" && bash "$compile" CHANGELOG.md changelog.d ) > "$tmp/case5d-mixed.out" 2>&1; then + note_fail "a stranded fragment must fail the compile even beside valid root fragments" +elif [[ -f "$dir/changelog.d/fixed-15-real.md" ]] && cmp -s "$dir/CHANGELOG.md" "$tmp/case5d.before"; then + note_ok "a stranded fragment blocks the compile before any root fragment is consumed" +else + note_fail "a stranded fragment must leave root fragments and CHANGELOG.md untouched" +fi + +# The repository itself must carry no stranded fragments: the live +# src/changelog.d/ holds only its README pointer (#18264). +repo_stranded=$(find "$script_dir/../changelog.d" -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null | sort) +if [[ -z "$repo_stranded" ]]; then + note_ok "the repository has no fragments under src/changelog.d/" +else + note_fail "fragments under src/changelog.d/ are never compiled; git mv them to the repo-root changelog.d/: $(echo "$repo_stranded" | tr '\n' ' ')" +fi + dir=$(new_case 5c) git init -q "$dir" git -C "$dir" config user.email test@example.com