Skip to content

fix(pr-unblock): stage apply-patch/cdn-paths.mjs for base-script activities - #18660

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/stage-cdn-paths-for-base-scripts
Nov 24, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/stage-cdn-paths-for-base-scripts

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: regression from #18336 found by the hub in pr-unblock runs 45296291302 and 45296314384

Summary

pr-unblock's apply-dependency-verdict activity fails on every Dependabot pull request with ERR_MODULE_NOT_FOUND: Cannot find module '/home/runner/work/_temp/apply-patch/cdn-paths.mjs'. collect-base-activity stages a script activity's directory to $RUNNER_TEMP/base-script, with lib/ and pr-merge/merge-holds.mjs beside it, but never apply-patch/cdn-paths.mjs. Since #18336, apply-dependency-verdict.mjs and cdn-pins-sync.mjs (which review-dependency.mjs imports) load it as ../apply-patch/cdn-paths.mjs.

Fix

  • .github/actions/collect-base-activity/action.yml: the script staging step copies .github/scripts/apply-patch/cdn-paths.mjs into $RUNNER_TEMP/apply-patch/ when the base has it, in the same shape as the merge-holds.mjs copy. cdn-paths.mjs has no imports of its own.
  • collect-base-activity.test.mjs: a new test reads docs/conventions/pr-pipeline.yaml, takes every .mjs script activity of a lane whose workflow calls pr-run-activity-read.yml or pr-run-activity-write.yml, runs the action's real staging step for it against this checkout, and walks the staged entry script's static relative imports. Each must resolve inside the staged layout. apply-patch.mjs also gets the copies the write runner's apply-base step makes, read from that step's cp lines. The suite's test-scope now also covers .github/scripts/*.mjs, pr-pipeline.yaml and pr-run-activity-write.yml, so a new cross-directory import selects it.
  • The test pins one remaining gap it found, which this change does not fix: declare-test-scope.mjs (the fix-test-scope activity, effect: read) statically imports ../maintenance-reconcile-lost-runs/infra-failure.mjs and, through ../lib/github-rest.mjs, ../../actions/log-api-budget/rate-guard.mjs. Neither is staged, so that activity should fail to load in the read runner the same way. Both imports came in with feat(pr-unblock): dark-launch test-scope declarations from the selection trace #18460. The test fails if that gap changes, in either direction.
  • A pr-pipeline patch changelog fragment.

Verification

  • Red first: with the new copy disabled, the new test reported apply-dependency-verdict.mjs: ['apply-patch/cdn-paths.mjs'] as unresolved; with it, only the pinned declare-test-scope.mjs entry remains.
  • node --test --test-concurrency=4 .github/actions/collect-base-activity/collect-base-activity.test.mjs: 159 pass, 0 fail.
  • bash scripts/check-affected.sh --base origin/main: 19 passed, 5 skipped.

Related

  • Regression from feat(pr-unblock): sync the CDN pins on a Dependabot manifest bump #18336.
  • feat(pr-unblock): dark-launch test-scope declarations from the selection trace #18460 added the declare-test-scope.mjs imports the test pins.
  • Other gaps found, not fixed here:
    • report-escalation.sh (a pr-unblock script activity) loads ../pr-merge/refire-refused.mjs in retried_refusal, which is not staged. The node -e call's stderr goes to /dev/null and a failure returns 1, so the workflow-modified-refusal check never holds a status back in the lane. Its ../../../.github/actions/log-api-budget/api-budget.bash source path does not resolve from base-script either. That call is guarded, so the API-budget wrap is skipped without an error.
    • address-feedback.mjs lazily imports ../pr-verify/resolve-pr.mjs, ../intake-triage/admit.mjs and ../../actions/log-api-budget/rate-guard.mjs, none staged. publish-feedback, resolve-threads and apply-dependency-verdict reach address-feedback.mjs, so any of them that takes one of those code paths fails at that call.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5

…vities

collect-base-activity copies a script activity's directory to
$RUNNER_TEMP/base-script with lib/ and pr-merge/merge-holds.mjs beside
it, but not apply-patch/cdn-paths.mjs. apply-dependency-verdict.mjs and
cdn-pins-sync.mjs (which review-dependency.mjs imports) load it as
../apply-patch/cdn-paths.mjs, so apply-dependency-verdict failed with
ERR_MODULE_NOT_FOUND on every Dependabot pull request since #18336.

Stage cdn-paths.mjs into $RUNNER_TEMP/apply-patch/ in the same shape as
merge-holds.mjs. A new test runs the staging step for every .mjs script
activity a lane runs through pr-run-activity-read or -write and checks
that each static relative import resolves in the staged layout. It pins
the one remaining gap, declare-test-scope.mjs, which this change leaves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 01:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T01:52:00.778332Z 3c69add Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18660

I found no security issues. This lane already reviewed an earlier head, so this review reported only CRITICAL and IMPORTANT findings. There were none.

What changed since the last review. This head is a merge of main into the branch. The three changed files match the head I reviewed before:

  • the staging copy in .github/actions/collect-base-activity/action.yml
  • the import-walk test in collect-base-activity.test.mjs
  • a changelog fragment

What I checked

  • Where the copied file comes from. The new copy is at action.yml#L163-L168. It reads a fixed path, .github/scripts/apply-patch/cdn-paths.mjs, from $BASE_PATH, which is inputs.base-path (L136). That is the same base checkout the existing lib/ and merge-holds.mjs copies read from. The pull request supplies no part of the path, so no code from the PR head enters the staged layout.
  • Script path check. The existing check that SCRIPT is a repository-relative path is unchanged (L138-L148).
  • Trust controls. The change widens none of them:
    • who is trusted is unchanged;
    • token scope is unchanged;
    • the tools a session may use are unchanged;
    • no new untrusted text reaches a lane;
    • no merge hold is changed.
  • Test changes. The new test runs the real staging step against the checkout in temporary directories. Its environment holds only PATH and the staging paths, with no credentials. The added test-scope line only changes which tests CI selects.
  • Changelog fragment. Text only.

Untrusted-text check. The PR description contains no instructions aimed at the lane.

Not counted. The description lists other staging gaps in files this PR does not change: report-escalation.sh and its refire-refused.mjs load, and the lazy imports in address-feedback.mjs. They are pre-existing, so I did not count them as findings. The report-escalation.sh gap is still worth a follow-up, because its failure silently skips the check that holds a status back when a workflow-modified refusal was retried.

Spend. None.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #18660, stage apply-patch/cdn-paths.mjs for base-script activities

Blocking only. This lane already reviewed an earlier head (3c69adda), so this pass reports only blocking findings. The new head is a merge of main into the branch. The diff is the same three files as before.

I found no blocking issues.

  • The import paths resolve. apply-dependency-verdict.mjs:81 and cdn-pins-sync.mjs:6 import ../apply-patch/cdn-paths.mjs. Seen from $RUNNER_TEMP/base-script, that path is $RUNNER_TEMP/apply-patch/cdn-paths.mjs.
  • The new copy puts the file there. The copy at action.yml#L163-L168 writes it to that path. It uses the same guarded mkdir -p + cp shape as the merge-holds.mjs copy.
  • The test finds the step it runs. The new test reads the step by its name, Copy the script's base directory, and that name is still at action.yml:130.

Not verified. I did not run the test suite. The PR says it gives 159 pass and 0 fail and was red first without the copy; that is the author's claim and I have not checked it.

Closing issue: none. The PR is a regression fix for #18336 and names no closing issue, so there were no criteria to check.

Spend (not a finding): the wider test-scope line (.github/scripts/*.mjs) runs this suite on more PRs. That spends CI minutes on the standard runners the repository already uses.

Loosened checks: none. The diff adds a check and relaxes nothing. Loosened checks would be marked: fail. That is the default: the prompt had no loosened_check_verdict: line, and with no loosened_check_patterns: line there are 0 patterns. The prompt also had no loosened_check_decision_record: line, so I did not check the citation requirement.

Dropped as advisory: the pre-existing gap the prior review noted is not repeated here. That gap is declare-test-scope.mjs importing files that are not staged, which the test pins. This review is blocking only.

Verifier dropped 0 of 0 candidates.

@kyle-sexton

Copy link
Copy Markdown
Member Author

The claude-review advisory (declare-test-scope.mjs cannot load in the read runner, pinned by this PR's test) is fixed in the stacked follow-up #18664. That PR stages each base-script activity's whole load closure: static and literal dynamic imports, new URL resources and BASH_SOURCE-relative shell loads, with each containing directory copied to its repository path. It removes the pin, so the same test fails on any unresolved load. #18664 flips ready once this one merges.

Lane-Activity: pr-unblock/resolve-conflicts
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit c8f9d62 Nov 24, 2026
67 of 68 checks passed
@kyle-sexton
kyle-sexton deleted the fix/stage-cdn-paths-for-base-scripts branch November 24, 2026 03:42
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant