Skip to content

fix(source-control): run the PR monitor's poll script from a file, not inline - #16870

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-16353-44126804116-1
Nov 17, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-16353-44126804116-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #16353

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The pull-request monitor's Monitor watch used to get the REST poll script inline as its command, and an auto-mode safety check refused that call. The script now ships as skills/pull-request/scripts/monitor-poll.sh, and the watch runs bash <skill-dir>/scripts/monitor-poll.sh --pr <N> --checkout <checkout>. Following the recorded decision, settings are flags: --interval, --baseline, --snapshot, and --repo <owner>/<repo> naming the base repository on a triangular flow. Polling works exactly as before; only the flag parsing at the top is new. I also added --once. The no-Monitor fallback in monitor.md said to edit the inline script so it exits on its first emitted line, which a file cannot be. --once keeps that fallback usable without editing.

Not verified

  • Neither monitor-poll.test.sh suite was run: this lane cannot run test suites, so the PR's CI runs them. The review subagent traced both suites against the new script by reading.
  • The live auto-mode probe, showing a monitor <n> run arms its watch without a safety-check denial. Per the recorded decision, a person runs it after merge and records the result on the issue; if the call is still denied, a follow-up isolates the flagged construct.
  • Tidy skipped: the change is about 640 changed lines (the new 200-line script plus the 160-line block removed from the reference), over the 300-line tidy cutoff.
  • Nothing in the tests checks that the command in the docs matches the script's flags; before this change the tests ran the doc block itself.
  • monitor-poll.sh is not executable in the working tree (the lane cannot chmod). apply-patch sets the bit on new .sh files, and the docs always run it with bash.
  • Untracked files at the repo root (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were already there and were not created or touched by this run; they are not part of the change.

Fix

  • plugins/source-control/skills/pull-request/scripts/monitor-poll.sh: new file holding the poll script that was inline in the provider reference. It parses flags (--pr, --checkout, --repo, --interval, --baseline, --snapshot, --once), and finds target-repo.sh and the plugin's review-threads script relative to its own path.
  • plugins/source-control/skills/pull-request/scripts/monitor-poll.test.sh: runs monitor-poll.sh from a copy of the plugin's layout with flags, instead of pulling the block out of the reference with awk/sed. Adds usage-error cases. The triangular case now uses --repo acme/app.
  • plugins/source-control/scripts/monitor-poll.test.sh: runs monitor-poll.sh directly from a copy of the plugin's layout with --interval 0, replacing the doc extraction and the sleep stub. The rm/mktemp checks now grep the script file. Adds a --once case. The zsh cases are gone because both docs hand the script to bash. A new case now pins that: it reads the documented command from both monitor docs and asserts each starts with bash "<skill-dir>/scripts/monitor-poll.sh". It also asserts neither doc holds an inline poll body, and runs each command, placeholders filled in, against the stub through to the merge.
  • plugins/source-control/reference/providers/github/pull-request/monitor.md: 'Poll checks over REST' now shows the bash <skill-dir>/scripts/monitor-poll.sh command and its flags, with no inline script, and notes why the watch runs a file. It says the REST read of a PR's checks lives only in the script, and that a one-off read is a --snapshot <file> run.
  • plugins/source-control/skills/pull-request/reference/monitor.md: 3.0.1's arming call and re-arm steps pass bash <path> with --snapshot/--baseline and no inline script. It says <skill-dir> is the pull-request skill's directory even when babysit-prs arms the watch. The no-Monitor fallback uses --once. 3.1 points a one-off checks read at a --snapshot run instead of running part of the script standalone.
  • plugins/source-control/reference/providers/github/README.md: the API-budget example names the monitor's --interval flag instead of the old INTERVAL variable.
  • .changes/source-control/work-resolve-issue-issue-16353-44126804116-1-75403a62.md: patch changelog fragment for source-control.

Verification

The runner ran each check from the base copy against 5b16873:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 6 fragments under .changes/ valid
  • check-changed-skills: pull-request PASS, 0 errors. The 4 warnings are about SKILL.md size and ready-for-review.md's missing contents block, neither touched here.
  • check-affected: the first run failed shellcheck SC2292 in monitor-poll.sh. After the fix: 16 passed, 6 skipped, 0 failed over 7 changed files.
  • Grep: no rm word and no mktemp in monitor-poll.sh, so the suite's no-rm and no-temp-file assertions hold
  • Grep over plugins/source-control: nothing still describes the inline poll block, an editable BASELINE_FILE=/SNAPSHOT_FILE= line, or the INTERVAL variable
  • A fresh-context review subagent read the whole diff and found no correctness bugs. It confirmed the script body matches the old inline block apart from flag parsing. Its findings are fixed, including adding --once for the no-Monitor fallback.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44126804116
  • The review-round fix (the documented-command case in scripts/monitor-poll.test.sh and the reworded one-off read in both monitor docs) was not run in the round that made it. CI runs the suite on the new head.

Left out: the items under Not verified.

Related

#16353

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 53fe9c584589cbb99a56239a8e54ed05826e7cc5: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

claude-security-review: incremental review of 53fe9c58 since a045886a. I read every change in all 3 files in scope and found no security issues. This lane already reviewed an earlier head, so this pass reports only CRITICAL and IMPORTANT findings.

What changed: the push only changes comments and help text.

What I checked:

  • Logic. The poll loop, the gh api calls, read_into, the baseline/snapshot handling and the threads read are unchanged. The edits add no new input path, shell interpolation or credentialed context.
  • Instruction surface. The removed text is code comments, not a standing rule for an agent. The "no rm, no mktemp" rule is still enforced by the test assertions, which are untouched (plugins/source-control/scripts/monitor-poll.test.sh).
  • Trust controls. No file in scope matches a trusted-path glob or touches a trust control, workflow, token request, kill switch, merge hold or plugin manifest. There are no manifest lines.
  • PR context. It holds no text aimed at the review lane.
  • Earlier post. It had no line anchor and reported 0 findings, so nothing carries forward.
  • Spend. None: the push changes no CI or lane behaviour.

critical-findings: 0

@github-actions github-actions 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.

claude-review: 3 inline finding(s) on 5b16873e118ab77b22b242a33c576d161d34fe81; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 53fe9c584589cbb99a56239a8e54ed05826e7cc5: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review, incremental: PR #16870 (closes #16353), a045886..53fe9c5

No blocking findings. This lane has already reviewed an earlier head (blocking only: yes), so this review reports blocking findings only.

I read every hunk of the 3 files in scope. Only comments and help text changed; no executable code did:

Checks I made against the head:

  • The usage-error cases (monitor-poll.test.sh:84-87) check only the exit status (3), so the longer usage text cannot break them.
  • The suite's "poll script runs no rm" grep ((^|[^[:alnum:]_-])rm([^[:alnum:]_-]|$)) and its mktemp grep run over the script, which now includes the heredoc text. A Grep of monitor-poll.sh for both patterns finds no match, so both assertions still hold.

I traced this by reading. I did not run either suite.

Closing issue #16353: this push does not touch any acceptance criterion. Their state is as the last review reported.

Settled threads and prior findings: the three earlier findings stay settled. One thread is marked lines changed since resolution: yes because its file's comments changed, but the guard case that resolved it is unchanged. Nothing is posted again. I found no embedded instructions in the PR context, the settled threads or the prior findings.

Loosened-check verdict: fail. This is the default, because the prompt has no loosened_check_verdict: or loosened_check_patterns: line, so I used fail with no consumer entries. This push removes no test, assertion or check.

The push changes no plugin manifest and no hold class applies.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44131762211

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM64jS20
Lane-Thread: PRRT_kwDOTCGFQM64jS22
Lane-Thread: PRRT_kwDOTCGFQM64jS2-
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed a045886
Run 44131762211

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on a045886.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44131762211

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head a045886aa27b68424038edf73e9fcb9182b0710d. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44141683391

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 53fe9c5
Run 44141683391

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 53fe9c584589cbb99a56239a8e54ed05826e7cc5, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 53fe9c5

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-16870-53fe9c584589cbb99a56239a8e54ed05826e7cc5, expires on 2026-12-17.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=53fe9c584589cbb99a56239a8e54ed05826e7cc5 rubric=10.2.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 16f96fb Nov 17, 2026
47 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-16353-44126804116-1 branch November 17, 2026 19:27
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 16f96fb6e3c46b5c724a640f178ffe9c6fe0cc38; later checks count it verified from this comment.

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.

source-control:pull-request monitor: the inline Monitor poll script is refused by Claude Code's removal safety check

0 participants