Skip to content

refactor(work-resolve-issue): simplify the second half of report-outcome.mjs - #14299

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14147

Summary

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

Simplified the functions that start in the second half of report-outcome.mjs (range 2 of 2: from humanLabelFrom at line 1673 on; decide starts at line 1428, in range 1, so it is unchanged). Behavior stays the same. Six lane.json readers (readBranch, readLimit, readIssueStop, readFunding, readTurnCap, readOverCap) now share one fromLane(dir, read, fallback) helper instead of six copies of the read, parse and catch code. The helper keeps each reader's whole body inside the try, so a model-rewritten lane.json value still falls back the way it did before. The two turn-count parsers became one turnCount. main and findPriorMain share targetIssue, which runs the ISSUE_NUMBER and GITHUB_REPOSITORY checks once. The bot login and the resolved-config path each come from one helper instead of five and three inline copies. Three copies of the 'did this run already post its marker' check became postedThisRun. findPriorMain reuses the existing listedCommits instead of an inline copy of it.

Not verified

  • node --test .github/scripts/work-resolve-issue/report-outcome.test.mjs (and post-statuses and label-unblocked tests that import this module) were not run: this lane's Bash runs only the named wrappers, so the suites are left to the PR's CI.
  • Tidy skipped: the change is under .github/, a listed shared path for the tidy cutoffs.
  • One remaining edge in main: targetIssue checks the ISSUE_NUMBER pattern before Number(), where main used to call Number() first. The error text differs only for a non-string, non-coercible env value such as a Symbol, which no command-line run can pass.
  • ci-status green is a PR check left to the PR's CI.

Fix

  • .github/scripts/work-resolve-issue/report-outcome.mjs: added fromLane, turnCount, targetIssue, botLogin, resolvedConfigPath and postedThisRun (all module-private), and moved the lane.json readers, findPriorMain, finishStop and main onto them; findPriorMain uses listedCommits. Exports, messages, API…

Verification

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

  • 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

#14147

Merge-Risk: max=MEDIUM demote=false head=fc2856f67d6da63e91ce295cf9a2df894236c0aa 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 fc2856f67d6da63e91ce295cf9a2df894236c0aa: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14299, no security issues found

Scope: I read every hunk of .github/scripts/work-resolve-issue/report-outcome.mjs, the PR's only changed file. It is on the trusted-path list, so I read its whole change and what it gates.

The PR is a behavior-preserving refactor. I checked each part that touches a trust or safety decision against the base code:

  • lane.json readers. readBranch, readLimit, readIssueStop, readFunding, readTurnCap and readOverCap now go through the new fromLane(dir, read, fallback) helper. Each reader's whole body still runs inside the try, so a model-rewritten lane.json value that throws still returns the same fallback as before ("" or null).
    • readBranch still accepts a branch only when isLaneBranch passes.
    • readIssueStop still looks up stop text with Object.hasOwn(ISSUE_STOPS, …).
    • readFunding only moved the error-text read below the 401 check, which gives the same result.
    • turnCount keeps the same /^[1-9][0-9]{0,5}$/ pattern.
  • targetIssue. It runs the same ISSUE_NUMBER and GITHUB_REPOSITORY pattern checks, and it still throws before any API path is built from those values, in both main and findPriorMain.
  • postedThisRun. It keeps the comment.user?.login === bot author check, so a marker written by another account still does not stop the post. It also keeps the non-empty runId check. Each call site passes the same outcome and run id as before: plan.exit with runId in finishStop, "turn-cap" with runId, and plan.action with plan.runId.
  • botLogin and resolvedConfigPath. They return the same values as the inline copies they replace. Hoisting bot to the top of main leaves no duplicate declaration in that scope: the only remaining const bot declarations are at lines 2140 (in findPriorMain) and 2491 (in main).
  • listedCommits. findPriorMain now calls the existing function (line 1722), whose expression is the same as the inline copy it removes, so a branch the compare listing cuts short is still never resumed.

Trust controls: this file is a module the merge-hold scripts import from work-resolve-issue/. Nothing here widens who is trusted, what a token can do, or what untrusted text reaches a lane, and no merge hold is narrowed. There is no embedded instruction text in the PR context and no manifest change.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of the one changed file, .github/scripts/work-resolve-issue/report-outcome.mjs, and checked the code around each change at head.

Is behavior unchanged? Yes, as far as reading the code shows.

  • The lane.json readers. readBranch, readLimit, readIssueStop, readFunding, readTurnCap and readOverCap all run their whole body inside the try of the new fromLane. So a lane.json value that makes a reader throw still falls back the same way as before.
  • readFunding. The error-text read now happens after the 401 check. That read cannot throw: there is a typeof guard, and slice on a string is safe. So moving it changes nothing.
  • turnCount. It uses the same pattern and conversion as the two parsers it replaces.
  • targetIssue. It runs the same two checks in the same order as findPriorMain did. In main, the Number() call now runs after the checks instead of before. The PR body notes this, and it only matters for a value that is not a string, which the environment never supplies.
  • bot in main. It is now one const bot = botLogin(env) at the top of main, before the try. Before, appIdFrom read the same expression in that same spot, so this adds no new way to throw. The const bot declarations removed from the outside-author block and from the try body (old line ~2642) gave the same value. Every remaining use, including allLaneCommits(commits, bot) at line 2638, gets the same login. No other bot binding in main shadows or clashes with it.
  • postedThisRun. All three call sites keep their old checks: the run id must be non-empty and match the marker's run, and the outcome must match. The third call site passes plan.runId, which keeps its earlier behavior.
  • listedCommits and resolvedConfigPath. They compute the same values as the inline code they replace. No leftover reference to the removed local resolved remains.

Closing issue #14147, criterion by criterion:

  • Behavior unchanged. Met, by my reading above. No exported name, flag or message changes, and the new helpers are all module-private.
  • Only the listed file is edited. Met.
  • Within 400 lines and 15 files. Met.
  • Only functions starting in range 2 are changed. Met: every changed function starts at or after readBranch (around line 1726), past humanLabelFrom at line 1673.
  • ci-status green. Left to CI. I did not run it, and the author says they did not run the node --test suites either.

I did not run any tests. The verification in the PR body is the author's claim and I have not checked it. Because this is a refactor meant to keep behavior the same, the existing report-outcome.test.mjs suite would catch a regression in what it already asserts. The change adds no new behavior that would need a test of its own.

This file matches a trusted path. I read its whole change, and I found no security or trust-boundary change: every validation and fallback is the same as before.

No embedded instructions were found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for fc2856f

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-14299-fc2856f67d6da63e91ce295cf9a2df894236c0aa, 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 82fb346 Nov 9, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14147-42550090408-1 branch November 9, 2026 02:53
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 82fb3463ff14c663151816508eebac32d359009e; 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 2 of 2)

0 participants