Skip to content

refactor(work-unblock): simplify sync-status.mjs imports and log line - #14191

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14155

Summary

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

sync-status.mjs now imports the REPOSITORY regex that check-trusted-trigger.mjs already exports, instead of keeping its own copy. It now imports fieldStatus, loadTrustedActors and statusWriter statically: read-status.mjs and write-status.mjs (which read-status imports) were already loaded at module load through the HOLD_STATES import, so the dynamic imports in main() fetched modules that were already loaded. Only resolve-config.mjs, which pulls in ajv and yaml, stays a dynamic import after the kill switch. The nested ternary in the result log line is now one detail value. Every output, exit code, export and flag is unchanged.

Not verified

  • node --test .github/scripts/work-unblock/sync-status.test.mjs was not run: this lane cannot run an interpreter, so the PR's CI runs the suite
  • tidy skipped: the change touches .github/, a listed shared path, so it is not tidied
  • No changelog fragment: the change is to repository CI scripts under .github/, not to a plugin, and check-changelog-fragments passed

Fix

  • .github/scripts/work-unblock/sync-status.mjs: imports REPOSITORY from check-trusted-trigger.mjs instead of redefining the same regex; imports fieldStatus, loadTrustedActors and statusWriter statically, keeping only resolve-config.mjs dynamic after the kill switch, and corrects the comment about…

Verification

The runner ran each check from the base copy against 9a9977b:

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

The run reports:

  • Compared the exported REPOSITORY at .github/actions/check-trusted-trigger/check-trusted-trigger.mjs:629 with the removed local regex: identical, and neither has flags
  • Grep of the imports in read-status.mjs, write-status.mjs, issue-status.mjs, resolve.mjs and patch-rules.mjs: read-status imports only node built-ins and ./write-status.mjs, and write-status has no static imports, so both were already loaded at module load. resolve-config.mjs reaches ajv and yaml…
  • check-changelog-fragments: all 2 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped, the rest CI only
  • A fresh-context review subagent read the whole diff, the test and the related modules: no findings (same regex, same module-load order relative to the kill switch, identical log text for every result shape, same exports)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42508626695

Left out: the items under Not verified.

Related

#14155

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

Code review: PR #14191, refactor(work-unblock): simplify sync-status.mjs imports and log line

No findings. I read every hunk of the one changed file, .github/scripts/work-unblock/sync-status.mjs. I could not run the test suite, so the checks below come from reading the code.

Checks against the base code:

  • REPOSITORY import. check-trusted-trigger.mjs exports a regex at line 629. It is identical to the local copy the PR removes, and neither has flags. The module was already imported statically for createGitHub, so no new code loads.
  • Static imports of fieldStatus, loadTrustedActors and statusWriter. These were imported dynamically before. Their modules are read-status.mjs (its static imports are node:fs, node:path and ./write-status.mjs) and write-status.mjs (no static imports). Both were already loaded at module load through the existing HOLD_STATES import, so nothing new runs before the kill-switch check. loadTrustedActors still comes from read-status.mjs, which takes env. That is not the export of the same name in check-trusted-trigger.mjs, which takes a path. resolve-config.mjs, which loads the installed packages, is still imported dynamically after the kill switch.
  • Log line. result.reason || result.state gives the same text as the old nested ternary in every case: a truthy reason, else a truthy state, else nothing.
  • Comment. The updated comment correctly drops issue-status.mjs, which sync-status.mjs never imported directly.

Closing issue #14155, acceptance criteria:

  • Behavior unchanged: met by reading the code. Exports (translateLabel, STOPPED_STATE, onLabelEvent, main), exit codes and printed text are unchanged. sync-status.test.mjs covers main's early-exit paths.
  • Only listed files edited: met. The diff changes only sync-status.mjs.
  • Within 400 lines and 15 files: met.
  • ci-status green: I can't see it from this lane, so it's unverified here. The author also says they did not run node --test.

Other checks: no .claude/rules/ file's paths: glob matches the changed file. There are no plugin manifest changes and no earlier findings from this lane. The changed file is not on the trusted-paths list. Nothing in the pull request context tries to instruct the review.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14191 (.github/scripts/work-unblock/sync-status.mjs)

No security issues found.

This change only refactors imports and one log line. I read the whole diff and checked each piece of the refactor against the code in the repository:

  • REPOSITORY validation regex. The PR now imports this regex from check-trusted-trigger instead of keeping its own copy. The exported one at check-trusted-trigger.mjs:629 is /^[A-Za-z0-9-]+\/(?!\.\.?$)[A-Za-z0-9_.-]+$/. That matches the removed local copy character for character, and neither has flags, so the GITHUB_REPOSITORY check at sync-status.mjs:99 accepts exactly what it did before.
  • Kill switch and module load order. fieldStatus, loadTrustedActors and statusWriter are now imported statically. These were already loaded before main() ran, because the script already imported HOLD_STATES from read-status.mjs:
    • read-status.mjs imports only node:fs, node:path and ./write-status.mjs (lines 14–17).
    • write-status.mjs has no static imports.
    • So making these imports static runs no new code before the kill switch.
    • resolve-config.mjs, which pulls in ajv and yaml, is still a dynamic import placed after the KILL_SWITCH !== "proceed" early return at sync-status.mjs:95. The kill switch still stops the lane before any read or write.
  • Trust controls. The trusted-actor loading (loadTrustedActors(env)), the token (env.GH_TOKEN), the field-hold check (HOLD_STATES) and the event handling are unchanged. Nothing new is trusted, no token's scope changes, and no new untrusted text reaches the lane.
  • Log line. result.reason || result.state prints the same text as the old nested ternary for every result. The event-derived value it logs is still passed through Number(...).

The PR context contains no embedded instructions aimed at the review. The closing issue's body was left out by the wrapper.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 9a9977b

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-14191-9a9977bb6cfe77ab2b65b1b4a3ec25a97793484a, 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 aa4e624 Nov 8, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14155-42508626695-1 branch November 8, 2026 19:07
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit aa4e624d3b0678abb209302df90b663159518a9a; 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: sync-status.mjs

0 participants