Skip to content

docs(source-control): state worktree hook rules and point at upstream docs - #17185

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-16841-44324583141-1
Nov 18, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #16841

Summary

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

The comments in worktree-create-gate.sh (the CLAUDE_PLUGIN_OPTION_ read), worktree-remove-gate.sh (the header contract and its verification stamp) and worktree-create.sh (the .worktreeinclude copy) restated Claude Code behavior. Each now states the rule the code keeps and its reason, with a 'when ..., fetch <anchor> live' pointer to the docs section for the platform behavior. The stamp block in worktree-remove-gate.sh is gone because upstream-drift's Required parts gives a pointer record no stamp. Only comment lines changed. This is part 3 of 5 of #15513.

Not verified

  • check-affected skipped comment-hygiene (its fetch of the ci-workflows action failed with no network) and typos (not installed). Left to the PR's CI.
  • comment-lint is CI-only (pull request). Left to the PR's CI. Each added comment that names an outside party's behavior carries its link.
  • lychee link checks are CI-only. The three anchors were confirmed by reading the pages in this run.
  • tidy ran passes 1-4 and the rubric half of pass 5. ai-slop's deterministic detect.sh and digest guard were not run because the lane's Bash allows only the named wrappers. The code passes had nothing to change: the code lines are comments only and no class-A comment was found.
  • no test suite was run. The change is comment-only, and the PR's CI runs the suites.
  • the other comments in these files that the issue does not list were left as they were (for example worktree-remove-gate.sh's 'Claude Code never deletes it' line about the branch).

Fix

  • plugins/source-control/hooks/worktree-create-gate.sh: the user_config comment now states our rule (read the option from its environment variable and keep the configured path as data) with its reason and a fetch-live pointer to manifest-reference#fields-that-run-through-a-shell. The next line's 'It…
  • plugins/source-control/hooks/worktree-remove-gate.sh: the 'Contract (hooks page, stamp below)' bullets became 'Rules this hook keeps' (acts only on worktree_path, refuses a lock not naming session_id, exits 0 only once the directory is gone, every refusal exits 1 remedy-first, unseen worktrees go…
  • plugins/source-control/scripts/worktree-create.sh: the .worktreeinclude comment now says why the helper copies the files itself (the hook path and the skill path), which git filters it applies and that it has no **/ special case, with a fetch-live pointer to…
  • .changes/source-control/work-resolve-issue-issue-16841-44324583141-1-6f80e6c7.md: new bump-none changelog fragment for the comment-only change.

Verification

The runner ran each check from the base copy against 30cd744:

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

The run reports:

  • read https: //code.claude.com/docs/en/plugins/manifest-reference: 'Fields that run through a shell' says shell-form hook commands reject ${user_config.*} and points hooks to CLAUDE_PLUGIN_OPTION_<KEY>, so the anchor and the rule's basis hold
  • read https: //code.claude.com/docs/en/hooks: the 'WorktreeRemove' and 'WorktreeRemove input' sections exist (anchors #worktreeremove, #worktreeremove-input) and cover when the hook fires, the exit-code outcome and the worktree_path payload
  • read https: //code.claude.com/docs/en/worktrees: 'Copy gitignored files into worktrees' exists (anchor #copy-gitignored-files-into-worktrees) and covers the match-and-gitignored rule, the **/ rule and copying inside a WorktreeCreate hook
  • git-read diff HEAD: every changed line in the three scripts is a comment line
  • check-changelog-fragments: all 4 fragments valid (run after the last edit)
  • check-changed-skills: no changed skills, nothing to gate (run after the last edit)
  • check-affected: 15 passed, 7 skipped, 0 failed (run after the last edit)
  • fresh-context review subagent over the diff: no blocking findings. Two medium findings (the .worktreeinclude reason covered only the hook path; the session_id lock check had the wrong reason) and the low prose findings were confirmed against the code and fixed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44324583141

Left out: the items under Not verified.

Related

#16841

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

Copy link
Copy Markdown
Contributor

claude-review reviewed 30cd7448e0c6082e98ef498036e24266170bae51: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #17185 (comment-only)

I found nothing that blocks this PR and nothing to flag.

I read every hunk of all 4 changed files. Each changed line in the three shell scripts is a comment line, and the fourth file is a new changelog fragment with bump: none. So the closing issue's "no code line changes" criterion is met (#16841).

What I checked against the code at head:

  • worktree-remove-gate.sh, the new "Rules this hook keeps" bullets. Each bullet matches the code:
    • It reads only .worktree_path (L79).
    • It refuses a lock that doesn't name the session through worktree_reason_is_ours (L176).
    • It exits 0 only when the path is already gone or after a check that it no longer exists (L109, L214-L218).
    • Every refusal goes through gate::refuse, which prints the remedy first and then exits 1.
  • Removed verification stamp. The PR says no stamp is needed, and that holds: docs/contracts/upstream-drift/README.md "Required parts" gives a pointer record no as-of date and no stamp. The new Pointer: when …, fetch <anchor> live. lines follow that form. Nothing outside the hooks directory parses that stamp block.
  • worktree-create.sh, the .worktreeinclude comment. It describes the loop accurately: ls-files -o -i -z --exclude-from filtered by check-ignore -q (L1327-L1339).
  • worktree-create-gate.sh. The rewritten comment still matches the CLAUDE_PLUGIN_OPTION_WORKTREE_ROOT read just below it.

Not checked by me: I did not fetch the three doc anchors. The PR author says they confirmed them by reading the pages, and the link checks run in CI.

Criteria:

  • Rules: .claude/rules/mod-authoring.md matches plugins/*/hooks/**. A comment-only change gives it nothing to judge.
  • Plugin manifests: none changed.
  • Paved paths: nothing to report.
  • Settled threads and prior findings: no settled-threads file was given. The prior-findings file shows no earlier review, so this was a full review, not blocking only.
  • Holds: no cost hold, and nothing spends credits.

Loosened-check verdict: fail (default, the wrapper gave no loosened_check_verdict line); patterns: 0. No check is loosened: removing the comment stamp removes no check.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #17185

No security issues found.

I read the whole diff for all 4 changed files. Every changed line in the three shell scripts is a comment. No executable code changed.

  • plugins/source-control/hooks/worktree-create-gate.sh: the comment about reading worktree_root was rewritten. It still says to read the value from CLAUDE_PLUGIN_OPTION_WORKTREE_ROOT and never to write ${user_config.worktree_root} into the hook command. The line that reads the value (root="${CLAUDE_PLUGIN_OPTION_WORKTREE_ROOT:-}") did not change.
  • plugins/source-control/hooks/worktree-remove-gate.sh: the header's "Contract" bullets became "Rules this hook keeps", and the verification-stamp comment block was removed. The refusal checks, the lock and session check, and the exit codes did not change.
  • plugins/source-control/scripts/worktree-create.sh: the .worktreeinclude copy comment was reworded. The filter logic (ls-files -o -i --exclude-from, check-ignore -q, NUL-delimited reads) did not change.
  • .changes/source-control/...6f80e6c7.md: a new changelog fragment with bump: none.

Removed guidance: these are comments inside shell scripts. They are not instructions a model follows (not CLAUDE.md, AGENTS.md, a skill or agent body, or a hook's block list). Even read that way, nothing was lost: every rule the old comments described is still enforced by the unchanged code, and the new text keeps each rule.

Trust controls and trusted paths: no changed file matches a TRUSTED PATHS glob, no plugin manifest changed, and no trust control is touched.

PR context: the description and the closing issue contain no embedded directives aimed at the review lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 30cd744

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-17185-30cd7448e0c6082e98ef498036e24266170bae51, expires on 2026-12-18.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=LOW demote=false head=30cd7448e0c6082e98ef498036e24266170bae51 rubric=10.3.4 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit e9a9d70 Nov 18, 2026
107 of 110 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-16841-44324583141-1 branch November 18, 2026 18:36
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit e9a9d70e0a09e1dd7dd2aa1870c98eabe9cad873; 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.

docs: cut restated upstream behavior left by the stamp sweep (batch 5) - part 3 of 5

0 participants