Skip to content

refactor(work-resolve-issue): dedupe repeated helpers in report-outcome part 1 - #14290

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14146-42540818224-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14146

Summary

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

Simplified the first half (original lines 1-1436) of .github/scripts/work-resolve-issue/report-outcome.mjs and kept its behavior the same. Comment lines that were built the same way in several places now come from small helpers: runLines (six run-link pushes), notDoneLines (two not-done sections), firstLine (two decision first-line reads), labelNames (three label-name maps) and warnStatus (two identical work-status warnings). readHoldPaths and heldPaths now share one parse through readDiffCheck and deniedPaths, so heldPaths reads the config file once instead of twice, and readSummary and readChecks reuse the existing BLOB regex. Comment strings, returned objects, exported names and flags are unchanged, and no code past original line 1436 was touched.

Not verified

  • report-outcome.test.mjs was not run directly: this lane's Bash runs only the named wrappers, not node. Left to the PR's CI.
  • Tidy skipped: the change sits under the shared .github/ path, which the tidy cutoffs exclude.
  • On non-array labels or notDone (inputs GitHub and notDoneList never produce), the TypeError message now names the helper's parameter (for example 'labels.map is not a function' in place of 'had.map is not a function'). The throw itself is unchanged.
  • No changelog fragment: .github/scripts is not a plugin, so no release record applies.

Fix

  • .github/scripts/work-resolve-issue/report-outcome.mjs: added the runLines, notDoneLines, firstLine, labelNames, warnStatus, readDiffCheck and deniedPaths helpers and used them in handBack, stopPlan, outsideAuthorPlan, limitedPlan, fundingPlan, turnCapPlan, unmarkedAnswer, lateRecord,…

Verification

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

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

The run reports:

Left out: the items under Not verified.

Related

#14146

Merge-Risk: max=MEDIUM demote=false head=aa908e343c5d9e534e8f9d16e8be8d02aa96e2d7 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 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14290 (head aa908e3)

I found no security issues.

Scope: one changed file, .github/scripts/work-resolve-issue/report-outcome.mjs, which is on the trusted-path list. I read every hunk. The file counts as a merge-hold control because enable-auto-merge.mjs imports readHoldPaths from it (enable-auto-merge.mjs#L256, #L1805). The file also calls heldPaths itself (report-outcome.mjs#L2653).

Merge-hold check (readHoldPaths / heldPaths): I compared base and head behaviour case by case. The hold does not get weaker.

  • Config file unreadable or not valid JSON: at base, readHoldPaths returned null (holds every PR). At head, readDiffCheck returns undefined, and deniedPaths(undefined) then returns null, so the result is still null.
  • denied-paths missing, not a list, or holding a non-string: both versions return null.
  • heldPaths: at base, a failed second parse fell back to paths, which is already null in that case. At head the file is parsed once, and it still returns [] only when paths !== null and path-holds is one of undefined, null, false or "false". Otherwise it returns paths. This is the same fail-closed result as before.

Other hunks:

  • runLines, notDoneLines, firstLine, labelNames and warnStatus produce the same strings, the same order and the same checks as the code they replace.
  • DECISION.test(firstLine(...)) still requires a listed human who did not post through an app. The COMMENT_URL check in unmarkedAnswer and lateRecord is unchanged.
  • The warning text still strips \r, \n and %, so the workflow-command escaping is unchanged.
  • readSummary and readChecks now use the module-level const BLOB = /^[0-9a-f]{40}$/ (#L921). It is the same pattern the code had inline, and these functions only run after the module has loaded, so there is no initialisation-order (TDZ) problem.

Other checks:

  • No trust control gets wider: no change to who is trusted, to token scope, or to what untrusted text reaches a lane.
  • No standing instruction is deleted, no plugin manifest changes, and nothing in the change can cause a charge.
  • The PR context has no embedded instructions aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14290 (refactor of report-outcome.mjs, part 1)

No findings. This was a full review, not blocking-only: the lane has not reviewed an earlier head of this PR. I read every hunk of the one changed file, .github/scripts/work-resolve-issue/report-outcome.mjs. Its path is in the trusted list, so I checked each hunk for behavior equivalence against the unchanged code around it.

Equivalence checks, hunk by hunk:

  • heldPaths / readHoldPaths. They now share one parse through readDiffCheck and deniedPaths. A read or parse failure still gives null, which holds every PR, because deniedPaths(undefined) returns null. A missing or non-list denied-paths value still gives null. With path-holds set to undefined, null, false or "false" and a valid list, the result is still []. The only difference is that the file is now read once instead of twice. That is the efficiency gain the PR claims, and no caller sees a different result.
  • handBack. notDoneLines moved inside the array that escalated([...]) wraps. escalated only puts ESCALATION_MARKER in front of the array (L320), so the line order is the same. runLines is spread into the final push just before its "" line, which is also the same order as before.
  • stopPlan, outsideAuthorPlan, limitedPlan, fundingPlan, turnCapPlan. The run link and not-done lines are added at the same positions as before.
  • firstLine. lateRecord already turns body into a string (L1102). In unmarkedAnswer the helper reproduces the original String(last?.body ?? "") expression.
  • labelNames, warnStatus. The output is the same and the warning text is identical.
  • BLOB. BLOB is the same /^[0-9a-f]{40}$/ regex with no g flag (L921). It is defined at module level, so readSummary and readChecks can use it when they run.

Closing issue #14146, acceptance criteria:

  • Behavior unchanged: met, by the checks above. report-outcome.test.mjs already tests heldPaths/readHoldPaths, the not-done section, the run link and the work-status warning, so a regression here could fail a test.
  • Edits only the listed file: met.
  • Within 400 changed lines: met.
  • Changes only inside range 1 of 2: met. The last edit sits near head line 1266, inside the first 1436 lines of the original file.
  • ci-status green: the PR's CI decides this. I did not run the tests, because this lane has no shell. The author's verification is their own claim, and I have not confirmed it.

None of the .claude/rules/ path globs match the changed file. The diff changes no plugin manifest. I found no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head aa908e343c5d9e534e8f9d16e8be8d02aa96e2d7. The lanes clear this reason on their own; the next scheduled run judges it again.

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for aa908e3

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-14290-aa908e343c5d9e534e8f9d16e8be8d02aa96e2d7, expires on 2026-12-09.

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 9, 2026
Merged via the queue into main with commit bbfd932 Nov 9, 2026
80 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14146-42540818224-1 branch November 9, 2026 01:55
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit bbfd9320893de5a0a39d26629875f1bea7b941a3; 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 report-outcome.mjs .github script (part 1 of 2)

0 participants