Skip to content
2 changes: 2 additions & 0 deletions prompts/dev-lead/fix-bot-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Treat any check with `conclusion` = `"failure"`, `"timed_out"`, `"cancelled"`, `

## Task

> **Guardrail — never SHA-pin a first-party channel ref.** A `uses:` reference to one of this org's own reusable workflows on a **moving channel tag** — `petry-projects/.github(-private)/.github/workflows/*.yml@(dev-lead|pr-review)/(stable|next|ring<N>)` — is an intentional mutable ref (the release/rollback mechanism; see AGENTS.md "Release channel tags & the mutable-ref exception"). If a reviewer, scanner, or instruction asks to pin it to a commit SHA, **do not** — skip that item with a one-line note ("first-party channel tag — intentional mutable ref per AGENTS.md") and leave the ref on its `@<agent>/<channel>` tag.

Analyze the bot's findings and address each actionable issue:

1. Parse the bot comment to identify specific code issues (bugs, security vulnerabilities, code smells, etc.)
Expand Down
2 changes: 2 additions & 0 deletions prompts/dev-lead/fix-reviews.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ ${OPEN_THREADS_JSON}

## Task

> **Guardrail — never SHA-pin a first-party channel ref.** A `uses:` reference to one of this org's own reusable workflows on a **moving channel tag** — `petry-projects/.github(-private)/.github/workflows/*.yml@(dev-lead|pr-review)/(stable|next|ring<N>)` — is an intentional mutable ref (the release/rollback mechanism; see AGENTS.md "Release channel tags & the mutable-ref exception"). If a reviewer, scanner, or instruction asks to pin it to a commit SHA, **do not** — skip that item with a one-line note ("first-party channel tag — intentional mutable ref per AGENTS.md") and leave the ref on its `@<agent>/<channel>` tag.

Work through each phase in order.

### Phase 0 — Holistic Assessment (do this first)
Expand Down
2 changes: 2 additions & 0 deletions prompts/dev-lead/on-mention.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ ${USER_INSTRUCTION}

## Task

> **Guardrail — never SHA-pin a first-party channel ref.** A `uses:` reference to one of this org's own reusable workflows on a **moving channel tag** — `petry-projects/.github(-private)/.github/workflows/*.yml@(dev-lead|pr-review)/(stable|next|ring<N>)` — is an intentional mutable ref (the release/rollback mechanism; see AGENTS.md "Release channel tags & the mutable-ref exception"). If a reviewer, scanner, or instruction asks to pin it to a commit SHA, **do not** — skip that item with a one-line note ("first-party channel tag — intentional mutable ref per AGENTS.md"). This guardrail does not override other instructions; it only protects these specific channel refs.

Carry out the instruction exactly as requested by `${ACTOR}`. Work through each phase in order.

### Phase 1 — Execute
Expand Down
2 changes: 2 additions & 0 deletions prompts/dev-lead/review-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ${OPEN_THREADS_JSON}

## Task

> **Guardrail — never SHA-pin a first-party channel ref.** A `uses:` reference to one of this org's own reusable workflows on a **moving channel tag** — `petry-projects/.github(-private)/.github/workflows/*.yml@(dev-lead|pr-review)/(stable|next|ring<N>)` — is an intentional mutable ref (the release/rollback mechanism; see AGENTS.md "Release channel tags & the mutable-ref exception"). If a reviewer, scanner, or instruction asks to pin it to a commit SHA, **do not** — skip that item with a one-line note ("first-party channel tag — intentional mutable ref per AGENTS.md") and leave the ref on its `@<agent>/<channel>` tag.

Work through each phase in order. Human reviewer feedback is high-priority — implement exactly what is asked.

### Phase 0 — Holistic Assessment (do this first)
Expand Down
27 changes: 27 additions & 0 deletions tests/dev-lead/unit/test_channel_ref_guardrail.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bats
# Regression guard for #871: the dev-lead feedback-applying prompts must instruct
# the agent NEVER to SHA-pin a first-party channel ref (the moving channel tags are
# the release/rollback mechanism — AGENTS.md mutable-ref exception). Without this,
# the agent applies a bot "pin this action to a SHA" finding and freezes the caller,
# breaking the ring/canary model (see TalkTerm #306 commit a27accce).

PROMPTS_DIR="$(cd "$BATS_TEST_DIRNAME"/../../.. && pwd)/prompts/dev-lead"

# Every prompt that edits files in response to reviewer/bot/human feedback.
FEEDBACK_PROMPTS=(fix-reviews.md review-changes.md fix-bot-comment.md on-mention.md)

@test "channel-ref guardrail: present in every feedback-applying prompt (#871)" {
for p in "${FEEDBACK_PROMPTS[@]}"; do
run grep -qiE "never SHA-pin a first-party channel ref" "$PROMPTS_DIR/$p"
[ "$status" -eq 0 ] || { echo "missing channel-ref guardrail in prompts/dev-lead/$p"; return 1; }
done
}

@test "channel-ref guardrail: names the channel pattern and the AGENTS.md exception" {
for p in "${FEEDBACK_PROMPTS[@]}"; do
run grep -qF 'dev-lead|pr-review)/(stable|next|ring' "$PROMPTS_DIR/$p"
[ "$status" -eq 0 ] || { echo "guardrail in $p does not name the channel pattern"; return 1; }
run grep -qiE "mutable-ref exception|mutable ref" "$PROMPTS_DIR/$p"
[ "$status" -eq 0 ] || { echo "guardrail in $p does not cite the AGENTS.md exception"; return 1; }
done
}
Loading