Skip to content

Add Dispatch Brain V1 — repo-scoped shared memory for agents - #569

Merged
selfcontained merged 2 commits into
mainfrom
agt_1e725361e610/dispatch-task
May 21, 2026
Merged

Add Dispatch Brain V1 — repo-scoped shared memory for agents#569
selfcontained merged 2 commits into
mainfrom
agt_1e725361e610/dispatch-task

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds Brain V1: a repo-scoped shared memory surface for agents with two primitives — mutable objects (key-value with optimistic concurrency) and append-only events (structured history log).
  • New database tables (brain_objects, brain_events) via migration 0025_brain.sql, with appropriate indexes for collection/kind/subject/tags queries.
  • Six new MCP tools (brain_get_object, brain_store_object, brain_list_objects, brain_delete_object, brain_append_event, brain_query_events) available to agent and job scopes.
  • BrainStore class with optimistic concurrency (revision-based updates), TOCTOU race protection on concurrent creates, LIKE wildcard escaping, and clamped query limits (default 50, max 200).
  • 19 unit tests covering CRUD, concurrency conflicts, filtering, repo isolation, and event queries.
  • Assisted update migration manifest (0006-brain-tables.yaml) for the new tables.

Test plan

  • TypeScript type checking passes (pnpm run check)
  • All 1243 unit tests pass (pnpm run test)
  • All 142 E2E tests pass (pnpm run test:e2e)
  • Live-tested with a real agent exercising all 6 brain tools through the UI
  • Architecture review persona approved (round 2, all 5 findings from round 1 fixed)
  • Assisted update migration manifest validates against runtime schema

🤖 Generated with Claude Code

selfcontainedand others added 2 commits May 20, 2026 21:10
Introduces two primitives for cross-agent state sharing within a repo:
objects (mutable key-value with optimistic concurrency) and events
(append-only structured history). Includes migration, store, 6 MCP tools,
input validation, and 19 unit tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 75af847 into mainMay 21, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_1e725361e610/dispatch-task branch May 21, 2026 03:34
selfcontained added a commit that referenced this pull request May 21, 2026
… (#573)
PR #569 added 6 new MCP tools (brain_get_object, brain_store_object,
brain_list_objects, brain_delete_object, brain_append_event,
brain_query_events) to both AGENT_TOOLS and JOB_TOOLS but the docs
surfaces were not updated.
- Add brain tools to docs-pane "Built-in tools" list
- Add brain tools to docs-pane "Tools available to job agents" list
- Add "Brain (shared memory)" subsection to Repo Tools section
- Update "State across runs" to mention Brain as alternative to
filesystem handoff
- Add brain tools to README Interactive agents table and Job agents list
- Add missing brain/ directory to CLAUDE.md project structure tree
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for freeto 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

@selfcontained