Skip to content

feat: implement issue #1866 — standards-sync rewrites the per-repo channel pin it is told to preserve — PR #1819 would move dev-lead from stable to next in the repo that hosts it - #1889

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-1866-20260922-1658
Sep 22, 2026
Merged

don-petry merged 2 commits into
mainfrom
dev-lead/issue-1866-20260922-1658

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Problem

standards-sync rewrites the per-repo channel pin it is told to preserve — PR #1819 would move dev-lead from stable to next in the repo that hosts it

From the issue: The standards-sync that opens chore: sync N org-standard workflow stub(s) PRs rewrites the per-repo channel pin — the one field the org standard explicitly designates as repo-owned — and in PR #1819 it moved three stubs from stable to next, including dev-lead in the repository that hosts dev-lead-reusable.yml.

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/fixtures/channel-pin/stub-agent-ref-desync.yml,tests/fixtures/channel-pin/stub-aligned.yml tests/fixtures/channel-pin/stub-both-differ.yml,tests/fixtures/channel-pin/stub-comment-mismatch.yml tests/fixtures/channel-pin/stub-contrast.yml,tests/fixtures/channel-pin/stub-no-pin.yml tests/fixtures/channel-pin/stub-other-agent.yml,tests/test_channel_pin_consistency.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.

Closes #1866

…annel pin it is told to preserve — PR #1819 would move dev-lead from stable to next in the repo that hosts it
@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.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 22 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 401dce3e-1fba-4a9e-88f0-64caf11439e5

📥 Commits

Reviewing files that changed from the base of the PR and between 34f48ef and 95d379a.

📒 Files selected for processing (11)
  • .github/workflows/lint.yml
  • .github/workflows/pr-review-mention.yml
  • scripts/lib/channel-pin-consistency.sh
  • tests/fixtures/channel-pin/stub-agent-ref-desync.yml
  • tests/fixtures/channel-pin/stub-aligned.yml
  • tests/fixtures/channel-pin/stub-both-differ.yml
  • tests/fixtures/channel-pin/stub-comment-mismatch.yml
  • tests/fixtures/channel-pin/stub-contrast.yml
  • tests/fixtures/channel-pin/stub-no-pin.yml
  • tests/fixtures/channel-pin/stub-other-agent.yml
  • tests/test_channel_pin_consistency.bats

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.

@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 same-file channel-pin and comment consistency guard script (channel-pin-consistency.sh) along with supporting test fixtures and a BATS test suite to prevent configuration drift in workflow stubs. The feedback recommends securing temporary file creation in the test suite using mktemp instead of predictable paths with $$, avoiding standalone conditional expressions in the library script to prevent unintended termination under set -e, and tightening test assertions by checking for specific non-zero exit codes rather than generic non-zero statuses.

Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread scripts/lib/channel-pin-consistency.sh Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
Comment thread tests/test_channel_pin_consistency.bats Outdated
@codeant-ai

codeant-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. A missing or unreadable file is treated as no pin, so invalid paths and read failures pass the consistency guard as not applicable.

Error handling · scripts/lib/channel-pin-consistency.sh:65

@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-09-22T18:34:08Z.

@don-petry

Copy link
Copy Markdown
Collaborator Author

template-drift — left red, out of this PR's scope (known-red under #1448).

template-drift verifies that files committed in petry-projects/repo-template are byte-identical to their standards-derived baselines (it re-hashes seed-repo-template.sh's emission and compares against the repo-template contents API). Its own job comment in lint.yml documents it as "known-red under #1448" and it is deliberately excluded from the main-push trigger for that reason.

This PR's diff does not touch repo-template, scripts/seed-repo-template.sh, or scripts/template_stub_drift.sh — it adds scripts/lib/channel-pin-consistency.sh + its bats suite/fixtures, appends the new bats file to lint.yml's test list, and corrects one guard-comment word in pr-review-mention.yml (v2-stable→v2-next, to match that file's own uses: pin). None of those inputs feed the template-drift computation, so the diff cannot be the cause and the red cannot be resolved from within this PR. Making it green would require editing what the check asserts (the drift baseline), which is exactly the failure mode I must not take — so I'm leaving it red and flagging it as the pre-existing #1448 condition.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed. Requested items addressed:

  • tests/test_channel_pin_consistency.bats:169 — applied
  • scripts/lib/channel-pin-consistency.sh:98 — applied
  • tests/test_channel_pin_consistency.bats:69 — applied
  • tests/test_channel_pin_consistency.bats:84 — applied
  • tests/test_channel_pin_consistency.bats:91 — applied
  • tests/test_channel_pin_consistency.bats:110 — applied
  • tests/test_channel_pin_consistency.bats:138 — applied
  • tests/test_channel_pin_consistency.bats:149 — applied

@don-petry
don-petry enabled auto-merge (squash) September 22, 2026 17:37
@sonarqubecloud

Copy link
Copy Markdown

@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-09-22T18:40:39Z.

@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: MEDIUM
Reviewed commit: 308a4a132c129b03abf6fd4cf6344bb8fd4ea259
Cascade: triage → deep (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5)

Summary

Adds a pure receiving-side channel-pin/comment consistency guard (scripts/lib/channel-pin-consistency.sh) with fixtures and a 19-case BATS suite (all pass locally), plus a one-line comment fix to pr-review-mention.yml aligning its header (v2-stable -> v2-next) to the already-existing uses: pin — exactly the #1819 stale-comment shape the guard exists to catch; LIVE test #19 confirms the file is now consistent. Core control/data flow is correct: no-pin and cross-agent/contrast cases are handled and return N/A, and conflict detection covers comment and agent_ref desync. No security-critical path is touched; safety checks report no hard-stops (CI_WEAKENING/PROMPT_INJECTION false). Downstream impact: none.

Findings

  • minor: cpc_stub_conflicts/cpc_assert_consistent treat a missing or unreadable file as 'no pin -> N/A' (returns 0). Harmless in current wiring since the only caller (the LIVE bats test) globs existing .github/workflows/*.yml with nullglob, so a nonexistent path is unreachable; but if this guard is later wired to a manifest/user-supplied path, a typo'd path would silently pass instead of erroring. Confirmed by invoking cpc_assert_consistent on a nonexistent path (exit 0, 'no reusable channel pin — N/A').
  • minor: Advisory (gemini, security-high) flags the predictable temp path /tmp/cpc_live.$$ in the LIVE bats test (symlink-attack risk of $$ in /tmp). Real-world severity is low: this is test-only code on ephemeral CI runners, not the shipped library. Recommend mktemp with a create-failure guard as a hygiene improvement, but non-blocking.
  • info: Advisory (gemini, low, 6 instances) suggests asserting the exact non-zero exit code ([ "$status" -eq 1 ]) instead of the generic [ "$status" -ne 0 ] so a test cannot pass on an unexpected failure (syntax/command-not-found). Reasonable tightening; the guard functions return exactly 1 on conflict. Style-level, non-blocking.
  • info: The template-drift check shows FAILURE, but it is documented as known-red under #1448 ('must not fail every merge until that is resolved') and inspects the petry-projects/repo-template repo's committed stubs via network, which this PR does not modify. Not introduced by this PR and explicitly non-blocking. All correctness-relevant gates (Lint, shellcheck, unit-tests, actionlint, CodeQL, caller-stub-freeze, sync-scope-guard, validate-fixtures, stub-structure) are green; the touched bats suite passes 19/19 locally.

Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit a8c6bd9 into main Sep 22, 2026
63 of 64 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1866-20260922-1658 branch September 22, 2026 17:41
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.

standards-sync rewrites the per-repo channel pin it is told to preserve — PR #1819 would move dev-lead from stable to next in the repo that hosts it

2 participants