Skip to content

feat: implement issue #2220 — dev-lead repins its own caller stub to the legacy dev-lead/v1-stable channel to silence template-drift (salvaged checkpoint) - #2238

Merged
don-petry merged 9 commits into
mainfrom
dev-lead/issue-2220-20261010-2339
Oct 11, 2026
Merged

don-petry merged 9 commits into
mainfrom
dev-lead/issue-2220-20261010-2339

Conversation

@don-petry

@don-petry don-petry commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2220

Provenance: salvaged checkpoint, not a finished pass

dev-lead's run on #2220 (38094945253) hit the 45-minute action budget and escalated. Before stopping it pushed its work as one commit, ab82dc92 ("checkpoint(dev-lead): INCOMPLETE — partial work for issue #2220 (stage timeout — unreviewed, do not merge)"). This PR is opened from that branch unchanged, so CI and the normal review passes can finish it in smaller steps. Nothing here has been reviewed yet.

What the checkpoint contains

  • scripts/lib/channel-pin-guard.sh (new): a harness guard that scans a pass's diff and refuses a change to a first-party channel pin on a caller stub (uses: ref or agent_ref), including SHA-pinning or deleting the stub. Restoring the base branch's pin, or adopting a pin the base branch moved to, is allowed.
  • scripts/dev-lead-fix-reviews.sh, scripts/dev-lead-fix-ci.sh: the guard runs before the push for every pushing intent; a refusal stops the pass and escalates.
  • .github/workflows/dev-lead-reusable.yml, scripts/dev-lead-fix-ci.sh, prompts/dev-lead/fix-ci.md: a red template-drift check is no longer relayed and no longer starts a fix-ci pass on its own.
  • scripts/template_stub_drift.sh: a DRIFTED or MISSING row no longer carries a file= anchor on this repo's stub, and says the drift is in petry-projects/repo-template.
  • Tests: tests/dev-lead/unit/test_channel_pin_guard.bats (new, 351 lines) and additions to tests/template_stub_drift.bats.
  • AGENTS.md: the rule in prose.

Against the issue's criteria

Criterion State in this checkpoint
1. dev-lead never edits a caller stub's channel pin (harness, not prompt) Implemented with tests; needs review
2. template-drift is not a fix-ci trigger Implemented with tests; needs review
3. The template stops asking for it Partly: the annotation no longer points at this repo's stub. The standards-baseline side is not addressed here
4. Clean up the affected PRs Not code. PR #2157 and PR #2205 merged with clean stubs and PR #2210's stub was restored before it merged. PR #1796 is still open with the dev-lead/v1-stable repin and must be restored separately
5. Tests Present for criteria 1 and 2

Known before review

Related: #2215 (on hold behind this issue; covers what this does not), #2214, #2185, #2212.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Problem

See the linked issue.

Risk

Medium — changes GitHub Actions workflow behavior, which is exercised only post-merge; verify via the affected workflow runs.

Test plan

Tests added/updated: tests/dev-lead/unit/test_channel_pin_guard.bats,tests/template_stub_drift.bats. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

Watch the affected workflow run(s) in the Actions tab and this PR's Lint check for regressions.

@don-petry
don-petry requested a review from a team as a code owner October 11, 2026 00:27
@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.

@gemini-code-assist

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 473c1764-8a09-4c21-8c9e-510269ba36da

📥 Commits

Reviewing files that changed from the base of the PR and between 684e4b9 and c3a7928.


📒 Files selected for processing (8)
  • .github/workflows/dev-lead-reusable.yml
  • AGENTS.md
  • prompts/dev-lead/fix-ci.md
  • scripts/dev-lead-fix-ci.sh
  • scripts/dev-lead-fix-reviews.sh
  • scripts/lib/channel-pin-guard.sh
  • tests/dev-lead/unit/test_channel_pin_guard.bats
  • tests/dev-lead/unit/test_sync_stub_guard_fix_ci.bats

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

Comment thread scripts/dev-lead-fix-ci.sh Resolved
Comment thread scripts/lib/channel-pin-guard.sh Resolved
@codeant-ai

codeant-ai Bot commented Oct 11, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. When this guard refuses fix-bot-comment or review-changes, their status-4 handlers still report only test or sync-stub refusals, misleading operators about why no push occurred.

Comment mismatch · scripts/dev-lead-fix-reviews.sh:3080-3081

@codeant-ai

codeant-ai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; it prevents unfixable template-drift failures from triggering fix passes and blocks caller-stub channel repins before pushing.
  • Added tests cover pin changes, base-branch updates, guard wiring, and filtering template-drift when other CI failures are present.

Assessed commit: c3a7928f014e

@don-petry
don-petry enabled auto-merge October 11, 2026 00:54
@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-10-11T02:02:02Z.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry
don-petry disabled auto-merge October 11, 2026 01:37
@don-petry
don-petry force-pushed the dev-lead/issue-2220-20261010-2339 branch from f91667c to c188161 Compare October 11, 2026 01:38
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rebase (applied)

Rebase completed and pushed; PR is no longer conflicting.

@don-petry
don-petry enabled auto-merge October 11, 2026 01:38
Comment thread scripts/template_stub_drift.sh Resolved
@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-10-11T02:51:19Z.

@donpetry-bot

Copy link
Copy Markdown
Contributor

No description provided.

@donpetry-bot

Copy link
Copy Markdown
Contributor

No description provided.

@don-petry
don-petry disabled auto-merge October 11, 2026 01:57
@don-petry

Copy link
Copy Markdown
Collaborator Author

This is a rate-limit notice from the bot indicating it has reached its daily quota. No code changes are needed — the bot will resume processing requests after 24 hours.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
The bot comment is a **pure rate-limit notice** — an operational notice with no code findings. The bot has reached its daily quota limit and will resume processing after 24 hours.
**Disposition details:**
- Posted reply explaining this is a non-actionable rate-limit notice
- Marked with `<!-- dev-lead:comment-disposition id=IC_kwDOR9SdIs8AAAABa8_KdA disposition=informational -->`
- The harness will minimize the original comment RESOLVED
**PR state:**
- All critical checks passing (no failures, timeouts, or blockers)
- Two checks still in progress: `bats` and `unit` (no action needed)
- No code changes required
The rate-limit notice is now dispositioned and cleared for the maintainer-comment gate.

@don-petry
don-petry enabled auto-merge October 11, 2026 01:58
@donpetry-bot

Copy link
Copy Markdown
Contributor

No description provided.

@don-petry
don-petry disabled auto-merge October 11, 2026 02:00
@don-petry

Copy link
Copy Markdown
Collaborator Author

Fixed in scripts/dev-lead-fix-reviews.sh: updated the status-4 handler messages for fix-bot-comment and review-changes to include 'channel-pin' guard in the list of possible guard refusals, matching the complete list mentioned in the fix-reviews handler.

@don-petry
don-petry enabled auto-merge October 11, 2026 02:14
@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-10-11T03:20:11Z.

…nel-pin

When fix-bot-comment or review-changes guards refuse due to channel-pin
violations, the status-4 handlers now report all possible guard refusals
(test tamper/regression, sync-stub, and channel-pin) to match fix-reviews.

Previously these handlers were misleading operators by only mentioning
test and sync-stub guards, omitting the channel-pin guard that could
have triggered the refusal.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@don-petry
don-petry force-pushed the dev-lead/issue-2220-20261010-2339 branch from 784ae62 to 244b374 Compare October 11, 2026 03:35
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rebase (applied)

Rebase completed and pushed; PR is no longer conflicting.

@don-petry
don-petry enabled auto-merge October 11, 2026 03:35
@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@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-10-11T04:54:00Z.

@don-petry
don-petry disabled auto-merge October 11, 2026 04:15
@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry don-petry added the needs-human-review Flagged by automated PR review agent label Oct 11, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Test suite newly red — human attention needed

The fix-reviews pass left the test suite failing on test(s) that passed on the pre-pass head: Wiring: fix-ci sources the guard and evaluates it before push_with_merge_guard. A fix that breaks a passing test is wrong or incomplete, so dev-lead did not push this pass (#2013). Auto-merge has been disabled.

@don-petry

Copy link
Copy Markdown
Collaborator Author

dev-lead is withholding action on this item.

It is labeled needs-human-review (flagged for human review — this label is applied by automation as well as by people, so an item can become held without anyone noticing), so dev-lead will not pick it up while that label is present. This notice is posted once so the withhold is visible rather than looking like a stalled run.

To re-enable automated pickup: remove the needs-human-review label.

don-petry and others added 2 commits October 11, 2026 09:43
…ts from #2220

- scripts/dev-lead-fix-ci.sh: resolve lib/dev-lead-pr-body.sh and
  lib/sync-stub-guard.sh from BASH_SOURCE[0] instead of $0, so the script
  loads its libs when a bats test sources it (the source guard added for
  the channel-pin guard tests already assumes this).
- tests/dev-lead/unit/test_channel_pin_guard.bats: the idempotency test
  pinned an out-of-date status list with an ERE that could not match;
  assert the script's literal list (now including `declined`) with -F.
- tests/dev-lead/unit/test_sync_stub_guard_fix_ci.bats: the wiring test
  pinned the old `$0` form of the sync-stub-guard source line.
- scripts/template_stub_drift.sh, tests/template_stub_drift.bats: restored
  to main. The annotation change moves to issue #2215.

Test-Change-Justification: the wiring assertion in test_sync_stub_guard_fix_ci.bats pinned the literal `$(dirname "$0")` source line; it now pins the `${BASH_SOURCE[0]}` form the graphite-app review thread on scripts/dev-lead-fix-ci.sh:20 (PR #2238) asked for. The assertion still checks that fix-ci sources the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread scripts/lib/channel-pin-guard.sh Resolved
@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-10-11T15:49:33Z.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

Conflict in AGENTS.md: main added the seed-repo-template notes (#1927, #1925) at the same spot as this branch's template-drift note (#2220). Both are kept.
@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

don-petry and others added 2 commits October 11, 2026 12:13
…ranch added

cpg_scan_pass skipped the base-branch exemption when a workflow file had no
channel pin at the pre-pass head. A pass that merged or rebased onto a base
that had added a channel-pinned workflow (or newly pinned an existing one)
was reported as drift, so the push was refused, the PR flagged and auto-merge
disabled, although the file carried the base's own pins. Apply the same base
comparison on that path. A pin that differs from the base's is still drift.
Raised by the graphite-app review thread on scripts/lib/channel-pin-guard.sh
(PR #2238).

AGENTS.md: the template-drift note said the check's annotations no longer
carry a `file=` anchor. That change was dropped from this PR and is tracked
in issue #2215, so the note now says the anchor is still there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit be87333 into main Oct 11, 2026
70 checks passed
@don-petry
don-petry deleted the dev-lead/issue-2220-20261010-2339 branch October 11, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human-review Flagged by automated PR review agent

Projects

None yet

2 participants