Skip to content

feat(CC-425): gate --head <ref> for fixed base..head ref diffs#355

Merged
screenleon merged 4 commits into
mainfrom
feat/CC-425
Jul 2, 2026
Merged

feat(CC-425): gate --head <ref> for fixed base..head ref diffs#355
screenleon merged 4 commits into
mainfrom
feat/CC-425

Conversation

@screenleon

Copy link
Copy Markdown
Owner

Summary

  • pr-gate.sh gains --head <ref> to diff a fixed base..head ref pair (branch/tag/commit) with no PR and no working tree involved — review a branch before opening a PR, or diff v0.6.0..v0.7.0 tag-to-tag.
  • Rejects --allow-dirty as incompatible (it folds local uncommitted state into scope, which a fixed ref pair never touches).
  • Both pmctl gate run routes (foreground and --lifecycle detached) already transparently forward unrecognized flags, so no changes needed there.
  • Audit during implementation found the ticket's other stated problem (gate result keyed by PR#) already resolved by the CC-423 detached-lifecycle refactor (gate_id-keyed run dirs); narrowed scope to --head alone.

Test plan

  • scripts/test-pr-gate.sh — 122 passed (3 new: fixed-ref diff, invalid head ref, --head+--allow-dirty conflict)
  • scripts/test-gate-lifecycle.sh — 12 passed, no regression
  • scripts/test-pmctl-gate.sh — 17 passed, no regression
  • scripts/test-pr-gate-profile.sh — 13 passed, no regression
  • shellcheck scripts/pr-gate.sh — no new findings
  • pmctl backlog lint — clean

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

screenleon and others added 4 commits July 2, 2026 09:44
pmctl gate run / pr-gate.sh can now diff a fixed base..head ref pair
(branch, tag, or commit) with no PR and no working tree involved --
review a branch before opening a PR, or diff v0.6.0..v0.7.0 tag-to-tag.
Rejects --allow-dirty as incompatible since it exists to fold local
uncommitted state into scope, which a fixed ref pair never touches.

Both pmctl gate run routes (foreground exec and --lifecycle detached
via gate-supervisor.sh's -- passthrough) forward --head unchanged since
neither special-cases it -- unrecognized flags already pass through.

Repo audit during implementation found the ticket's other stated
problem (gate result keyed by PR#) already resolved by the CC-423
detached-lifecycle refactor (gate_id-keyed run dirs) and the
timestamp-based --output default -- narrowing this ticket's actual
scope to --head alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Guard bare `--head` operand with a controlled error instead of a raw
  `unbound variable` crash under set -u (mirrors --override-file).
- Clarify --head uses the same merge-base (three-dot) semantics as the
  existing --base path in --help, code comments, BACKLOG, and CHANGELOG --
  the prior wording ("diff base..head") read as a literal two-dot tree
  diff, which is not what the implementation does.
- Add test_head_override_merge_base_semantics: a diverged base/head
  topology (main and feature each gain independent commits) proving
  three-dot semantics -- base's own progress does not leak into the diff.
- Add test_head_override_missing_operand for the new guard.
- Fix the stale MILESTONES.md Phase 2 note that still described CC-425
  as needing pre-implementation design work, contradicting the done row
  immediately above it.

scripts/test-pr-gate.sh: 124 passed, 0 failed (was 122; +2 new).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
qa-tester block (round 2 NO-GO): the five new --head test functions used
prose comments but skipped this file's existing docstring convention
(one-line behavior statement + numbered "# Steps:" list, e.g.
test_artifact_filter_drops_gate_artifacts). No behavioral change --
critic and architecture-reviewer already approved this round.

scripts/test-pr-gate.sh: 124 passed, 0 failed (unchanged count).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@screenleon screenleon merged commit ddd47c0 into main Jul 2, 2026
45 checks passed
@screenleon screenleon deleted the feat/CC-425 branch July 2, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant