feat(native): name local branches no session lease will report #1287

Merged
coilyco-ops merged 1 commit from aos/claude/ff54 into main 2026-08-26 10:49:17 +00:00
Owner

Closes #1286

The gap

Branch reaping skips the aos/ namespace on purpose, and reportNativeStuckLeases is reachable only through the loop over native session leases, so it reports a branch only when a lease recorded it as artifact.Branch. A branch made by hand, made outside a native shadow, or outliving the sweep that removed its lease falls between the two exemptions and is named by neither, however much work it holds.

This checkout reached 78 local branches with 13 reported. Of the 65 unreported, 7 held 13 commits whose patch-id was on no origin ref.

Why patch-id and not reachability

Reusing the reaper's rev-list <branch> --not --remotes=origin test repository-wide reports every squash-merged branch, because a squashed branch is reachable from no origin ref while carrying no work. On this checkout that test called 64 landed branches unpushed. git cherry is the only test that says something true on a fleet whose default merge style is squash.

TestASquashMergedBranchIsNotAnOrphan is a real negative control for that decision: swapping the implementation to the reachability count makes it fail.

Cost

A cheap rev-list count gates the patch-id walk, and a branch with an origin counterpart is skipped before either. A fleet with nothing to say pays one show-ref per branch.

Verification

Full aos-cli suite green. Run against this repository the new reading reports exactly one branch, aos/claude/issue-refs-write-path, with no false positives from main or the six live session worktrees.

🤖 Generated with Claude Code

Closes https://forgejo.coilysiren.me/coilyco-flight-deck/agentic-os/issues/1286 ## The gap Branch reaping skips the `aos/` namespace on purpose, and `reportNativeStuckLeases` is reachable only through the loop over native session leases, so it reports a branch only when a lease recorded it as `artifact.Branch`. A branch made by hand, made outside a native shadow, or outliving the sweep that removed its lease falls between the two exemptions and is named by neither, however much work it holds. This checkout reached 78 local branches with 13 reported. Of the 65 unreported, 7 held 13 commits whose patch-id was on no origin ref. ## Why patch-id and not reachability Reusing the reaper's `rev-list <branch> --not --remotes=origin` test repository-wide reports every squash-merged branch, because a squashed branch is reachable from no origin ref while carrying no work. On this checkout that test called 64 landed branches unpushed. `git cherry` is the only test that says something true on a fleet whose default merge style is squash. `TestASquashMergedBranchIsNotAnOrphan` is a real negative control for that decision: swapping the implementation to the reachability count makes it fail. ## Cost A cheap `rev-list` count gates the patch-id walk, and a branch with an `origin` counterpart is skipped before either. A fleet with nothing to say pays one `show-ref` per branch. ## Verification Full `aos-cli` suite green. Run against this repository the new reading reports exactly one branch, `aos/claude/issue-refs-write-path`, with no false positives from `main` or the six live session worktrees. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(native): name local branches no session lease will report
All checks were successful
ci / ward-doctor (pull_request) Successful in 7s
ci / aos-eval-tests (pull_request) Successful in 7s
ci / aos-cli-tests (pull_request) Successful in 27s
ci / gate (pull_request) Successful in 50s
44378abd85
Branch reaping skips the `aos/` namespace and the lease path reports only a
branch a lease recorded, so a branch made by hand, made outside a native
shadow, or outliving the sweep that removed its lease falls between the two.
This checkout reached 78 local branches with 13 reported, and 7 of the
unreported ones held 13 commits no origin ref carried.

Absence is measured by patch-id rather than reachability. The default merge
style here is squash, so a landed branch is reachable from nothing on origin
while holding no work, and reusing the reaper's `rev-list --not --remotes`
test called 64 landed branches unpushed on that same checkout. A cheap
rev-list count gates the patch-id walk so a clean fleet pays almost nothing.

Closes agentic-os#1286

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Agent-Role: platform
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agentic-os!1287
No description provided.