Skip to content

fix: Simplify the scripts and lib source-control plugin code - #15000

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14846-42724638311-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14846

Summary

Opened by the work-resolve-issue lane from work-resolve-issue/issue-14846-42724638311-1, which an earlier run left with commits and no report. The model did not run again, and the earlier run's outcome could not be read, so this body carries none of its text.

Fix

The diff shows the changes.

Files the branch changes, from the compare listing; a denied path, which the merge lane refuses, is marked and listed first:

  • .changes/source-control/work-resolve-issue-issue-14846-42724638311-1-382f5483.md
  • plugins/source-control/scripts/lib/worktree-facts.sh
  • plugins/source-control/scripts/write-changelog-fragments.sh

Verification

The earlier run reported no checks here.

The runner ran each check from the base copy against 78beea7:

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

The runner's leak scan read everything the branch changes since its merge base with the default branch and found nothing credential-shaped.

Left out: every check; ci-status, pr-verify and the security review lane check the head before it merges.

Related

#14846

Merge-Risk: max=MEDIUM demote=false head=78beea76215c49cf92cd7c84fed3008018c5f1d3 rubric=8.3.3 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15000 (head 78beea7)

No security issues found. I read all three changed files in full in the diff.

  • .changes/source-control/…-382f5483.md: a new changelog fragment with a patch bump. It is prose only and controls nothing.
  • plugins/source-control/scripts/lib/worktree-facts.sh: a refactor of worktree_facts_parse_z.
    • The bare and prunable flags now hold yes/no directly.
    • The WT_FACT_LINKED value is now set inside _worktree_facts_flush, not in a second loop afterwards. The result is the same: the first record is no, a bare record is no, and every other record is yes.
    • The file mode changes from 644 to 755. That makes a sourced lib file executable, which has no trust impact.
    • No input reaches a shell eval, an unquoted expansion or a path in a new way.
  • plugins/source-control/scripts/write-changelog-fragments.sh:
    • The bump-level if is flattened into if/elif and gives the same results.
    • ! git rev-parse … || ref= is rewritten as git rev-parse … && ref=, which does the same thing. Its fixed inputs are origin/main and main.
    • Neither change touches command construction or input handling.

None of the changed files is on a trusted path or is a trust control: no trusted-trigger check, token scope, kill switch, merge hold or plugin manifest. No standing instruction is deleted or softened, so the instruction-surface lens does not apply. The diff spends no extra credit and can start no charge.

The PR context contains no embedded directives aimed at the lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15000, a cleanup of the source-control scripts (closes #14846)

I read all three changed files in full. The goal is a cleanup that changes no behavior.

Logic checks: no behavior change found

  • worktree-facts.sh, worktree_facts_parse_z. The second pass that worked out WT_FACT_LINKED now happens inside _worktree_facts_flush. The flush checks whether any record exists yet before it adds one, so:

    • the first record, including a bare hub, is still linked=no;
    • a later bare record is still no;
    • every other record is still yes;
    • an empty input still leaves an empty array.

    bare and prunable now hold yes/no directly, so the two if/else blocks that converted them are gone. The output values are the same. Folding the variable resets onto one line is a valid bash command. The function still returns 0.

  • write-changelog-fragments.sh, bump level. The nested if became if [[ -z level && -n breaking ]] … elif [[ -z level ]], which is the same logic.

  • write-changelog-fragments.sh, default-ref loop. ! git rev-parse … || ref=… became git rev-parse … && ref=…. The script runs under set -uo pipefail without -e and sets no ERR trap. The loop's exit status is never read, so the non-zero status this leaves when no candidate exists changes nothing.

  • Tests. The parse result is still checked by worktree-facts.test.sh (linked flag at L51-52, bare hub at L97). I did not run it.

Finding

  1. Unexplained file-mode change on a sourced library. The diff changes plugins/source-control/scripts/lib/worktree-facts.sh from 100644 to 100755.

    • The file has no #! line; L1 is # shellcheck shell=bash.
    • Callers source it, and its own usage text says to run it as bash worktree-facts.sh list.
    • Running ./worktree-facts.sh directly would now fall back to whatever shell the caller uses, not bash.
    • The repository's exec-bit check (scripts/check-affected.sh L50) only requires shebang files to be 100755, so nothing asks for this.

    The change touches no line of code, so it goes here and not as an inline comment. It conflicts with issue Simplify the scripts and lib source-control plugin code #14846's criterion "Behavior is unchanged: same outputs, exit codes, written files…" and with the fragment's line "no behavior change". Fix: restore the mode (git update-index --chmod=-x plugins/source-control/scripts/lib/worktree-facts.sh).

Acceptance criteria (#14846)

  • Behavior unchanged: met for the code. Not met for the file mode (finding 1).
  • Edits only listed files plus a fragment: met. The two files changed are on the issue's list, plus one fragment.
  • Size limit: met, well under 400 changed lines and 15 files.
  • Fragment: met. bump: patch, ### Changed, "Internal simplification, no behavior change."
  • ci-status green: I could not see it from here. The PR body's check results are the author's claim, and I did not verify them.

Other notes

  • Plugin manifests: none changed.
  • Settled threads: none were provided.
  • Prior findings: none; this is the lane's first review of the PR.
  • I found no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 78beea7

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-15000-78beea76215c49cf92cd7c84fed3008018c5f1d3, expires on 2026-12-10.

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 10, 2026
Merged via the queue into main with commit 773e339 Nov 10, 2026
64 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14846-42724638311-1 branch November 10, 2026 06:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 773e339f157ebd62691cff126e3a82f0efc2051b; 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 scripts and lib source-control plugin code

0 participants