Skip to content

refactor(work-resolve-issue): simplify stop-routes and write-issue lookups - #14266

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14150

Summary

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

In stop-routes.mjs, the five exported row readers (stopRoute, stopReasonCode, stopRetries, stopFault, stopWhy) each repeated an Object.hasOwn(STOP_ROUTES, reason) guard. They now share one rowOf helper. Because the load-time validation guarantees every listed row has a route and a non-empty why, the results are the same for listed and unlisted reasons. In write-issue.mjs, the four dropped-counter initializations are now one Object.assign with the same key order, so the logged JSON is unchanged. The comment loop computes the App-author and body checks once, and one entry() builder replaces the two duplicated comment-object literals with the same key order. retry-fetch.mjs and scan-reuse.mjs are unchanged: retry-fetch.mjs is a mirrored copy that retry-fetch.test.mjs keeps byte-equal with the apply-patch/ and pr-unblock/ copies, so editing it would mean editing files outside this issue's list. scan-reuse.mjs had nothing that would get shorter without changing behavior.

Not verified

  • The node test suites (stop-routes.test.mjs, write-issue.test.mjs) were not run: this lane cannot run node, so they are left to the PR's CI.
  • tidy: not run, because the change is under .github/, a listed shared path that the tidy cutoffs exclude.
  • retry-fetch.mjs left unchanged: retry-fetch.test.mjs keeps it byte-equal with apply-patch/retry-fetch.mjs and pr-unblock/retry-fetch.mjs, so any edit would also touch files outside this issue's list.
  • scan-reuse.mjs left unchanged: no simplification found that keeps behavior identical and makes it shorter.
  • ci-status green: a PR check, left to the PR's CI.

Fix

  • .github/scripts/work-resolve-issue/stop-routes.mjs: added a private rowOf(reason) helper; stopRoute, stopReasonCode, stopRetries, stopFault and stopWhy read through it instead of repeating the Object.hasOwn guard.
  • .github/scripts/work-resolve-issue/write-issue.mjs: one Object.assign sets the lanes-app, after-admission, over-cap and stale-split counters to 0, in their old order. The comment loop hoists the fromApp and text checks, and one entry() builder makes the verify-findings, refinement, human and bot…

Verification

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

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

The run reports:

  • check-changelog-fragments: all 5 fragments valid; no plugin changed, so no fragment is owed
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped over 2 changed files
  • git-read diff --numstat HEAD: 2 files, 24 added and 30 removed lines
  • fresh-context review subagent over the diff: it found one error-path difference (readResume/readStale had moved ahead of building the issue object, which changes the network-call order and which error is reported when that build throws); that hunk was reverted to the original order. It found no…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42530387747

Left out: the items under Not verified.

Related

#14150

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

Code review: PR #14266, a refactor of the work-resolve-issue scripts

I read every hunk of both changed files in the full diff. I found no blocking or advisory findings. stop-routes.mjs is on the trusted-path list, so I read all of its change and the load-time validation that the change depends on.

stop-routes.mjs

  • The new rowOf helper still checks Object.hasOwn, so prototype keys such as constructor and __proto__ still count as unlisted reasons.
  • stopRoute and stopWhy: the ?? "fail" and ?? "<fallback why>" defaults only apply when a reason is not in the table. The load-time loop at stop-routes.mjs#L49-L51 makes every listed row have a valid route and a non-empty why, so results are the same as before.
  • stopReasonCode: an unlisted reason looks up CLASS_CODES[undefined] and falls back to "none", as before. A listed row has either no class or one from HOLD_CLASSES (L59-L64), so the lookups are the same.
  • stopRetries and stopFault: same results for listed and unlisted reasons.
  • All five names are still exported.

write-issue.mjs

  • stale-split is now set to 0 earlier, at L244 instead of after the split-parent block. Nothing between those two points writes to dropped, and a thrown error goes to the catch, which never logs dropped. The logged JSON keeps the same key order and values.
  • The entry() builder writes keys in the old order (author_login, author_kind, created_at, url, body, decision), with decided_at added last. The written issue JSON is unchanged.
  • ...(decision && {...}) spreads nothing when decision is falsy, the same as the old ternary.
  • fromApp and text are computed once and used in place of the repeated inline expressions, with the same truth values.

Closing issue #14150

  • Behavior unchanged: met, based on my reading of the code above. The existing stop-routes.test.mjs and write-issue.test.mjs cover these functions. I did not run them; the PR body also says it did not run them and leaves that to CI.
  • Only listed files edited: met. Both files are on the issue's list.
  • Size limits: met, at 24 added and 30 removed lines in 2 files.
  • ci-status green: left to the PR's CI. I could not check it from here.

The PR body explains why retry-fetch.mjs and scan-reuse.mjs are unchanged. I found no embedded instructions in the PR context.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14266, head d65c735

I found no security issues. I read every hunk of both changed files. Both are trusted paths, so I compared each changed expression against the base code it replaces.

.github/scripts/work-resolve-issue/stop-routes.mjs (trusted path; the work-resolve-issue/ modules feed the lane's stop routing and the merge-hold modules)

  • The new rowOf helper still checks Object.hasOwn(STOP_ROUTES, reason). A reason taken from run output therefore still can't reach a prototype key such as __proto__ or constructor.
  • An unlisted reason gets the same results as before: stopRoute → "fail", stopReasonCode → "none", stopRetries → cap, stopFault → false, stopWhy → the "not in the lane's route table" text.
  • A listed row behaves the same, with one small difference. A row with no route or why now falls back to "fail" or the default text instead of returning undefined. That is fail-closed, so it opens no new path. The load-time validation the PR cites already rules such rows out.
  • stopReasonCode looks up CLASS_CODES the same way the base code did. The class value comes from the repository's own table, not from untrusted input. No hold, route or retry cap is widened.

.github/scripts/work-resolve-issue/write-issue.mjs

  • Dropped counters: the Object.assign sets the same four counters in the same order. Moving the stale-split reset earlier is harmless: nothing between line 244 and the comment loop touches that counter (L244–L305).
  • Comment trust filtering is unchanged. The verify-findings check is still: authored by the lanes App, starts with CAPPED_CLOSE_MARKER, and either never edited or last edited by the App only (L296). The other checks are unchanged too: the non-refinement App drop, the stale-split drop, the after-admission time gate, isDecisionComment, and the human/bot classification against humans.
  • Output is unchanged. entry() builds the same keys in the same order. ...(decision && {...}) adds decided_at only when decision is true, as the old ternary did.
  • No untrusted text gets new access to the lane, and no token, secret or actor list is involved.

The diff removes no standing instruction and changes no plugin manifest. It doesn't touch the trusted-actor list, the lanes token request, or the kill switch. The PR context file contains no embedded directives.

Spend: none.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head d65c735e6082d3809e0a6e8518049d33b656d31a. 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 d65c735e6082d3809e0a6e8518049d33b656d31a, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for d65c735

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-14266-d65c735e6082d3809e0a6e8518049d33b656d31a, 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 a2c9db1 Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14150-42530387747-1 branch November 8, 2026 23:10
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 1, timeout 0, no coverage 0, invalid 0, not run 6.
Covered-code score 0%; mutation score 0%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/work-resolve-issue/stop-routes.mjs 0 0 0 0 0 4
.github/scripts/work-resolve-issue/write-issue.mjs 0 1 0 0 0 2

Surviving mutants

Location Operator Disposition Cause
.github/scripts/work-resolve-issue/write-issue.mjs:244 SBR unclassified none

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit a2c9db16cb217afe70d4014a7e59948f03887e51; 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 work-resolve-issue .github script (2 of 2)

0 participants