feat(worktree): add worktree up/down and harden branch gc
pkgmgr worktree up and down create and release a branch worktree with its own slot and run the operator-pinned worktree-init and worktree-fini hooks; branch gc removes merged worktrees, now also patch-merged ones (git cherry), and the hooks of each repository run only from worktree_hooks pins of a managed repository whose git directory is its own. Removal walks to the worktree without following a symbolic link and skips paths that are not their own realpath. A bare-name hook program resolves once to a root-controlled file on a root-controlled PATH: root is uid 0 only in the initial user namespace and the overflow uid elsewhere, nosuid mounts never count on the host, and the hook runs the resolved file with only those PATH entries, stdin closed and a timeout over its process group. 🎯 Fix: 93 % 💥 Break: 3 % 💸 Cost: 114 % ⏱️ Time: 129 % 🛡️ Security: 100 % 🏆 Score: 61 🚦 Gate: cost 114 % and time 129 %: accepted by the operator for B (2026-11-07) after skeptic round 6 found no hole and MEDUSA reached 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
54f0cbb37b
commit
102c74f1e0
32 files changed
+2593
-207
No files matched your search
@@ -208,8 +208,9 @@ class TestBranchTree(unittest.TestCase):
|
||||
patch.object(gc, "fetch_forge_facts", return_value=ForgeFacts()),
|
||||
redirect_stdout(out),
|
||||
):
|
||||
gc.branch_gc(
|
||||
gc.cleanup(
|
||||
[self.repo],
|
||||
scope="all",
|
||||
apply=False,
|
||||
as_json=True,
|
||||
include=[],
|
||||
@@ -217,6 +218,7 @@ class TestBranchTree(unittest.TestCase):
|
||||
merged_into=[],
|
||||
sizes=False,
|
||||
min_age=None,
|
||||
hooks={},
|
||||
)
|
||||
planned = {
|
||||
(item["branch"], item["worktree"]): (
|
||||
|
||||
Reference in new issue
Block a user