feat(CC-425): gate --head <ref> for fixed base..head ref diffs#355
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pr-gate.shgains--head <ref>to diff a fixedbase..headref pair (branch/tag/commit) with no PR and no working tree involved — review a branch before opening a PR, or diffv0.6.0..v0.7.0tag-to-tag.--allow-dirtyas incompatible (it folds local uncommitted state into scope, which a fixed ref pair never touches).pmctl gate runroutes (foreground and--lifecycle detached) already transparently forward unrecognized flags, so no changes needed there.--headalone.Test plan
scripts/test-pr-gate.sh— 122 passed (3 new: fixed-ref diff, invalid head ref,--head+--allow-dirtyconflict)scripts/test-gate-lifecycle.sh— 12 passed, no regressionscripts/test-pmctl-gate.sh— 17 passed, no regressionscripts/test-pr-gate-profile.sh— 13 passed, no regressionshellcheck scripts/pr-gate.sh— no new findingspmctl backlog lint— cleanCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com