Honor caller changelog policy in gated sync and closeout

Merged
UN
12d ago
+576-72

Fixes #226

Both reusable workflows appended --no-pending-release to the default changelog:full post-script. The caller's changelog:check used its declared release policy. Both sync CI for pm-brief#224 and closeout CI for pm-context#222 reported tracker_changed. The closeout diff replaced the committed Unreleased heading with the caller's expected 2026.11.16 heading.

After tracker writes, each workflow runs the caller's declared npm script without added arguments and then runs the caller's changelog:check if present. A failed check stops before commit, push, or PR creation. The gated commit contains the tracker changes and regenerated changelog. The privacy gate and default-branch protection stay in place. The README describes when callers can remove their changelog:automation override.

Tagged and untagged caller-policy cases and focused sync and closeout publication tests passed. Typecheck, test typecheck, lint, docstrings, duplication, identity inventory, changelog check, and privacy passed locally. The full affected-file test run is in progress.

PM item pm-github-xcr3

Summary by Sourcery

Honor caller changelog policies in gated sync and closeout workflows before publishing tracker changes.

Bug Fixes:

  • Honor each caller's changelog release policy during gated sync and closeout publication.
  • Prevent publication when the caller changelog check fails or modifies verified tracker or changelog content.

Enhancements:

  • Run caller post-scripts without injected arguments and publish regenerated changelogs with tracker changes while preserving safe no-op behavior.
  • Bind publication to policy-verified content and disable caller Git hooks during the final commit.
  • Document when callers can remove changelog automation wrappers and retain custom policy overrides.

Documentation:

  • Update changelog workflow documentation and release-placement guidance for caller-owned changelog policies.

Tests:

  • Add coverage for caller-policy success and failure, lifecycle-hook mutations, no-op runs, verified commits, and late content changes.

Chores:

  • Record the associated project-management item and history.

Summary by cubic

Honors the caller's declared changelog release policy in gated sync and closeout, fixing the tracker_changed failures reported in #226.

Both reusable workflows now run the caller's post-script without added arguments, then run the caller's changelog:check when publishing tracker changes. The check runs after the changed-path and privacy gate so it sees regenerated output; a failed check stops the run before commit, push, or PR creation, and the regenerated changelog stays in the tracker commit.

Bug fixes

  • Publication is bound to the check via a hash of the tracker scope (index plus raw worktree bytes), so clean filters cannot hide changes.
  • The check is skipped on no-op runs (no staged tracker changes), so those runs can still discard changelog drift and close stale review PRs.
  • Tests verify the final commit tree contains both the tracker changes and the regenerated changelog.
  • The README limits changelog:automation wrapper removal to a wrapper that purely delegates to changelog:full; wrappers adding flags or environment must stay.