Skip to content

feat: implement issue #1103 — cmd_rollback moves the bare <agent>/<ring> tag, not <agent>/v<M>-<ring> — the emergency lever is a silent no-op for every v-scoped agent - #1117

Open
don-petry wants to merge 140 commits into
mainfrom
dev-lead/issue-1103-20260913-0329
Open

don-petry wants to merge 140 commits into
mainfrom
dev-lead/issue-1103-20260913-0329

Conversation

@don-petry

@don-petry don-petry commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

User description

Closes #1103

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Make rollback target the channel tag used by each agent

What Changed

  • Rollback now targets the version-scoped channel tag for agents with an established major, and the bare channel tag for legacy agents.
  • Rollback stops with an error if the resolved channel tag is missing or GitHub lookup fails, rather than moving the wrong tag or reporting success.
  • Explicitly version-scoped channel names continue to target that exact tag.

Impact

✅ Rollbacks update the channel tag fleets actually use
✅ Missing channel tags cannot produce false-success rollbacks
✅ GitHub lookup errors cannot trigger unintended tag moves

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…ng> tag, not <agent>/v<M>-<ring> — the emergency lever is a silent no-op for every v-scoped agent
@don-petry
don-petry requested a review from a team as a code owner September 13, 2026 03:47
@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

@codeant-ai

This comment has been minimized.

@codeant-ai

This comment has been minimized.

@coderabbitai

This comment has been minimized.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Sep 13, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

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

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) September 13, 2026 03:48

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the rollback command in scripts/canary-rollout.sh to resolve ring tags in a v-scope-aware manner, matching the behavior of promotions and preventing silent no-ops. It also introduces loud failures when a resolved ring tag does not exist, accompanied by comprehensive BATS tests. The review feedback suggests asserting the exact expected non-zero exit status in the BATS tests rather than using a generic non-zero check to prevent false positives.

Comment thread tests/canary_rollout.bats Resolved
@don-petry
don-petry disabled auto-merge September 13, 2026 03:49
Comment thread scripts/canary-rollout.sh Resolved
Comment thread scripts/canary-rollout.sh Resolved
@codeant-ai

This comment has been minimized.

donpetry-bot
donpetry-bot previously approved these changes Sep 13, 2026

@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: 1d3987d009ca177fd781db3a64bed7909f30e28c
Review mode: triage-approved (single reviewer)

Summary

Fixes #1103: cmd_rollback now resolves the ring tag v-scope-aware via _resolved_channel (prefer /v-, fall back to bare), matching cmd_promote. Dry-run output names the exact ref to be PATCHed, and a resolved-but-absent ring tag now fails loudly instead of silently moving a tag nobody pins. 21/-5 lines in scripts/canary-rollout.sh plus 83 lines of bats regression tests covering the v-scoped, legacy-fallback, and missing-tag shapes.

Linked issue analysis

Linked issue #1103 (silent no-op rollback on v-scoped agents) is substantively addressed. Acceptance criteria: (1) ring tag resolved the same way as cmd_promote/_resolved_channel — done, verified _resolved_channel emits tagcommit which the new IFS=$'\t' read consumes correctly; (2) dry-run names the exact ref — done; (3) fail loudly rather than no-op when the resolved tag is absent — done (::error:: + return 1); (4) audit of other subcommands — the issue itself records promote/evaluate/drift as already correct; (5) regression test with the real shape (major 139, v139-* family) — done.

Findings

No blocking findings. Non-blocking notes: (a) three unresolved bot review threads (gemini: assert exact exit code in bats; codeant: _resolved_channel derives major from highest release rather than caller pin, and _channel_tag_commit masks API outages as empty) — the latter two describe pre-existing behavior of shared helpers that this PR intentionally reuses for parity with cmd_promote, and the dev-lead agent reviewed them and posted no-changes; (b) codeant nitpicks on test stubs are test-quality suggestions, not defects. Secret-scan MCP tool unavailable in this session; gitleaks CI check passed.

CI status

All code checks green: Lint, ShellCheck, Canary-rollout bats, CodeQL (incl. actions analysis), Secret scan (gitleaks), Agent Security Scan, AgentShield, SonarCloud quality gate, duplicate-decl-gate, dependency-audit. A few dev-lead dispatch/ci-relay/resume runs show CANCELLED — superseded agent-orchestration runs, not code checks. mergeStateStatus is BEHIND (branch needs update against main) but mergeable.


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

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed. Requested items addressed:

  • tests/canary_rollout.bats:1065 — applied

@don-petry
don-petry enabled auto-merge (squash) September 13, 2026 03:55
@don-petry
don-petry disabled auto-merge September 13, 2026 03:56
@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
Issues addressed: 0
- SonarCloud Quality Gate passed (0 new issues, 0 security hotspots) — informational summary, no actionable defects
Files changed: (none)
Skipped (informational): 1
```
The branch is ready; no fixes required.

@don-petry
don-petry enabled auto-merge (squash) September 13, 2026 03:57
donpetry-bot
donpetry-bot previously approved these changes Sep 13, 2026

@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: a547522d4ad3435a3ae1819fcc42d1d43ef4f168
Review mode: triage-approved (single reviewer)

Summary

Fixes #1103: cmd_rollback now resolves the ring tag v-scope-aware via _resolved_channel (prefer /v-, fall back to legacy bare), matching cmd_promote. Dry-run names the exact ref to be PATCHed, and a resolved-but-absent ring tag fails loudly (::error:: + exit 1) instead of silently moving a tag nobody pins. +21/-5 in scripts/canary-rollout.sh plus 83 lines of bats regression tests. This confirms the prior approval at 1d3987d: the only deltas are a merge from main and one test-assertion fix ([ "$status" -ne 0 ] → -eq 1) addressing Gemini's review feedback.

Linked issue analysis

Linked issue #1103 (silent no-op rollback on v-scoped agents) is substantively addressed against all acceptance criteria: (1) ring tag resolved the same way as cmd_promote/_resolved_channel — verified: _resolved_channel emits tagcommit, consumed via IFS=$'\t' read identically to the three pre-existing call sites; (2) dry-run output names the exact ref — done; (3) fail loudly rather than no-op when the resolved tag is absent — done; (4) audit of other subcommands — the issue itself records promote/evaluate/drift as already correct; (5) regression test with the real shape (major 139, v139-* family, rollback must target v139-stable) — done, plus legacy-bare-fallback and missing-tag cases.

Findings

No blocking findings. The prior review's only actionable item (Gemini: assert exact exit code in the missing-tag bats test) is resolved in commit a547522 — the test now asserts [ "$status" -eq 1 ]. Remaining CodeAnt suggestions (_resolved_channel derives major from the highest release rather than a caller pin; _channel_tag_commit masks API outages as empty output) describe pre-existing behavior of shared helpers this PR intentionally reuses for parity with cmd_promote — carried as non-blocking, consistent with the prior review; the dev-lead agent reviewed and posted no-changes for them. CodeAnt nitpicks on test stubs are test-quality suggestions, not defects. Secret-scan MCP tool unavailable in this session; noted per protocol — gitleaks CI check passed and the diff contains only placeholder SHAs.

CI status

All checks green at a547522 (waited for in-progress runs to finish): Lint, ShellCheck, Canary-rollout bats (Lint and bats), CodeQL (actions analysis), Secret scan (gitleaks), Agent Security Scan, AgentShield, SonarCloud quality gate + Code Analysis, duplicate-decl-gate, dependency-audit (npm audit passed; other ecosystems skipped), CodeRabbit context SUCCESS. Skipped jobs are conditional agent-orchestration/dependabot steps, not code checks. Mergeable; mergeStateStatus BLOCKED only pending required review.


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

donpetry-bot
donpetry-bot previously approved these changes Sep 13, 2026

@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: a547522d4ad3435a3ae1819fcc42d1d43ef4f168
Review mode: triage-approved (single reviewer)

Summary

Fixes #1103: cmd_rollback previously moved the bare <agent>/<ring> tag even when the fleet pins the v-scoped <agent>/v<M>-<ring> tag, making the emergency rollback a silent no-op that exits 0. The fix resolves the ring tag through _resolved_channel — the exact same v-scope-preferring path used by cmd_promote — and refuses loudly (exit 1) when the resolved tag does not exist, rather than create-and-moving a tag nobody pins. Dry-run output now names the exact ref to be PATCHed. The change is small (2 files, +104/−5), well-commented, and covered by three targeted bats regression tests mirroring the real shape from the issue (dev-lead on major 139).

Linked issue analysis

Linked issue #1103 is substantively addressed. All acceptance criteria are met: (1) ring tag resolved identically to cmd_promote/_resolved_channel — prefer <agent>/v<M>-<ring>, fall back to bare; (2) dry-run names the exact ref (refs/tags/dev-lead/v139-stable vs .../stable is now visible to the operator); (3) fail-loud instead of silent no-op when the resolved tag is absent; (4) the issue itself audited promote/evaluate/drift as already correct, so no further subcommand changes were needed; (5) regression test with the real shape (major 139, v139-* family present) asserts the v-scoped tag is targeted and the bare tag never is.

Findings

No blocking findings.

  • Verified _resolved_channel emits <tag>\t<commit>; the IFS=$'\t' read -r ring_tag ring_commit parse is correct, including the absent-tag case (empty commit → loud refusal).
  • Tests correctly stub gh to distinguish the v-scoped, bare, and absent-tag shapes, and assert the bare tier is never the PATCH target on a v-scoped agent.
  • Two unresolved CodeAnt bot threads remain; both were triaged by the dev-lead fix-bot-comment pass (no-changes) and I concur they are non-blocking:
    1. "_resolved_channel derives the tag from the highest release major, not the caller's channel major" — this is the documented, issue-mandated behavior (epic #657 F4), identical to cmd_promote; rollback's CLI takes a bare ring name and there is no "caller channel major" input. A design critique of pre-existing shared infrastructure, not a defect of this PR.
    2. "_channel_tag_commit hides GitHub read failures as empty output" — pre-existing behavior of the shared helper used by all subcommands. Under this PR the failure mode is fail-closed (refuse with a clear error) rather than the prior silent wrong-tag move, which is strictly safer. Distinguishing 404 from transient API failure is a reasonable follow-up, out of scope here.
  • Secret scan: the run_secret_scanning MCP tool is not available in this environment; the gitleaks CI check passed and the diff contains only dummy test oids.

CI status

All required checks green: ShellCheck ✓, Lint and bats ✓, CodeQL ✓, Agent Security Scan ✓, AgentShield ✓, Secret scan (gitleaks) ✓, SonarCloud Quality Gate ✓, duplicate-decl-gate ✓, AGENTS.md Self-Check ✓. Remaining skips are ecosystem-not-present audits (npm/pip/cargo/go) and dependabot-automerge — expected.


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

@donpetry-bot
donpetry-bot dismissed their stale review September 13, 2026 04:02

Superseded by automated re-review at a547522.

@don-petry
don-petry disabled auto-merge September 13, 2026 04:06
The three new rollback tests were missing the v<M>-next channel anchor
tags in their gh stubs. These anchors are required for _agent_current_channel_major
to detect the release major and enable v-scoped channel tag resolution.
Without them, _resolved_channel would fall back to bare tags, causing test 112
to fail. Added v139-next stubs and handlers to all three tests so they properly
exercise v-scoped channel resolution as intended.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

This comment has been minimized.

@don-petry

This comment has been minimized.

@don-petry

This comment has been minimized.

@don-petry

don-petry commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

This is a non-actionable thank-you notice with no findings to address.

@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
**Disposition:** ✅ `informational` 
**Details:**
- Reviewed the CodeAnt bot comment which contains only a promotional/thank-you notice with no code findings
- Per task guidance, this qualifies as a non-actionable informational notice
- Posted disposition reply: `<!-- dev-lead:comment-disposition id=IC_kwDORyesfc8AAAABlfheLA disposition=informational -->`
**CodeRabbit Status:** All review threads already confirmed as addressed
- Test suite: ✅ 50/50 tests passing (including all rollback tests #1103, #1402)
- Code changes: ✅ cmd_rollback resolves ring tags v-scope-aware, matches cmd_promote behavior
- Error handling: ✅ Fails closed on API errors, refuses to move non-existent tags
**PR State:** Ready for harness verification of dispositions

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #1117
No changes were committed, but the PR still can't be marked done: a reviewer requested changes. The retry cron will re-attempt automatically. Next attempt after: 2026-11-15T10:02:23Z

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

Re-read the current body (review-status table only: all runs completed, latest on b0bc6fd). It lists no findings and needs no action.

@don-petry

Copy link
Copy Markdown
Contributor Author

Re-read the current body. It is the CodeRabbit summary, with reviews paused at 15d32c0 and a Moderate merge-risk note, a failed Linked Issues pre-merge check, and a stale Resolution. Each point is already resolved at head b0bc6fd:

  • Rollback-local bare-tag fallback. It is gone (removed in d87367f). scripts/canary-rollout.sh cmd_rollback now takes the tag and commit only from the resolver: IFS=$'\t' read -r ring_tag ring_commit <<< "$resolved", then if [[ -z "$ring_commit" ]]; then echo "::error::rollback target ring tag $ring_tag does not exist on $host ..."; return 1; fi.
  • Transient lookup failure. A failure no longer reads as an absent tag. The per-lookup flag is armed (_CANARY_TAG_FAIL_FLAG), and lookup_failed=1 triggers return 1 with "refusing to move any tag" before any move.
  • [[ ... ]] consistency. Done in 356a5a0.
  • Tests.
    • Test 113 ("fails loudly when the resolved ring tag does not exist") is present.
    • The bare-tag legacy test covers an agent with no channel-major anchor.
    • Added tests cover lookup-error and listing-error fail-closed.
    • bats -f rollback tests/canary_rollout.bats passes 17/17 at head.

@don-petry

Copy link
Copy Markdown
Contributor Author

Re-read the current body. It is a CodeAnt PR Risk summary: Low Risk, with no actionable finding. Its note that rollback refuses to move tags on lookup failure or an absent resolved tag matches the current code. No action needed.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — rate-limited (intent: fix-reviews)

PR: #1117
The retry cron will re-attempt automatically.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — rate-limited (intent: fix-reviews)

PR: #1117
The retry cron will re-attempt automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmd_rollback moves the bare <agent>/<ring> tag, not <agent>/v<M>-<ring> — the emergency lever is a silent no-op for every v-scoped agent

2 participants