Skip to content

refactor(check-trusted-trigger): reuse shared patterns and fold the duplicated listed-human check - #14223

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14095-42514590105-1
Nov 8, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14095-42514590105-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14095

Summary

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

Reviewed the five listed files through the four /simplify checks and applied only fixes that keep behavior unchanged. In check-trusted-trigger.mjs, the identical isListedHuman closure written in both verifyDispatcher and verifyRecordedRerun is now one module-level listedHuman helper built on isListed. Inline regex literals now reuse the existing SHA and PR_NUMBER constants, and a new ENV_ID constant replaces three copies of the same id pattern in main. Two Stop("no-pr") guards in evaluateTrigger are merged, main's catch tests instanceof Stop once, and one wrapped call is collapsed onto one line. The action.yml description is reflowed; the folded scalar resolves to the same string. reconciler-record.mjs, check-upstream-status/action.yml and check-upstream-status.mjs are left unchanged: the review found nothing in them to simplify without changing behavior, and the one candidate in reconciler-record.mjs (passing sleep straight through) was reverted after review because a null sleep would no longer fall back to the default. No export, output, exit code, printed message or flag changed.

Not verified

  • The node test suite (check-trusted-trigger.test.mjs, check-upstream-status.test.mjs) was not run: this lane permits no interpreter. Left to the PR's CI.
  • Tidy skipped: the change sits under .github/, a listed shared path for the tidy cutoffs.
  • ci-status green on the PR: a PR check, left to the PR's CI.
  • Lint (Biome) on the edited .mjs file not run here; check-affected lists no local JS lint, so it is left to the PR's CI.
  • check-trusted-trigger.mjs is a floor entry in plugins/source-control/skills/babysit-prs/scripts/tests/test_merge_holds_sync.py, so expect the PR to need a human merge.

Fix

  • .github/actions/check-trusted-trigger/check-trusted-trigger.mjs: one listedHuman helper replaces two identical isListedHuman closures; reuses SHA and PR_NUMBER and adds ENV_ID for the repeated id pattern in main; merges two no-pr guards in evaluateTrigger; main's catch evaluates instanceof Stop…
  • .github/actions/check-trusted-trigger/action.yml: description reflowed to even line widths; the folded > value is byte-identical.

Verification

The runner ran each check from the base copy against e76b6aa:

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

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: passed (All 1 changelog fragment(s) under .changes/ are valid); run before and after the final edits.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: passed (no changed skills under plugins/*/skills/).
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: passed (9 passed, 7 skipped over 2 changed files).
  • Fresh-context review subagent over the whole diff: every hunk equivalent except reconciler-record.mjs's sleep pass-through (null sleep would no longer fall back to defaultSleep); that hunk was reverted and the two comment wording notes were applied.
  • git-read diff --numstat HEAD: 2 files, 48 changed lines, within the issue's 400-line and 15-file limits.
  • Grep for callers: reconciler-record main is called only by pr-feedback-dispatch.yml (no sleep) and the test file (a function sleep); no test reads the module source or names isListedHuman.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42514590105

Left out: the items under Not verified.

Related

#14095

Merge-Risk: max=HIGH demote=true head=e76b6aa5b23971fb87ed1676b5f5bb4e950edf8e rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14223 (no findings)

I found no security issues. Both changed files are in the trusted-trigger control (.github/actions/check-trusted-trigger/**). I read every hunk of both files and the head code each hunk depends on. None of the changes lets anything through the trusted-trigger check that the base code stopped:

  • listedHuman helper (L615):
    • isListed(list.humans, user) && !deniedIds.has(user.id) expands to Number.isInteger(user?.id) && list.humans.has(user.id) && !deniedIds.has(user.id). That is the same predicate as the two closures it replaces.
    • list.humans is still read when the check is called, not when the helper is built.
    • Both call sites (verifyDispatcher L926, verifyRecordedRerun L1101) pass the same list and deniedIds.
  • Regex constants:
    • PR_NUMBER (L17) is /^[1-9][0-9]{0,9}$/, the same pattern as the inline literal it replaces in isTrustedClose.
    • SHA (L21) is /^[0-9a-f]{40}$/, the same as the literal it replaces in resolveRunPull.
    • The new ENV_ID is the same pattern as the three /^[1-9][0-9]{0,14}$/ copies it replaces in main, which validate LANES_APP_ID, APP_FIELD_ID and APP_FIELD_OPTION.
    • None of these regexes has the g flag, so reusing one across calls carries no lastIndex state between them.
  • responseDetail catch: text is still initialised to "" (L122), and an awaited call that throws never assigns. So the removed text = "" changed nothing.
  • evaluateTrigger guard merge: the two throw new Stop("no-pr") guards are joined with ||. The same conditions still produce the same stop.
  • main catch: instanceof Stop is now tested once and stored in stop. Which branches run is unchanged: fault, FAULT_REASON and the no-pr fallback all behave as before.
  • action.yml: only the folded description: scalar is reflowed; no inputs, steps or permissions changed.

The PR description has no embedded text aimed at this lane. The kill switch, token scope and merge holds are untouched, and nothing here can cause a charge.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings. I read every hunk of both changed files. This was a full review, not blocking-only: the prior-findings file shows no earlier head reviewed by this lane.

I checked each hunk against the closing issue's main acceptance criterion (#14095, "Behavior is unchanged"). Every hunk keeps behavior the same:

  • check-trusted-trigger.mjs listedHuman helper (L58, used at L926 and L1101): isListed(list.humans, user) && !deniedIds.has(user.id) gives the same predicate as the two removed closures, Number.isInteger(user?.id) && list.humans.has(user.id) && !deniedIds.has(user.id). list.humans is still read when the check runs, and deniedIds is the same parameter the closures captured.
  • Regex reuse: PR_NUMBER (L17) is /^[1-9][0-9]{0,9}$/ and SHA (L21) is /^[0-9a-f]{40}$/, the same patterns as the inline literals they replace. The new ENV_ID matches the three copies it replaces. None of these use the g flag, so sharing them across .test() calls carries no state from one call to the next.
  • responseDetail catch: text starts as "" (L122), and the assignment inside the try only happens if .text() resolves, so the removed reset did nothing.
  • Merged evaluateTrigger guards: both branches threw Stop("no-pr"), so joining them with OR keeps the same result.
  • main catch: computing instanceof Stop once gives the same values for fault and the reason.
  • action.yml: the description is a folded > scalar, so the reflow keeps the same words and the same resolved string.

Other criteria:

  • The diff edits only files the issue lists, and changes 48 lines in 2 files.
  • I could not run anything in this lane, so the CI status and the test suite are left to the PR's CI.
  • The PR body's checks ("check-affected: passed", the fresh-context review) are the author's claims, and I did not verify them.

No .claude/rules/ file's paths: covers these files in a way that changes the review, and the diff touches no plugin manifest. No paved-path finding applies.

No cost or spend impact.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for e76b6aa

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-14223-e76b6aa5b23971fb87ed1676b5f5bb4e950edf8e, expires on 2026-12-08.

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 95ac05c Nov 8, 2026
68 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14095-42514590105-1 branch November 8, 2026 20:15
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 95ac05c9560b493be4da7a03f2d968dedbddd7f1; 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.

Simplify the check-trusted-trigger and check-upstream-status actions

0 participants