Skip to content

Ignore local Brain runtime state by default#14

Open
JimmyMcBride wants to merge 1 commit intomainfrom
feature/ignore-local-runtime-state
Open

Ignore local Brain runtime state by default#14
JimmyMcBride wants to merge 1 commit intomainfrom
feature/ignore-local-runtime-state

Conversation

@JimmyMcBride
Copy link
Copy Markdown
Owner

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 .gitignore block 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

  • narrow the Brain-managed .gitignore block to:
    • .brain/session.json
    • .brain/sessions/
    • .brain/state/
    • .brain/policy.override.yaml
  • stop auto-ignoring local agent skill roots
  • sync .gitignore before other Brain-managed tracked files during install/adopt
  • add ignore-local-runtime-state-v1 as an explicit-only project migration
  • have brain update --project . and brain context migrate --project . refresh .gitignore, untrack legacy runtime files from Git, keep them on disk, and print what changed
  • keep lazy preflight on auto-safe migrations only
  • downgrade explicit cleanup to informational status in brain doctor
  • update README, usage docs, skills docs, and the Brain skill guidance to match the new runtime-state behavior

Why

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 ./cmd
  • brain 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 . or brain 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.

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