Skip to content

chore: backfill TODO Ready→Done + full-loop merge --admin fallback#18748

Merged
marcusquinn merged 1 commit intomainfrom
chore/backfill-ready-done-and-admin-merge-fallback
Apr 13, 2026
Merged

chore: backfill TODO Ready→Done + full-loop merge --admin fallback#18748
marcusquinn merged 1 commit intomainfrom
chore/backfill-ready-done-and-admin-merge-fallback

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

Summary

Two maintenance follow-ups from the #18538 session, per user guidance:

  1. TODO.md backfill (69 entries) — Every top-level completed entry that had accumulated in the Ready section is now in Done. Nested sub-items under completed parents moved with their parent. Sub-items under still-open parents were not touched.
  2. full-loop-helper.sh merge --admin fallback — The wrapper now catches the base branch policy prohibits the merge error and retries once with --admin. Workers run as the same GitHub account as the maintainer on the same machine with the same gh auth — --admin works for them too.

Why

Backfill: every completed-but-stranded entry in Ready would generate the same Gemini review complaint on the next review pass, feeding the recurring review-followup cost that GH#18538 just addressed at the scanner.

--admin fallback: observed on PR #18607 — after all checks passed, the wrapper still failed with base branch policy prohibits the merge. Every recent merge in this repo (#18596-#18608) required manual gh pr merge --admin. Workers hit this wall with no recovery path.

How

Backfill: single-use Python script (/tmp/backfill-ready-to-done.py, not committed) parses TODO.md, identifies top-level - [x] markers in Ready, captures each entry + continuation lines (including nested sub-items), prepends to Done.

Merge wrapper: cmd_merge in .agents/scripts/full-loop-helper.sh now captures gh pr merge output, matches branch-protection error patterns (base branch policy prohibits, Required status checks, At least N approving review), retries once with --admin on a match, and surfaces any other failure verbatim. The narrow retry protects against paper-over.

Testing

  • shellcheck clean (only pre-existing SC1091 info)
  • bash -n syntax clean
  • TODO.md: 0 top-level [x] remain in Ready, 82 now in Done (was ~13, +69 moved)
  • Parent-child pairs preserved (t1962+t1963, t1873+7 children)

Decisions

  • Nested sub-items under completed parents move WITH the parent (audit trail).
  • Sub-items under still-open parents untouched.
  • --admin retry is narrow (specific error only), not blanket.
  • No test harness for the merge change — error-string matching is simple; the alternative (gh stub mocking) is a larger refactor than the fix.

Ref #18538



aidevops.sh v3.8.10 plugin for OpenCode v1.4.3 with claude-opus-4-6 spent 17h 51m and 52,514 tokens on this with the user in an interactive session.

@marcusquinn marcusquinn added the origin:interactive Auto-created from TODO.md tag label Apr 13, 2026
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 53857944-6c40-42c6-88f0-e1f9fd80bb3d

📥 Commits

Reviewing files that changed from the base of the PR and between 77e948b and 873909c.

📒 Files selected for processing (2)
  • .agents/scripts/full-loop-helper.sh
  • TODO.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/backfill-ready-done-and-admin-merge-fallback

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.

@github-actions github-actions bot added the chore Auto-created from TODO.md tag label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 226 code smells

Mon Apr 13 22:24:01 UTC 2026: Code review monitoring started
Mon Apr 13 22:24:02 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 226

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 226
  • VULNERABILITIES: 0

Generated on: Mon Apr 13 22:24:04 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 13, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

…ge wrapper

Two maintenance follow-ups from the GH#18538 session:

1. TODO.md backfill — 69 top-level completed entries had accumulated in
   the Ready section. Move them all to Done in one sweep, preserving
   nested sub-items under their completed parents as the entry audit
   trail.

2. full-loop-helper.sh merge — workers hit 'base branch policy
   prohibits the merge' on every interactive PR because the repo has no
   auto-merge enabled and no self-approval possible. Workers run as the
   same GitHub account as the maintainer on the same machine with the
   same gh auth, so --admin works for them too. The wrapper now tries
   plain merge first, and only on the specific branch-protection error
   retries once with --admin. Any other failure is surfaced verbatim.

Ref #18538
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 226 code smells

Mon Apr 13 22:26:02 UTC 2026: Code review monitoring started
Mon Apr 13 22:26:03 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 226

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 226
  • VULNERABILITIES: 0

Generated on: Mon Apr 13 22:26:05 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

@marcusquinn marcusquinn merged commit 7b085eb into main Apr 13, 2026
27 checks passed
@marcusquinn marcusquinn deleted the chore/backfill-ready-done-and-admin-merge-fallback branch April 13, 2026 22:27
marcusquinn added a commit that referenced this pull request Apr 13, 2026
…r set -e

PR #18748 shipped the --admin fallback for branch-protection rejections
(GH#18538), but used a bare assignment to capture the merge output:

    _merge_out=$(gh pr merge ... 2>&1)
    _merge_rc=$?

Under `set -euo pipefail` (line 8), a failing command substitution
exits the script before `_merge_rc=$?` runs. The function silently
returns, the --admin fallback never triggers, and the wrapper looks
like it succeeded when in fact it bailed without merging anything.

Discovered by self-test: PR #18748 only merged because I had the
if-form fix applied locally and uncommitted in the worktree at the
time I ran the wrapper. The merged main code was the bare-assignment
version and would have failed silently for the next worker.

Switch to the if-form which is portable across all bash versions and
respects errexit semantics:

    if _merge_out=$(gh pr merge ... 2>&1); then
        _merge_rc=0
    else
        _merge_rc=$?
    fi

Ref #18538
marcusquinn added a commit that referenced this pull request Apr 13, 2026
…r set -e (#18750)

PR #18748 shipped the --admin fallback for branch-protection rejections
(GH#18538), but used a bare assignment to capture the merge output:

    _merge_out=$(gh pr merge ... 2>&1)
    _merge_rc=$?

Under `set -euo pipefail` (line 8), a failing command substitution
exits the script before `_merge_rc=$?` runs. The function silently
returns, the --admin fallback never triggers, and the wrapper looks
like it succeeded when in fact it bailed without merging anything.

Discovered by self-test: PR #18748 only merged because I had the
if-form fix applied locally and uncommitted in the worktree at the
time I ran the wrapper. The merged main code was the bare-assignment
version and would have failed silently for the next worker.

Switch to the if-form which is portable across all bash versions and
respects errexit semantics:

    if _merge_out=$(gh pr merge ... 2>&1); then
        _merge_rc=0
    else
        _merge_rc=$?
    fi

Ref #18538
marcusquinn added a commit that referenced this pull request Apr 13, 2026
… discipline

Captures the lesson from the GH#18538 session where PR #18748 shipped a
`set -e` bug in full-loop-helper.sh's --admin fallback that the local
self-test passed only because of an uncommitted if-form fix in the
worktree. PR #18750 was the hotfix.

The brief proposes adding a 'Self-modifying tooling test discipline'
subsection to prompts/build.txt with the rule and the evidence chain.

Ref #18538
marcusquinn added a commit that referenced this pull request Apr 13, 2026
…ment task (#18754)

* plan(t2062): file self-improvement task — self-modifying tooling test discipline

Captures the lesson from the GH#18538 session where PR #18748 shipped a
`set -e` bug in full-loop-helper.sh's --admin fallback that the local
self-test passed only because of an uncommitted if-form fix in the
worktree. PR #18750 was the hotfix.

The brief proposes adding a 'Self-modifying tooling test discipline'
subsection to prompts/build.txt with the rule and the evidence chain.

Ref #18538

* chore(t2062): stamp ref:GH#18753 from issue-sync
marcusquinn added a commit that referenced this pull request Apr 13, 2026
Extends cmd_merge arg parser to accept --admin and --auto flags and
pass them through to gh pr merge. Enables workers and interactive
sessions to use gh's native branch-protection escape hatches without
bypassing the sanctioned merge wrapper.

Design:
- Explicit --admin / --auto skip the error-retry fallback (intent is
  already set; retrying --admin when --admin was requested is a no-op,
  retrying --admin when --auto was requested would clobber queue intent).
- No-flag path preserves the GH#18538 / PR #18748 / PR #18750 branch-
  protection error-retry fallback verbatim.
- --auto success reports 'queued for auto-merge' (correct semantics:
  gh doesn't merge now, it queues when required checks pass).
- Bash 3.2 safe: empty array expansion uses ${arr[@]+"${arr[@]}"} —
  plain "${arr[@]}" under set -u raises 'unbound variable' on macOS
  default bash.

Verification:
- shellcheck clean (SC1091 info only, pre-existing source directive).
- bash -n syntax clean.
- 21/21 runtime assertions pass in /tmp/test-cmd-merge-parsing.sh covering:
  * bash 3.2 empty-array crash regression
  * --admin, --auto, --admin --auto, --rebase --admin pass-through
  * --admin failure suppresses retry (no duplicate gh call)
  * no-flag branch-protection failure still triggers fallback (#18748/#18750)
  * unknown flag rejection
- show_help usage line updated.

Closes #18731.
Context: #18725 (fix that surfaced this), t1382 review bot gate,
GH#17541 sanctioned merge path, #18748 (--admin fallback), #18750
(set -e capture fix), #18732 (superseded stale PR on same branch).
marcusquinn added a commit that referenced this pull request Apr 13, 2026
…31) (#18757)

Extends cmd_merge arg parser to accept --admin and --auto flags and
pass them through to gh pr merge. Enables workers and interactive
sessions to use gh's native branch-protection escape hatches without
bypassing the sanctioned merge wrapper.

Design:
- Explicit --admin / --auto skip the error-retry fallback (intent is
  already set; retrying --admin when --admin was requested is a no-op,
  retrying --admin when --auto was requested would clobber queue intent).
- No-flag path preserves the GH#18538 / PR #18748 / PR #18750 branch-
  protection error-retry fallback verbatim.
- --auto success reports 'queued for auto-merge' (correct semantics:
  gh doesn't merge now, it queues when required checks pass).
- Bash 3.2 safe: empty array expansion uses ${arr[@]+"${arr[@]}"} —
  plain "${arr[@]}" under set -u raises 'unbound variable' on macOS
  default bash.

Verification:
- shellcheck clean (SC1091 info only, pre-existing source directive).
- bash -n syntax clean.
- 21/21 runtime assertions pass in /tmp/test-cmd-merge-parsing.sh covering:
  * bash 3.2 empty-array crash regression
  * --admin, --auto, --admin --auto, --rebase --admin pass-through
  * --admin failure suppresses retry (no duplicate gh call)
  * no-flag branch-protection failure still triggers fallback (#18748/#18750)
  * unknown flag rejection
- show_help usage line updated.

Closes #18731.
Context: #18725 (fix that surfaced this), t1382 review bot gate,
GH#17541 sanctioned merge path, #18748 (--admin fallback), #18750
(set -e capture fix), #18732 (superseded stale PR on same branch).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Auto-created from TODO.md tag origin:interactive Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant