Skip to content

refactor(intake-triage): simplify the second half of admit.mjs - #14281

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14105

Summary

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

Simplified the functions that start in range 2 of 2 of .github/scripts/intake-triage/admit.mjs (decide() at line 1438 onward; the file had 2827 lines, so the range starts at line 1414). Nothing they do has changed. Repeated inline checks now go through shared helpers: appActor for the lanes App actor test (used in decide, closedByTrusted and admissionFacts), appRefinement for the App refinement-comment test (refineDue, refinementSpec), and humanActor for the listed-human GraphQL actor test (writtenBy, splitChildBody). Existing helpers are reused where the same logic was written inline: BLOCKER_NUMBER, taskText, splitScope. decide() reads rules["task-list"] once and computes its hold flag from holdCodes. The admit() calls collapse to one line each, and splitRecord drops a redundant parse. The diff is 51 insertions and 69 deletions in one file; no export, flag, output or message changed.

Not verified

  • admit.test.mjs and the suites of the modules that import admit.mjs were not executed: this lane cannot run node. They are left to the PR's CI (ci-status).
  • tidy skipped: the change is under .github/, a listed shared path, so tidy-diff does not run on it.
  • One accepted theoretical difference, not reachable with the real GitHub client: if the issue GET in admit() answered null, the old code threw at names(issue.labels) before any other read. The new code throws later, inside admissionFacts, after the blocker and spec reads.
  • ci-status green is a PR CI check this lane cannot observe.

Fix

  • .github/scripts/intake-triage/admit.mjs: within decide() and the functions after it, added three private helpers (appActor, appRefinement, humanActor) and used them in place of repeated inline predicates. Reused BLOCKER_NUMBER in trustedElsewhere, taskText in tickedForms and splitScope in…

Verification

The runner ran each check from the base copy against 8b48a2f:

  • 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

#14105

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

Code review: PR #14281, simplifying the second half of admit.mjs

No findings. I read every hunk of the one changed file, .github/scripts/intake-triage/admit.mjs. It matches a trusted-path glob, so I checked each hunk against base behaviour in full. I could not run anything, so the equivalence results below come from reading the code only.

Equivalence checks, all passed:

  • App and human actor checks. appActor and trustedActor keep the old checks: an id compared strictly, and false when appId is undefined. The currentAppClose call was already behind appId !== undefined, so adding the appId guard through isApp changes nothing.
  • The hold flag. hold is now computed as holdCodes.size > 0 at line 1648. Every holdFor call happens before that line, nothing calls holdCodes.add directly, and hold is first read at line 1677.
  • The task-list read. taskList is now read after the settled-skip return. rules is reassigned later, but that only changes sizes, never task-list.
  • Joined criteria text. texts.join("\n") gives the same string as the old texts.flatMap(split("\n")).join("\n"), and nothing else read lines.
  • workCharges(issue, …). It destructures only { title, body }, so passing the whole issue is the same.
  • Shared helpers.
    • BLOCKER_NUMBER (line 313) is the same regex with no g flag, so .test keeps no state between calls.
    • taskText matches the inline slice it replaces.
    • splitScope(line) gives the same result, because line is one line that already starts with SCOPE_PREFIX.
  • Refinement-comment checks. In refineDue, the extra appId !== undefined check that appRefinement brings in can never matter: the function already returns false at line 1947 when appId is undefined.
  • splitRecord.
    • In order, match[3] === "" gives the same result as numbers(match[3], ",").length === 0, since numbers returns [] only for an empty string.
    • The groups spread: ...(false) adds nothing to the object, as before.
  • Label names in admit(). Dropping own is safe because names (line 1221) leaves string labels as they are, so names(names(x)) equals names(x).

Closing issue #14105, acceptance criteria:

  • Behaviour unchanged: met by reading. No export or message changed. Coverage comes from the existing admit.test.mjs, which the author says they did not run; it is left to CI.
  • Only the listed file edited: met.
  • Within 400 lines and 15 files: met (51 insertions, 69 deletions, 1 file).
  • Only functions starting in range 2 changed: met. Every edit is in decide() (line 1438) or a function after it, and the new private helpers sit in that range too.
  • ci-status green: I cannot observe it from here.

The author's verification (the changelog and skills checks, and the fresh-context equivalence subagent) is the author's own claim and I did not confirm it.

No embedded instructions were found in the PR context. No paved-path, manifest, or cost concerns apply.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14281, refactor(intake-triage): simplify the second half of admit.mjs

No security issues found.

.github/scripts/intake-triage/admit.mjs is on the trusted-path list. It is the intake admission gate: it decides whether an issue starts a credentialed run, and it applies the security, cost and intent holds. I read every hunk of the change and checked each rewrite against the code it replaced. None of them widens who is trusted, what gets admitted, or when a hold applies.

  • appActor (appId !== undefined && actor?.id === appId) matches the inline checks it replaces in decide, closedByTrusted and admissionFacts, including the child split-marker check. The currentAppClose call used to pass actor?.id === appId with no appId guard. It still runs only inside local && appId !== undefined, so the result is the same.
  • trustedActor in admissionSettled and judgedSince is humans.has(actor?.id) || isApp(actor), the same as before.
  • The hold flag is now holdCodes.size > 0 instead of a let that holdFor set. Nothing adds to holdCodes except holdFor. The new const hold is declared at admit.mjs#L1648, and its first use is at L1677, so it is never read before it is set and the security and cost holds behave as before.
  • appRefinement keeps the Bot type, databaseId === appId and REFINE_MARKER checks. In refineDue it adds appId !== undefined, which is a little stricter and admits nothing new.
  • humanActor has the same User type and humans check as before.
  • Unchanged behaviour in the other rewrites:
    • BLOCKER_NUMBER at L313 is the same regex as the old inline one, with no g flag.
    • taskText at L2230 is the same expression as the code it replaces.
    • splitScope gives the same result, because its only caller (L2218) passes one line that starts with SCOPE_PREFIX.
    • numbers (L2274) returns an empty list only for an empty string, so match[3] === "" gives the same result.
    • workCharges takes { title, body } apart from its first argument (L895), so passing issue gives the same input.
    • names lets strings through unchanged (L1221), so names(issue.labels) equals the old names(names(issue.labels)).
    • texts.join("\n") equals the old split-then-join.

The PR's text is about the refactor only and asks the lane for nothing.

No merge hold, trust control, token scope or charge path is widened. No manifests changed. This PR spends nothing billable.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 8b48a2f

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-14281-8b48a2fb5791e51b61610663848b8f6c66f2edb9, 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 858bf13 Nov 9, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14105-42531944168-1 branch November 9, 2026 00:00
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 858bf137b12080f243706a93645d77c48e600530; 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 admit.mjs .github script (part 2 of 2)

0 participants