Repository navigation
fix(pr-pipeline): land issue-lane scripts executable through apply-patch - #9100
Conversation
The issue lane's patch committed new scripts as 100644, so check-affected's exec-bit check failed and run 39729937593 stopped. apply-patch now sets 100755 itself, after every refusal passes, on each new or changed file that ends in .sh or starts with #!, under a new script-exec-bit row key the issue row sets. new-executable still refuses any bit the patch itself carries; on a resumed run, a script bit only the start commit carries is admitted. The issue row now refuses instruction-path, and a row that sets script-exec-bit must. The issue lane's checks wrapper sets CHECK_AFFECTED_SCRIPT_EXEC_BIT=1, so check-affected --uncommitted gives its snapshot the same bits and exec-bit passes inside the run. Closes #9096 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental, since 948f7c5)I found no security issues in
Lazy Line 578 (the script-exec-bit promotion): It uses the same stricter The change touches no manifest, so there are no |
|
claude-review reviewed No findings. I reviewed the incremental change since 948f7c5 in
|
On a resumed issue-lane run, isScript ran while the refusal list was being built. That was before any refusal, so for a gitlink it read the entry's commit sha as a blob, and the uncaught git error came before the gitlink refusal could escalate patch-invalid. isScript now admits only 100644 and 100755 entries before it calls git. The start commit's entries also get their refusal list only when their turn comes, after the patch's own entries have passed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Compose both new --uncommitted test cases in scripts/check-affected.test.sh: the branch's CHECK_DATA_ROOT case and main's CHECK_AFFECTED_SCRIPT_EXEC_BIT case (#9100). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mode and report the patch escalation (#9182) Closes #9180 ## Summary Fixes two issue-lane defects found in [run 39836229787](https://github.com/melodic-software/claude-code-plugins/actions/runs/39836229787) (#9161): 1. The lane bumped `plugins/corrections/.claude-plugin/plugin.json`, and since #9100 the `issue` row's `instruction-path` refusal blocks that path. The bump was the real defect. `corrections` (#8822) and `app-control` (#8820) were never added to `scripts/fragment-plugins.txt`, so the lane followed an unlisted plugin's per-PR rules and bumped the version. Every other plugin is listed, and only the release PR moves a version (`scripts/check-changelog-parity.sh:101-110`, `pr-require-checks.yml` changelog-parity comment). 2. report-outcome never received apply-issue-patch's escalation reason, so it told the issue "The run reported done but committed nothing" when the patch had in fact been refused. ## Fix - **Fragment list:** `scripts/fragment-plugins.txt` now lists `corrections` and `app-control`. Every directory under `plugins/` is listed (checked with `comm`). The lane's per-PR rule is now a fragment, and `instruction-path` still refuses every `plugin.json` change, as #9100 intended. An earlier commit on this branch added a version-only `plugin.json` admission; the security review (S&C) questioned it and it is removed. - **report-outcome**: - `work-resolve-issue.yml` passes `needs.apply-issue-patch.outputs.escalation-reason` to report-outcome. - `report-outcome.mjs` validates `ESCALATION_REASON` against `PATCH_REASONS` and throws on an unknown value. - When a `done` run's patch was refused (`patch-protected-path`, `patch-invalid` or `patch-not-applied`), report-outcome hands the issue back naming the reason and opens no PR, from a resumed branch either. On a resumed run the hand-back names the resumed branch. - `patch-empty`, and every non-done exit, keep their current plan. - **Write runner input check** (`pr-run-activity-write.yml`): accepts the four `patch-*` reasons in issue mode only. pr-unblock's report-escalation still takes none, as `callers.test.mjs` documents. - **Refused path not passed through.** report-outcome does not receive it. Passing it would need a new apply-patch output, a reusable-workflow output and input, and sanitizing of a path the model chose before it goes into an issue comment. The hand-back links the run, whose log has the `refused (<refusal>): <path>` line. - Docs: the `report-outcome` paragraph in `pr-run-activity.md`, plus a `pr-pipeline` changelog fragment (patch). ## Verification - **Both plugins are now listed.** `comm` of `plugins/` against `scripts/fragment-plugins.txt` shows no plugin missing. `check-changelog-fragments.sh --check` and `check-changelog-parity.sh --check` both pass. The `changelog-fragments` and `check-changelog-parity` test scripts pass: 14 and 111. - **The #9161 patch, committed at base `ba598f08d3` in a scratch worktree, against `check-changelog-parity.sh --check-bump ba598f0`:** - With the old list it exits 0, and the gate lets the lane's bump through. - With this branch's list it exits 1: `FRAGMENT-MODE RELEASE: corrections is in fragment mode ... moves its version 0.5.0 -> 0.6.0`, and again for the added `0.6.0` heading. - **report-outcome:** six new tests failed before the fix and pass after it: the refused-patch hand-back, the resumed case, `main` naming the reason, and an unknown reason refused. Guard tests show `patch-empty` and pushback plans unchanged. - **callers:** two new tests, for the `escalation-reason` wiring and the issue-mode-only input check, failed on the old workflows and pass now. - **Suites:** `node --test` over `work-resolve-issue` and `apply-patch` passes, 344 of 344. `.github/actions/resolve-config` passes, 600 of 600. `report-escalation.test.sh`: ok. The pre-push `check-affected` hook passed. ## Related - #9161, the run diagnosis. - #8639. - #9100, which added `instruction-path` to the issue row. - #9211, version_sort_key hardening, found in the same review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #9096
Summary
In the issue lane, a patch run committed new scripts as 100644, so check-affected's exec-bit
check failed and run 39729937593
stopped on #8324. Two things caused this. The chmod grant exists only for runs that commit
(
collect-base-activity/action.yml, theelif CAN_COMMITbranch). And granting it in patch modewould not help, because
new-executablerefuses any executable bit a patch carries(
apply-patch.mjsREFUSALS). With this change, apply-patch sets the bit itself, and the modelstill sets no file mode.
Fix
script-exec-bitrow key, each new or changed file that ends in.shor starts with
#!is set to 100755 in the applied index once every refusal has passed. Thetree is then rebuilt.
new-executableis unchanged for the patch's own entries. A bit the model set is still refused,on a script or on any other file. On a resumed run, refusals also cover what the start commit
added, so a script's bit that only the start commit carries is admitted. That is the bit an
earlier apply set.
patch-rules.json: theissuerow setsscript-exec-bitand now refusesinstruction-path,so the issue lane pushes no plugin hooks, monitors, bin, or agent instruction files.
checkRowfails any row that sets
script-exec-bitwithout refusinginstruction-path. The schema andthe pr-pipeline README describe both.
CHECK_AFFECTED_SCRIPT_EXEC_BIT=1.check-affected.sh --uncommittedthen gives its snapshotthe same bits, so exec-bit passes inside the run. A run that commits gets no flag and still has
to chmod its own scripts.
UNIVERSAL_REFUSEandresolve.mjsare untouched, and noneof the
BROKER_PATHSfiles inpr-require-checks.ymlis in the diff. No azure-iac pin isneeded.
Verification
Each new test was run red before its fix and green after:
apply-patch.test.mjs, 93/93 pass. Red then green:patch-invalid". Red:
Command failed: git ... cat-file blob abab..., becauseisScriptreada gitlink's sha before any refusal ran. Fixed in bba6511:
isScriptchecks the modefirst, and start-commit entries get their refusal list lazily.
100644"
executable there is still refused"
before and after the change, as a guard test should.
collect-base-activity.test.mjs, 112/112 pass. "only an issue lane's patch run gets a wrapperthat sets the script exec bit" was red, then green.
check-affected.test.shexits 0. "--uncommitted with CHECK_AFFECTED_SCRIPT_EXEC_BIT judges anew #! file as executable" was red with
FAIL exec-bit, then green.check-affected.sh --uncommitted --base origin/main: 8 passed, 5 skipped.Related
because its Bash allows only the named wrappers. This change does not address that.
🤖 Generated with Claude Code