Skip to content

refactor(lanes): share retry-fetch and markLaneHold through .github/scripts/lib - #15472

Merged
kyle-sexton merged 5 commits into
mainfrom
refactor/lane-lib-retry-fetch
Nov 12, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
refactor/lane-lib-retry-fetch

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes #15444

Summary

retry-fetch.mjs lived as three byte-identical copies in apply-patch/, pr-unblock/ and work-resolve-issue/, and report-outcome.mjs carried its own copy of markLaneHold. Both now live once in .github/scripts/lib/, which collect-base-activity already stages beside every script copy, and every importer reads them from there. Part of restructuring pass #14159 (R1).

Built in a session because the shared-lib move is outside what the issue lane can patch (host-run); agreed with the hub session.

session: Simplify Planning

Fix

  • lib/retry-fetch.mjs replaces the three copies; apply-patch.mjs, address-feedback.mjs, post-statuses.mjs and report-outcome.mjs import it. report-outcome.mjs imports markLaneHold from lib/lane-hold-marker.mjs.
  • Hold floor: the three retry-fetch enforcement rows become one lib/retry-fetch.mjs row, and lib/lane-hold-marker.mjs gains an enforcement row, since report-outcome.mjs now imports it. No row is dropped for a file that still exists and no class changes (60 rows to 59). merge-holds.mjs, both review workflows' hold-paths and ci-status's hold_patterns are regenerated by scripts/sync-hold-floor.py.
  • ci-status's base-config sparse checkout lists both lib files in place of the old copies.
  • The write runner's apply-base step copies lib/retry-fetch.mjs out of the base with apply-patch's other cross-directory imports, and the collect-base-activity test's base fixture stages it for deny-rules.mjs (the first CI run's test-node and write-runner-never-rules failures). That fix and a pr-pipeline changelog fragment take the change past the issue's 15-file cap to 18 files; each is required for the move to work or to release.
  • The test that only held the copies equal is gone; lane-hold-marker.test.mjs tests the one markLaneHold. Floor-row tests, test_babysit_risk counts and test_floor_paths pins follow the moved paths.

Verification

  • python3 scripts/sync-hold-floor.py --check: pass, after merging current main.
  • test_merge_holds_sync (18), the full babysit-prs Python suite (4,295), callers.test.mjs, and the node suites in lib, apply-patch, pr-unblock, work-resolve-issue and pr-merge (3,441): pass.
  • scripts/ci-lanes-pr-hold.test.sh: exit 0. actionlint on the three workflows: clean.
  • test_floor_paths pins: the old and new floor sets were diffed by script first, and it reproduced the old pins exactly before they were updated.
  • Known for this PR only: on its own ci-status run, base clear-escalations.mjs cannot import from base-config, because base address-feedback.mjs still imports ./retry-fetch.mjs (pr-require-checks.yml:5987-6002). It fails closed (the hold stays) and matters only if the lanes App clears a stale hold on this PR.

Related

Follow-ups

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQb9Q3tnh28AzDYZ8AUjhH

kyle-sexton and others added 3 commits November 11, 2026 18:32
…cripts/lib

retry-fetch.mjs lived as three byte-identical copies in apply-patch/,
pr-unblock/ and work-resolve-issue/, and report-outcome.mjs carried its
own copy of markLaneHold. collect-base-activity stages the whole base
.github/scripts/lib/ beside every script copy, so both now live once in
lib/ and every importer reads them from there. The test that only held
the copies equal is gone, and lane-hold-marker.test.mjs tests the one
markLaneHold.

The hold floor keeps every module the floored scripts import: the three
retry-fetch enforcement rows become one lib/retry-fetch.mjs row, and
lib/lane-hold-marker.mjs gets an enforcement row, since report-outcome
now imports it (test_merge_holds_sync asks for it). ci-status's
base-config sparse checkout lists both lib files. merge-holds.mjs, both
review workflows' hold-paths and ci-status's hold_patterns are
regenerated by scripts/sync-hold-floor.py; the floor-row tests and the
test_floor_paths pins follow the moved paths.

Refs: #15444

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQb9Q3tnh28AzDYZ8AUjhH
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 11, 2026 23:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 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-12T00:00:52.479452Z 47ac002 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 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15472 (head d2f5238)

No security issues found. This lane already reviewed an earlier head (47ac0027), so this review was blocking only: only CRITICAL and IMPORTANT findings would be reported, and there are none.

What I checked. I read every hunk of all 21 listed files, plus the two deleted retry-fetch.mjs copies, which the diff carries but the file list doesn't. I read each trusted-path file's whole change and what it gates: merge-holds.mjs, docs/conventions/pr-pipeline.yaml, pr-require-checks.yml, both hosted review workflows, pr-run-activity-write.yml, apply-patch.mjs, address-feedback.mjs and report-outcome.mjs.

  • Merge-hold floor (trust control: merge hold). HOLD_PATH_CLASSES (merge-holds.mjs#L427-L433), the merge rows in pr-pipeline.yaml, ci-status hold_patterns and both review workflows' hold-paths all change the same way:

    • the three enforcement rows for the deleted retry-fetch copies become one .github/scripts/lib/retry-fetch.mjs row;
    • .github/scripts/lib/lane-hold-marker.mjs gains an enforcement row, since report-outcome.mjs now imports it.

    Each module that the hold scripts load is still floored, and no class changes. Nothing the floor covered is left uncovered, so no hold is weakened.

  • Moved code is unchanged. lib/retry-fetch.mjs is the old copy minus two comment lines. Its logs still name only an error's name and cause code, never its message, so a token in an error message still can't reach the log. The markLaneHold that report-outcome.mjs now imports has the same body as the inline copy it replaces.

  • New since the last head: write runner's apply-base step. pr-run-activity-write.yml#L1441-L1442 copies lib/retry-fetch.mjs from .base (the trusted base) into $RUNNER_TEMP/lib/. This happens before the head checkout replaces .base and before the runner is isolated, like apply-patch's other sibling imports. So apply-patch's ../lib/retry-fetch.mjs import loads base code, never head code, and no untrusted code joins the credentialed step's load path.

  • New since the last head: collect-base-activity test fixture. Adding .github/scripts/lib/retry-fetch.mjs to PATCH_RULE_FILES only changes what the test stages. No behavior changes.

  • Known for this PR only. The PR description notes that on this PR's own ci-status run, base clear-escalations.mjs can't import its modules from the new sparse checkout. That fails closed (the hold stays on), so it isn't a security finding.

  • Tests and docs. The count and digest pin updates (enforcement 60 → 59, floor 142 → 141) and the lane-hold-marker.test.mjs rewrite follow the moved paths. None of them weakens what a test asserts about hold behavior.

  • Not affected. The PR adds no trusted actor, grows no token scope, leaves the kill switch alone, sends no new untrusted text to a lane and touches no plugin manifest. It removes no standing instruction, so the instruction-surface check doesn't apply.

PR text. No embedded instructions in the PR description or the issue context.

Spend. None. Nothing changes lane runs, models, schedules or billing.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #15472, moving retry-fetch and markLaneHold into .github/scripts/lib

Scope: I read every hunk of all 21 listed files in the full diff, and the two deleted retry-fetch.mjs copies, which are on no list. This lane already reviewed an earlier head (47ac0027), so this review reports blocking findings only. The earlier review's summary comment had 0 findings, and no prior finding is open. No settled-threads file was supplied.

No blocking findings.

What changed since the earlier head, and what I checked

  • pr-run-activity-write.yml apply-base step (#L1441-L1442). The step now creates $RUNNER_TEMP/lib and copies .base/.github/scripts/lib/retry-fetch.mjs into it.
    • The script runs from $RUNNER_TEMP/base-script/ (#L1710), so apply-patch's new ../lib/retry-fetch.mjs import resolves to that copy.
    • .base is the default-branch tip checkout (#L734-L738), the same tree the workflow comes from once this merges, so the cp source exists.
    • retry-fetch.mjs imports only node builtins, so nothing else needs staging.
  • collect-base-activity.test.mjs. PATCH_RULE_FILES adds .github/scripts/lib/retry-fetch.mjs, so the test's base fixture gives deny-rules.mjs/apply-patch the file they now import.
  • Rest of the move (unchanged since the last review):
    • All four importers point at ../lib/retry-fetch.mjs.
    • report-outcome.mjs imports markLaneHold from ../lib/lane-hold-marker.mjs, and the fs/path names it dropped are unused.
    • The three floor rows become one plus a lane-hold-marker.mjs row (60 → 59 enforcement, 142 → 141 total). The change is the same in pr-pipeline.yaml, merge-holds.mjs, both review workflows' hold-paths, ci-status hold_patterns, merge-holds.test.mjs, test_babysit_risk.py, test_floor_paths.py and ci-lanes-pr-hold.test.sh.
    • Git records lib/retry-fetch.mjs as a rename from apply-patch/ rather than work-resolve-issue/. That doesn't matter because the copies were byte-identical.

Closing issue #15444

  • The criteria on "exists once / every importer uses those" and "behavior unchanged" are met: the code moves byte for byte apart from two dropped header comment lines.
  • The file-cap criterion is not literally met: 18 hand-edited files against the cap of 15. The PR body gives the reason: the write-runner apply-base copy and the test fixture are needed for the move to run, plus the convention-page changelog fragment. I did not count this as a blocking finding.
  • These criteria are author-claimed and unverified: sync-hold-floor.py --check passes, the named suites pass, and ci-status is green. This lane has no shell, so I could not run them or recompute the new test_floor_paths.py digests.

Spend

None. This change adds no paid usage.

kyle-sexton and others added 2 commits November 11, 2026 20:16
apply-patch.mjs now imports ../lib/retry-fetch.mjs. The write runner's
apply-base step copies each cross-directory module apply-patch imports
out of the base before the head checkout replaces it, so it copies
lib/retry-fetch.mjs too; the collect-base-activity test's base fixture
stages it for deny-rules.mjs.

Refs: #15444

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQb9Q3tnh28AzDYZ8AUjhH
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 7db93e3 Nov 12, 2026
85 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/lane-lib-retry-fetch branch November 12, 2026 01:36
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 12, 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.

Move the retry-fetch copies and report-outcome's markLaneHold copy into .github/scripts/lib

1 participant