Skip to content

refactor(intake-triage): simplify refine.mjs and lane-run-report post.mjs - #14197

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14107

Summary

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

Made both files shorter without changing what they do. refine.mjs: merged the duplicate node:fs and admit.mjs imports, added small helpers for code that was repeated (byApp, laneComment, issueContext, admissionComment, breakLinks shared by line and titleLine), folded the three copies of the exact-refinement retriage sequence in applyRefinement into exactRetriage and exactStays, and dropped orderProblem's placeholder array. post.mjs: inlined the WORDS alias and built the LEGS map from a list. The API calls, their order, logged text, outputs, exports and CLI flags are the same as before.

Not verified

  • Node test suites (refine.test.mjs, admit.test.mjs, post.test.mjs) were not run directly: this lane cannot run node, so they are left to the PR's CI
  • ci-status green on the PR: this is a PR check, left to the PR's CI
  • tidy: skipped because the change is under .github/, a listed shared path for tidy

Fix

  • .github/scripts/intake-triage/refine.mjs: merged the imports; added the byApp, laneComment, issueContext, admissionComment and breakLinks helpers in place of the repeated inline code; folded the retriage and stays branches of applyRefinement into exactRetriage and exactStays; orderProblem uses…
  • .github/scripts/lane-run-report/post.mjs: inlined the REST_PATH_WORDS alias and built LEGS from a list, with the same entries in the same order (2 added, 9 removed)

Verification

The runner ran each check from the base copy against 0ad994c:

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

The run reports:

  • check-changelog-fragments: passed (All 2 changelog fragment(s) under .changes/ are valid); no fragment is needed because .github/ belongs to no plugin
  • check-changed-skills: passed (no changed skills)
  • check-affected: 8 passed, 8 skipped over the 2 changed files
  • Fresh-context review subagent over the whole diff: found no behavior change. It confirmed line() output is byte-identical after the reorder (the bracket escape and the zero-width-space breaks commute, and U+200B is unchanged), that the helpers keep their semantics (undefined appId, null comments,…
  • Grep: each zero-width break in breakLinks holds exactly one U+200B, the same character titleLine used before as \u200b
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42508821379

Left out: the items under Not verified.

Related

#14107

Merge-Risk: max=HIGH demote=true head=0ad994cd680949037f3f7d92189183ee6d7dd48a 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 0ad994cd680949037f3f7d92189183ee6d7dd48a: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14197 (head 0ad994c)

I found no security issues. I read every hunk of both changed files. Neither file matches a listed trusted path, and the diff changes no trust control, token request, kill-switch read, merge hold, manifest or standing instruction.

This is a behavior-preserving refactor. I checked each part that touches a security boundary:

  • line() / titleLine() sanitizers (refine.mjs): these stop model and title text from forging lane markup, mentions, issue links and URLs. line() now escapes < and brackets/parens before running the shared breakLinks step, where before the escapes and link breaks were interleaved. The operations commute: no break pattern (@, #/GH- before a digit, ://, www.) matches a character or position that the < or bracket escape adds or removes. A backslash only ever lands before [, ], ( or ), never between # and a digit. A content search confirms the breakLinks replacements at refine.mjs#L652-L655 contain the zero-width space, so titleLine keeps the U+200B it used to write as ​.
  • App-identity checks: the new byApp helper still requires a defined appId and an exact match on user.id. isRefinement, postDecline, ownSplit, sizeSplitPending and admissionComment keep the same marker-prefix conditions.
  • laneComment: same as before. It still requires exactly one lane comment from the Bot-typed LANE_BOT login that starts with MARKER and was updated at or after startedAt. A NaN date still fails.
  • applyRefinement: the exactRetriage and exactStays helpers keep the same order of steps: untrusted() check, then retriage() (returning early if it holds), then the optional NEEDS_DECISION removal, then post(true). The untrusted() gate still runs before any label is lifted on every path that lifts one.
  • orderProblem: replacing parts.length with count changes nothing. Both callers pass an array length (L413, L449), which is always a non-negative integer.
  • post.mjs: LEGS has the same five entries in the same order, and templatePath still collapses every segment not in REST_PATH_WORDS to *.

The PR description contains no text directed at the review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 0ad994cd680949037f3f7d92189183ee6d7dd48a: 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 (.github/scripts/intake-triage/refine.mjs and .github/scripts/lane-run-report/post.mjs). This is a refactor that should change nothing, and I checked each edit against the code before it:

  • Imports. The duplicate node:fs and admit.mjs imports are merged into one each, with the same names.
  • byApp / laneComment / admissionComment / issueContext. Each one matches the inline code it replaces. laneComment returning null is the exact negation of the old lane.length !== 1 || !(Date.parse(...) >= startedAt) check, and an unparsable updated_at (NaN) still declines. The admission lookup now runs only when the issue is not thin. That lookup is a pure find, so nothing observable changes.
  • labels reuse in selectRefinement. One array now goes to statusOf, splitOf and splitStays where each used to get a fresh copy. statusReader's labels either returns names as-is or filters it (.github/actions/resolve-config/read-status.mjs). Nothing in intake-triage/ mutates a labels array, so sharing it is safe.
  • line() order. The bracket escape now runs before the zero-width-space breaks. The escape only adds \ before [](){}-type characters, and none of the break patterns (@, #/GH- followed by a digit, ://, www.) involve those characters or are blocked by a backslash, so the output is the same. titleLine still skips the length cap and the escapes.
  • orderProblem. count is always parts.length or groups.length, an integer, so p <= count, Array.from({ length: count }, fn) and done === count give the same results as the old placeholder array.
  • exactRetriage / exactStays. All three exact branches keep their call order: untrusted → retriage (with the held early-return) → lift (removeLabel only in the needs-decision branch) → post(true) → log. Return values and log text are unchanged, and the stays branch still posts before it logs.
  • post.mjs. LEGS has the same five entries in the same order. WORDS had no other use, so inlining REST_PATH_WORDS is safe.

Closing issue #14107 criteria

  • Behavior unchanged, flags and exports kept: met as far as I can tell from reading. Exports are untouched and the existing refine.test.mjs and post.test.mjs would fail on a regression. I did not run them (I have no shell), and the PR says its lane did not run them either.
  • Diff edits only the listed files: met.
  • Stays within 400 changed lines and 15 files: met (2 files, well under 400 lines).
  • ci-status green: I can't check this from here. It is left to the PR's checks.

The verification the PR describes (the fresh-context subagent review and the byte-identical line() output) comes from the author and I have not confirmed it independently.

Neither changed file matches a trusted-path glob. The diff spends nothing and changes no billing.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 0ad994c

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-14197-0ad994cd680949037f3f7d92189183ee6d7dd48a, 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 8bff445 Nov 8, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14107-42508821379-1 branch November 8, 2026 19:00
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 8bff445ed4863173eed4dc40c3d418a4dd440f74; 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 .github: intake-triage, lane-run-report

0 participants