Skip to content

feat(brain-repo): add .claude/agent-memory to WATCH_PATHS#92

Open
mt-alarcon wants to merge 1 commit into
evolution-foundation:mainfrom
mt-alarcon:fix/brain-repo-agent-memory-watch
Open

feat(brain-repo): add .claude/agent-memory to WATCH_PATHS#92
mt-alarcon wants to merge 1 commit into
evolution-foundation:mainfrom
mt-alarcon:fix/brain-repo-agent-memory-watch

Conversation

@mt-alarcon
Copy link
Copy Markdown

@mt-alarcon mt-alarcon commented May 23, 2026

Problem

Agents with durable memory write to .claude/agent-memory/ (e.g. nova-product/clients_*, raven-critic/feedback_*). This path was not included in WATCH_PATHS, so the Brain Repo never observed or mirrored those files — agent memory was silently lost on every sync.

Changes

  • dashboard/backend/brain_repo/watcher.py — add .claude/agent-memory to WATCH_PATHS (the filesystem observer list)
  • dashboard/backend/brain_repo/job_runner.py — add .claude/agent-memory to _WATCH_PATHS (the mirror pipeline list)

Both lists must stay in sync: watcher.py controls what paths are observed for change events; job_runner.py controls what paths are copied during the mirror pipeline.

Impact

Any EvoNexus instance using custom agents with persistent memory (agent-memory/ subdirs) will now have that memory versioned automatically by the Brain Repo. No behavior change for instances without custom agents.

Testing

  • Confirm WATCH_PATHS in watcher.py and _WATCH_PATHS in job_runner.py both include .claude/agent-memory
  • Write a file to .claude/agent-memory/ and verify it triggers a Brain Repo sync after debounce

Summary by Sourcery

Bug Fixes:

  • Preserve custom agents' durable memory by including .claude/agent-memory in the brain repo watcher paths and mirror pipeline paths.

Agents with durable memory (e.g. nova-product/clients_*, raven-critic/feedback_*)
write to .claude/agent-memory/ but that path was not watched or mirrored by the
Brain Repo, so their state was never versioned.

Add .claude/agent-memory to WATCH_PATHS in both watcher.py (file system observer)
and job_runner.py (_WATCH_PATHS used by the mirror pipeline) so custom-agent memory
is included in every auto-sync.

Applies to any EvoNexus instance running custom agents with persistent memory.
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds the .claude/agent-memory directory to both the file watcher and mirror pipeline so agent durable memory is observed and versioned by the Brain Repo.

Flow diagram for Brain Repo watching .claude/agent-memory changes

flowchart TD
    A[Agent writes file under .claude/agent-memory/] --> B[Watcher in watcher.py monitors WATCH_PATHS including .claude/agent-memory]
    B --> C[Change event enqueued for Brain Repo sync]
    C --> D[Job runner in job_runner.py processes _WATCH_PATHS including .claude/agent-memory]
    D --> E[Updated agent-memory files are mirrored into Brain Repo versioned storage]
Loading

File-Level Changes

Change Details Files
Ensure agent durable memory directory is included in the mirror pipeline watch paths.
  • Extend the list of watched paths for the mirror pipeline to include the .claude/agent-memory directory so its contents are mirrored into the Brain Repo.
dashboard/backend/brain_repo/job_runner.py
Ensure agent durable memory directory is included in the filesystem watcher paths.
  • Extend the filesystem watcher path list to include the .claude/agent-memory directory so file changes there trigger Brain Repo syncs.
dashboard/backend/brain_repo/watcher.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since WATCH_PATHS and _WATCH_PATHS must stay in sync, consider extracting them to a single shared constant or config source to avoid future divergence when paths are added or changed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since `WATCH_PATHS` and `_WATCH_PATHS` must stay in sync, consider extracting them to a single shared constant or config source to avoid future divergence when paths are added or changed.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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