GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(server): clean up idle jj workspaces by THEjacob1000 · Pull Request #20755 · pingdotgg/t3code

Conversation

@THEjacob1000

@THEjacob1000 THEjacob1000 commented Oct 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Problem

Git worktree cleanup can't safely remove jj workspaces. This adds the jj side. It's auxiliary: nothing else in the stack depends on it, so it can be deferred until the rest has merged.

Change

JjStorageCleanup only considers registered secondary workspaces with the expected managed bookmark, and never infers ownership from a path or touches the main workspace. Its fetch goes into private refs/t3/remotes/ like every other background fetch, so local main never moves. A workspace is kept, with the reason reported, if it has edits, unsnapshotted, oversized or ignored files, a description on @, conflicts, or commits not on a bookmark. Removal re-checks the files on disk at the last moment and restores the workspace if anything changed. Repo-wide prune and removal share a lock, so a concurrent prune can't forget a workspace mid-removal. The .jj keep guard stays for any repo not detected as jj, including colocated repos that fell back to Git.

All three of @omarshaarawi's items are fixed, each with a real jj test: the fetch moving main, removal deleting large files, and the dropped .jj guard.

Scope and approval

Approval is pending in #18468. Commits 1 to 6 are dormant on their own, #20756 is the one that turns jj on, and #20755 (idle workspace cleanup) sits on top so it can wait until the rest lands. Tracks #1126, the originals #11373, #11382, #11383, #11384, and ports #13816, #16380. @gergesh's port was a reference.

  • feat(server): add the jj driver and version checks #20749
  • feat(server): add jj checkpoints and review diffs #20750
  • feat(server): route jj status and workspace operations #20751
  • refactor(server): extract the change-request step #20752
  • feat(server): add jj commit, push and PR workflows #20753
  • feat(web,mobile): use jj terminology and shared vcs actions #20754
  • feat(server): prefer jj in colocated repositories #20756
  • feat(server): clean up idle jj workspaces #20755 ← this PR

GitHub can't create stacked PRs from a fork, so the diff carries the PRs below. Review the top commit only.

Verification

Automatic startup cleanup removed an idle managed workspace, while unsnapshotted, 20 MiB and described ones were kept with their reasons. The cleanup fetch advanced only the private ref, and a T3 Git worktree with jj git init --colocate in it was kept.

Screenshots are from the integrated stack before the latest rebase onto current main. After rebasing, the stack was re-verified with the automated tests and the process comparison; the manual pass wasn't repeated.

Managed workspace and cleanup evidence
Scenario Result
Unsnapshotted file caused retention Unsnapshotted workspace retained
Oversized file caused retention Workspace with oversized file retained
Working-copy description caused retention Workspace with description retained
Idle managed workspace removed Idle managed workspace cleaned
Genuine managed Git worktree with jj retained Managed Git worktree with jj retained
Cleanup fetch ref observations
Ref Before / root value After cleanup fetch
refs/heads/main cca316e82517f0b164b828bc228c4d507c313c53 unchanged cca316e82517f0b164b828bc228c4d507c313c53
refs/remotes/origin/main cca316e82517f0b164b828bc228c4d507c313c53 unchanged cca316e82517f0b164b828bc228c4d507c313c53
refs/t3/remotes/origin/main stale before fetch advanced to 898a27a19f7395345e60958b81ec0b470e6440d7

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Oct 17, 2026
feat(server): add the jj driver and version checks #20749
Closed
feat(server): add jj checkpoints and review diffs #20750
Closed
feat(server): route jj status and workspace operations #20751
Closed
@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Oct 17, 2026
This was referenced Oct 17, 2026
refactor(server): extract the change-request step #20752
Closed
feat(server): add jj commit, push and PR workflows #20753
Closed
feat(web,mobile): use jj terminology and shared vcs actions #20754
Closed
feat(server): prefer jj in colocated repositories #20756
Closed
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Oct 17, 2026
@THEjacob1000
THEjacob1000 force-pushed the feat/jj-cleanup branch 4 times, most recently from 4c52513 to 8422ddc Compare October 17, 2026 22:25
@omarshaarawi

omarshaarawi commented Oct 19, 2026

Copy link
Copy Markdown

I'd take this out of the stack and follow up later.

  • Cleanup runs plain jj git fetch --bookmark exact:"main", which fast-forwards the user's local main, or conflicts it if they have local commits (JjStorageCleanup.ts:172-182). Every other background fetch writes only to refs/t3/remotes/.
  • jj workspace remove never refuses. Files over snapshot.max-new-file-size get deleted, and late edits become an unreported orphan.
  • It removes the .jj -> keep guard in storageCleanup.ts:661-671 while detection is still off. A T3 git worktree where the user ran jj git init --colocate now gets git worktree removed with its .jj/. Reproduced.

The ownership and stranded-ancestry checks are stricter than the git side, which is good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@THEjacob1000
THEjacob1000 force-pushed the feat/jj-cleanup branch 3 times, most recently from cbc2b11 to 244a503 Compare October 19, 2026 20:12
@omarshaarawi

omarshaarawi commented Oct 20, 2026

Copy link
Copy Markdown

Rechecked at 244a503060 with jj 0.46. The fetch and removal fixes hold. I ran the exact git fetch from a secondary workspace with local main diverged and with it behind, and main, main@origin and refs/remotes/origin/main didn't move. A late 2 MB untracked file, a late edit, and a late description all block removal now. Remote names with /, ., % and non-ASCII all resolve.

One new major:

  • The hourly pass can rewrite a stale workspace's files (JjStorageCleanup.ts:112-116 with JjProcess.ts:145-154). The cleanup's snapshotting jj status goes through the stale retry. I reproduced it on 0.46:

    1. A thread workspace has unsnapshotted edits (an edited a.txt and a new n.txt).
    2. The user runs jj rebase -s ws@ -d B from the main workspace.
    3. The cleanup's jj status gets "working copy is stale", and JjProcess runs jj workspace update-stale.

    n.txt disappears from disk and both edits end up in a divergent change nobody is told about. Cleanup then sees M a.txt and keeps the workspace, so nothing gets deleted, but a background job has still changed the user's files. Cleanup should opt out of the stale retry and keep the workspace with "workspace is stale". The status poller has the same path, but only while someone has the thread open.

Minor:

  • On jj, keepWhen: "tracked-changes" behaves like uncommitted-changes (:49). Any untracked file blocks removal, where the git branch runs git clean -ffdx first (storageCleanup.ts:905-908). So a jj workspace with one stray file is never cleaned. Either clear it in the held dir before forget, or document the difference.
  • primaryRemote is passed as a positional argument at :200 (and at JjStatus.ts:486). Git allows a remote named -x, which fetch would read as an option. Add -- before it.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@only21mil only21mil mentioned this pull request Oct 20, 2026
fix(mobile): await branch refs before choosing an automatic feature branch #22098
Merged
@THEjacob1000
THEjacob1000 force-pushed the feat/jj-cleanup branch 4 times, most recently from 420f4b5 to 4ce485e Compare October 25, 2026 19:32
THEjacob1000 and others added 7 commits October 26, 2026 07:02
@THEjacob1000 @knocking4thcylinder
feat(server): jj driver, detection, process wrapper and version check
382b2d3
Co-authored-by: Лев Федорец <[email protected]>
@THEjacob1000 @knocking4thcylinder @omarshaarawi
feat(server): jj-native checkpoints and review diffs
b39d609
Co-authored-by: Лев Федорец <[email protected]>
Co-authored-by: Omar Shaarawi <[email protected]>
@THEjacob1000 @knocking4thcylinder
feat(server): jj status, bookmarks, workspaces and remotes routed by …
5c2c08e
…vcs kind

Co-authored-by: Лев Федорец <[email protected]>
@THEjacob1000
refactor(server): extract change-request step from GitManager
11a694f
@THEjacob1000 @knocking4thcylinder
feat(server): jj commit, push, PR create/checkout and stacked actions
f4c9548
Co-authored-by: Лев Федорец <[email protected]>
@THEjacob1000 @knocking4thcylinder
feat(web,mobile): jj terminology, unsupported-repo state and shared v…
0bf9b20
…cs actions

Co-authored-by: Лев Федорец <[email protected]>
@THEjacob1000 @omarshaarawi
feat(server): detect colocated jj repositories before git
9eb133c
Co-authored-by: Omar Shaarawi <[email protected]>
@THEjacob1000
feat(server): automatic cleanup of idle jj workspaces
7f57ebc
@THEjacob1000
THEjacob1000 force-pushed the feat/jj-cleanup branch from 4ce485e to 7f57ebc Compare October 25, 2026 20:23
@t3-code-bot

t3-code-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This PR does not currently meet the contribution guide's prior-approval requirement. Part of the new native Jujutsu integration stack. Every layer explicitly says approval is pending in discussion #18468; retrieved discussion comments contain peer review but no approval from the trusted maintainer group. Dormant groundwork and a preparatory refactor do not establish prior scope approval. Please obtain explicit upstream maintainer approval of the direction and scope in the relevant Ideas discussion and link the approval comment when requesting reconsideration. For a substantial bug fix, establish the failure and intended behavior through maintainer issue triage. Verification and draft status do not replace that requirement.

Thank you for trying to help improve T3 Code. If you think this closure was a mistake and the PR should be reopened, please tag @UtkarshUsername.

Closed at the request of @UtkarshUsername.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3-code-bot t3-code-bot Bot closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@THEjacob1000 @omarshaarawi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.