Move session state under ~/.corbits/projects (CL-5257) - #313
Merged
Conversation
TheGreatAxios
force-pushed
the
stack/w5-cl-5167-attribution
branch
from
August 4, 2026 23:03
7571e12 to
a892cf3
Compare
Sessions no longer live in-repo under .agent-state. Each workspace maps to a stable project key (git toplevel realpath + short hash) and stores run state, context, labels, and workflows at: ~/.corbits/projects/<project-key>/<session-id>/ Main and git worktrees that share a toplevel resume the same history. Legacy in-repo sessions dual-read and migrate on open/list. Permission path restriction treats the global state root like .agent-state: reads allowed, writes still ask. Docs updated for the new layout. CL-5257
Key off git common dir so main and worktrees land under one ~/.corbits/projects entry. Dual-read legacy .agent-state from both cwd and project root so migrate still finds sessions created on main.
Legacy sessions are discovered under cwd and the shared git project root so worktree resumes find main-repo .agent-state. Optional home on store, workflow state, and seeded approvals keeps unit tests out of the real ~/.corbits tree.
TheGreatAxios
force-pushed
the
stack/cl-5257-session-global
branch
from
August 4, 2026 23:03
79c2fb0 to
844f616
Compare
TheGreatAxios
changed the base branch from
stack/w5-cl-5167-attribution
to
main
August 4, 2026 23:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Session runtime state moves out of the repo into a global projects tree so worktrees and clones share resume history without polluting git status.
~/.corbits/projects/<project-key>/<session-id>/for run.json, context/, labels, workflows, permissions.agent-state/<id>/; migrate into the global tree on open/list.agent-state)Stack
Base:
stack/w5-cl-5167-attribution(PR #311 tip)Linear
https://linear.app/abklabs/issue/CL-5257/move-session-state-out-of-the-repo-into-corbitsprojects
Test plan
bun run typecheck~/.corbits/projects/not.agent-state/.agent-statesession migrates on list/resume