Repository navigation
fix(continual-learning): write memory to AGENTS.local.md in team repos - #372
Liqiuyue9597 wants to merge 5 commits into
Conversation
|
Thanks — all four review findings are addressed in a43311e.
Hook behavior checked manually: deny for relative and absolute repo |
|
The remaining listing-copy mismatch is fixed in 341d9e9: the root marketplace |
|
Filed the underlying problem internally (continual-learning writing personal memory into the repo's tracked |
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.
Keep the root marketplace description identical to the plugin manifest so listing copy stays in sync.
341d9e9 to
8134ba5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
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 8134ba5. Configure here.
| expanded = expanded === "~" ? homedir() : join(homedir(), expanded.slice(2)); | ||
| } | ||
| return isAbsolute(expanded) ? expanded : resolve(workspaceCwd, expanded); | ||
| } |
There was a problem hiding this comment.
expandPath args are interchangeable
Low Severity · Bugbot Rules
expandPath takes two string parameters (value and workspaceCwd), so swapping them at a call site typechecks and would resolve env paths against the wrong base.
Triggered by team rule: No ambiguous args at callsite in typescript
Reviewed by Cursor Bugbot for commit 8134ba5. Configure here.
Cursor Write payloads put the file body in content, so the repo-write guard never saw a full overwrite of a tracked AGENTS.md.


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
Changes default memory and state locations and adds hook-level write blocking; misconfiguration could surprise users, but opt-in env vars restore prior shared-file behavior.
Overview
Continual Learning 1.1.0 makes team repos safe by default: learned bullets and cadence/index state move out of the workspace into
~/.cursor/projects/<slug>/(AGENTS.local.mdandcontinual-learning/), while Cursor still stacks that file with the repoAGENTS.md.The stop hook now resolves those absolute paths in the followup, routes preferences/facts to the user file (optional shared workspace file via env), and migrates legacy
.cursor/hooks/state/*into the user dir without deleting tracked originals.A new
preToolUsehook blocksWrite/StrReplacethat add## Learned User Preferences/## Learned Workspace Factsto trackedAGENTS.md,CLAUDE.md, orGEMINI.md, unlessCONTINUAL_LEARNING_WORKSPACE_FILEis allowed (gitignored orCONTINUAL_LEARNING_ALLOW_SHARED=1). Subagent/skill/docs copy is updated to match; heading names are unchanged.Reviewed by Cursor Bugbot for commit 03c1507. Bugbot is set up for automated code reviews on this repo. Configure here.