Open
Conversation
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
This PR keeps Brain's shared project memory in markdown and docs, while treating the raw runtime layer as local-only state.
It narrows the managed
.gitignoreblock to Brain runtime artifacts only, adds an explicit Git-cleanup migration for older repos, and keeps lazy preflight limited to auto-safe migrations so normal Brain commands do not silently mutate the Git index.What Changed
.gitignoreblock to:.brain/session.json.brain/sessions/.brain/state/.brain/policy.override.yaml.gitignorebefore other Brain-managed tracked files during install/adoptignore-local-runtime-state-v1as an explicit-only project migrationbrain update --project .andbrain context migrate --project .refresh.gitignore, untrack legacy runtime files from Git, keep them on disk, and print what changedbrain doctorWhy
The valuable shared context in Brain lives in repo-tracked markdown and docs. The session ledger, sqlite/index state, history logs, backups, and policy overrides are operational artifacts. Tracking those by default creates noisy diffs and pushes raw runtime traces into Git instead of encouraging durable note promotion.
Verification
go test ./internal/projectcontext ./cmdbrain session run --project . -- go test ./...brain session run --project . -- go build ./...Release Notes
Brain now ignores its local runtime state from Git by default and treats Git cleanup for older repos as an explicit upgrade action instead of a surprise side effect during normal command preflight.
Projects upgraded with
brain update --project .orbrain context migrate --project .can refresh their managed.gitignore, remove previously tracked Brain runtime artifacts from the Git index while keeping them on disk, and review a clear printed summary of what changed before committing the diff.