feat(workspaces): workspaces.py makes, lists and cleans up the jj workspaces of the repositories beside it #16
No reviewers
Labels
No labels
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Tooling!16
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Tooling:feat/workspaces"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agents on a shared PC each work in a jj workspace of their own, and nothing ever removes them: on one PC there are 340 across the team's repositories, many on commits already merged and some whose folders are long gone, each with its builds. This adds a way to make, list and clean them up, safe enough for an agent to run.
What changed
scripts/workspaces.py(standard library; usesjj), for the jj repositories beside Tooling that have a remote on git.magicbean.dev, plus any folders named in~/.config/longshot/workspaces.json:new REPO NAME [-r REV]: a workspace at<checkouts>/<REPO>-<NAME>ontrunk()after a fetch. It refuses a folder on a RAM file system.list [--all] [--json]: for each workspace, what it holds that main lacks, how long it has been idle, and whatcleanwould do with it.clean [--auto | --dry-run], with three tiers:cd,jj -Rorgit -Cthere; a session that went through more than 8 workspaces is a sweep and doesn't count); one touched in the last 24 h.--autoremoves these and nothing else.--auto.remove REPO:NAME ...: the ones the person named, for an agent after asking.--forceis needed for one that looks in use; the repository's own checkout is never removed.clean --autoany time; anything else is the person's to remove), and an Always rule: nothing big on a RAM file system (/tmpis often one). README lists the script.On this PC,
listtakes about 7 s for 342 workspaces in 10 repositories: 47 are safe because they hold nothing main lacks, 15 are workspaces whose folders are gone (mostly agents' scratch folders in/tmp), and the rest are kept or recent. Nothing was removed here except the test workspaces below.How it was tested
tests/test_workspaces.py, offline:python -I -B tests/run_all.py: 4 of 5 files pass. The failure istest_forge_pr.py'stest_create_draft_is_the_default_and_wip_is_not_doubled, which fails on main too (see #11 and #14).new Tooling wstest, an unsnapshotted edit, thenremove Tooling:wstest. The folder is gone, the workspace is forgotten, and the edit is in a commit (abandoned afterwards).A companion Longshot PR (the job queue and
dev_build.py) says the same about RAM file systems for builds.🤖 Generated with Claude Code
WIP: feat(workspaces): workspaces.py makes, lists and cleans up the jj workspaces of the repositories beside itto feat(workspaces): workspaces.py makes, lists and cleans up the jj workspaces of the repositories beside itRebased on main after #13 (farm-run): both PRs added a row to AGENTS.md's task table and README's file table; both rows kept. tests/test_workspaces.py passes.
d3e836c239to4366425a5d