Skip to content

Move session state under ~/.corbits/projects (CL-5257) - #313

Merged
TheGreatAxios merged 3 commits into
mainfrom
stack/cl-5257-session-global
Aug 4, 2026
Merged

Move session state under ~/.corbits/projects (CL-5257)#313
TheGreatAxios merged 3 commits into
mainfrom
stack/cl-5257-session-global

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

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.

  • Layout: ~/.corbits/projects/<project-key>/<session-id>/ for run.json, context/, labels, workflows, permissions
  • Project key: slug + short hash of git toplevel realpath (workspace realpath when not a git tree) — main + worktrees share one key
  • Migration: dual-read of in-repo .agent-state/<id>/; migrate into the global tree on open/list
  • Permissions: global state root is an outside-workspace exception — reads allowed, writes still ask (same policy as legacy .agent-state)
  • Docs: IMPLEMENTATION / PRODUCT / ARCHITECTURE / README / PERFTRACE paths updated

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
  • Targeted session + permission tests (51 pass)
  • Manual: open a session, confirm files under ~/.corbits/projects/ not .agent-state/
  • Manual: legacy .agent-state session migrates on list/resume
  • Manual: write under global state root still prompts in auto mode

@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

CL-5257

@TheGreatAxios
TheGreatAxios force-pushed the stack/w5-cl-5167-attribution branch from 7571e12 to a892cf3 Compare August 4, 2026 23:03
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
TheGreatAxios force-pushed the stack/cl-5257-session-global branch from 79c2fb0 to 844f616 Compare August 4, 2026 23:03
@TheGreatAxios
TheGreatAxios changed the base branch from stack/w5-cl-5167-attribution to main August 4, 2026 23:03
@TheGreatAxios
TheGreatAxios merged commit 4ef82ba into main Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant