Skip to content

perf(source-control): move the worktree nesting measurement out of the skill hub - #12387

Merged
kyle-sexton merged 3 commits into
mainfrom
host-run/12243-worktree-disclosure
Nov 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
host-run/12243-worktree-disclosure

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Refs: #12243

Summary

First of the six body cuts #12243 asks for. The /source-control:worktree SKILL.md goes from 39,059 to 32,516 bytes (about 17% less loaded per invocation). Its action routing, safety invariants and gates stay in the hub.

Fix

  • The section "The nesting invariant, dated measurement" moves verbatim to skills/worktree/reference/nesting-invariant.md, which is read on demand. The hub keeps a short pointer section under the same heading.
  • nesting-invariant-ssot.test.sh now names the reference file as the owner. Every pointer site follows it: SKILL.md, context/create.md, fixtures/README.md, the probe script, both hooks, worktree-create.sh and the plugin README.
  • The quoted isolation-enforcement passage under "Repository context" becomes our rules in our own words plus a pointer to How Claude Code enforces isolation, with an as-of date and a recheck trigger, per .claude/rules/skill-bodies-state-current-rules.md.

Verification

  • /docs-hygiene:compress compare (fresh compare-labeler, before against after): VERDICT PASS, with no SEMANTIC LOSS. It raised two AMBIGUITY rows, and both are fixed on this head: PowerShell's scope is restored to "the git-redirect or command-shape check", and the reference file now says its fixtures/ paths are relative to the skill directory.
  • scripts/check-affected.sh --tests on the committed head: 14 passed, 2 skipped. That includes nesting-invariant-ssot.test.sh (22 cases, 0 failures).
  • Eval no-loss evidence: non-inferior at margin 0.05 on a round that is VALID on both arms.
    • Method: before and after plugin copies ran concurrently with identical flags on Claude Code 2.1.316: claude plugin eval <copy> --case 'worktree-*' --ablation none --runs 2 -j 2 --scaffold --allow-tools Bash Write Edit --model claude-opus-5-5.
    • Validity: main's run-validity.py --runs 2 --scaffolded (after fix(evals): check case helper plugins per case and excuse plugin-data compound denials #12388) marks round 1 VALID on both arms.
      • Before arm: two ls calls denied under the run's own plugin-data directory. The gate does not count these.
      • After arm: no denials.
    • Round 1 scores: 8/8 cases at 1.000 in both arms. The noise report gives a paired change of +0.00 (interval +0.00 to +0.00), and its verdict is non-inferior at margin 0.05.
    • Two more concurrent rounds each had one INVALID arm:
      • Round 2, before arm: a with-arm Read of the sandbox settings.json was denied.
      • Round 3, after arm: the same settings.json denial, plus one unfired Skill call in worktree-not-pr-lifecycle.
      • Pooled over all 3 rounds, mean case score is 0.984 before and 0.979 after. The one case that drops is worktree-create-routes-through-helper: its 0.25 run under that denial hit each version once.
    • Limits: both arms score at the ceiling, and no case covers audit, whose text this cut left unchanged.

Remaining on #12243

The other five cuts are not started: /source-control:pull-request, /session-flow:handoff, /discovery:research, /evals:plugin-eval and /source-control:commit. Each needs its own paired before and after eval run on a host.

Related

🤖 Generated with Claude Code

…e skill hub

The /source-control:worktree body drops from 39,059 to 32,469 bytes. The
nesting invariant's dated measurement moves to reference/nesting-invariant.md,
which the SSOT test now treats as the owner, and every pointer follows it. The
quoted isolation-enforcement passage becomes our rules plus a docs pointer
with an as-of date and recheck trigger.

Refs: #12243

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 2, 2026
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 2, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 2, 2026 16:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:16:37.962680Z a70cc90 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on a70cc903fe5e3b4dfe56a7c8a74cf197460739eb; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #12387, incremental (a70cc90 → 68eba76)

No new findings. I read every hunk of the incremental diff in all 4 files in scope.

Both earlier findings are fixed

  1. Two owner pointers still named SKILL.md (summary finding from round 1). Both now point at skills/worktree/reference/nesting-invariant.md:

    • the --root help text at worktree-create.sh:200
    • the worktree-root-convention.md:71 link

    This commit also fixes a third stale pointer that I missed last round. The worktree-create.sh comment at L804–805 cited the old section name "The nesting invariant, verified" and now cites "The nesting invariant, dated measurement". The README pointer is updated as well. A grep over the plugin's shell files finds no remaining skills/worktree/SKILL.md owner citation. I did not grep the plugin's markdown files, so this check covers only the shell files.

  2. Upstream docs quote in reference/nesting-invariant.md (inline thread, resolved by the owner, fixed in this commit).

    • Line 20 no longer quotes the hooks page. It now states our rule (register the probe hook in the args exec form). It points at the section's anchor, #exec-form-and-shell-form, and adds an As-of date and a recheck trigger. The "still unprobed" sentence is kept.
    • Line 22 no longer restates chore(release): release 1 plugins #16600's state. It points at the issue and names the state-change recheck trigger, which line 26 does list.
    • This change follows .claude/rules/skill-bodies-state-current-rules.md.

Regression check on the SSOT test

I read nesting-invariant-ssot.test.sh but did not run it.

  • The new As-of: 2026-11-02 on line 20 does not change which date the stamp check reads. That check (L108) only matches as-of **YYYY-MM-DD** (lowercase, bold), so it still picks up the verification stamp's 2026-09-30.
  • The count of files citing the section by name (L295, needs at least 5) can only go up: worktree-create.sh already cited it at L37/L674/L854.

Other checks

  • No plugin.json or marketplace.json change in this increment, so there are no manifest items.
  • Cost: none. This increment only changes docs and comments.
  • I found no embedded instructions in the PR context, the settled threads or the prior-findings files.
  • This is round 2 of a cap of 3, so the cap did not apply.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #12387 (incremental since a70cc90), no security issues found

I read every hunk in .claude-lane/incremental.diff for all 4 files in scope. None of them matches a TRUSTED PATHS: glob, and the change touches no plugin manifest.

What changed since the last review

  • plugins/source-control/README.md and reference/worktree-root-convention.md now point at skills/worktree/reference/nesting-invariant.md for the nesting claim. Previously they pointed at skills/worktree/SKILL.md. Only the link and pointer text changed.
  • scripts/worktree-create.sh:
    • The --help heredoc gets a new path string. The heredoc is unquoted, but the new text has no $, backtick or backslash, so nothing new expands.
    • A code comment's pointer and section name change.
    • No executable line, exit code or control flow changed.
  • skills/worktree/reference/nesting-invariant.md has two reworded lines:
    • Hook registration: the paragraph still tells the reader to register the InstructionsLoaded probe hook in the args-array exec form. The quoted docs sentence is replaced by a pointer with an as-of date and a recheck trigger.
    • Upstream coverage: the hard-coded "OPEN, labeled …" state of chore(release): release 1 plugins #16600 is replaced by "read its current state there".

Instruction-surface lens. The nesting-invariant edits are a skill reference body, so I checked each change by its consequence:

  • The exec-form rule is kept; only its source citation changed.
  • Removing the issue's stale state is a factual update. It gates no action.
  • No rule was dropped or loosened.

I recognised removals by their consequence and did not read the instruction exception register for this pass.

Trust controls. Nothing in this change touches:

  • the trusted-trigger check
  • the lane token request or broker
  • the kill switch
  • merge holds

PR context. The description matches the change. It contains no embedded instructions aimed at the review lane.

Prior findings. This lane's only earlier post is the clean summary for a70cc90, with no findings to repeat. This is round 0 of 3, so the cap does not apply.

critical-findings: 0

…ference

Addresses the claude-review findings on a70cc90. Three remaining
citations still named skills/worktree/SKILL.md as the owner of the nesting
invariant: the worktree-create.sh --root help text, the same script's
comment (which also used the old heading name) and the worktree-root
convention. They now name the reference file, along with the README's
second mention. The reference file stops quoting the hooks page and stops
restating issue #16600's state. It keeps our exec-form rule, plus a pointer
with its section anchor, an as-of date and a recheck trigger.

Refs: #12243

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton

Copy link
Copy Markdown
Member Author

Reply to the claude-review summary on a70cc903fe:

Finding Classification Basis
1. Two owner pointers still name SKILL.md VALID (fix now) verified: scripts/worktree-create.sh:200 and reference/worktree-root-convention.md:71 named skills/worktree/SKILL.md as the owner
2. The reference file quotes an upstream docs passage VALID (fix now) answered on the inline thread

Fixed in 68eba76. A sweep for the same owner phrasing found two more sites, and both are fixed too: the README's second mention (line 489), and the comment at scripts/worktree-create.sh:804, which also used the old heading name "verified". nesting-invariant-ssot.test.sh still passes 22 cases with 0 failures, and check-affected.sh --tests passed on the new head (14 passed, 2 skipped). No eval case reads the reference file, so the no-loss result recorded in the PR body still holds for the hub.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 339ce4a Nov 2, 2026
72 of 76 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/12243-worktree-disclosure branch November 2, 2026 18:21
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.

1 participant