Skip to content

fix(dev-lead): never SHA-pin first-party channel refs when applying feedback (#871) - #880

Merged
don-petry merged 8 commits into
mainfrom
claude/dev-lead-no-shapin-channel-refs
Jun 21, 2026
Merged

don-petry merged 8 commits into
mainfrom
claude/dev-lead-no-shapin-channel-refs

Conversation

@don-petry

@don-petry don-petry commented Jun 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the systemic conflict found during the v1.4.0 canary: the dev-lead agent SHA-pins first-party channel refs while applying a reviewer/scanner "pin this action" finding, freezing the caller and breaking the ring/canary model.

Root cause: dev-lead-fix-reviews.sh:627 ("apply manual instructions" — on-mention/review-changes) and the feedback prompts had no exception for first-party channel tags. On TalkTerm #306 (commit a27accce) the agent rewrote @dev-lead/ring1 → @<sha> # dev-lead/ring1, contradicting both the ring model (#499/#500/#501) and check_dev_lead_stub's channel-only rule (#503).

Fix: add a guardrail to the four feedback-applying prompts (fix-reviews, review-changes, fix-bot-comment, on-mention): refs on @(dev-lead|pr-review)/(stable|next|ring<N>) are intentional mutable channel tags (AGENTS.md mutable-ref exception) and must never be SHA-pinned, even when a reviewer asks — skip that finding with a one-line note. Plus a regression test.

Defense in depth: check_dev_lead_stub (#503) already rejects a SHA-pinned stub, so a slip is caught; this prevents it at the source.

Rollout note: takes effect for live agents once promoted to dev-lead/stable. The open re-pin PRs (TalkTerm #308, bmad-bgreat-suite #334) carry dev-lead:hands-off as the stopgap until then.

Closes #871. Refs #499, #500, #503.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added guardrail instructions to agent prompts preventing SHA-pinning of first-party reusable workflow references when using mutable channel tags, ensuring these references remain on their intended moving tags.
  • Tests

    • Added regression tests to validate guardrail compliance across feedback-applying prompts.

…eedback (#871)

The agent, while applying a reviewer/scanner "pin this action to a SHA" finding
(fix-reviews / fix-bot-comment / on-mention / review-changes), rewrote a caller
stub's moving channel ref `@dev-lead/ring1` → `@<sha>` (TalkTerm #306 commit
a27accce). That freezes the caller, defeating the ring/canary model (#499/#500/#501)
and contradicting check_dev_lead_stub's channel-only rule (#503).

Add a guardrail to the four feedback-applying prompts: first-party reusable refs on
`@(dev-lead|pr-review)/(stable|next|ring<N>)` are intentional mutable channel tags
(AGENTS.md mutable-ref exception) and must NEVER be SHA-pinned, even when a reviewer
asks. Plus a regression test (tests/dev-lead/unit/test_channel_ref_guardrail.bats).

Note: takes effect for live agents once promoted to dev-lead/stable; the open re-pin
PRs (TalkTerm #308, bmad-bgreat-suite #334) carry dev-lead:hands-off until then.

Closes #871. Refs #499, #500, #503.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner June 21, 2026 13:09
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 809230c4-400b-447f-b36e-52a0d4ceca71

📥 Commits

Reviewing files that changed from the base of the PR and between 42913ab and dc2427f.

📒 Files selected for processing (5)
  • prompts/dev-lead/fix-bot-comment.md
  • prompts/dev-lead/fix-reviews.md
  • prompts/dev-lead/on-mention.md
  • prompts/dev-lead/review-changes.md
  • tests/dev-lead/unit/test_channel_ref_guardrail.bats

📝 Walkthrough

Walkthrough

Adds a two-line "Guardrail" directive to four dev-lead agent prompt files (fix-bot-comment.md, fix-reviews.md, on-mention.md, review-changes.md) instructing the agent to skip SHA-pinning of first-party reusable workflow uses: refs on mutable channel tags. A new Bats test file enforces the presence of this guardrail text in all relevant prompts.

Changes

Dev-lead channel ref SHA-pin guardrail

Layer / File(s) Summary
Guardrail added to all four dev-lead prompts
prompts/dev-lead/fix-reviews.md, prompts/dev-lead/fix-bot-comment.md, prompts/dev-lead/on-mention.md, prompts/dev-lead/review-changes.md
Each prompt's Task section receives a new Guardrail instruction: skip any request to SHA-pin a first-party reusable workflow ref using a mutable channel tag (dev-lead|pr-review)/(stable|next|ring<N>), leave the ref on its @<agent>/<channel> tag, and add a one-line note referencing the mutable-ref exception.
Bats regression test
tests/dev-lead/unit/test_channel_ref_guardrail.bats
New Bats suite (regression #871) iterates over the dev-lead feedback prompts and asserts each contains the no-SHA-pin guardrail text, the expected channel pattern, and the AGENTS.md mutable-ref exception citation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • petry-projects/.github-private#509 — Documents the mutable channel tag SHA-pinning exception in AGENTS.md; this PR enforces that same contract in dev-lead prompts and tests.

Suggested labels

documentation

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a guardrail to prevent SHA-pinning of first-party channel references in the dev-lead agent. It is concise, directly related to the changeset, and references the issue number.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/dev-lead-no-shapin-channel-refs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 13:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a guardrail instruction across several dev-lead prompt files to prevent SHA-pinning first-party channel references, ensuring the release/rollback mechanism is preserved. It also adds a BATS unit test suite to verify the presence and correct format of this guardrail. The reviewer suggests using the built-in BATS_TEST_DIRNAME variable in the test script to avoid an unnecessary subshell call.

Comment thread tests/dev-lead/unit/test_channel_ref_guardrail.bats Outdated
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T14:11:09Z.

@don-petry
don-petry disabled auto-merge June 21, 2026 13:11
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 21, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #880
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-21T13:43:25Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-21T13:43:25Z

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 13:13
@don-petry
don-petry disabled auto-merge June 21, 2026 13:14
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Tier 1 blockers: 0 (all CI checks passed, no CHANGES_REQUESTED reviews)
Quality gate: PASSED (0 new issues, 0 security hotspots)
Files changed: None required
Skipped (informational): 0
```

@don-petry
don-petry disabled auto-merge June 21, 2026 13:16
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
(no open threads)
Test verification: pass — no changes made this session; working tree is clean
Files changed: none
```

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 13:16
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T14:20:08Z.

@don-petry
don-petry disabled auto-merge June 21, 2026 15:02
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 15:03
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T16:05:50Z.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: f0f111301ef9fa38af96281d56d9d9a9988de85d
Review mode: triage-approved (single reviewer)

Summary

Adds an identical 'never SHA-pin a first-party channel ref' guardrail blockquote to the four dev-lead feedback-applying prompts (fix-reviews, review-changes, fix-bot-comment, on-mention) plus a bats regression test for #871. +35/-0 across 5 files; no executable logic, auth, secrets, or migrations. Verified the cited AGENTS.md section 'Release channel tags & the mutable-ref exception' (line 158) exists and the channel-tag refs (e.g. dev-lead-reusable.yml@dev-lead/stable) are real in the workflows, so the guardrail text is accurate.

Linked issue analysis

Closes #871. The PR directly addresses the root cause: feedback-applying prompts had no exception for first-party moving channel tags, so the agent would SHA-pin them when a scanner/reviewer asked, freezing the caller and breaking the ring/canary model. The guardrail instructs the agent to skip such pin requests with a one-line note, and the regression test asserts the guardrail (and the channel pattern + AGENTS.md citation) is present in all four prompts. Defense-in-depth via check_dev_lead_stub (#503) remains as a backstop.

Findings

No blocking findings. Prompt-text + test only; the guardrail wording matches the real channel-tag pattern and the AGENTS.md mutable-ref exception it cites. CodeRabbit approved; gemini and don-petry left non-blocking comments with no unresolved threads. Secret scanning MCP tool not invoked (gitleaks CI check passed); no secrets present in a docs/test diff.

CI status

All required checks green (Lint, shellcheck/ShellCheck, bats, unit-tests/unit, CodeQL Analyze actions+python, SonarCloud, agent-shield, Agent Security Scan, validate-agent-profiles, prompt-coverage, Secret scan gitleaks, holdout-guard, etc.). dependency-audit ecosystem jobs and ci-relay SKIPPED as expected. mergeStateStatus is BLOCKED only because reviewDecision=REVIEW_REQUIRED — this approving review satisfies that gate.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry disabled auto-merge June 21, 2026 16:18
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #880
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-21T16:49:47Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-21T16:49:47Z

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 16:19
@don-petry
don-petry disabled auto-merge June 21, 2026 16:31
@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 16:31
@don-petry
don-petry disabled auto-merge June 21, 2026 16:34
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
- ✓ 0.0% Coverage on New Code
- ✓ 0.0% Duplication on New Code
**Review State:**
- CodeRabbit approved ✓
- donpetry-bot approved with detailed analysis ✓
- gemini-code-assist and don-petry left non-blocking comments ✓
---
## Summary
**No actionable issues to address.** The SonarCloud Quality Gate has passed with zero new issues and zero security hotspots. There are no Tier 1 blockers (failing CI checks or change requests), and all reviews are either approvals or non-blocking feedback.
The PR is in good standing and ready for merge once remaining CI checks complete.

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 16:34
@don-petry
don-petry disabled auto-merge June 21, 2026 16:40
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: none
Tier 1 blockers: 0
Status: Quality Gate PASSED ✓
```

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 16:40
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit ce51626 into main Jun 21, 2026
36 of 38 checks passed
@don-petry
don-petry deleted the claude/dev-lead-no-shapin-channel-refs branch June 21, 2026 16:41
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T17:47:55Z.

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.

bug(dev-lead): agent SHA-pins first-party channel refs on review, breaking the ring/canary model

2 participants