#!/usr/bin/env python3 """Args: --tree: the tree file `pkgmgr branch tree` writes; the plan goes beside it as local-plan.json, in the directory the orchestrator mounts read-only. --pkgmgr: the pkgmgr executable built from a signed tag. --budget: seconds one repository's dry run may take, well below the tree unit's TimeoutStartSec. Returns: Keeps local-plan.json beside the tree file: the dry run of `pkgmgr branch cleanup --local --json` of every repository the tree file says pkgmgr knows, run in it as the cleanup runner runs its dry run (cleanup.run: no repository hook or fsmonitor), named by its real path. A repository whose refs, HEAD, config, reftable and worktree heads (fingerprint) are unchanged since its last attempt is not planned again. Before each dry run the file is rewritten atomically with that repository marked stale ("replan started