Skip to content

feat(repo-fleet-hygiene): add reclaimable-worktree finding (#1776) - #2558

Merged
kyle-sexton merged 1 commit into
mainfrom
cursor/reclaimable-worktree-1776-d116
Aug 13, 2026
Merged

feat(repo-fleet-hygiene): add reclaimable-worktree finding (#1776)#2558
kyle-sexton merged 1 commit into
mainfrom
cursor/reclaimable-worktree-1776-d116

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Closes #1776

Summary

Adds the reclaimable-worktree peel from #1776 to the repo-fleet-hygiene audit collector: detect clean, unlocked linked worktrees via allowlisted git status --porcelain.

Fix

  • Widen git_probe_allowed for status --porcelain and optional log -1 --format=%ct HEAD
  • Emit MEDIUM reclaimable-worktree for clean linked worktrees; UNKNOWN worktree-disposability-unverifiable on probe failure
  • Skip main/locked/missing/prunable/unverifiable; never use stash list
  • Bump repo-fleet-hygiene 0.12.1 → 0.13.0 with CHANGELOG, docs, eval, tests

Verification

  • bash plugins/repo-fleet-hygiene/skills/audit/scripts/audit-fleet.test.sh
  • scripts/affected-tests.sh --run on touched paths

Related

Refs #1774 — host reap of unreaped worktrees remains Class C operator work.

Emit MEDIUM reclaimable-worktree when a linked worktree has reliable
admin and an empty git status --porcelain. Status probe failures emit
UNKNOWN worktree-disposability-unverifiable. Bump plugin to 0.13.0.

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
@github-actions github-actions Bot deleted a comment from claude Bot Aug 13, 2026
@claude

claude Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Automated security review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

The check is green on purpose, and it is not evidence. It certifies that a security pass ran, and this one did not complete — but the cause is outside this PR's control, so merging is deliberately left unblocked rather than locking every merge for the length of the outage. Nothing was reviewed at this head. Where this check is required, it is satisfied without that evidence; a human should review security-sensitive changes here before merging.

Re-run the job, or workflow_dispatch this workflow with the PR number, to retry the review (ci-workflows#227). A new push also retries it only if the caller's pull_request triggers include synchronize (the canonical security caller keeps it). An automatic retry may already have run — it is skipped when a partial review could duplicate comments, or when the failure class needs an operator.

Re-running does NOT help for every class:

  • rate-limit that persists across re-runs, or auth — the credential or usage budget needs an operator; retrying will not clear it.
  • a run that exhausted its turn budget ("subtype":"error_max_turns" above) will exhaust it again. As the PR author, split the change into smaller PRs; raising --max-turns is a change to the caller workflow, not something you can set on this PR.

@kyle-sexton
kyle-sexton marked this pull request as ready for review August 13, 2026 05:39
@cursor

cursor Bot commented Aug 13, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@kyle-sexton
kyle-sexton merged commit 845f4b3 into main Aug 13, 2026
39 of 40 checks passed
@kyle-sexton
kyle-sexton deleted the cursor/reclaimable-worktree-1776-d116 branch August 13, 2026 05:39
@github-actions github-actions Bot deleted a comment from claude Bot Aug 13, 2026
@github-actions github-actions Bot deleted a comment from claude Bot Aug 13, 2026
@claude

claude Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@github-actions

Copy link
Copy Markdown

Warning

Automated review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-run the job, or workflow_dispatch this workflow with the PR number, to retry the review. A new push re-triggers this lane only if the caller's pull_request triggers include synchronize (the canonical caller omits it).
An automatic retry may already have run — it is skipped when a partial review could duplicate comments, or when the failure class needs an operator (auth).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 311862d145

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Reclaimability is working-tree evidence only: an empty porcelain status means no uncommitted
# changes at audit time, not that nobody still needs the checkout. Stash list is deliberately
# out of scope — it would widen the read surface and still would not prove wantedness.
if wt_status_output="$(run_git_probe -C "$wt_path" status --porcelain 2>/dev/null)"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Disable repository-controlled fsmonitor before status

When a scanned worktree's local configuration sets core.fsmonitor to an executable path, this new git status probe executes that program, so merely auditing a repository can run repository-controlled code that mutates the host or hangs the unbounded probe. Setting GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM to /dev/null does not suppress repository-local configuration; the Git configuration documentation specifies that a non-boolean core.fsmonitor value is treated as a hook pathname. Override core.fsmonitor=false for this probe before describing the collector as read-only.

Useful? React with 👍 / 👎.

# Reclaimability is working-tree evidence only: an empty porcelain status means no uncommitted
# changes at audit time, not that nobody still needs the checkout. Stash list is deliberately
# out of scope — it would widen the read surface and still would not prove wantedness.
if wt_status_output="$(run_git_probe -C "$wt_path" status --porcelain 2>/dev/null)"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Force submodule changes into the cleanliness check

When a worktree configures submodule.<name>.ignore=all or diff.ignoreSubmodules=all, this command can produce empty output even if an initialized submodule contains modified tracked files, causing the audit to emit reclaimable-worktree despite uncommitted content. The git status documentation states that --ignore-submodules=none overrides these configuration settings and considers all submodule modifications, so the probe and its allowlist should include that option.

Useful? React with 👍 / 👎.

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.

Worktrees accumulate unreaped: 115 of 142 were clean and disposable, across 6 roots including one the convention forbids

2 participants