fix(continual-learning): write memory to AGENTS.local.md in team repos - #372
Liqiuyue9597 wants to merge 4 commits into
Conversation
Default learned bullets to the user-scoped file and deny Learned-section edits to tracked AGENTS.md, so marketplace upgrades no longer dirty the team conventions file.
…vior Drop the local-only marketplace manifest from git, align README/CHANGELOG with official plugin tone, and let the deny hook honor an explicitly allowed shared workspace file.
Resolve relative paths before probing the git work tree so the deny hook also fires for workspace-relative AGENTS.md. Let the followup route workspace facts to an opted-in shared file instead of contradicting it, align the marketplace listing with the new default target, and take named arguments in the git helpers.
|
Thanks — all four review findings are addressed in a43311e.
Hook behavior checked manually: deny for relative and absolute repo |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit a43311e. Configure here.
Keep the root marketplace description identical to the plugin manifest so listing copy stays in sync.
|
The remaining listing-copy mismatch is fixed in 341d9e9: the root marketplace |

Summary
Make continual-learning safe to enable in team repositories.
The marketplace plugin currently writes learned bullets into the workspace
AGENTS.mdand keeps cadence/index under.cursor/hooks/state/. On a shared repo those paths are owned by every contributor, so personal preferences end up in the team's instructions and the state files show up ingit status.This PR changes the defaults to user-scoped locations under
~/.cursor/projects/<workspace-slug>/(the same layout Cursor already uses foragent-transcripts/). Writes inside the repo stay strictly opt-in.Related: #74. Same default memory path, with three differences intended as follow-ups to that PR:
## Learned User Preferences/## Learned Workspace Facts). Do not rename facts to(local), which would miss existingAGENTS.local.mdfiles..cursor/hooks/state/*into the user-scoped dir; do not delete originals when they are git-tracked.preToolUsedeny hook so Learned-section edits to trackedAGENTS.md/CLAUDE.md/GEMINI.mdare blocked even if the updater ignores the prompt. The hook allows the write whenCONTINUAL_LEARNING_WORKSPACE_FILEis set and the path is gitignored, orCONTINUAL_LEARNING_ALLOW_SHARED=1.What changes
~/.cursor/projects/<slug>/AGENTS.local.md~/.cursor/projects/<slug>/continual-learning/(cadence.json,index.json)followup_messageand tells the updater not to write the repoAGENTS.mdCONTINUAL_LEARNING_WORKSPACE_FILE, refused when the path is tracked and not gitignored unlessCONTINUAL_LEARNING_ALLOW_SHARED=1Backwards compatibility
AGENTS.mdto the user-scoped file. Restore the old behavior withCONTINUAL_LEARNING_WORKSPACE_FILE=<abs path to AGENTS.md>andCONTINUAL_LEARNING_ALLOW_SHARED=1.CONTINUOUS_LEARNING_*aliases are unchanged.Test plan
bun build --target bun continual-learning/hooks/continual-learning-stop.tsbundlesAGENTS.mdby defaultCONTINUAL_LEARNING_WORKSPACE_FILEmatches andCONTINUAL_LEARNING_ALLOW_SHARED=1ALLOW_SHAREDis set but the path is a different fileNote
Medium Risk
Default memory and state locations change behavior for existing installs; the preToolUse deny hook alters what agents can write in team agent files, though shared writes remain explicitly opt-in.
Overview
Continual-learning v1.1.0 stops writing learned bullets into the repo by default and routes personal memory to
~/.cursor/projects/<slug>/AGENTS.local.md, with cadence/index under~/.cursor/projects/<slug>/continual-learning/.The stop hook now resolves targets via
memory-targets.ts, migrates legacy.cursor/hooks/state/*into the user dir (copies tracked files without deleting them), and emits a followup that embeds absolute paths and forbids repoAGENTS.mdunless an allowed shared workspace file is configured (CONTINUAL_LEARNING_WORKSPACE_FILE+ gitignore orCONTINUAL_LEARNING_ALLOW_SHARED=1).A new
preToolUsehook (block-repo-agents-md.mjs) deniesWrite/StrReplacethat add## Learned *sections to trackedAGENTS.md/CLAUDE.md/GEMINI.md, with the same opt-in exception. Agent/skill docs and README describe the new env knobs and migration path to restore old shared-file behavior.Reviewed by Cursor Bugbot for commit 341d9e9. Bugbot is set up for automated code reviews on this repo. Configure here.